better-auth-studio 1.0.30 → 1.0.32

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,674 +0,0 @@
1
- function k2(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function Em(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hv={exports:{}},Vd={},Vv={exports:{}},$e={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 ml=Symbol.for("react.element"),S2=Symbol.for("react.portal"),C2=Symbol.for("react.fragment"),E2=Symbol.for("react.strict_mode"),M2=Symbol.for("react.profiler"),D2=Symbol.for("react.provider"),_2=Symbol.for("react.context"),P2=Symbol.for("react.forward_ref"),T2=Symbol.for("react.suspense"),O2=Symbol.for("react.memo"),A2=Symbol.for("react.lazy"),wx=Symbol.iterator;function z2(e){return e===null||typeof e!="object"?null:(e=wx&&e[wx]||e["@@iterator"],typeof e=="function"?e:null)}var Yv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xv=Object.assign,qv={};function Li(e,t,n){this.props=e,this.context=t,this.refs=qv,this.updater=n||Yv}Li.prototype.isReactComponent={};Li.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): 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")};Li.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Gv(){}Gv.prototype=Li.prototype;function Mm(e,t,n){this.props=e,this.context=t,this.refs=qv,this.updater=n||Yv}var Dm=Mm.prototype=new Gv;Dm.constructor=Mm;Xv(Dm,Li.prototype);Dm.isPureReactComponent=!0;var yx=Array.isArray,Kv=Object.prototype.hasOwnProperty,_m={current:null},Qv={key:!0,ref:!0,__self:!0,__source:!0};function Zv(e,t,n){var r,a={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Kv.call(t,r)&&!Qv.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:ml,type:e,key:i,ref:o,props:a,_owner:_m.current}}function $2(e,t){return{$$typeof:ml,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Pm(e){return typeof e=="object"&&e!==null&&e.$$typeof===ml}function R2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var bx=/\/+/g;function Yu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?R2(""+e.key):t.toString(36)}function Dc(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case ml:case S2:o=!0}}if(o)return o=e,a=a(o),e=r===""?"."+Yu(o,0):r,yx(a)?(n="",e!=null&&(n=e.replace(bx,"$&/")+"/"),Dc(a,t,n,"",function(d){return d})):a!=null&&(Pm(a)&&(a=$2(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(bx,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",yx(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Yu(i,l);o+=Dc(i,t,n,c,a)}else if(c=z2(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Yu(i,l++),o+=Dc(i,t,n,c,a);else if(i==="object")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 Wl(e,t,n){if(e==null)return e;var r=[],a=0;return Dc(e,r,"","",function(i){return t.call(n,i,a++)}),r}function I2(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 Qt={current:null},_c={transition:null},L2={ReactCurrentDispatcher:Qt,ReactCurrentBatchConfig:_c,ReactCurrentOwner:_m};function Jv(){throw Error("act(...) is not supported in production builds of React.")}$e.Children={map:Wl,forEach:function(e,t,n){Wl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Wl(e,function(){t++}),t},toArray:function(e){return Wl(e,function(t){return t})||[]},only:function(e){if(!Pm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};$e.Component=Li;$e.Fragment=C2;$e.Profiler=M2;$e.PureComponent=Mm;$e.StrictMode=E2;$e.Suspense=T2;$e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L2;$e.act=Jv;$e.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Xv({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=_m.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Kv.call(t,c)&&!Qv.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:ml,type:e.type,key:a,ref:i,props:r,_owner:o}};$e.createContext=function(e){return e={$$typeof:_2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:D2,_context:e},e.Consumer=e};$e.createElement=Zv;$e.createFactory=function(e){var t=Zv.bind(null,e);return t.type=e,t};$e.createRef=function(){return{current:null}};$e.forwardRef=function(e){return{$$typeof:P2,render:e}};$e.isValidElement=Pm;$e.lazy=function(e){return{$$typeof:A2,_payload:{_status:-1,_result:e},_init:I2}};$e.memo=function(e,t){return{$$typeof:O2,type:e,compare:t===void 0?null:t}};$e.startTransition=function(e){var t=_c.transition;_c.transition={};try{e()}finally{_c.transition=t}};$e.unstable_act=Jv;$e.useCallback=function(e,t){return Qt.current.useCallback(e,t)};$e.useContext=function(e){return Qt.current.useContext(e)};$e.useDebugValue=function(){};$e.useDeferredValue=function(e){return Qt.current.useDeferredValue(e)};$e.useEffect=function(e,t){return Qt.current.useEffect(e,t)};$e.useId=function(){return Qt.current.useId()};$e.useImperativeHandle=function(e,t,n){return Qt.current.useImperativeHandle(e,t,n)};$e.useInsertionEffect=function(e,t){return Qt.current.useInsertionEffect(e,t)};$e.useLayoutEffect=function(e,t){return Qt.current.useLayoutEffect(e,t)};$e.useMemo=function(e,t){return Qt.current.useMemo(e,t)};$e.useReducer=function(e,t,n){return Qt.current.useReducer(e,t,n)};$e.useRef=function(e){return Qt.current.useRef(e)};$e.useState=function(e){return Qt.current.useState(e)};$e.useSyncExternalStore=function(e,t,n){return Qt.current.useSyncExternalStore(e,t,n)};$e.useTransition=function(){return Qt.current.useTransition()};$e.version="18.3.1";Vv.exports=$e;var m=Vv.exports;const Z=Em(m),Tm=k2({__proto__:null,default:Z},[m]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its 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 F2=m,U2=Symbol.for("react.element"),B2=Symbol.for("react.fragment"),W2=Object.prototype.hasOwnProperty,H2=F2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,V2={key:!0,ref:!0,__self:!0,__source:!0};function ew(e,t,n){var r,a={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)W2.call(t,r)&&!V2.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:U2,type:e,key:i,ref:o,props:a,_owner:H2.current}}Vd.Fragment=B2;Vd.jsx=ew;Vd.jsxs=ew;Hv.exports=Vd;var s=Hv.exports,Jh={},tw={exports:{}},kn={},nw={exports:{}},rw={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its 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(E,D){var $=E.length;E.push(D);e:for(;0<$;){var H=$-1>>>1,T=E[H];if(0<a(T,D))E[H]=D,E[$]=T,$=H;else break e}}function n(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var D=E[0],$=E.pop();if($!==D){E[0]=$;e:for(var H=0,T=E.length,U=T>>>1;H<U;){var G=2*(H+1)-1,Q=E[G],re=G+1,ne=E[re];if(0>a(Q,$))re<T&&0>a(ne,Q)?(E[H]=ne,E[re]=$,H=re):(E[H]=Q,E[G]=$,H=G);else if(re<T&&0>a(ne,$))E[H]=ne,E[re]=$,H=re;else break e}}return D}function a(E,D){var $=E.sortIndex-D.sortIndex;return $!==0?$:E.id-D.id}if(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=[],d=[],h=1,u=null,f=3,p=!1,w=!1,v=!1,j=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(E){for(var D=n(d);D!==null;){if(D.callback===null)r(d);else if(D.startTime<=E)r(d),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(d)}}function b(E){if(v=!1,x(E),!w)if(n(c)!==null)w=!0,_(N);else{var D=n(d);D!==null&&P(b,D.startTime-E)}}function N(E,D){w=!1,v&&(v=!1,g(M),M=-1),p=!0;var $=f;try{for(x(D),u=n(c);u!==null&&(!(u.expirationTime>D)||E&&!B());){var H=u.callback;if(typeof H=="function"){u.callback=null,f=u.priorityLevel;var T=H(u.expirationTime<=D);D=e.unstable_now(),typeof T=="function"?u.callback=T:u===n(c)&&r(c),x(D)}else r(c);u=n(c)}if(u!==null)var U=!0;else{var G=n(d);G!==null&&P(b,G.startTime-D),U=!1}return U}finally{u=null,f=$,p=!1}}var k=!1,S=null,M=-1,O=5,I=-1;function B(){return!(e.unstable_now()-I<O)}function z(){if(S!==null){var E=e.unstable_now();I=E;var D=!0;try{D=S(!0,E)}finally{D?L():(k=!1,S=null)}}else k=!1}var L;if(typeof y=="function")L=function(){y(z)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,A=C.port2;C.port1.onmessage=z,L=function(){A.postMessage(null)}}else L=function(){j(z,0)};function _(E){S=E,k||(k=!0,L())}function P(E,D){M=j(function(){E(e.unstable_now())},D)}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(E){E.callback=null},e.unstable_continueExecution=function(){w||p||(w=!0,_(N))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(E){switch(f){case 1:case 2:case 3:var D=3;break;default:D=f}var $=f;f=D;try{return E()}finally{f=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,D){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var $=f;f=E;try{return D()}finally{f=$}},e.unstable_scheduleCallback=function(E,D,$){var H=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?H+$:H):$=H,E){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=$+T,E={id:h++,callback:D,priorityLevel:E,startTime:$,expirationTime:T,sortIndex:-1},$>H?(E.sortIndex=$,t(d,E),n(c)===null&&E===n(d)&&(v?(g(M),M=-1):v=!0,P(b,$-H))):(E.sortIndex=T,t(c,E),w||p||(w=!0,_(N))),E},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(E){var D=f;return function(){var $=f;f=D;try{return E.apply(this,arguments)}finally{f=$}}}})(rw);nw.exports=rw;var Y2=nw.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its 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 X2=m,bn=Y2;function oe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var sw=new Set,Ao={};function Pa(e,t){wi(e,t),wi(e+"Capture",t)}function wi(e,t){for(Ao[e]=t,e=0;e<t.length;e++)sw.add(t[e])}var Gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ef=Object.prototype.hasOwnProperty,q2=/^[: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]*$/,jx={},Nx={};function G2(e){return ef.call(Nx,e)?!0:ef.call(jx,e)?!1:q2.test(e)?Nx[e]=!0:(jx[e]=!0,!1)}function K2(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Q2(e,t,n,r){if(t===null||typeof t>"u"||K2(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Zt(e,t,n,r,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Lt[e]=new Zt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Lt[t]=new Zt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Lt[e]=new Zt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Lt[e]=new Zt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Lt[e]=new Zt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Lt[e]=new Zt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Lt[e]=new Zt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Lt[e]=new Zt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Lt[e]=new Zt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Om=/[\-:]([a-z])/g;function Am(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Om,Am);Lt[t]=new Zt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Om,Am);Lt[t]=new Zt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Om,Am);Lt[t]=new Zt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Lt[e]=new Zt(e,1,!1,e.toLowerCase(),null,!1,!1)});Lt.xlinkHref=new Zt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Lt[e]=new Zt(e,1,!1,e.toLowerCase(),null,!0,!0)});function zm(e,t,n,r){var a=Lt.hasOwnProperty(t)?Lt[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Q2(t,n,a,r)&&(n=null),r||a===null?G2(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ns=X2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Hl=Symbol.for("react.element"),qa=Symbol.for("react.portal"),Ga=Symbol.for("react.fragment"),$m=Symbol.for("react.strict_mode"),tf=Symbol.for("react.profiler"),aw=Symbol.for("react.provider"),iw=Symbol.for("react.context"),Rm=Symbol.for("react.forward_ref"),nf=Symbol.for("react.suspense"),rf=Symbol.for("react.suspense_list"),Im=Symbol.for("react.memo"),ms=Symbol.for("react.lazy"),ow=Symbol.for("react.offscreen"),kx=Symbol.iterator;function Gi(e){return e===null||typeof e!="object"?null:(e=kx&&e[kx]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Object.assign,Xu;function po(e){if(Xu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Xu=t&&t[1]||""}return`
34
- `+Xu+e}var qu=!1;function Gu(e,t){if(!e||qu)return"";qu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var a=d.stack.split(`
35
- `),i=r.stack.split(`
36
- `),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
37
- `+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{qu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?po(e):""}function Z2(e){switch(e.tag){case 5:return po(e.type);case 16:return po("Lazy");case 13:return po("Suspense");case 19:return po("SuspenseList");case 0:case 2:case 15:return e=Gu(e.type,!1),e;case 11:return e=Gu(e.type.render,!1),e;case 1:return e=Gu(e.type,!0),e;default:return""}}function sf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ga:return"Fragment";case qa:return"Portal";case tf:return"Profiler";case $m:return"StrictMode";case nf:return"Suspense";case rf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case iw:return(e.displayName||"Context")+".Consumer";case aw:return(e._context.displayName||"Context")+".Provider";case Rm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Im:return t=e.displayName||null,t!==null?t:sf(e.type)||"Memo";case ms:t=e._payload,e=e._init;try{return sf(e(t))}catch{}}return null}function J2(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sf(t);case 8:return t===$m?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Os(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ek(e){var t=lw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vl(e){e._valueTracker||(e._valueTracker=ek(e))}function cw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=lw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Zc(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}}function af(e,t){var n=t.checked;return xt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Sx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Os(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function dw(e,t){t=t.checked,t!=null&&zm(e,"checked",t,!1)}function of(e,t){dw(e,t);var n=Os(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?lf(e,t.type,n):t.hasOwnProperty("defaultValue")&&lf(e,t.type,Os(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Cx(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function lf(e,t,n){(t!=="number"||Zc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var xo=Array.isArray;function li(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Os(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function cf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(oe(91));return xt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ex(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(oe(92));if(xo(n)){if(1<n.length)throw Error(oe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Os(n)}}function uw(e,t){var n=Os(t.value),r=Os(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Mx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function hw(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function df(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?hw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Yl,fw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Yl=Yl||document.createElement("div"),Yl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Yl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function zo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tk=["Webkit","ms","Moz","O"];Object.keys(jo).forEach(function(e){tk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jo[t]=jo[e]})});function mw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jo.hasOwnProperty(e)&&jo[e]?(""+t).trim():t+"px"}function pw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=mw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var nk=xt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function uf(e,t){if(t){if(nk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function hf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 ff=null;function Lm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mf=null,ci=null,di=null;function Dx(e){if(e=gl(e)){if(typeof mf!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=Kd(t),mf(e.stateNode,e.type,t))}}function xw(e){ci?di?di.push(e):di=[e]:ci=e}function gw(){if(ci){var e=ci,t=di;if(di=ci=null,Dx(e),t)for(e=0;e<t.length;e++)Dx(t[e])}}function vw(e,t){return e(t)}function ww(){}var Ku=!1;function yw(e,t,n){if(Ku)return e(t,n);Ku=!0;try{return vw(e,t,n)}finally{Ku=!1,(ci!==null||di!==null)&&(ww(),gw())}}function $o(e,t){var n=e.stateNode;if(n===null)return null;var r=Kd(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(oe(231,t,typeof n));return n}var pf=!1;if(Gr)try{var Ki={};Object.defineProperty(Ki,"passive",{get:function(){pf=!0}}),window.addEventListener("test",Ki,Ki),window.removeEventListener("test",Ki,Ki)}catch{pf=!1}function rk(e,t,n,r,a,i,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(h){this.onError(h)}}var No=!1,Jc=null,ed=!1,xf=null,sk={onError:function(e){No=!0,Jc=e}};function ak(e,t,n,r,a,i,o,l,c){No=!1,Jc=null,rk.apply(sk,arguments)}function ik(e,t,n,r,a,i,o,l,c){if(ak.apply(this,arguments),No){if(No){var d=Jc;No=!1,Jc=null}else throw Error(oe(198));ed||(ed=!0,xf=d)}}function Ta(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 bw(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 _x(e){if(Ta(e)!==e)throw Error(oe(188))}function ok(e){var t=e.alternate;if(!t){if(t=Ta(e),t===null)throw Error(oe(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return _x(a),e;if(i===r)return _x(a),t;i=i.sibling}throw Error(oe(188))}if(n.return!==r.return)n=a,r=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o)throw Error(oe(189))}}if(n.alternate!==r)throw Error(oe(190))}if(n.tag!==3)throw Error(oe(188));return n.stateNode.current===n?e:t}function jw(e){return e=ok(e),e!==null?Nw(e):null}function Nw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Nw(e);if(t!==null)return t;e=e.sibling}return null}var kw=bn.unstable_scheduleCallback,Px=bn.unstable_cancelCallback,lk=bn.unstable_shouldYield,ck=bn.unstable_requestPaint,wt=bn.unstable_now,dk=bn.unstable_getCurrentPriorityLevel,Fm=bn.unstable_ImmediatePriority,Sw=bn.unstable_UserBlockingPriority,td=bn.unstable_NormalPriority,uk=bn.unstable_LowPriority,Cw=bn.unstable_IdlePriority,Yd=null,Nr=null;function hk(e){if(Nr&&typeof Nr.onCommitFiberRoot=="function")try{Nr.onCommitFiberRoot(Yd,e,void 0,(e.current.flags&128)===128)}catch{}}var nr=Math.clz32?Math.clz32:pk,fk=Math.log,mk=Math.LN2;function pk(e){return e>>>=0,e===0?32:31-(fk(e)/mk|0)|0}var Xl=64,ql=4194304;function go(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function nd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?r=go(l):(i&=o,i!==0&&(r=go(i)))}else o=n&~a,o!==0?r=go(o):i!==0&&(r=go(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-nr(t),a=1<<n,r|=e[n],t&=~a;return r}function xk(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gk(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-nr(i),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=xk(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function gf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ew(){var e=Xl;return Xl<<=1,!(Xl&4194240)&&(Xl=64),e}function Qu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-nr(t),e[t]=n}function vk(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-nr(n),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~i}}function Um(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-nr(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var qe=0;function Mw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Dw,Bm,_w,Pw,Tw,vf=!1,Gl=[],Ns=null,ks=null,Ss=null,Ro=new Map,Io=new Map,gs=[],wk="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 submit".split(" ");function Tx(e,t){switch(e){case"focusin":case"focusout":Ns=null;break;case"dragenter":case"dragleave":ks=null;break;case"mouseover":case"mouseout":Ss=null;break;case"pointerover":case"pointerout":Ro.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(t.pointerId)}}function Qi(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=gl(t),t!==null&&Bm(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function yk(e,t,n,r,a){switch(t){case"focusin":return Ns=Qi(Ns,e,t,n,r,a),!0;case"dragenter":return ks=Qi(ks,e,t,n,r,a),!0;case"mouseover":return Ss=Qi(Ss,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return Ro.set(i,Qi(Ro.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Io.set(i,Qi(Io.get(i)||null,e,t,n,r,a)),!0}return!1}function Ow(e){var t=Js(e.target);if(t!==null){var n=Ta(t);if(n!==null){if(t=n.tag,t===13){if(t=bw(n),t!==null){e.blockedOn=t,Tw(e.priority,function(){_w(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ff=r,n.target.dispatchEvent(r),ff=null}else return t=gl(n),t!==null&&Bm(t),e.blockedOn=n,!1;t.shift()}return!0}function Ox(e,t,n){Pc(e)&&n.delete(t)}function bk(){vf=!1,Ns!==null&&Pc(Ns)&&(Ns=null),ks!==null&&Pc(ks)&&(ks=null),Ss!==null&&Pc(Ss)&&(Ss=null),Ro.forEach(Ox),Io.forEach(Ox)}function Zi(e,t){e.blockedOn===t&&(e.blockedOn=null,vf||(vf=!0,bn.unstable_scheduleCallback(bn.unstable_NormalPriority,bk)))}function Lo(e){function t(a){return Zi(a,e)}if(0<Gl.length){Zi(Gl[0],e);for(var n=1;n<Gl.length;n++){var r=Gl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ns!==null&&Zi(Ns,e),ks!==null&&Zi(ks,e),Ss!==null&&Zi(Ss,e),Ro.forEach(t),Io.forEach(t),n=0;n<gs.length;n++)r=gs[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<gs.length&&(n=gs[0],n.blockedOn===null);)Ow(n),n.blockedOn===null&&gs.shift()}var ui=ns.ReactCurrentBatchConfig,rd=!0;function jk(e,t,n,r){var a=qe,i=ui.transition;ui.transition=null;try{qe=1,Wm(e,t,n,r)}finally{qe=a,ui.transition=i}}function Nk(e,t,n,r){var a=qe,i=ui.transition;ui.transition=null;try{qe=4,Wm(e,t,n,r)}finally{qe=a,ui.transition=i}}function Wm(e,t,n,r){if(rd){var a=wf(e,t,n,r);if(a===null)oh(e,t,r,sd,n),Tx(e,r);else if(yk(a,e,t,n,r))r.stopPropagation();else if(Tx(e,r),t&4&&-1<wk.indexOf(e)){for(;a!==null;){var i=gl(a);if(i!==null&&Dw(i),i=wf(e,t,n,r),i===null&&oh(e,t,r,sd,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else oh(e,t,r,null,n)}}var sd=null;function wf(e,t,n,r){if(sd=null,e=Lm(r),e=Js(e),e!==null)if(t=Ta(e),t===null)e=null;else if(n=t.tag,n===13){if(e=bw(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 sd=e,null}function Aw(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(dk()){case Fm:return 1;case Sw:return 4;case td:case uk:return 16;case Cw:return 536870912;default:return 16}default:return 16}}var ys=null,Hm=null,Tc=null;function zw(){if(Tc)return Tc;var e,t=Hm,n=t.length,r,a="value"in ys?ys.value:ys.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[i-r];r++);return Tc=a.slice(e,1<r?1-r:void 0)}function Oc(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 Kl(){return!0}function Ax(){return!1}function Sn(e){function t(n,r,a,i,o){this._reactName=n,this._targetInst=a,this.type=r,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)?Kl:Ax,this.isPropagationStopped=Ax,this}return xt(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=Kl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Kl)},persist:function(){},isPersistent:Kl}),t}var Fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vm=Sn(Fi),xl=xt({},Fi,{view:0,detail:0}),kk=Sn(xl),Zu,Ju,Ji,Xd=xt({},xl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ym,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!==Ji&&(Ji&&e.type==="mousemove"?(Zu=e.screenX-Ji.screenX,Ju=e.screenY-Ji.screenY):Ju=Zu=0,Ji=e),Zu)},movementY:function(e){return"movementY"in e?e.movementY:Ju}}),zx=Sn(Xd),Sk=xt({},Xd,{dataTransfer:0}),Ck=Sn(Sk),Ek=xt({},xl,{relatedTarget:0}),eh=Sn(Ek),Mk=xt({},Fi,{animationName:0,elapsedTime:0,pseudoElement:0}),Dk=Sn(Mk),_k=xt({},Fi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pk=Sn(_k),Tk=xt({},Fi,{data:0}),$x=Sn(Tk),Ok={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ak={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"},zk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $k(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zk[e])?!!t[e]:!1}function Ym(){return $k}var Rk=xt({},xl,{key:function(e){if(e.key){var t=Ok[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Oc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ak[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ym,charCode:function(e){return e.type==="keypress"?Oc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Oc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ik=Sn(Rk),Lk=xt({},Xd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rx=Sn(Lk),Fk=xt({},xl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ym}),Uk=Sn(Fk),Bk=xt({},Fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wk=Sn(Bk),Hk=xt({},Xd,{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}),Vk=Sn(Hk),Yk=[9,13,27,32],Xm=Gr&&"CompositionEvent"in window,ko=null;Gr&&"documentMode"in document&&(ko=document.documentMode);var Xk=Gr&&"TextEvent"in window&&!ko,$w=Gr&&(!Xm||ko&&8<ko&&11>=ko),Ix=" ",Lx=!1;function Rw(e,t){switch(e){case"keyup":return Yk.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Iw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ka=!1;function qk(e,t){switch(e){case"compositionend":return Iw(t);case"keypress":return t.which!==32?null:(Lx=!0,Ix);case"textInput":return e=t.data,e===Ix&&Lx?null:e;default:return null}}function Gk(e,t){if(Ka)return e==="compositionend"||!Xm&&Rw(e,t)?(e=zw(),Tc=Hm=ys=null,Ka=!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 $w&&t.locale!=="ko"?null:t.data;default:return null}}var Kk={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 Fx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Kk[e.type]:t==="textarea"}function Lw(e,t,n,r){xw(r),t=ad(t,"onChange"),0<t.length&&(n=new Vm("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var So=null,Fo=null;function Qk(e){Kw(e,0)}function qd(e){var t=Ja(e);if(cw(t))return e}function Zk(e,t){if(e==="change")return t}var Fw=!1;if(Gr){var th;if(Gr){var nh="oninput"in document;if(!nh){var Ux=document.createElement("div");Ux.setAttribute("oninput","return;"),nh=typeof Ux.oninput=="function"}th=nh}else th=!1;Fw=th&&(!document.documentMode||9<document.documentMode)}function Bx(){So&&(So.detachEvent("onpropertychange",Uw),Fo=So=null)}function Uw(e){if(e.propertyName==="value"&&qd(Fo)){var t=[];Lw(t,Fo,e,Lm(e)),yw(Qk,t)}}function Jk(e,t,n){e==="focusin"?(Bx(),So=t,Fo=n,So.attachEvent("onpropertychange",Uw)):e==="focusout"&&Bx()}function eS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qd(Fo)}function tS(e,t){if(e==="click")return qd(t)}function nS(e,t){if(e==="input"||e==="change")return qd(t)}function rS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ar=typeof Object.is=="function"?Object.is:rS;function Uo(e,t){if(ar(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!ef.call(t,a)||!ar(e[a],t[a]))return!1}return!0}function Wx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hx(e,t){var n=Wx(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Wx(n)}}function Bw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ww(){for(var e=window,t=Zc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Zc(e.document)}return t}function qm(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")}function sS(e){var t=Ww(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Bw(n.ownerDocument.documentElement,n)){if(r!==null&&qm(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=Hx(n,i);var o=Hx(n,r);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var aS=Gr&&"documentMode"in document&&11>=document.documentMode,Qa=null,yf=null,Co=null,bf=!1;function Vx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bf||Qa==null||Qa!==Zc(r)||(r=Qa,"selectionStart"in r&&qm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Co&&Uo(Co,r)||(Co=r,r=ad(yf,"onSelect"),0<r.length&&(t=new Vm("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Qa)))}function Ql(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Za={animationend:Ql("Animation","AnimationEnd"),animationiteration:Ql("Animation","AnimationIteration"),animationstart:Ql("Animation","AnimationStart"),transitionend:Ql("Transition","TransitionEnd")},rh={},Hw={};Gr&&(Hw=document.createElement("div").style,"AnimationEvent"in window||(delete Za.animationend.animation,delete Za.animationiteration.animation,delete Za.animationstart.animation),"TransitionEvent"in window||delete Za.transitionend.transition);function Gd(e){if(rh[e])return rh[e];if(!Za[e])return e;var t=Za[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Hw)return rh[e]=t[n];return e}var Vw=Gd("animationend"),Yw=Gd("animationiteration"),Xw=Gd("animationstart"),qw=Gd("transitionend"),Gw=new Map,Yx="abort auxClick 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(" ");function Ls(e,t){Gw.set(e,t),Pa(t,[e])}for(var sh=0;sh<Yx.length;sh++){var ah=Yx[sh],iS=ah.toLowerCase(),oS=ah[0].toUpperCase()+ah.slice(1);Ls(iS,"on"+oS)}Ls(Vw,"onAnimationEnd");Ls(Yw,"onAnimationIteration");Ls(Xw,"onAnimationStart");Ls("dblclick","onDoubleClick");Ls("focusin","onFocus");Ls("focusout","onBlur");Ls(qw,"onTransitionEnd");wi("onMouseEnter",["mouseout","mouseover"]);wi("onMouseLeave",["mouseout","mouseover"]);wi("onPointerEnter",["pointerout","pointerover"]);wi("onPointerLeave",["pointerout","pointerover"]);Pa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Pa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Pa("onBeforeInput",["compositionend","keypress","textInput","paste"]);Pa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Pa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Pa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),lS=new Set("cancel close invalid load scroll toggle".split(" ").concat(vo));function Xx(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,ik(r,t,void 0,e),e.currentTarget=null}function Kw(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;Xx(a,l,d),i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;Xx(a,l,d),i=c}}}if(ed)throw e=xf,ed=!1,xf=null,e}function at(e,t){var n=t[Cf];n===void 0&&(n=t[Cf]=new Set);var r=e+"__bubble";n.has(r)||(Qw(t,e,2,!1),n.add(r))}function ih(e,t,n){var r=0;t&&(r|=4),Qw(n,e,r,t)}var Zl="_reactListening"+Math.random().toString(36).slice(2);function Bo(e){if(!e[Zl]){e[Zl]=!0,sw.forEach(function(n){n!=="selectionchange"&&(lS.has(n)||ih(n,!1,e),ih(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zl]||(t[Zl]=!0,ih("selectionchange",!1,t))}}function Qw(e,t,n,r){switch(Aw(t)){case 1:var a=jk;break;case 4:a=Nk;break;default:a=Wm}n=a.bind(null,t,n,e),a=void 0,!pf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function oh(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=Js(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}yw(function(){var d=i,h=Lm(n),u=[];e:{var f=Gw.get(e);if(f!==void 0){var p=Vm,w=e;switch(e){case"keypress":if(Oc(n)===0)break e;case"keydown":case"keyup":p=Ik;break;case"focusin":w="focus",p=eh;break;case"focusout":w="blur",p=eh;break;case"beforeblur":case"afterblur":p=eh;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":p=zx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Ck;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Uk;break;case Vw:case Yw:case Xw:p=Dk;break;case qw:p=Wk;break;case"scroll":p=kk;break;case"wheel":p=Vk;break;case"copy":case"cut":case"paste":p=Pk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Rx}var v=(t&4)!==0,j=!v&&e==="scroll",g=v?f!==null?f+"Capture":null:f;v=[];for(var y=d,x;y!==null;){x=y;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,g!==null&&(b=$o(y,g),b!=null&&v.push(Wo(y,b,x)))),j)break;y=y.return}0<v.length&&(f=new p(f,w,null,n,h),u.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==ff&&(w=n.relatedTarget||n.fromElement)&&(Js(w)||w[Kr]))break e;if((p||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,p?(w=n.relatedTarget||n.toElement,p=d,w=w?Js(w):null,w!==null&&(j=Ta(w),w!==j||w.tag!==5&&w.tag!==6)&&(w=null)):(p=null,w=d),p!==w)){if(v=zx,b="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(v=Rx,b="onPointerLeave",g="onPointerEnter",y="pointer"),j=p==null?f:Ja(p),x=w==null?f:Ja(w),f=new v(b,y+"leave",p,n,h),f.target=j,f.relatedTarget=x,b=null,Js(h)===d&&(v=new v(g,y+"enter",w,n,h),v.target=x,v.relatedTarget=j,b=v),j=b,p&&w)t:{for(v=p,g=w,y=0,x=v;x;x=La(x))y++;for(x=0,b=g;b;b=La(b))x++;for(;0<y-x;)v=La(v),y--;for(;0<x-y;)g=La(g),x--;for(;y--;){if(v===g||g!==null&&v===g.alternate)break t;v=La(v),g=La(g)}v=null}else v=null;p!==null&&qx(u,f,p,v,!1),w!==null&&j!==null&&qx(u,j,w,v,!0)}}e:{if(f=d?Ja(d):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var N=Zk;else if(Fx(f))if(Fw)N=nS;else{N=eS;var k=Jk}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=tS);if(N&&(N=N(e,d))){Lw(u,N,n,h);break e}k&&k(e,f,d),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&lf(f,"number",f.value)}switch(k=d?Ja(d):window,e){case"focusin":(Fx(k)||k.contentEditable==="true")&&(Qa=k,yf=d,Co=null);break;case"focusout":Co=yf=Qa=null;break;case"mousedown":bf=!0;break;case"contextmenu":case"mouseup":case"dragend":bf=!1,Vx(u,n,h);break;case"selectionchange":if(aS)break;case"keydown":case"keyup":Vx(u,n,h)}var S;if(Xm)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Ka?Rw(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&($w&&n.locale!=="ko"&&(Ka||M!=="onCompositionStart"?M==="onCompositionEnd"&&Ka&&(S=zw()):(ys=h,Hm="value"in ys?ys.value:ys.textContent,Ka=!0)),k=ad(d,M),0<k.length&&(M=new $x(M,e,null,n,h),u.push({event:M,listeners:k}),S?M.data=S:(S=Iw(n),S!==null&&(M.data=S)))),(S=Xk?qk(e,n):Gk(e,n))&&(d=ad(d,"onBeforeInput"),0<d.length&&(h=new $x("onBeforeInput","beforeinput",null,n,h),u.push({event:h,listeners:d}),h.data=S))}Kw(u,t)})}function Wo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ad(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=$o(e,n),i!=null&&r.unshift(Wo(e,i,a)),i=$o(e,t),i!=null&&r.push(Wo(e,i,a))),e=e.return}return r}function La(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function qx(e,t,n,r,a){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&d!==null&&(l=d,a?(c=$o(n,i),c!=null&&o.unshift(Wo(n,c,l))):a||(c=$o(n,i),c!=null&&o.push(Wo(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var cS=/\r\n?/g,dS=/\u0000|\uFFFD/g;function Gx(e){return(typeof e=="string"?e:""+e).replace(cS,`
38
- `).replace(dS,"")}function Jl(e,t,n){if(t=Gx(t),Gx(e)!==t&&n)throw Error(oe(425))}function id(){}var jf=null,Nf=null;function kf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sf=typeof setTimeout=="function"?setTimeout:void 0,uS=typeof clearTimeout=="function"?clearTimeout:void 0,Kx=typeof Promise=="function"?Promise:void 0,hS=typeof queueMicrotask=="function"?queueMicrotask:typeof Kx<"u"?function(e){return Kx.resolve(null).then(e).catch(fS)}:Sf;function fS(e){setTimeout(function(){throw e})}function lh(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Lo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Lo(t)}function Cs(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==="$?")break;if(t==="/$")return null}}return e}function Qx(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}var Ui=Math.random().toString(36).slice(2),wr="__reactFiber$"+Ui,Ho="__reactProps$"+Ui,Kr="__reactContainer$"+Ui,Cf="__reactEvents$"+Ui,mS="__reactListeners$"+Ui,pS="__reactHandles$"+Ui;function Js(e){var t=e[wr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Kr]||n[wr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qx(e);e!==null;){if(n=e[wr])return n;e=Qx(e)}return t}e=n,n=e.parentNode}return null}function gl(e){return e=e[wr]||e[Kr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ja(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(oe(33))}function Kd(e){return e[Ho]||null}var Ef=[],ei=-1;function Fs(e){return{current:e}}function it(e){0>ei||(e.current=Ef[ei],Ef[ei]=null,ei--)}function et(e,t){ei++,Ef[ei]=e.current,e.current=t}var As={},Yt=Fs(As),ln=Fs(!1),ma=As;function yi(e,t){var n=e.type.contextTypes;if(!n)return As;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function cn(e){return e=e.childContextTypes,e!=null}function od(){it(ln),it(Yt)}function Zx(e,t,n){if(Yt.current!==As)throw Error(oe(168));et(Yt,t),et(ln,n)}function Zw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(oe(108,J2(e)||"Unknown",a));return xt({},n,r)}function ld(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||As,ma=Yt.current,et(Yt,e),et(ln,ln.current),!0}function Jx(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=Zw(e,t,ma),r.__reactInternalMemoizedMergedChildContext=e,it(ln),it(Yt),et(Yt,e)):it(ln),et(ln,n)}var Lr=null,Qd=!1,ch=!1;function Jw(e){Lr===null?Lr=[e]:Lr.push(e)}function xS(e){Qd=!0,Jw(e)}function Us(){if(!ch&&Lr!==null){ch=!0;var e=0,t=qe;try{var n=Lr;for(qe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Lr=null,Qd=!1}catch(a){throw Lr!==null&&(Lr=Lr.slice(e+1)),kw(Fm,Us),a}finally{qe=t,ch=!1}}return null}var ti=[],ni=0,cd=null,dd=0,In=[],Ln=0,pa=null,Fr=1,Ur="";function Xs(e,t){ti[ni++]=dd,ti[ni++]=cd,cd=e,dd=t}function ey(e,t,n){In[Ln++]=Fr,In[Ln++]=Ur,In[Ln++]=pa,pa=e;var r=Fr;e=Ur;var a=32-nr(r)-1;r&=~(1<<a),n+=1;var i=32-nr(t)+a;if(30<i){var o=a-a%5;i=(r&(1<<o)-1).toString(32),r>>=o,a-=o,Fr=1<<32-nr(t)+a|n<<a|r,Ur=i+e}else Fr=1<<i|n<<a|r,Ur=e}function Gm(e){e.return!==null&&(Xs(e,1),ey(e,1,0))}function Km(e){for(;e===cd;)cd=ti[--ni],ti[ni]=null,dd=ti[--ni],ti[ni]=null;for(;e===pa;)pa=In[--Ln],In[Ln]=null,Ur=In[--Ln],In[Ln]=null,Fr=In[--Ln],In[Ln]=null}var wn=null,vn=null,lt=!1,Qn=null;function ty(e,t){var n=Un(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function eg(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,wn=e,vn=Cs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,wn=e,vn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=pa!==null?{id:Fr,overflow:Ur}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Un(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,wn=e,vn=null,!0):!1;default:return!1}}function Mf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Df(e){if(lt){var t=vn;if(t){var n=t;if(!eg(e,t)){if(Mf(e))throw Error(oe(418));t=Cs(n.nextSibling);var r=wn;t&&eg(e,t)?ty(r,n):(e.flags=e.flags&-4097|2,lt=!1,wn=e)}}else{if(Mf(e))throw Error(oe(418));e.flags=e.flags&-4097|2,lt=!1,wn=e}}}function tg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;wn=e}function ec(e){if(e!==wn)return!1;if(!lt)return tg(e),lt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!kf(e.type,e.memoizedProps)),t&&(t=vn)){if(Mf(e))throw ny(),Error(oe(418));for(;t;)ty(e,t),t=Cs(t.nextSibling)}if(tg(e),e.tag===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){var n=e.data;if(n==="/$"){if(t===0){vn=Cs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}vn=null}}else vn=wn?Cs(e.stateNode.nextSibling):null;return!0}function ny(){for(var e=vn;e;)e=Cs(e.nextSibling)}function bi(){vn=wn=null,lt=!1}function Qm(e){Qn===null?Qn=[e]:Qn.push(e)}var gS=ns.ReactCurrentBatchConfig;function eo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(oe(309));var r=n.stateNode}if(!r)throw Error(oe(147,e));var a=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(oe(284));if(!n._owner)throw Error(oe(290,e))}return e}function tc(e,t){throw e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ng(e){var t=e._init;return t(e._payload)}function ry(e){function t(g,y){if(e){var x=g.deletions;x===null?(g.deletions=[y],g.flags|=16):x.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function r(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function a(g,y){return g=_s(g,y),g.index=0,g.sibling=null,g}function i(g,y,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<y?(g.flags|=2,y):x):(g.flags|=2,y)):(g.flags|=1048576,y)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,y,x,b){return y===null||y.tag!==6?(y=xh(x,g.mode,b),y.return=g,y):(y=a(y,x),y.return=g,y)}function c(g,y,x,b){var N=x.type;return N===Ga?h(g,y,x.props.children,b,x.key):y!==null&&(y.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===ms&&ng(N)===y.type)?(b=a(y,x.props),b.ref=eo(g,y,x),b.return=g,b):(b=Fc(x.type,x.key,x.props,null,g.mode,b),b.ref=eo(g,y,x),b.return=g,b)}function d(g,y,x,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=gh(x,g.mode,b),y.return=g,y):(y=a(y,x.children||[]),y.return=g,y)}function h(g,y,x,b,N){return y===null||y.tag!==7?(y=oa(x,g.mode,b,N),y.return=g,y):(y=a(y,x),y.return=g,y)}function u(g,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=xh(""+y,g.mode,x),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Hl:return x=Fc(y.type,y.key,y.props,null,g.mode,x),x.ref=eo(g,null,y),x.return=g,x;case qa:return y=gh(y,g.mode,x),y.return=g,y;case ms:var b=y._init;return u(g,b(y._payload),x)}if(xo(y)||Gi(y))return y=oa(y,g.mode,x,null),y.return=g,y;tc(g,y)}return null}function f(g,y,x,b){var N=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return N!==null?null:l(g,y,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Hl:return x.key===N?c(g,y,x,b):null;case qa:return x.key===N?d(g,y,x,b):null;case ms:return N=x._init,f(g,y,N(x._payload),b)}if(xo(x)||Gi(x))return N!==null?null:h(g,y,x,b,null);tc(g,x)}return null}function p(g,y,x,b,N){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(x)||null,l(y,g,""+b,N);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Hl:return g=g.get(b.key===null?x:b.key)||null,c(y,g,b,N);case qa:return g=g.get(b.key===null?x:b.key)||null,d(y,g,b,N);case ms:var k=b._init;return p(g,y,x,k(b._payload),N)}if(xo(b)||Gi(b))return g=g.get(x)||null,h(y,g,b,N,null);tc(y,b)}return null}function w(g,y,x,b){for(var N=null,k=null,S=y,M=y=0,O=null;S!==null&&M<x.length;M++){S.index>M?(O=S,S=null):O=S.sibling;var I=f(g,S,x[M],b);if(I===null){S===null&&(S=O);break}e&&S&&I.alternate===null&&t(g,S),y=i(I,y,M),k===null?N=I:k.sibling=I,k=I,S=O}if(M===x.length)return n(g,S),lt&&Xs(g,M),N;if(S===null){for(;M<x.length;M++)S=u(g,x[M],b),S!==null&&(y=i(S,y,M),k===null?N=S:k.sibling=S,k=S);return lt&&Xs(g,M),N}for(S=r(g,S);M<x.length;M++)O=p(S,g,M,x[M],b),O!==null&&(e&&O.alternate!==null&&S.delete(O.key===null?M:O.key),y=i(O,y,M),k===null?N=O:k.sibling=O,k=O);return e&&S.forEach(function(B){return t(g,B)}),lt&&Xs(g,M),N}function v(g,y,x,b){var N=Gi(x);if(typeof N!="function")throw Error(oe(150));if(x=N.call(x),x==null)throw Error(oe(151));for(var k=N=null,S=y,M=y=0,O=null,I=x.next();S!==null&&!I.done;M++,I=x.next()){S.index>M?(O=S,S=null):O=S.sibling;var B=f(g,S,I.value,b);if(B===null){S===null&&(S=O);break}e&&S&&B.alternate===null&&t(g,S),y=i(B,y,M),k===null?N=B:k.sibling=B,k=B,S=O}if(I.done)return n(g,S),lt&&Xs(g,M),N;if(S===null){for(;!I.done;M++,I=x.next())I=u(g,I.value,b),I!==null&&(y=i(I,y,M),k===null?N=I:k.sibling=I,k=I);return lt&&Xs(g,M),N}for(S=r(g,S);!I.done;M++,I=x.next())I=p(S,g,M,I.value,b),I!==null&&(e&&I.alternate!==null&&S.delete(I.key===null?M:I.key),y=i(I,y,M),k===null?N=I:k.sibling=I,k=I);return e&&S.forEach(function(z){return t(g,z)}),lt&&Xs(g,M),N}function j(g,y,x,b){if(typeof x=="object"&&x!==null&&x.type===Ga&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Hl:e:{for(var N=x.key,k=y;k!==null;){if(k.key===N){if(N=x.type,N===Ga){if(k.tag===7){n(g,k.sibling),y=a(k,x.props.children),y.return=g,g=y;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===ms&&ng(N)===k.type){n(g,k.sibling),y=a(k,x.props),y.ref=eo(g,k,x),y.return=g,g=y;break e}n(g,k);break}else t(g,k);k=k.sibling}x.type===Ga?(y=oa(x.props.children,g.mode,b,x.key),y.return=g,g=y):(b=Fc(x.type,x.key,x.props,null,g.mode,b),b.ref=eo(g,y,x),b.return=g,g=b)}return o(g);case qa:e:{for(k=x.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(g,y.sibling),y=a(y,x.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=gh(x,g.mode,b),y.return=g,g=y}return o(g);case ms:return k=x._init,j(g,y,k(x._payload),b)}if(xo(x))return w(g,y,x,b);if(Gi(x))return v(g,y,x,b);tc(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(g,y.sibling),y=a(y,x),y.return=g,g=y):(n(g,y),y=xh(x,g.mode,b),y.return=g,g=y),o(g)):n(g,y)}return j}var ji=ry(!0),sy=ry(!1),ud=Fs(null),hd=null,ri=null,Zm=null;function Jm(){Zm=ri=hd=null}function ep(e){var t=ud.current;it(ud),e._currentValue=t}function _f(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function hi(e,t){hd=e,Zm=ri=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(an=!0),e.firstContext=null)}function Wn(e){var t=e._currentValue;if(Zm!==e)if(e={context:e,memoizedValue:t,next:null},ri===null){if(hd===null)throw Error(oe(308));ri=e,hd.dependencies={lanes:0,firstContext:e}}else ri=ri.next=e;return t}var ea=null;function tp(e){ea===null?ea=[e]:ea.push(e)}function ay(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,tp(t)):(n.next=a.next,a.next=n),t.interleaved=n,Qr(e,r)}function Qr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ps=!1;function np(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function iy(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Yr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Es(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Be&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Qr(e,n)}return a=r.interleaved,a===null?(t.next=t,tp(r)):(t.next=a.next,a.next=t),r.interleaved=t,Qr(e,n)}function Ac(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Um(e,n)}}function rg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function fd(e,t,n,r){var a=e.updateQueue;ps=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=d:l.next=d,h.lastBaseUpdate=c))}if(i!==null){var u=a.baseState;o=0,h=d=c=null,l=i;do{var f=l.lane,p=l.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,v=l;switch(f=t,p=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){u=w.call(p,u,f);break e}u=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,f=typeof w=="function"?w.call(p,u,f):w,f==null)break e;u=xt({},u,f);break e;case 2:ps=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=a.effects,f===null?a.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(d=h=p,c=u):h=h.next=p,o|=f;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;f=l,l=f.next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}while(!0);if(h===null&&(c=u),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=h,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);ga|=o,e.lanes=o,e.memoizedState=u}}function sg(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(oe(191,a));a.call(r)}}}var vl={},kr=Fs(vl),Vo=Fs(vl),Yo=Fs(vl);function ta(e){if(e===vl)throw Error(oe(174));return e}function rp(e,t){switch(et(Yo,t),et(Vo,e),et(kr,vl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:df(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=df(t,e)}it(kr),et(kr,t)}function Ni(){it(kr),it(Vo),it(Yo)}function oy(e){ta(Yo.current);var t=ta(kr.current),n=df(t,e.type);t!==n&&(et(Vo,e),et(kr,n))}function sp(e){Vo.current===e&&(it(kr),it(Vo))}var ft=Fs(0);function md(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==="$?"||n.data==="$!"))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}var dh=[];function ap(){for(var e=0;e<dh.length;e++)dh[e]._workInProgressVersionPrimary=null;dh.length=0}var zc=ns.ReactCurrentDispatcher,uh=ns.ReactCurrentBatchConfig,xa=0,pt=null,Mt=null,Pt=null,pd=!1,Eo=!1,Xo=0,vS=0;function Ut(){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(!ar(e[n],t[n]))return!1;return!0}function op(e,t,n,r,a,i){if(xa=i,pt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,zc.current=e===null||e.memoizedState===null?jS:NS,e=n(r,a),Eo){i=0;do{if(Eo=!1,Xo=0,25<=i)throw Error(oe(301));i+=1,Pt=Mt=null,t.updateQueue=null,zc.current=kS,e=n(r,a)}while(Eo)}if(zc.current=xd,t=Mt!==null&&Mt.next!==null,xa=0,Pt=Mt=pt=null,pd=!1,t)throw Error(oe(300));return e}function lp(){var e=Xo!==0;return Xo=0,e}function pr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?pt.memoizedState=Pt=e:Pt=Pt.next=e,Pt}function Hn(){if(Mt===null){var e=pt.alternate;e=e!==null?e.memoizedState:null}else e=Mt.next;var t=Pt===null?pt.memoizedState:Pt.next;if(t!==null)Pt=t,Mt=e;else{if(e===null)throw Error(oe(310));Mt=e,e={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},Pt===null?pt.memoizedState=Pt=e:Pt=Pt.next=e}return Pt}function qo(e,t){return typeof t=="function"?t(e):t}function hh(e){var t=Hn(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var r=Mt,a=r.baseQueue,i=n.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}r.baseQueue=a=i,n.pending=null}if(a!==null){i=a.next,r=r.baseState;var l=o=null,c=null,d=i;do{var h=d.lane;if((xa&h)===h)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var u={lane:h,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=u,o=r):c=c.next=u,pt.lanes|=h,ga|=h}d=d.next}while(d!==null&&d!==i);c===null?o=r:c.next=l,ar(r,t.memoizedState)||(an=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do i=a.lane,pt.lanes|=i,ga|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function fh(e){var t=Hn(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);ar(i,t.memoizedState)||(an=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function ly(){}function cy(e,t){var n=pt,r=Hn(),a=t(),i=!ar(r.memoizedState,a);if(i&&(r.memoizedState=a,an=!0),r=r.queue,cp(hy.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Pt!==null&&Pt.memoizedState.tag&1){if(n.flags|=2048,Go(9,uy.bind(null,n,r,a,t),void 0,null),Ot===null)throw Error(oe(349));xa&30||dy(n,t,a)}return a}function dy(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=pt.updateQueue,t===null?(t={lastEffect:null,stores:null},pt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function uy(e,t,n,r){t.value=n,t.getSnapshot=r,fy(t)&&my(e)}function hy(e,t,n){return n(function(){fy(t)&&my(e)})}function fy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ar(e,n)}catch{return!0}}function my(e){var t=Qr(e,1);t!==null&&rr(t,e,1,-1)}function ag(e){var t=pr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:e},t.queue=e,e=e.dispatch=bS.bind(null,pt,e),[t.memoizedState,e]}function Go(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=pt.updateQueue,t===null?(t={lastEffect:null,stores:null},pt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function py(){return Hn().memoizedState}function $c(e,t,n,r){var a=pr();pt.flags|=e,a.memoizedState=Go(1|t,n,void 0,r===void 0?null:r)}function Zd(e,t,n,r){var a=Hn();r=r===void 0?null:r;var i=void 0;if(Mt!==null){var o=Mt.memoizedState;if(i=o.destroy,r!==null&&ip(r,o.deps)){a.memoizedState=Go(t,n,i,r);return}}pt.flags|=e,a.memoizedState=Go(1|t,n,i,r)}function ig(e,t){return $c(8390656,8,e,t)}function cp(e,t){return Zd(2048,8,e,t)}function xy(e,t){return Zd(4,2,e,t)}function gy(e,t){return Zd(4,4,e,t)}function vy(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function wy(e,t,n){return n=n!=null?n.concat([e]):null,Zd(4,4,vy.bind(null,t,e),n)}function dp(){}function yy(e,t){var n=Hn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ip(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function by(e,t){var n=Hn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ip(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function jy(e,t,n){return xa&21?(ar(n,t)||(n=Ew(),pt.lanes|=n,ga|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,an=!0),e.memoizedState=n)}function wS(e,t){var n=qe;qe=n!==0&&4>n?n:4,e(!0);var r=uh.transition;uh.transition={};try{e(!1),t()}finally{qe=n,uh.transition=r}}function Ny(){return Hn().memoizedState}function yS(e,t,n){var r=Ds(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ky(e))Sy(t,n);else if(n=ay(e,t,n,r),n!==null){var a=Kt();rr(n,e,r,a),Cy(n,t,r)}}function bS(e,t,n){var r=Ds(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ky(e))Sy(t,a);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(a.hasEagerState=!0,a.eagerState=l,ar(l,o)){var c=t.interleaved;c===null?(a.next=a,tp(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=ay(e,t,a,r),n!==null&&(a=Kt(),rr(n,e,r,a),Cy(n,t,r))}}function ky(e){var t=e.alternate;return e===pt||t!==null&&t===pt}function Sy(e,t){Eo=pd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Cy(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Um(e,n)}}var xd={readContext:Wn,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useInsertionEffect:Ut,useLayoutEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useMutableSource:Ut,useSyncExternalStore:Ut,useId:Ut,unstable_isNewReconciler:!1},jS={readContext:Wn,useCallback:function(e,t){return pr().memoizedState=[e,t===void 0?null:t],e},useContext:Wn,useEffect:ig,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$c(4194308,4,vy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $c(4194308,4,e,t)},useInsertionEffect:function(e,t){return $c(4,2,e,t)},useMemo:function(e,t){var n=pr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=pr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yS.bind(null,pt,e),[r.memoizedState,e]},useRef:function(e){var t=pr();return e={current:e},t.memoizedState=e},useState:ag,useDebugValue:dp,useDeferredValue:function(e){return pr().memoizedState=e},useTransition:function(){var e=ag(!1),t=e[0];return e=wS.bind(null,e[1]),pr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pt,a=pr();if(lt){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),Ot===null)throw Error(oe(349));xa&30||dy(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,ig(hy.bind(null,r,i,e),[e]),r.flags|=2048,Go(9,uy.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=pr(),t=Ot.identifierPrefix;if(lt){var n=Ur,r=Fr;n=(r&~(1<<32-nr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Xo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=vS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},NS={readContext:Wn,useCallback:yy,useContext:Wn,useEffect:cp,useImperativeHandle:wy,useInsertionEffect:xy,useLayoutEffect:gy,useMemo:by,useReducer:hh,useRef:py,useState:function(){return hh(qo)},useDebugValue:dp,useDeferredValue:function(e){var t=Hn();return jy(t,Mt.memoizedState,e)},useTransition:function(){var e=hh(qo)[0],t=Hn().memoizedState;return[e,t]},useMutableSource:ly,useSyncExternalStore:cy,useId:Ny,unstable_isNewReconciler:!1},kS={readContext:Wn,useCallback:yy,useContext:Wn,useEffect:cp,useImperativeHandle:wy,useInsertionEffect:xy,useLayoutEffect:gy,useMemo:by,useReducer:fh,useRef:py,useState:function(){return fh(qo)},useDebugValue:dp,useDeferredValue:function(e){var t=Hn();return Mt===null?t.memoizedState=e:jy(t,Mt.memoizedState,e)},useTransition:function(){var e=fh(qo)[0],t=Hn().memoizedState;return[e,t]},useMutableSource:ly,useSyncExternalStore:cy,useId:Ny,unstable_isNewReconciler:!1};function Xn(e,t){if(e&&e.defaultProps){t=xt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Pf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:xt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Jd={isMounted:function(e){return(e=e._reactInternals)?Ta(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Kt(),a=Ds(e),i=Yr(r,a);i.payload=t,n!=null&&(i.callback=n),t=Es(e,i,a),t!==null&&(rr(t,e,a,r),Ac(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Kt(),a=Ds(e),i=Yr(r,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Es(e,i,a),t!==null&&(rr(t,e,a,r),Ac(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Kt(),r=Ds(e),a=Yr(n,r);a.tag=2,t!=null&&(a.callback=t),t=Es(e,a,r),t!==null&&(rr(t,e,r,n),Ac(t,e,r))}};function og(e,t,n,r,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Uo(n,r)||!Uo(a,i):!0}function Ey(e,t,n){var r=!1,a=As,i=t.contextType;return typeof i=="object"&&i!==null?i=Wn(i):(a=cn(t)?ma:Yt.current,r=t.contextTypes,i=(r=r!=null)?yi(e,a):As),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Jd,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function lg(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Jd.enqueueReplaceState(t,t.state,null)}function Tf(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},np(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Wn(i):(i=cn(t)?ma:Yt.current,a.context=yi(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Pf(e,t,i,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Jd.enqueueReplaceState(a,a.state,null),fd(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function ki(e,t){try{var n="",r=t;do n+=Z2(r),r=r.return;while(r);var a=n}catch(i){a=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:a,digest:null}}function mh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Of(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var SS=typeof WeakMap=="function"?WeakMap:Map;function My(e,t,n){n=Yr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){vd||(vd=!0,Wf=r),Of(e,t)},n}function Dy(e,t,n){n=Yr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){Of(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Of(e,t),typeof r!="function"&&(Ms===null?Ms=new Set([this]):Ms.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function cg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new SS;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=LS.bind(null,e,t,n),t.then(e,e))}function dg(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ug(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Yr(-1,1),t.tag=2,Es(n,t,1))),n.lanes|=1),e)}var CS=ns.ReactCurrentOwner,an=!1;function qt(e,t,n,r){t.child=e===null?sy(t,null,n,r):ji(t,e.child,n,r)}function hg(e,t,n,r,a){n=n.render;var i=t.ref;return hi(t,a),r=op(e,t,n,r,i,a),n=lp(),e!==null&&!an?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Zr(e,t,a)):(lt&&n&&Gm(t),t.flags|=1,qt(e,t,r,a),t.child)}function fg(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!vp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,_y(e,t,i,r,a)):(e=Fc(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Uo,n(o,r)&&e.ref===t.ref)return Zr(e,t,a)}return t.flags|=1,e=_s(i,r),e.ref=t.ref,e.return=t,t.child=e}function _y(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(Uo(i,r)&&e.ref===t.ref)if(an=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(an=!0);else return t.lanes=e.lanes,Zr(e,t,a)}return Af(e,t,n,r,a)}function Py(e,t,n){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(ai,fn),fn|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,et(ai,fn),fn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,et(ai,fn),fn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,et(ai,fn),fn|=r;return qt(e,t,a,n),t.child}function Ty(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Af(e,t,n,r,a){var i=cn(n)?ma:Yt.current;return i=yi(t,i),hi(t,a),n=op(e,t,n,r,i,a),r=lp(),e!==null&&!an?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Zr(e,t,a)):(lt&&r&&Gm(t),t.flags|=1,qt(e,t,n,a),t.child)}function mg(e,t,n,r,a){if(cn(n)){var i=!0;ld(t)}else i=!1;if(hi(t,a),t.stateNode===null)Rc(e,t),Ey(t,n,r),Tf(t,n,r,a),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=Wn(d):(d=cn(n)?ma:Yt.current,d=yi(t,d));var h=n.getDerivedStateFromProps,u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==d)&&lg(t,o,r,d),ps=!1;var f=t.memoizedState;o.state=f,fd(t,r,o,a),c=t.memoizedState,l!==r||f!==c||ln.current||ps?(typeof h=="function"&&(Pf(t,n,h,r),c=t.memoizedState),(l=ps||og(t,n,l,r,f,c,d))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=d,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,iy(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Xn(t.type,l),o.props=d,u=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Wn(c):(c=cn(n)?ma:Yt.current,c=yi(t,c));var p=n.getDerivedStateFromProps;(h=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==u||f!==c)&&lg(t,o,r,c),ps=!1,f=t.memoizedState,o.state=f,fd(t,r,o,a);var w=t.memoizedState;l!==u||f!==w||ln.current||ps?(typeof p=="function"&&(Pf(t,n,p,r),w=t.memoizedState),(d=ps||og(t,n,d,r,f,w,c)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,w,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),o.props=r,o.state=w,o.context=c,r=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return zf(e,t,n,r,i,a)}function zf(e,t,n,r,a,i){Ty(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&Jx(t,n,!1),Zr(e,t,i);r=t.stateNode,CS.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ji(t,e.child,null,i),t.child=ji(t,null,l,i)):qt(e,t,l,i),t.memoizedState=r.state,a&&Jx(t,n,!0),t.child}function Oy(e){var t=e.stateNode;t.pendingContext?Zx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Zx(e,t.context,!1),rp(e,t.containerInfo)}function pg(e,t,n,r,a){return bi(),Qm(a),t.flags|=256,qt(e,t,n,r),t.child}var $f={dehydrated:null,treeContext:null,retryLane:0};function Rf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ay(e,t,n){var r=t.pendingProps,a=ft.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),et(ft,a&1),e===null)return Df(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=nu(o,r,0,null),e=oa(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Rf(n),t.memoizedState=$f,e):up(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return ES(e,t,o,r,l,a,n);if(i){i=r.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=_s(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=_s(l,i):(i=oa(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Rf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=$f,r}return i=e.child,e=i.sibling,r=_s(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function up(e,t){return t=nu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nc(e,t,n,r){return r!==null&&Qm(r),ji(t,e.child,null,n),e=up(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ES(e,t,n,r,a,i,o){if(n)return t.flags&256?(t.flags&=-257,r=mh(Error(oe(422))),nc(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=nu({mode:"visible",children:r.children},a,0,null),i=oa(i,a,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ji(t,e.child,null,o),t.child.memoizedState=Rf(o),t.memoizedState=$f,i);if(!(t.mode&1))return nc(e,t,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(oe(419)),r=mh(i,r,void 0),nc(e,t,o,r)}if(l=(o&e.childLanes)!==0,an||l){if(r=Ot,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Qr(e,a),rr(r,e,a,-1))}return gp(),r=mh(Error(oe(421))),nc(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=FS.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,vn=Cs(a.nextSibling),wn=t,lt=!0,Qn=null,e!==null&&(In[Ln++]=Fr,In[Ln++]=Ur,In[Ln++]=pa,Fr=e.id,Ur=e.overflow,pa=t),t=up(t,r.children),t.flags|=4096,t)}function xg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_f(e.return,t,n)}function ph(e,t,n,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function zy(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(qt(e,t,r.children,n),r=ft.current,r&2)r=r&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&&xg(e,n,t);else if(e.tag===19)xg(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}r&=1}if(et(ft,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&md(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),ph(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&md(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}ph(t,!0,n,null,i);break;case"together":ph(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Rc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ga|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,n=_s(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_s(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function MS(e,t,n){switch(t.tag){case 3:Oy(t),bi();break;case 5:oy(t);break;case 1:cn(t.type)&&ld(t);break;case 4:rp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;et(ud,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(et(ft,ft.current&1),t.flags|=128,null):n&t.child.childLanes?Ay(e,t,n):(et(ft,ft.current&1),e=Zr(e,t,n),e!==null?e.sibling:null);et(ft,ft.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return zy(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),et(ft,ft.current),r)break;return null;case 22:case 23:return t.lanes=0,Py(e,t,n)}return Zr(e,t,n)}var $y,If,Ry,Iy;$y=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};If=function(){};Ry=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,ta(kr.current);var i=null;switch(n){case"input":a=af(e,a),r=af(e,r),i=[];break;case"select":a=xt({},a,{value:void 0}),r=xt({},r,{value:void 0}),i=[];break;case"textarea":a=cf(e,a),r=cf(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=id)}uf(n,r);var o;n=null;for(d in a)if(!r.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Ao.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(l=a!=null?a[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Ao.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&at("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};Iy=function(e,t,n,r){n!==r&&(t.flags|=4)};function to(e,t){if(!lt)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function DS(e,t,n){var r=t.pendingProps;switch(Km(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(t),null;case 1:return cn(t.type)&&od(),Bt(t),null;case 3:return r=t.stateNode,Ni(),it(ln),it(Yt),ap(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ec(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Qn!==null&&(Yf(Qn),Qn=null))),If(e,t),Bt(t),null;case 5:sp(t);var a=ta(Yo.current);if(n=t.type,e!==null&&t.stateNode!=null)Ry(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(oe(166));return Bt(t),null}if(e=ta(kr.current),ec(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[wr]=t,r[Ho]=i,e=(t.mode&1)!==0,n){case"dialog":at("cancel",r),at("close",r);break;case"iframe":case"object":case"embed":at("load",r);break;case"video":case"audio":for(a=0;a<vo.length;a++)at(vo[a],r);break;case"source":at("error",r);break;case"img":case"image":case"link":at("error",r),at("load",r);break;case"details":at("toggle",r);break;case"input":Sx(r,i),at("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},at("invalid",r);break;case"textarea":Ex(r,i),at("invalid",r)}uf(n,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Jl(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Jl(r.textContent,l,e),a=["children",""+l]):Ao.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&at("scroll",r)}switch(n){case"input":Vl(r),Cx(r,i,!0);break;case"textarea":Vl(r),Mx(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=id)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=hw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[wr]=t,e[Ho]=r,$y(e,t,!1,!1),t.stateNode=e;e:{switch(o=hf(n,r),n){case"dialog":at("cancel",e),at("close",e),a=r;break;case"iframe":case"object":case"embed":at("load",e),a=r;break;case"video":case"audio":for(a=0;a<vo.length;a++)at(vo[a],e);a=r;break;case"source":at("error",e),a=r;break;case"img":case"image":case"link":at("error",e),at("load",e),a=r;break;case"details":at("toggle",e),a=r;break;case"input":Sx(e,r),a=af(e,r),at("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=xt({},r,{value:void 0}),at("invalid",e);break;case"textarea":Ex(e,r),a=cf(e,r),at("invalid",e);break;default:a=r}uf(n,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?pw(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&fw(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&zo(e,c):typeof c=="number"&&zo(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ao.hasOwnProperty(i)?c!=null&&i==="onScroll"&&at("scroll",e):c!=null&&zm(e,i,c,o))}switch(n){case"input":Vl(e),Cx(e,r,!1);break;case"textarea":Vl(e),Mx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Os(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?li(e,!!r.multiple,i,!1):r.defaultValue!=null&&li(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=id)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Bt(t),null;case 6:if(e&&t.stateNode!=null)Iy(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(oe(166));if(n=ta(Yo.current),ta(kr.current),ec(t)){if(r=t.stateNode,n=t.memoizedProps,r[wr]=t,(i=r.nodeValue!==n)&&(e=wn,e!==null))switch(e.tag){case 3:Jl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Jl(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[wr]=t,t.stateNode=r}return Bt(t),null;case 13:if(it(ft),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(lt&&vn!==null&&t.mode&1&&!(t.flags&128))ny(),bi(),t.flags|=98560,i=!1;else if(i=ec(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(oe(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(oe(317));i[wr]=t}else bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bt(t),i=!1}else Qn!==null&&(Yf(Qn),Qn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ft.current&1?_t===0&&(_t=3):gp())),t.updateQueue!==null&&(t.flags|=4),Bt(t),null);case 4:return Ni(),If(e,t),e===null&&Bo(t.stateNode.containerInfo),Bt(t),null;case 10:return ep(t.type._context),Bt(t),null;case 17:return cn(t.type)&&od(),Bt(t),null;case 19:if(it(ft),i=t.memoizedState,i===null)return Bt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)to(i,!1);else{if(_t!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=md(e),o!==null){for(t.flags|=128,to(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return et(ft,ft.current&1|2),t.child}e=e.sibling}i.tail!==null&&wt()>Si&&(t.flags|=128,r=!0,to(i,!1),t.lanes=4194304)}else{if(!r)if(e=md(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),to(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!lt)return Bt(t),null}else 2*wt()-i.renderingStartTime>Si&&n!==1073741824&&(t.flags|=128,r=!0,to(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=wt(),t.sibling=null,n=ft.current,et(ft,r?n&1|2:n&1),t):(Bt(t),null);case 22:case 23:return xp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fn&1073741824&&(Bt(t),t.subtreeFlags&6&&(t.flags|=8192)):Bt(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function _S(e,t){switch(Km(t),t.tag){case 1:return cn(t.type)&&od(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ni(),it(ln),it(Yt),ap(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return sp(t),null;case 13:if(it(ft),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return it(ft),null;case 4:return Ni(),null;case 10:return ep(t.type._context),null;case 22:case 23:return xp(),null;case 24:return null;default:return null}}var rc=!1,Vt=!1,PS=typeof WeakSet=="function"?WeakSet:Set,xe=null;function si(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){vt(e,t,r)}else n.current=null}function Lf(e,t,n){try{n()}catch(r){vt(e,t,r)}}var gg=!1;function TS(e,t){if(jf=rd,e=Ww(),qm(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,d=0,h=0,u=e,f=null;t:for(;;){for(var p;u!==n||a!==0&&u.nodeType!==3||(l=o+a),u!==i||r!==0&&u.nodeType!==3||(c=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(p=u.firstChild)!==null;)f=u,u=p;for(;;){if(u===e)break t;if(f===n&&++d===a&&(l=o),f===i&&++h===r&&(c=o),(p=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Nf={focusedElem:e,selectionRange:n},rd=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,j=w.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Xn(t.type,v),j);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(b){vt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return w=gg,gg=!1,w}function Mo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Lf(t,n,i)}a=a.next}while(a!==r)}}function eu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ff(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ly(e){var t=e.alternate;t!==null&&(e.alternate=null,Ly(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wr],delete t[Ho],delete t[Cf],delete t[mS],delete t[pS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Fy(e){return e.tag===5||e.tag===3||e.tag===4}function vg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fy(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.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 Uf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=id));else if(r!==4&&(e=e.child,e!==null))for(Uf(e,t,n),e=e.sibling;e!==null;)Uf(e,t,n),e=e.sibling}function Bf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Bf(e,t,n),e=e.sibling;e!==null;)Bf(e,t,n),e=e.sibling}var Rt=null,Gn=!1;function is(e,t,n){for(n=n.child;n!==null;)Uy(e,t,n),n=n.sibling}function Uy(e,t,n){if(Nr&&typeof Nr.onCommitFiberUnmount=="function")try{Nr.onCommitFiberUnmount(Yd,n)}catch{}switch(n.tag){case 5:Vt||si(n,t);case 6:var r=Rt,a=Gn;Rt=null,is(e,t,n),Rt=r,Gn=a,Rt!==null&&(Gn?(e=Rt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Rt.removeChild(n.stateNode));break;case 18:Rt!==null&&(Gn?(e=Rt,n=n.stateNode,e.nodeType===8?lh(e.parentNode,n):e.nodeType===1&&lh(e,n),Lo(e)):lh(Rt,n.stateNode));break;case 4:r=Rt,a=Gn,Rt=n.stateNode.containerInfo,Gn=!0,is(e,t,n),Rt=r,Gn=a;break;case 0:case 11:case 14:case 15:if(!Vt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Lf(n,t,o),a=a.next}while(a!==r)}is(e,t,n);break;case 1:if(!Vt&&(si(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){vt(n,t,l)}is(e,t,n);break;case 21:is(e,t,n);break;case 22:n.mode&1?(Vt=(r=Vt)||n.memoizedState!==null,is(e,t,n),Vt=r):is(e,t,n);break;default:is(e,t,n)}}function wg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new PS),t.forEach(function(r){var a=US.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Yn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Rt=l.stateNode,Gn=!1;break e;case 3:Rt=l.stateNode.containerInfo,Gn=!0;break e;case 4:Rt=l.stateNode.containerInfo,Gn=!0;break e}l=l.return}if(Rt===null)throw Error(oe(160));Uy(i,o,a),Rt=null,Gn=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){vt(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)By(t,e),t=t.sibling}function By(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Yn(t,e),ur(e),r&4){try{Mo(3,e,e.return),eu(3,e)}catch(v){vt(e,e.return,v)}try{Mo(5,e,e.return)}catch(v){vt(e,e.return,v)}}break;case 1:Yn(t,e),ur(e),r&512&&n!==null&&si(n,n.return);break;case 5:if(Yn(t,e),ur(e),r&512&&n!==null&&si(n,n.return),e.flags&32){var a=e.stateNode;try{zo(a,"")}catch(v){vt(e,e.return,v)}}if(r&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&dw(a,i),hf(l,o);var d=hf(l,i);for(o=0;o<c.length;o+=2){var h=c[o],u=c[o+1];h==="style"?pw(a,u):h==="dangerouslySetInnerHTML"?fw(a,u):h==="children"?zo(a,u):zm(a,h,u,d)}switch(l){case"input":of(a,i);break;case"textarea":uw(a,i);break;case"select":var f=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?li(a,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?li(a,!!i.multiple,i.defaultValue,!0):li(a,!!i.multiple,i.multiple?[]:"",!1))}a[Ho]=i}catch(v){vt(e,e.return,v)}}break;case 6:if(Yn(t,e),ur(e),r&4){if(e.stateNode===null)throw Error(oe(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(v){vt(e,e.return,v)}}break;case 3:if(Yn(t,e),ur(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lo(t.containerInfo)}catch(v){vt(e,e.return,v)}break;case 4:Yn(t,e),ur(e);break;case 13:Yn(t,e),ur(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(mp=wt())),r&4&&wg(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Vt=(d=Vt)||h,Yn(t,e),Vt=d):Yn(t,e),ur(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!h&&e.mode&1)for(xe=e,h=e.child;h!==null;){for(u=xe=h;xe!==null;){switch(f=xe,p=f.child,f.tag){case 0:case 11:case 14:case 15:Mo(4,f,f.return);break;case 1:si(f,f.return);var w=f.stateNode;if(typeof w.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(v){vt(r,n,v)}}break;case 5:si(f,f.return);break;case 22:if(f.memoizedState!==null){bg(u);continue}}p!==null?(p.return=f,xe=p):bg(u)}h=h.sibling}e:for(h=null,u=e;;){if(u.tag===5){if(h===null){h=u;try{a=u.stateNode,d?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=u.stateNode,c=u.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=mw("display",o))}catch(v){vt(e,e.return,v)}}}else if(u.tag===6){if(h===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(v){vt(e,e.return,v)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:Yn(t,e),ur(e),r&4&&wg(e);break;case 21:break;default:Yn(t,e),ur(e)}}function ur(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Fy(n)){var r=n;break e}n=n.return}throw Error(oe(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(zo(a,""),r.flags&=-33);var i=vg(e);Bf(e,i,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=vg(e);Uf(e,l,o);break;default:throw Error(oe(161))}}catch(c){vt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function OS(e,t,n){xe=e,Wy(e)}function Wy(e,t,n){for(var r=(e.mode&1)!==0;xe!==null;){var a=xe,i=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||rc;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Vt;l=rc;var d=Vt;if(rc=o,(Vt=c)&&!d)for(xe=a;xe!==null;)o=xe,c=o.child,o.tag===22&&o.memoizedState!==null?jg(a):c!==null?(c.return=o,xe=c):jg(a);for(;i!==null;)xe=i,Wy(i),i=i.sibling;xe=a,rc=l,Vt=d}yg(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,xe=i):yg(e)}}function yg(e){for(;xe!==null;){var t=xe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Vt||eu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Vt)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Xn(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&sg(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}sg(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var h=d.memoizedState;if(h!==null){var u=h.dehydrated;u!==null&&Lo(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(oe(163))}Vt||t.flags&512&&Ff(t)}catch(f){vt(t,t.return,f)}}if(t===e){xe=null;break}if(n=t.sibling,n!==null){n.return=t.return,xe=n;break}xe=t.return}}function bg(e){for(;xe!==null;){var t=xe;if(t===e){xe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,xe=n;break}xe=t.return}}function jg(e){for(;xe!==null;){var t=xe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{eu(4,t)}catch(c){vt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){vt(t,a,c)}}var i=t.return;try{Ff(t)}catch(c){vt(t,i,c)}break;case 5:var o=t.return;try{Ff(t)}catch(c){vt(t,o,c)}}}catch(c){vt(t,t.return,c)}if(t===e){xe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,xe=l;break}xe=t.return}}var AS=Math.ceil,gd=ns.ReactCurrentDispatcher,hp=ns.ReactCurrentOwner,Bn=ns.ReactCurrentBatchConfig,Be=0,Ot=null,bt=null,It=0,fn=0,ai=Fs(0),_t=0,Ko=null,ga=0,tu=0,fp=0,Do=null,sn=null,mp=0,Si=1/0,Rr=null,vd=!1,Wf=null,Ms=null,sc=!1,bs=null,wd=0,_o=0,Hf=null,Ic=-1,Lc=0;function Kt(){return Be&6?wt():Ic!==-1?Ic:Ic=wt()}function Ds(e){return e.mode&1?Be&2&&It!==0?It&-It:gS.transition!==null?(Lc===0&&(Lc=Ew()),Lc):(e=qe,e!==0||(e=window.event,e=e===void 0?16:Aw(e.type)),e):1}function rr(e,t,n,r){if(50<_o)throw _o=0,Hf=null,Error(oe(185));pl(e,n,r),(!(Be&2)||e!==Ot)&&(e===Ot&&(!(Be&2)&&(tu|=n),_t===4&&vs(e,It)),dn(e,r),n===1&&Be===0&&!(t.mode&1)&&(Si=wt()+500,Qd&&Us()))}function dn(e,t){var n=e.callbackNode;gk(e,t);var r=nd(e,e===Ot?It:0);if(r===0)n!==null&&Px(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Px(n),t===1)e.tag===0?xS(Ng.bind(null,e)):Jw(Ng.bind(null,e)),hS(function(){!(Be&6)&&Us()}),n=null;else{switch(Mw(r)){case 1:n=Fm;break;case 4:n=Sw;break;case 16:n=td;break;case 536870912:n=Cw;break;default:n=td}n=Qy(n,Hy.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Hy(e,t){if(Ic=-1,Lc=0,Be&6)throw Error(oe(327));var n=e.callbackNode;if(fi()&&e.callbackNode!==n)return null;var r=nd(e,e===Ot?It:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=yd(e,r);else{t=r;var a=Be;Be|=2;var i=Yy();(Ot!==e||It!==t)&&(Rr=null,Si=wt()+500,ia(e,t));do try{RS();break}catch(l){Vy(e,l)}while(!0);Jm(),gd.current=i,Be=a,bt!==null?t=0:(Ot=null,It=0,t=_t)}if(t!==0){if(t===2&&(a=gf(e),a!==0&&(r=a,t=Vf(e,a))),t===1)throw n=Ko,ia(e,0),vs(e,r),dn(e,wt()),n;if(t===6)vs(e,r);else{if(a=e.current.alternate,!(r&30)&&!zS(a)&&(t=yd(e,r),t===2&&(i=gf(e),i!==0&&(r=i,t=Vf(e,i))),t===1))throw n=Ko,ia(e,0),vs(e,r),dn(e,wt()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(oe(345));case 2:qs(e,sn,Rr);break;case 3:if(vs(e,r),(r&130023424)===r&&(t=mp+500-wt(),10<t)){if(nd(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Kt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Sf(qs.bind(null,e,sn,Rr),t);break}qs(e,sn,Rr);break;case 4:if(vs(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-nr(r);i=1<<o,o=t[o],o>a&&(a=o),r&=~i}if(r=a,r=wt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*AS(r/1960))-r,10<r){e.timeoutHandle=Sf(qs.bind(null,e,sn,Rr),r);break}qs(e,sn,Rr);break;case 5:qs(e,sn,Rr);break;default:throw Error(oe(329))}}}return dn(e,wt()),e.callbackNode===n?Hy.bind(null,e):null}function Vf(e,t){var n=Do;return e.current.memoizedState.isDehydrated&&(ia(e,t).flags|=256),e=yd(e,t),e!==2&&(t=sn,sn=n,t!==null&&Yf(t)),e}function Yf(e){sn===null?sn=e:sn.push.apply(sn,e)}function zS(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],i=a.getSnapshot;a=a.value;try{if(!ar(i(),a))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 vs(e,t){for(t&=~fp,t&=~tu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-nr(t),r=1<<n;e[n]=-1,t&=~r}}function Ng(e){if(Be&6)throw Error(oe(327));fi();var t=nd(e,0);if(!(t&1))return dn(e,wt()),null;var n=yd(e,t);if(e.tag!==0&&n===2){var r=gf(e);r!==0&&(t=r,n=Vf(e,r))}if(n===1)throw n=Ko,ia(e,0),vs(e,t),dn(e,wt()),n;if(n===6)throw Error(oe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qs(e,sn,Rr),dn(e,wt()),null}function pp(e,t){var n=Be;Be|=1;try{return e(t)}finally{Be=n,Be===0&&(Si=wt()+500,Qd&&Us())}}function va(e){bs!==null&&bs.tag===0&&!(Be&6)&&fi();var t=Be;Be|=1;var n=Bn.transition,r=qe;try{if(Bn.transition=null,qe=1,e)return e()}finally{qe=r,Bn.transition=n,Be=t,!(Be&6)&&Us()}}function xp(){fn=ai.current,it(ai)}function ia(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,uS(n)),bt!==null)for(n=bt.return;n!==null;){var r=n;switch(Km(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&od();break;case 3:Ni(),it(ln),it(Yt),ap();break;case 5:sp(r);break;case 4:Ni();break;case 13:it(ft);break;case 19:it(ft);break;case 10:ep(r.type._context);break;case 22:case 23:xp()}n=n.return}if(Ot=e,bt=e=_s(e.current,null),It=fn=t,_t=0,Ko=null,fp=tu=ga=0,sn=Do=null,ea!==null){for(t=0;t<ea.length;t++)if(n=ea[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=a,r.next=o}n.pending=r}ea=null}return e}function Vy(e,t){do{var n=bt;try{if(Jm(),zc.current=xd,pd){for(var r=pt.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}pd=!1}if(xa=0,Pt=Mt=pt=null,Eo=!1,Xo=0,hp.current=null,n===null||n.return===null){_t=1,Ko=t,bt=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=It,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,h=l,u=h.tag;if(!(h.mode&1)&&(u===0||u===11||u===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=dg(o);if(p!==null){p.flags&=-257,ug(p,o,l,i,t),p.mode&1&&cg(i,d,t),t=p,c=d;var w=t.updateQueue;if(w===null){var v=new Set;v.add(c),t.updateQueue=v}else w.add(c);break e}else{if(!(t&1)){cg(i,d,t),gp();break e}c=Error(oe(426))}}else if(lt&&l.mode&1){var j=dg(o);if(j!==null){!(j.flags&65536)&&(j.flags|=256),ug(j,o,l,i,t),Qm(ki(c,l));break e}}i=c=ki(c,l),_t!==4&&(_t=2),Do===null?Do=[i]:Do.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=My(i,c,t);rg(i,g);break e;case 1:l=c;var y=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ms===null||!Ms.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=Dy(i,l,t);rg(i,b);break e}}i=i.return}while(i!==null)}qy(n)}catch(N){t=N,bt===n&&n!==null&&(bt=n=n.return);continue}break}while(!0)}function Yy(){var e=gd.current;return gd.current=xd,e===null?xd:e}function gp(){(_t===0||_t===3||_t===2)&&(_t=4),Ot===null||!(ga&268435455)&&!(tu&268435455)||vs(Ot,It)}function yd(e,t){var n=Be;Be|=2;var r=Yy();(Ot!==e||It!==t)&&(Rr=null,ia(e,t));do try{$S();break}catch(a){Vy(e,a)}while(!0);if(Jm(),Be=n,gd.current=r,bt!==null)throw Error(oe(261));return Ot=null,It=0,_t}function $S(){for(;bt!==null;)Xy(bt)}function RS(){for(;bt!==null&&!lk();)Xy(bt)}function Xy(e){var t=Ky(e.alternate,e,fn);e.memoizedProps=e.pendingProps,t===null?qy(e):bt=t,hp.current=null}function qy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=_S(n,t),n!==null){n.flags&=32767,bt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{_t=6,bt=null;return}}else if(n=DS(n,t,fn),n!==null){bt=n;return}if(t=t.sibling,t!==null){bt=t;return}bt=t=e}while(t!==null);_t===0&&(_t=5)}function qs(e,t,n){var r=qe,a=Bn.transition;try{Bn.transition=null,qe=1,IS(e,t,n,r)}finally{Bn.transition=a,qe=r}return null}function IS(e,t,n,r){do fi();while(bs!==null);if(Be&6)throw Error(oe(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(oe(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(vk(e,i),e===Ot&&(bt=Ot=null,It=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||sc||(sc=!0,Qy(td,function(){return fi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Bn.transition,Bn.transition=null;var o=qe;qe=1;var l=Be;Be|=4,hp.current=null,TS(e,n),By(n,e),sS(Nf),rd=!!jf,Nf=jf=null,e.current=n,OS(n),ck(),Be=l,qe=o,Bn.transition=i}else e.current=n;if(sc&&(sc=!1,bs=e,wd=a),i=e.pendingLanes,i===0&&(Ms=null),hk(n.stateNode),dn(e,wt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(vd)throw vd=!1,e=Wf,Wf=null,e;return wd&1&&e.tag!==0&&fi(),i=e.pendingLanes,i&1?e===Hf?_o++:(_o=0,Hf=e):_o=0,Us(),null}function fi(){if(bs!==null){var e=Mw(wd),t=Bn.transition,n=qe;try{if(Bn.transition=null,qe=16>e?16:e,bs===null)var r=!1;else{if(e=bs,bs=null,wd=0,Be&6)throw Error(oe(331));var a=Be;for(Be|=4,xe=e.current;xe!==null;){var i=xe,o=i.child;if(xe.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(xe=d;xe!==null;){var h=xe;switch(h.tag){case 0:case 11:case 15:Mo(8,h,i)}var u=h.child;if(u!==null)u.return=h,xe=u;else for(;xe!==null;){h=xe;var f=h.sibling,p=h.return;if(Ly(h),h===d){xe=null;break}if(f!==null){f.return=p,xe=f;break}xe=p}}}var w=i.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var j=v.sibling;v.sibling=null,v=j}while(v!==null)}}xe=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,xe=o;else e:for(;xe!==null;){if(i=xe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Mo(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,xe=g;break e}xe=i.return}}var y=e.current;for(xe=y;xe!==null;){o=xe;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,xe=x;else e:for(o=y;xe!==null;){if(l=xe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:eu(9,l)}}catch(N){vt(l,l.return,N)}if(l===o){xe=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,xe=b;break e}xe=l.return}}if(Be=a,Us(),Nr&&typeof Nr.onPostCommitFiberRoot=="function")try{Nr.onPostCommitFiberRoot(Yd,e)}catch{}r=!0}return r}finally{qe=n,Bn.transition=t}}return!1}function kg(e,t,n){t=ki(n,t),t=My(e,t,1),e=Es(e,t,1),t=Kt(),e!==null&&(pl(e,1,t),dn(e,t))}function vt(e,t,n){if(e.tag===3)kg(e,e,n);else for(;t!==null;){if(t.tag===3){kg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ms===null||!Ms.has(r))){e=ki(n,e),e=Dy(t,e,1),t=Es(t,e,1),e=Kt(),t!==null&&(pl(t,1,e),dn(t,e));break}}t=t.return}}function LS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Kt(),e.pingedLanes|=e.suspendedLanes&n,Ot===e&&(It&n)===n&&(_t===4||_t===3&&(It&130023424)===It&&500>wt()-mp?ia(e,0):fp|=n),dn(e,t)}function Gy(e,t){t===0&&(e.mode&1?(t=ql,ql<<=1,!(ql&130023424)&&(ql=4194304)):t=1);var n=Kt();e=Qr(e,t),e!==null&&(pl(e,t,n),dn(e,n))}function FS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gy(e,n)}function US(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(t),Gy(e,n)}var Ky;Ky=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ln.current)an=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return an=!1,MS(e,t,n);an=!!(e.flags&131072)}else an=!1,lt&&t.flags&1048576&&ey(t,dd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Rc(e,t),e=t.pendingProps;var a=yi(t,Yt.current);hi(t,n),a=op(null,t,r,e,a,n);var i=lp();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,cn(r)?(i=!0,ld(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,np(t),a.updater=Jd,t.stateNode=a,a._reactInternals=t,Tf(t,r,e,n),t=zf(null,t,r,!0,i,n)):(t.tag=0,lt&&i&&Gm(t),qt(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Rc(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=WS(r),e=Xn(r,e),a){case 0:t=Af(null,t,r,e,n);break e;case 1:t=mg(null,t,r,e,n);break e;case 11:t=hg(null,t,r,e,n);break e;case 14:t=fg(null,t,r,Xn(r.type,e),n);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Xn(r,a),Af(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Xn(r,a),mg(e,t,r,a,n);case 3:e:{if(Oy(t),e===null)throw Error(oe(387));r=t.pendingProps,i=t.memoizedState,a=i.element,iy(e,t),fd(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=ki(Error(oe(423)),t),t=pg(e,t,r,n,a);break e}else if(r!==a){a=ki(Error(oe(424)),t),t=pg(e,t,r,n,a);break e}else for(vn=Cs(t.stateNode.containerInfo.firstChild),wn=t,lt=!0,Qn=null,n=sy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bi(),r===a){t=Zr(e,t,n);break e}qt(e,t,r,n)}t=t.child}return t;case 5:return oy(t),e===null&&Df(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,kf(r,a)?o=null:i!==null&&kf(r,i)&&(t.flags|=32),Ty(e,t),qt(e,t,o,n),t.child;case 6:return e===null&&Df(t),null;case 13:return Ay(e,t,n);case 4:return rp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ji(t,null,r,n):qt(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Xn(r,a),hg(e,t,r,a,n);case 7:return qt(e,t,t.pendingProps,n),t.child;case 8:return qt(e,t,t.pendingProps.children,n),t.child;case 12:return qt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,et(ud,r._currentValue),r._currentValue=o,i!==null)if(ar(i.value,o)){if(i.children===a.children&&!ln.current){t=Zr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Yr(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var h=d.pending;h===null?c.next=c:(c.next=h.next,h.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),_f(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(oe(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),_f(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}qt(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,hi(t,n),a=Wn(a),r=r(a),t.flags|=1,qt(e,t,r,n),t.child;case 14:return r=t.type,a=Xn(r,t.pendingProps),a=Xn(r.type,a),fg(e,t,r,a,n);case 15:return _y(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Xn(r,a),Rc(e,t),t.tag=1,cn(r)?(e=!0,ld(t)):e=!1,hi(t,n),Ey(t,r,a),Tf(t,r,a,n),zf(null,t,r,!0,e,n);case 19:return zy(e,t,n);case 22:return Py(e,t,n)}throw Error(oe(156,t.tag))};function Qy(e,t){return kw(e,t)}function BS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Un(e,t,n,r){return new BS(e,t,n,r)}function vp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WS(e){if(typeof e=="function")return vp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rm)return 11;if(e===Im)return 14}return 2}function _s(e,t){var n=e.alternate;return n===null?(n=Un(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&14680064,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}function Fc(e,t,n,r,a,i){var o=2;if(r=e,typeof e=="function")vp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ga:return oa(n.children,a,i,t);case $m:o=8,a|=8;break;case tf:return e=Un(12,n,t,a|2),e.elementType=tf,e.lanes=i,e;case nf:return e=Un(13,n,t,a),e.elementType=nf,e.lanes=i,e;case rf:return e=Un(19,n,t,a),e.elementType=rf,e.lanes=i,e;case ow:return nu(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case aw:o=10;break e;case iw:o=9;break e;case Rm:o=11;break e;case Im:o=14;break e;case ms:o=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Un(o,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function oa(e,t,n,r){return e=Un(7,e,r,t),e.lanes=n,e}function nu(e,t,n,r){return e=Un(22,e,r,t),e.elementType=ow,e.lanes=n,e.stateNode={isHidden:!1},e}function xh(e,t,n){return e=Un(6,e,null,t),e.lanes=n,e}function gh(e,t,n){return t=Un(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function HS(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qu(0),this.expirationTimes=Qu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qu(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function wp(e,t,n,r,a,i,o,l,c){return e=new HS(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Un(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},np(i),e}function VS(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qa,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Zy(e){if(!e)return As;e=e._reactInternals;e:{if(Ta(e)!==e||e.tag!==1)throw Error(oe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(cn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(oe(171))}if(e.tag===1){var n=e.type;if(cn(n))return Zw(e,n,t)}return t}function Jy(e,t,n,r,a,i,o,l,c){return e=wp(n,r,!0,e,a,i,o,l,c),e.context=Zy(null),n=e.current,r=Kt(),a=Ds(n),i=Yr(r,a),i.callback=t??null,Es(n,i,a),e.current.lanes=a,pl(e,a,r),dn(e,r),e}function ru(e,t,n,r){var a=t.current,i=Kt(),o=Ds(a);return n=Zy(n),t.context===null?t.context=n:t.pendingContext=n,t=Yr(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Es(a,t,o),e!==null&&(rr(e,a,o,i),Ac(e,a,o)),o}function bd(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Sg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yp(e,t){Sg(e,t),(e=e.alternate)&&Sg(e,t)}function YS(){return null}var eb=typeof reportError=="function"?reportError:function(e){console.error(e)};function bp(e){this._internalRoot=e}su.prototype.render=bp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));ru(e,t,null,null)};su.prototype.unmount=bp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;va(function(){ru(null,e,null,null)}),t[Kr]=null}};function su(e){this._internalRoot=e}su.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<gs.length&&t!==0&&t<gs[n].priority;n++);gs.splice(n,0,e),n===0&&Ow(e)}};function jp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function au(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cg(){}function XS(e,t,n,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var d=bd(o);i.call(d)}}var o=Jy(t,r,e,0,null,!1,!1,"",Cg);return e._reactRootContainer=o,e[Kr]=o.current,Bo(e.nodeType===8?e.parentNode:e),va(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var d=bd(c);l.call(d)}}var c=wp(e,0,!1,null,null,!1,!1,"",Cg);return e._reactRootContainer=c,e[Kr]=c.current,Bo(e.nodeType===8?e.parentNode:e),va(function(){ru(t,c,n,r)}),c}function iu(e,t,n,r,a){var i=n._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=bd(o);l.call(c)}}ru(t,o,e,a)}else o=XS(n,t,e,a,r);return bd(o)}Dw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=go(t.pendingLanes);n!==0&&(Um(t,n|1),dn(t,wt()),!(Be&6)&&(Si=wt()+500,Us()))}break;case 13:va(function(){var r=Qr(e,1);if(r!==null){var a=Kt();rr(r,e,1,a)}}),yp(e,1)}};Bm=function(e){if(e.tag===13){var t=Qr(e,134217728);if(t!==null){var n=Kt();rr(t,e,134217728,n)}yp(e,134217728)}};_w=function(e){if(e.tag===13){var t=Ds(e),n=Qr(e,t);if(n!==null){var r=Kt();rr(n,e,t,r)}yp(e,t)}};Pw=function(){return qe};Tw=function(e,t){var n=qe;try{return qe=e,t()}finally{qe=n}};mf=function(e,t,n){switch(t){case"input":if(of(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=Kd(r);if(!a)throw Error(oe(90));cw(r),of(r,a)}}}break;case"textarea":uw(e,n);break;case"select":t=n.value,t!=null&&li(e,!!n.multiple,t,!1)}};vw=pp;ww=va;var qS={usingClientEntryPoint:!1,Events:[gl,Ja,Kd,xw,gw,pp]},no={findFiberByHostInstance:Js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},GS={bundleType:no.bundleType,version:no.version,rendererPackageName:no.rendererPackageName,rendererConfig:no.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ns.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jw(e),e===null?null:e.stateNode},findFiberByHostInstance:no.findFiberByHostInstance||YS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ac.isDisabled&&ac.supportsFiber)try{Yd=ac.inject(GS),Nr=ac}catch{}}kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qS;kn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!jp(t))throw Error(oe(200));return VS(e,t,null,n)};kn.createRoot=function(e,t){if(!jp(e))throw Error(oe(299));var n=!1,r="",a=eb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=wp(e,1,!1,null,null,n,!1,r,a),e[Kr]=t.current,Bo(e.nodeType===8?e.parentNode:e),new bp(t)};kn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return 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=jw(t),e=e===null?null:e.stateNode,e};kn.flushSync=function(e){return va(e)};kn.hydrate=function(e,t,n){if(!au(t))throw Error(oe(200));return iu(null,e,t,!0,n)};kn.hydrateRoot=function(e,t,n){if(!jp(e))throw Error(oe(405));var r=n!=null&&n.hydratedSources||null,a=!1,i="",o=eb;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Jy(t,null,e,1,n??null,a,!1,i,o),e[Kr]=t.current,Bo(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new su(t)};kn.render=function(e,t,n){if(!au(t))throw Error(oe(200));return iu(null,e,t,!1,n)};kn.unmountComponentAtNode=function(e){if(!au(e))throw Error(oe(40));return e._reactRootContainer?(va(function(){iu(null,null,e,!1,function(){e._reactRootContainer=null,e[Kr]=null})}),!0):!1};kn.unstable_batchedUpdates=pp;kn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!au(n))throw Error(oe(200));if(e==null||e._reactInternals===void 0)throw Error(oe(38));return iu(e,t,n,!1,r)};kn.version="18.3.1-next-f1338f8080-20240426";function tb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tb)}catch(e){console.error(e)}}tb(),tw.exports=kn;var ou=tw.exports;const nb=Em(ou);var Eg=ou;Jh.createRoot=Eg.createRoot,Jh.hydrateRoot=Eg.hydrateRoot;/**
41
- * @remix-run/router v1.23.0
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */function Qo(){return Qo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qo.apply(this,arguments)}var js;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(js||(js={}));const Mg="popstate";function KS(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:l}=r.location;return Xf("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:jd(a)}return ZS(t,n,null,e)}function jt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function rb(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function QS(){return Math.random().toString(36).substr(2,8)}function Dg(e,t){return{usr:e.state,key:e.key,idx:t}}function Xf(e,t,n,r){return n===void 0&&(n=null),Qo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Bi(t):t,{state:n,key:t&&t.key||r||QS()})}function jd(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Bi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ZS(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,l=js.Pop,c=null,d=h();d==null&&(d=0,o.replaceState(Qo({},o.state,{idx:d}),""));function h(){return(o.state||{idx:null}).idx}function u(){l=js.Pop;let j=h(),g=j==null?null:j-d;d=j,c&&c({action:l,location:v.location,delta:g})}function f(j,g){l=js.Push;let y=Xf(v.location,j,g);d=h()+1;let x=Dg(y,d),b=v.createHref(y);try{o.pushState(x,"",b)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(b)}i&&c&&c({action:l,location:v.location,delta:1})}function p(j,g){l=js.Replace;let y=Xf(v.location,j,g);d=h();let x=Dg(y,d),b=v.createHref(y);o.replaceState(x,"",b),i&&c&&c({action:l,location:v.location,delta:0})}function w(j){let g=a.location.origin!=="null"?a.location.origin:a.location.href,y=typeof j=="string"?j:jd(j);return y=y.replace(/ $/,"%20"),jt(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(a,o)},listen(j){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Mg,u),c=j,()=>{a.removeEventListener(Mg,u),c=null}},createHref(j){return t(a,j)},createURL:w,encodeLocation(j){let g=w(j);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:p,go(j){return o.go(j)}};return v}var _g;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_g||(_g={}));function JS(e,t,n){return n===void 0&&(n="/"),e4(e,t,n)}function e4(e,t,n,r){let a=typeof t=="string"?Bi(t):t,i=Np(a.pathname||"/",n);if(i==null)return null;let o=sb(e);t4(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=f4(i);l=d4(o[c],d)}return l}function sb(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(jt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Ps([r,c.relativePath]),h=n.concat(c);i.children&&i.children.length>0&&(jt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),sb(i.children,t,h,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:l4(d,i.index),routesMeta:h})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of ab(i.path))a(i,o,c)}),t}function ab(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=ab(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function t4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:c4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const n4=/^:[\w-]+$/,r4=3,s4=2,a4=1,i4=10,o4=-2,Pg=e=>e==="*";function l4(e,t){let n=e.split("/"),r=n.length;return n.some(Pg)&&(r+=o4),t&&(r+=s4),n.filter(a=>!Pg(a)).reduce((a,i)=>a+(n4.test(i)?r4:i===""?a4:i4),r)}function c4(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function d4(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",u=u4({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},h),f=c.route;if(!u)return null;Object.assign(a,u.params),o.push({params:a,pathname:Ps([i,u.pathname]),pathnameBase:g4(Ps([i,u.pathnameBase])),route:f}),u.pathnameBase!=="/"&&(i=Ps([i,u.pathnameBase]))}return o}function u4(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=h4(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((d,h,u)=>{let{paramName:f,isOptional:p}=h;if(f==="*"){let v=l[u]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const w=l[u];return p&&!w?d[f]=void 0:d[f]=(w||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function h4(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),rb(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 r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function f4(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return rb(!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 Np(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function m4(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Bi(e):e;return{pathname:n?n.startsWith("/")?n:p4(n,t):t,search:v4(r),hash:w4(a)}}function p4(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function vh(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. 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 x4(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ib(e,t){let n=x4(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ob(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Bi(e):(a=Qo({},e),jt(!a.pathname||!a.pathname.includes("?"),vh("?","pathname","search",a)),jt(!a.pathname||!a.pathname.includes("#"),vh("#","pathname","hash",a)),jt(!a.search||!a.search.includes("#"),vh("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=n;else{let u=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),u-=1;a.pathname=f.join("/")}l=u>=0?t[u]:"/"}let c=m4(a,l),d=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||h)&&(c.pathname+="/"),c}const Ps=e=>e.join("/").replace(/\/\/+/g,"/"),g4=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),v4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,w4=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function y4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lb=["post","put","patch","delete"];new Set(lb);const b4=["get",...lb];new Set(b4);/**
50
- * React Router v6.30.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 Zo(){return Zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zo.apply(this,arguments)}const kp=m.createContext(null),j4=m.createContext(null),Oa=m.createContext(null),lu=m.createContext(null),Bs=m.createContext({outlet:null,matches:[],isDataRoute:!1}),cb=m.createContext(null);function N4(e,t){let{relative:n}=t===void 0?{}:t;wl()||jt(!1);let{basename:r,navigator:a}=m.useContext(Oa),{hash:i,pathname:o,search:l}=ub(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Ps([r,o])),a.createHref({pathname:c,search:l,hash:i})}function wl(){return m.useContext(lu)!=null}function Wi(){return wl()||jt(!1),m.useContext(lu).location}function db(e){m.useContext(Oa).static||m.useLayoutEffect(e)}function Dr(){let{isDataRoute:e}=m.useContext(Bs);return e?$4():k4()}function k4(){wl()||jt(!1);let e=m.useContext(kp),{basename:t,future:n,navigator:r}=m.useContext(Oa),{matches:a}=m.useContext(Bs),{pathname:i}=Wi(),o=JSON.stringify(ib(a,n.v7_relativeSplatPath)),l=m.useRef(!1);return db(()=>{l.current=!0}),m.useCallback(function(d,h){if(h===void 0&&(h={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let u=ob(d,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Ps([t,u.pathname])),(h.replace?r.replace:r.push)(u,h.state,h)},[t,r,o,i,e])}function Sp(){let{matches:e}=m.useContext(Bs),t=e[e.length-1];return t?t.params:{}}function ub(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Oa),{matches:a}=m.useContext(Bs),{pathname:i}=Wi(),o=JSON.stringify(ib(a,r.v7_relativeSplatPath));return m.useMemo(()=>ob(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function S4(e,t){return C4(e,t)}function C4(e,t,n,r){wl()||jt(!1);let{navigator:a}=m.useContext(Oa),{matches:i}=m.useContext(Bs),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=Wi(),h;if(t){var u;let j=typeof t=="string"?Bi(t):t;c==="/"||(u=j.pathname)!=null&&u.startsWith(c)||jt(!1),h=j}else h=d;let f=h.pathname||"/",p=f;if(c!=="/"){let j=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=JS(e,{pathname:p}),v=P4(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},l,j.params),pathname:Ps([c,a.encodeLocation?a.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:Ps([c,a.encodeLocation?a.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),i,n,r);return t&&v?m.createElement(lu.Provider,{value:{location:Zo({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:js.Pop}},v):v}function E4(){let e=z4(),t=y4(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={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:a},n):null,null)}const M4=m.createElement(E4,null);class D4 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(Bs.Provider,{value:this.props.routeContext},m.createElement(cb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _4(e){let{routeContext:t,match:n,children:r}=e,a=m.useContext(kp);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Bs.Provider,{value:t},r)}function P4(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let h=o.findIndex(u=>u.route.id&&(l==null?void 0:l[u.route.id])!==void 0);h>=0||jt(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let u=o[h];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(d=h),u.route.id){let{loaderData:f,errors:p}=n,w=u.route.loader&&f[u.route.id]===void 0&&(!p||p[u.route.id]===void 0);if(u.route.lazy||w){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((h,u,f)=>{let p,w=!1,v=null,j=null;n&&(p=l&&u.route.id?l[u.route.id]:void 0,v=u.route.errorElement||M4,c&&(d<0&&f===0?(R4("route-fallback"),w=!0,j=null):d===f&&(w=!0,j=u.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),y=()=>{let x;return p?x=v:w?x=j:u.route.Component?x=m.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=h,m.createElement(_4,{match:u,routeContext:{outlet:h,matches:g,isDataRoute:n!=null},children:x})};return n&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?m.createElement(D4,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:y(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):y()},null)}var hb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(hb||{}),fb=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}(fb||{});function T4(e){let t=m.useContext(kp);return t||jt(!1),t}function O4(e){let t=m.useContext(j4);return t||jt(!1),t}function A4(e){let t=m.useContext(Bs);return t||jt(!1),t}function mb(e){let t=A4(),n=t.matches[t.matches.length-1];return n.route.id||jt(!1),n.route.id}function z4(){var e;let t=m.useContext(cb),n=O4(),r=mb();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function $4(){let{router:e}=T4(hb.UseNavigateStable),t=mb(fb.UseNavigateStable),n=m.useRef(!1);return db(()=>{n.current=!0}),m.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Zo({fromRouteId:t},i)))},[e,t])}const Tg={};function R4(e,t,n){Tg[e]||(Tg[e]=!0)}function I4(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function tn(e){jt(!1)}function L4(e){let{basename:t="/",children:n=null,location:r,navigationType:a=js.Pop,navigator:i,static:o=!1,future:l}=e;wl()&&jt(!1);let c=t.replace(/^\/*/,"/"),d=m.useMemo(()=>({basename:c,navigator:i,static:o,future:Zo({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=Bi(r));let{pathname:h="/",search:u="",hash:f="",state:p=null,key:w="default"}=r,v=m.useMemo(()=>{let j=Np(h,c);return j==null?null:{location:{pathname:j,search:u,hash:f,state:p,key:w},navigationType:a}},[c,h,u,f,p,w,a]);return v==null?null:m.createElement(Oa.Provider,{value:d},m.createElement(lu.Provider,{children:n,value:v}))}function F4(e){let{children:t,location:n}=e;return S4(qf(t),n)}new Promise(()=>{});function qf(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,a)=>{if(!m.isValidElement(r))return;let i=[...t,a];if(r.type===m.Fragment){n.push.apply(n,qf(r.props.children,i));return}r.type!==tn&&jt(!1),!r.props.index||!r.props.children||jt(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=qf(r.props.children,i)),n.push(o)}),n}/**
59
- * React Router DOM v6.30.1
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 Gf(){return Gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gf.apply(this,arguments)}function U4(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function B4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function W4(e,t){return e.button===0&&(!t||t==="_self")&&!B4(e)}function Kf(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 r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function H4(e,t){let n=Kf(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const V4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Y4="6";try{window.__reactRouterVersion=Y4}catch{}const X4="startTransition",Og=Tm[X4];function q4(e){let{basename:t,children:n,future:r,window:a}=e,i=m.useRef();i.current==null&&(i.current=KS({window:a,v5Compat:!0}));let o=i.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:d}=r||{},h=m.useCallback(u=>{d&&Og?Og(()=>c(u)):c(u)},[c,d]);return m.useLayoutEffect(()=>o.listen(h),[o,h]),m.useEffect(()=>I4(r),[r]),m.createElement(L4,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const G4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",K4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cp=m.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:d,preventScrollReset:h,viewTransition:u}=t,f=U4(t,V4),{basename:p}=m.useContext(Oa),w,v=!1;if(typeof d=="string"&&K4.test(d)&&(w=d,G4))try{let x=new URL(window.location.href),b=d.startsWith("//")?new URL(x.protocol+d):new URL(d),N=Np(b.pathname,p);b.origin===x.origin&&N!=null?d=N+b.search+b.hash:v=!0}catch{}let j=N4(d,{relative:a}),g=Q4(d,{replace:o,state:l,target:c,preventScrollReset:h,relative:a,viewTransition:u});function y(x){r&&r(x),x.defaultPrevented||g(x)}return m.createElement("a",Gf({},f,{href:w||j,onClick:v||i?r:y,ref:n,target:c}))});var Ag;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ag||(Ag={}));var zg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(zg||(zg={}));function Q4(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Dr(),d=Wi(),h=ub(e,{relative:o});return m.useCallback(u=>{if(W4(u,n)){u.preventDefault();let f=r!==void 0?r:jd(d)===jd(h);c(e,{replace:f,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[d,c,h,r,a,n,e,i,o,l])}function Z4(e){let t=m.useRef(Kf(e)),n=m.useRef(!1),r=Wi(),a=m.useMemo(()=>H4(r.search,n.current?null:t.current),[r.search]),i=Dr(),o=m.useCallback((l,c)=>{const d=Kf(typeof l=="function"?l(a):l);n.current=!0,i("?"+d,c)},[i,a]);return[a,o]}function J4(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 eC=e=>{switch(e){case"success":return rC;case"info":return aC;case"warning":return sC;case"error":return iC;default:return null}},tC=Array(12).fill(0),nC=({visible:e,className:t})=>Z.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Z.createElement("div",{className:"sonner-spinner"},tC.map((n,r)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),rC=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.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"})),sC=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.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"})),aC=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.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"})),iC=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.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"})),oC=Z.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"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),lC=()=>{const[e,t]=Z.useState(document.hidden);return Z.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Qf=1;class cC{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:r,...a}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Qf++,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:r}),{...c,...t,id:i,dismissible:l,title:r}):c):this.addToast({title:r,...a,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(r=>r({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 r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,o;const l=a.then(async d=>{if(o=["resolve",d],Z.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(uC(d)&&!d.ok){i=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof u=="object"&&!Z.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(d instanceof Error){i=!1;const u=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,w=typeof u=="object"&&!Z.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(n.success!==void 0){i=!1;const u=typeof n.success=="function"?await n.success(d):n.success,f=typeof n.description=="function"?await n.description(d):n.description,w=typeof u=="object"&&!Z.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:f,...w})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,u=typeof n.description=="function"?await n.description(d):n.description,p=typeof h=="object"&&!Z.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:u,...p})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,h)=>l.then(()=>o[0]==="reject"?h(o[1]):d(o[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Qf++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const nn=new cC,dC=(e,t)=>{const n=(t==null?void 0:t.id)||Qf++;return nn.addToast({title:e,...t,id:n}),n},uC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",hC=dC,fC=()=>nn.toasts,mC=()=>nn.getActiveToasts(),Y=Object.assign(hC,{success:nn.success,info:nn.info,warning:nn.warning,error:nn.error,custom:nn.custom,message:nn.message,promise:nn.promise,dismiss:nn.dismiss,loading:nn.loading},{getHistory:fC,getToasts:mC});J4("[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 ic(e){return e.label!==void 0}const pC=3,xC="24px",gC="16px",$g=4e3,vC=356,wC=14,yC=45,bC=200;function hr(...e){return e.filter(Boolean).join(" ")}function jC(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const NC=e=>{var t,n,r,a,i,o,l,c,d;const{invert:h,toast:u,unstyled:f,interacting:p,setHeights:w,visibleToasts:v,heights:j,index:g,toasts:y,expanded:x,removeToast:b,defaultRichColors:N,closeButton:k,style:S,cancelButtonStyle:M,actionButtonStyle:O,className:I="",descriptionClassName:B="",duration:z,position:L,gap:C,expandByDefault:A,classNames:_,icons:P,closeButtonAriaLabel:E="Close toast"}=e,[D,$]=Z.useState(null),[H,T]=Z.useState(null),[U,G]=Z.useState(!1),[Q,re]=Z.useState(!1),[ne,J]=Z.useState(!1),[R,ee]=Z.useState(!1),[F,V]=Z.useState(!1),[K,ie]=Z.useState(0),[ce,pe]=Z.useState(0),ke=Z.useRef(u.duration||z||$g),Ie=Z.useRef(null),Ce=Z.useRef(null),tt=g===0,Je=g+1<=v,Le=u.type,_e=u.dismissible!==!1,Ge=u.className||"",nt=u.descriptionClassName||"",ot=Z.useMemo(()=>j.findIndex(ue=>ue.toastId===u.id)||0,[j,u.id]),St=Z.useMemo(()=>{var ue;return(ue=u.closeButton)!=null?ue:k},[u.closeButton,k]),At=Z.useMemo(()=>u.duration||z||$g,[u.duration,z]),ae=Z.useRef(0),me=Z.useRef(0),Te=Z.useRef(0),q=Z.useRef(null),[le,W]=L.split("-"),te=Z.useMemo(()=>j.reduce((ue,rt,ut)=>ut>=ot?ue:ue+rt.height,0),[j,ot]),he=lC(),ve=u.invert||h,be=Le==="loading";me.current=Z.useMemo(()=>ot*C+te,[ot,te]),Z.useEffect(()=>{ke.current=At},[At]),Z.useEffect(()=>{G(!0)},[]),Z.useEffect(()=>{const ue=Ce.current;if(ue){const rt=ue.getBoundingClientRect().height;return pe(rt),w(ut=>[{toastId:u.id,height:rt,position:u.position},...ut]),()=>w(ut=>ut.filter(Ct=>Ct.toastId!==u.id))}},[w,u.id]),Z.useLayoutEffect(()=>{if(!U)return;const ue=Ce.current,rt=ue.style.height;ue.style.height="auto";const ut=ue.getBoundingClientRect().height;ue.style.height=rt,pe(ut),w(Ct=>Ct.find(Qe=>Qe.toastId===u.id)?Ct.map(Qe=>Qe.toastId===u.id?{...Qe,height:ut}:Qe):[{toastId:u.id,height:ut,position:u.position},...Ct])},[U,u.title,u.description,w,u.id,u.jsx,u.action,u.cancel]);const de=Z.useCallback(()=>{re(!0),ie(me.current),w(ue=>ue.filter(rt=>rt.toastId!==u.id)),setTimeout(()=>{b(u)},bC)},[u,b,w,me]);Z.useEffect(()=>{if(u.promise&&Le==="loading"||u.duration===1/0||u.type==="loading")return;let ue;return x||p||he?(()=>{if(Te.current<ae.current){const Ct=new Date().getTime()-ae.current;ke.current=ke.current-Ct}Te.current=new Date().getTime()})():(()=>{ke.current!==1/0&&(ae.current=new Date().getTime(),ue=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),de()},ke.current))})(),()=>clearTimeout(ue)},[x,p,u,Le,he,de]),Z.useEffect(()=>{u.delete&&(de(),u.onDismiss==null||u.onDismiss.call(u,u))},[de,u.delete]);function De(){var ue;if(P!=null&&P.loading){var rt;return Z.createElement("div",{className:hr(_==null?void 0:_.loader,u==null||(rt=u.classNames)==null?void 0:rt.loader,"sonner-loader"),"data-visible":Le==="loading"},P.loading)}return Z.createElement(nC,{className:hr(_==null?void 0:_.loader,u==null||(ue=u.classNames)==null?void 0:ue.loader),visible:Le==="loading"})}const Se=u.icon||(P==null?void 0:P[Le])||eC(Le);var Fe,yt;return Z.createElement("li",{tabIndex:0,ref:Ce,className:hr(I,Ge,_==null?void 0:_.toast,u==null||(t=u.classNames)==null?void 0:t.toast,_==null?void 0:_.default,_==null?void 0:_[Le],u==null||(n=u.classNames)==null?void 0:n[Le]),"data-sonner-toast":"","data-rich-colors":(Fe=u.richColors)!=null?Fe:N,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":U,"data-promise":!!u.promise,"data-swiped":F,"data-removed":Q,"data-visible":Je,"data-y-position":le,"data-x-position":W,"data-index":g,"data-front":tt,"data-swiping":ne,"data-dismissible":_e,"data-type":Le,"data-invert":ve,"data-swipe-out":R,"data-swipe-direction":H,"data-expanded":!!(x||A&&U),"data-testid":u.testId,style:{"--index":g,"--toasts-before":g,"--z-index":y.length-g,"--offset":`${Q?K:me.current}px`,"--initial-height":A?"auto":`${ce}px`,...S,...u.style},onDragEnd:()=>{J(!1),$(null),q.current=null},onPointerDown:ue=>{ue.button!==2&&(be||!_e||(Ie.current=new Date,ie(me.current),ue.target.setPointerCapture(ue.pointerId),ue.target.tagName!=="BUTTON"&&(J(!0),q.current={x:ue.clientX,y:ue.clientY})))},onPointerUp:()=>{var ue,rt,ut;if(R||!_e)return;q.current=null;const Ct=Number(((ue=Ce.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),un=Number(((rt=Ce.current)==null?void 0:rt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qe=new Date().getTime()-((ut=Ie.current)==null?void 0:ut.getTime()),Ft=D==="x"?Ct:un,dr=Math.abs(Ft)/Qe;if(Math.abs(Ft)>=yC||dr>.11){ie(me.current),u.onDismiss==null||u.onDismiss.call(u,u),T(D==="x"?Ct>0?"right":"left":un>0?"down":"up"),de(),ee(!0);return}else{var Xt,zt;(Xt=Ce.current)==null||Xt.style.setProperty("--swipe-amount-x","0px"),(zt=Ce.current)==null||zt.style.setProperty("--swipe-amount-y","0px")}V(!1),J(!1),$(null)},onPointerMove:ue=>{var rt,ut,Ct;if(!q.current||!_e||((rt=window.getSelection())==null?void 0:rt.toString().length)>0)return;const Qe=ue.clientY-q.current.y,Ft=ue.clientX-q.current.x;var dr;const Xt=(dr=e.swipeDirections)!=null?dr:jC(L);!D&&(Math.abs(Ft)>1||Math.abs(Qe)>1)&&$(Math.abs(Ft)>Math.abs(Qe)?"x":"y");let zt={x:0,y:0};const za=hn=>1/(1.5+Math.abs(hn)/20);if(D==="y"){if(Xt.includes("top")||Xt.includes("bottom"))if(Xt.includes("top")&&Qe<0||Xt.includes("bottom")&&Qe>0)zt.y=Qe;else{const hn=Qe*za(Qe);zt.y=Math.abs(hn)<Math.abs(Qe)?hn:Qe}}else if(D==="x"&&(Xt.includes("left")||Xt.includes("right")))if(Xt.includes("left")&&Ft<0||Xt.includes("right")&&Ft>0)zt.x=Ft;else{const hn=Ft*za(Ft);zt.x=Math.abs(hn)<Math.abs(Ft)?hn:Ft}(Math.abs(zt.x)>0||Math.abs(zt.y)>0)&&V(!0),(ut=Ce.current)==null||ut.style.setProperty("--swipe-amount-x",`${zt.x}px`),(Ct=Ce.current)==null||Ct.style.setProperty("--swipe-amount-y",`${zt.y}px`)}},St&&!u.jsx&&Le!=="loading"?Z.createElement("button",{"aria-label":E,"data-disabled":be,"data-close-button":!0,onClick:be||!_e?()=>{}:()=>{de(),u.onDismiss==null||u.onDismiss.call(u,u)},className:hr(_==null?void 0:_.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(yt=P==null?void 0:P.close)!=null?yt:oC):null,(Le||u.icon||u.promise)&&u.icon!==null&&((P==null?void 0:P[Le])!==null||u.icon)?Z.createElement("div",{"data-icon":"",className:hr(_==null?void 0:_.icon,u==null||(a=u.classNames)==null?void 0:a.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||De():null,u.type!=="loading"?Se:null):null,Z.createElement("div",{"data-content":"",className:hr(_==null?void 0:_.content,u==null||(i=u.classNames)==null?void 0:i.content)},Z.createElement("div",{"data-title":"",className:hr(_==null?void 0:_.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?Z.createElement("div",{"data-description":"",className:hr(B,nt,_==null?void 0:_.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),Z.isValidElement(u.cancel)?u.cancel:u.cancel&&ic(u.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||M,onClick:ue=>{ic(u.cancel)&&_e&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,ue),de())},className:hr(_==null?void 0:_.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,Z.isValidElement(u.action)?u.action:u.action&&ic(u.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||O,onClick:ue=>{ic(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,ue),!ue.defaultPrevented&&de())},className:hr(_==null?void 0:_.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function Rg(){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 kC(e,t){const n={};return[e,t].forEach((r,a)=>{const i=a===1,o=i?"--mobile-offset":"--offset",l=i?gC:xC;function c(d){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}const SC=Z.forwardRef(function(t,n){const{id:r,invert:a,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:h,mobileOffset:u,theme:f="light",richColors:p,duration:w,style:v,visibleToasts:j=pC,toastOptions:g,dir:y=Rg(),gap:x=wC,icons:b,containerAriaLabel:N="Notifications"}=t,[k,S]=Z.useState([]),M=Z.useMemo(()=>r?k.filter(U=>U.toasterId===r):k.filter(U=>!U.toasterId),[k,r]),O=Z.useMemo(()=>Array.from(new Set([i].concat(M.filter(U=>U.position).map(U=>U.position)))),[M,i]),[I,B]=Z.useState([]),[z,L]=Z.useState(!1),[C,A]=Z.useState(!1),[_,P]=Z.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),E=Z.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=Z.useRef(null),H=Z.useRef(!1),T=Z.useCallback(U=>{S(G=>{var Q;return(Q=G.find(re=>re.id===U.id))!=null&&Q.delete||nn.dismiss(U.id),G.filter(({id:re})=>re!==U.id)})},[]);return Z.useEffect(()=>nn.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{S(G=>G.map(Q=>Q.id===U.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{nb.flushSync(()=>{S(G=>{const Q=G.findIndex(re=>re.id===U.id);return Q!==-1?[...G.slice(0,Q),{...G[Q],...U},...G.slice(Q+1)]:[U,...G]})})})}),[k]),Z.useEffect(()=>{if(f!=="system"){P(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:G})=>{P(G?"dark":"light")})}catch{U.addListener(({matches:Q})=>{try{P(Q?"dark":"light")}catch(re){console.error(re)}})}},[f]),Z.useEffect(()=>{k.length<=1&&L(!1)},[k]),Z.useEffect(()=>{const U=G=>{var Q;if(o.every(J=>G[J]||G.code===J)){var ne;L(!0),(ne=E.current)==null||ne.focus()}G.code==="Escape"&&(document.activeElement===E.current||(Q=E.current)!=null&&Q.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[o]),Z.useEffect(()=>{if(E.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,H.current=!1)}},[E.current]),Z.createElement("section",{ref:n,"aria-label":`${N} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((U,G)=>{var Q;const[re,ne]=U.split("-");return M.length?Z.createElement("ol",{key:U,dir:y==="auto"?Rg():y,tabIndex:-1,ref:E,className:d,"data-sonner-toaster":!0,"data-sonner-theme":_,"data-y-position":re,"data-x-position":ne,style:{"--front-toast-height":`${((Q=I[0])==null?void 0:Q.height)||0}px`,"--width":`${vC}px`,"--gap":`${x}px`,...v,...kC(h,u)},onBlur:J=>{H.current&&!J.currentTarget.contains(J.relatedTarget)&&(H.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||H.current||(H.current=!0,$.current=J.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{C||L(!1)},onDragEnd:()=>L(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},M.filter(J=>!J.position&&G===0||J.position===U).map((J,R)=>{var ee,F;return Z.createElement(NC,{key:J.id,icons:b,index:R,toast:J,defaultRichColors:p,duration:(ee=g==null?void 0:g.duration)!=null?ee:w,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:a,visibleToasts:j,closeButton:(F=g==null?void 0:g.closeButton)!=null?F:c,interacting:C,position:U,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:T,toasts:M.filter(V=>V.position==J.position),heights:I.filter(V=>V.position==J.position),setHeights:B,expandByDefault:l,gap:x,expanded:z,swipeDirections:t.swipeDirections})})):null}))});function kt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=kt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var CC={value:()=>{}};function cu(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Uc(n)}function Uc(e){this._=e}function EC(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Uc.prototype=cu.prototype={constructor:Uc,on:function(e,t){var n=this._,r=EC(e+"",n),a,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((a=(e=r[i]).type)&&(a=MC(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(a=(e=r[i]).type)n[a]=Ig(n[a],e.name,t);else if(t==null)for(a in n)n[a]=Ig(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Uc(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,i;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,a=i.length;r<a;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)}};function MC(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function Ig(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=CC,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Zf="http://www.w3.org/1999/xhtml";const Lg={svg:"http://www.w3.org/2000/svg",xhtml:Zf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function du(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Lg.hasOwnProperty(t)?{space:Lg[t],local:e}:e}function DC(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Zf&&t.documentElement.namespaceURI===Zf?t.createElement(e):t.createElementNS(n,e)}}function _C(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pb(e){var t=du(e);return(t.local?_C:DC)(t)}function PC(){}function Ep(e){return e==null?PC:function(){return this.querySelector(e)}}function TC(e){typeof e!="function"&&(e=Ep(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,l=r[a]=new Array(o),c,d,h=0;h<o;++h)(c=i[h])&&(d=e.call(c,c.__data__,h,i))&&("__data__"in c&&(d.__data__=c.__data__),l[h]=d);return new jn(r,this._parents)}function OC(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function AC(){return[]}function xb(e){return e==null?AC:function(){return this.querySelectorAll(e)}}function zC(e){return function(){return OC(e.apply(this,arguments))}}function $C(e){typeof e=="function"?e=zC(e):e=xb(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var o=t[i],l=o.length,c,d=0;d<l;++d)(c=o[d])&&(r.push(e.call(c,c.__data__,d,o)),a.push(c));return new jn(r,a)}function gb(e){return function(){return this.matches(e)}}function vb(e){return function(t){return t.matches(e)}}var RC=Array.prototype.find;function IC(e){return function(){return RC.call(this.children,e)}}function LC(){return this.firstElementChild}function FC(e){return this.select(e==null?LC:IC(typeof e=="function"?e:vb(e)))}var UC=Array.prototype.filter;function BC(){return Array.from(this.children)}function WC(e){return function(){return UC.call(this.children,e)}}function HC(e){return this.selectAll(e==null?BC:WC(typeof e=="function"?e:vb(e)))}function VC(e){typeof e!="function"&&(e=gb(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,l=r[a]=[],c,d=0;d<o;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&l.push(c);return new jn(r,this._parents)}function wb(e){return new Array(e.length)}function YC(){return new jn(this._enter||this._groups.map(wb),this._parents)}function Nd(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Nd.prototype={constructor:Nd,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 XC(e){return function(){return e}}function qC(e,t,n,r,a,i){for(var o=0,l,c=t.length,d=i.length;o<d;++o)(l=t[o])?(l.__data__=i[o],r[o]=l):n[o]=new Nd(e,i[o]);for(;o<c;++o)(l=t[o])&&(a[o]=l)}function GC(e,t,n,r,a,i,o){var l,c,d=new Map,h=t.length,u=i.length,f=new Array(h),p;for(l=0;l<h;++l)(c=t[l])&&(f[l]=p=o.call(c,c.__data__,l,t)+"",d.has(p)?a[l]=c:d.set(p,c));for(l=0;l<u;++l)p=o.call(e,i[l],l,i)+"",(c=d.get(p))?(r[l]=c,c.__data__=i[l],d.delete(p)):n[l]=new Nd(e,i[l]);for(l=0;l<h;++l)(c=t[l])&&d.get(f[l])===c&&(a[l]=c)}function KC(e){return e.__data__}function QC(e,t){if(!arguments.length)return Array.from(this,KC);var n=t?GC:qC,r=this._parents,a=this._groups;typeof e!="function"&&(e=XC(e));for(var i=a.length,o=new Array(i),l=new Array(i),c=new Array(i),d=0;d<i;++d){var h=r[d],u=a[d],f=u.length,p=ZC(e.call(h,h&&h.__data__,d,r)),w=p.length,v=l[d]=new Array(w),j=o[d]=new Array(w),g=c[d]=new Array(f);n(h,u,v,j,g,p,t);for(var y=0,x=0,b,N;y<w;++y)if(b=v[y]){for(y>=x&&(x=y+1);!(N=j[x])&&++x<w;);b._next=N||null}}return o=new jn(o,r),o._enter=l,o._exit=c,o}function ZC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function JC(){return new jn(this._exit||this._groups.map(wb),this._parents)}function eE(e,t,n){var r=this.enter(),a=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),r&&a?r.merge(a).order():a}function tE(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,i=r.length,o=Math.min(a,i),l=new Array(a),c=0;c<o;++c)for(var d=n[c],h=r[c],u=d.length,f=l[c]=new Array(u),p,w=0;w<u;++w)(p=d[w]||h[w])&&(f[w]=p);for(;c<a;++c)l[c]=n[c];return new jn(l,this._parents)}function nE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,i=r[a],o;--a>=0;)(o=r[a])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function rE(e){e||(e=sE);function t(u,f){return u&&f?e(u.__data__,f.__data__):!u-!f}for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var o=n[i],l=o.length,c=a[i]=new Array(l),d,h=0;h<l;++h)(d=o[h])&&(c[h]=d);c.sort(t)}return new jn(a,this._parents).order()}function sE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function aE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iE(){return Array.from(this)}function oE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}return null}function lE(){let e=0;for(const t of this)++e;return e}function cE(){return!this.node()}function dE(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],i=0,o=a.length,l;i<o;++i)(l=a[i])&&e.call(l,l.__data__,i,a);return this}function uE(e){return function(){this.removeAttribute(e)}}function hE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fE(e,t){return function(){this.setAttribute(e,t)}}function mE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function pE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xE(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 gE(e,t){var n=du(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?hE:uE:typeof t=="function"?n.local?xE:pE:n.local?mE:fE)(n,t))}function yb(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function vE(e){return function(){this.style.removeProperty(e)}}function wE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function yE(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function bE(e,t,n){return arguments.length>1?this.each((t==null?vE:typeof t=="function"?yE:wE)(e,t,n??"")):Ci(this.node(),e)}function Ci(e,t){return e.style.getPropertyValue(t)||yb(e).getComputedStyle(e,null).getPropertyValue(t)}function jE(e){return function(){delete this[e]}}function NE(e,t){return function(){this[e]=t}}function kE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function SE(e,t){return arguments.length>1?this.each((t==null?jE:typeof t=="function"?kE:NE)(e,t)):this.node()[e]}function bb(e){return e.trim().split(/^|\s+/)}function Mp(e){return e.classList||new jb(e)}function jb(e){this._node=e,this._names=bb(e.getAttribute("class")||"")}jb.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 Nb(e,t){for(var n=Mp(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function kb(e,t){for(var n=Mp(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function CE(e){return function(){Nb(this,e)}}function EE(e){return function(){kb(this,e)}}function ME(e,t){return function(){(t.apply(this,arguments)?Nb:kb)(this,e)}}function DE(e,t){var n=bb(e+"");if(arguments.length<2){for(var r=Mp(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?ME:t?CE:EE)(n,t))}function _E(){this.textContent=""}function PE(e){return function(){this.textContent=e}}function TE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function OE(e){return arguments.length?this.each(e==null?_E:(typeof e=="function"?TE:PE)(e)):this.node().textContent}function AE(){this.innerHTML=""}function zE(e){return function(){this.innerHTML=e}}function $E(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function RE(e){return arguments.length?this.each(e==null?AE:(typeof e=="function"?$E:zE)(e)):this.node().innerHTML}function IE(){this.nextSibling&&this.parentNode.appendChild(this)}function LE(){return this.each(IE)}function FE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UE(){return this.each(FE)}function BE(e){var t=typeof e=="function"?e:pb(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function WE(){return null}function HE(e,t){var n=typeof e=="function"?e:pb(e),r=t==null?WE:typeof t=="function"?t:Ep(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function VE(){var e=this.parentNode;e&&e.removeChild(this)}function YE(){return this.each(VE)}function XE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function GE(e){return this.select(e?qE:XE)}function KE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function QE(e){return function(t){e.call(this,t,this.__data__)}}function ZE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function JE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function e3(e,t,n){return function(){var r=this.__on,a,i=QE(t);if(r){for(var o=0,l=r.length;o<l;++o)if((a=r[o]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(a):this.__on=[a]}}function t3(e,t,n){var r=ZE(e+""),a,i=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,d=l.length,h;c<d;++c)for(a=0,h=l[c];a<i;++a)if((o=r[a]).type===h.type&&o.name===h.name)return h.value}return}for(l=t?e3:JE,a=0;a<i;++a)this.each(l(r[a],t,n));return this}function Sb(e,t,n){var r=yb(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function n3(e,t){return function(){return Sb(this,e,t)}}function r3(e,t){return function(){return Sb(this,e,t.apply(this,arguments))}}function s3(e,t){return this.each((typeof t=="function"?r3:n3)(e,t))}function*a3(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length,o;a<i;++a)(o=r[a])&&(yield o)}var Cb=[null];function jn(e,t){this._groups=e,this._parents=t}function yl(){return new jn([[document.documentElement]],Cb)}function i3(){return this}jn.prototype=yl.prototype={constructor:jn,select:TC,selectAll:$C,selectChild:FC,selectChildren:HC,filter:VC,data:QC,enter:YC,exit:JC,join:eE,merge:tE,selection:i3,order:nE,sort:rE,call:aE,nodes:iE,node:oE,size:lE,empty:cE,each:dE,attr:gE,style:bE,property:SE,classed:DE,text:OE,html:RE,raise:LE,lower:UE,append:BE,insert:HE,remove:YE,clone:GE,datum:KE,on:t3,dispatch:s3,[Symbol.iterator]:a3};function gn(e){return typeof e=="string"?new jn([[document.querySelector(e)]],[document.documentElement]):new jn([[e]],Cb)}function o3(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Kn(e,t){if(e=o3(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const l3={passive:!1},Jo={capture:!0,passive:!1};function wh(e){e.stopImmediatePropagation()}function mi(e){e.preventDefault(),e.stopImmediatePropagation()}function Eb(e){var t=e.document.documentElement,n=gn(e).on("dragstart.drag",mi,Jo);"onselectstart"in t?n.on("selectstart.drag",mi,Jo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Mb(e,t){var n=e.document.documentElement,r=gn(e).on("dragstart.drag",null);t&&(r.on("click.drag",mi,Jo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const oc=e=>()=>e;function Jf(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:i,x:o,y:l,dx:c,dy:d,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:r,enumerable:!0,configurable:!0},identifier:{value:a,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:d,enumerable:!0,configurable:!0},_:{value:h}})}Jf.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function c3(e){return!e.ctrlKey&&!e.button}function d3(){return this.parentNode}function u3(e,t){return t??{x:e.x,y:e.y}}function h3(){return navigator.maxTouchPoints||"ontouchstart"in this}function Db(){var e=c3,t=d3,n=u3,r=h3,a={},i=cu("start","drag","end"),o=0,l,c,d,h,u=0;function f(b){b.on("mousedown.drag",p).filter(r).on("touchstart.drag",j).on("touchmove.drag",g,l3).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(b,N){if(!(h||!e.call(this,b,N))){var k=x(this,t.call(this,b,N),b,N,"mouse");k&&(gn(b.view).on("mousemove.drag",w,Jo).on("mouseup.drag",v,Jo),Eb(b.view),wh(b),d=!1,l=b.clientX,c=b.clientY,k("start",b))}}function w(b){if(mi(b),!d){var N=b.clientX-l,k=b.clientY-c;d=N*N+k*k>u}a.mouse("drag",b)}function v(b){gn(b.view).on("mousemove.drag mouseup.drag",null),Mb(b.view,d),mi(b),a.mouse("end",b)}function j(b,N){if(e.call(this,b,N)){var k=b.changedTouches,S=t.call(this,b,N),M=k.length,O,I;for(O=0;O<M;++O)(I=x(this,S,b,N,k[O].identifier,k[O]))&&(wh(b),I("start",b,k[O]))}}function g(b){var N=b.changedTouches,k=N.length,S,M;for(S=0;S<k;++S)(M=a[N[S].identifier])&&(mi(b),M("drag",b,N[S]))}function y(b){var N=b.changedTouches,k=N.length,S,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),S=0;S<k;++S)(M=a[N[S].identifier])&&(wh(b),M("end",b,N[S]))}function x(b,N,k,S,M,O){var I=i.copy(),B=Kn(O||k,N),z,L,C;if((C=n.call(b,new Jf("beforestart",{sourceEvent:k,target:f,identifier:M,active:o,x:B[0],y:B[1],dx:0,dy:0,dispatch:I}),S))!=null)return z=C.x-B[0]||0,L=C.y-B[1]||0,function A(_,P,E){var D=B,$;switch(_){case"start":a[M]=A,$=o++;break;case"end":delete a[M],--o;case"drag":B=Kn(E||P,N),$=o;break}I.call(_,b,new Jf(_,{sourceEvent:P,subject:C,target:f,identifier:M,active:$,x:B[0]+z,y:B[1]+L,dx:B[0]-D[0],dy:B[1]-D[1],dispatch:I}),S)}}return f.filter=function(b){return arguments.length?(e=typeof b=="function"?b:oc(!!b),f):e},f.container=function(b){return arguments.length?(t=typeof b=="function"?b:oc(b),f):t},f.subject=function(b){return arguments.length?(n=typeof b=="function"?b:oc(b),f):n},f.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:oc(!!b),f):r},f.on=function(){var b=i.on.apply(i,arguments);return b===i?f:b},f.clickDistance=function(b){return arguments.length?(u=(b=+b)*b,f):Math.sqrt(u)},f}function Dp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _b(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function bl(){}var el=.7,kd=1/el,pi="\\s*([+-]?\\d+)\\s*",tl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",f3=/^#([0-9a-f]{3,8})$/,m3=new RegExp(`^rgb\\(${pi},${pi},${pi}\\)$`),p3=new RegExp(`^rgb\\(${Sr},${Sr},${Sr}\\)$`),x3=new RegExp(`^rgba\\(${pi},${pi},${pi},${tl}\\)$`),g3=new RegExp(`^rgba\\(${Sr},${Sr},${Sr},${tl}\\)$`),v3=new RegExp(`^hsl\\(${tl},${Sr},${Sr}\\)$`),w3=new RegExp(`^hsla\\(${tl},${Sr},${Sr},${tl}\\)$`),Fg={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};Dp(bl,wa,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ug,formatHex:Ug,formatHex8:y3,formatHsl:b3,formatRgb:Bg,toString:Bg});function Ug(){return this.rgb().formatHex()}function y3(){return this.rgb().formatHex8()}function b3(){return Pb(this).formatHsl()}function Bg(){return this.rgb().formatRgb()}function wa(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=f3.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Wg(t):n===3?new on(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?lc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?lc(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=m3.exec(e))?new on(t[1],t[2],t[3],1):(t=p3.exec(e))?new on(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=x3.exec(e))?lc(t[1],t[2],t[3],t[4]):(t=g3.exec(e))?lc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=v3.exec(e))?Yg(t[1],t[2]/100,t[3]/100,1):(t=w3.exec(e))?Yg(t[1],t[2]/100,t[3]/100,t[4]):Fg.hasOwnProperty(e)?Wg(Fg[e]):e==="transparent"?new on(NaN,NaN,NaN,0):null}function Wg(e){return new on(e>>16&255,e>>8&255,e&255,1)}function lc(e,t,n,r){return r<=0&&(e=t=n=NaN),new on(e,t,n,r)}function j3(e){return e instanceof bl||(e=wa(e)),e?(e=e.rgb(),new on(e.r,e.g,e.b,e.opacity)):new on}function em(e,t,n,r){return arguments.length===1?j3(e):new on(e,t,n,r??1)}function on(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Dp(on,em,_b(bl,{brighter(e){return e=e==null?kd:Math.pow(kd,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?el:Math.pow(el,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new on(la(this.r),la(this.g),la(this.b),Sd(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:Hg,formatHex:Hg,formatHex8:N3,formatRgb:Vg,toString:Vg}));function Hg(){return`#${na(this.r)}${na(this.g)}${na(this.b)}`}function N3(){return`#${na(this.r)}${na(this.g)}${na(this.b)}${na((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vg(){const e=Sd(this.opacity);return`${e===1?"rgb(":"rgba("}${la(this.r)}, ${la(this.g)}, ${la(this.b)}${e===1?")":`, ${e})`}`}function Sd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function la(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function na(e){return e=la(e),(e<16?"0":"")+e.toString(16)}function Yg(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Zn(e,t,n,r)}function Pb(e){if(e instanceof Zn)return new Zn(e.h,e.s,e.l,e.opacity);if(e instanceof bl||(e=wa(e)),!e)return new Zn;if(e instanceof Zn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,l=i-a,c=(i+a)/2;return l?(t===i?o=(n-r)/l+(n<r)*6:n===i?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new Zn(o,l,c,e.opacity)}function k3(e,t,n,r){return arguments.length===1?Pb(e):new Zn(e,t,n,r??1)}function Zn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Dp(Zn,k3,_b(bl,{brighter(e){return e=e==null?kd:Math.pow(kd,e),new Zn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?el:Math.pow(el,e),new Zn(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,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new on(yh(e>=240?e-240:e+120,a,r),yh(e,a,r),yh(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Zn(Xg(this.h),cc(this.s),cc(this.l),Sd(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=Sd(this.opacity);return`${e===1?"hsl(":"hsla("}${Xg(this.h)}, ${cc(this.s)*100}%, ${cc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xg(e){return e=(e||0)%360,e<0?e+360:e}function cc(e){return Math.max(0,Math.min(1,e||0))}function yh(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 _p=e=>()=>e;function S3(e,t){return function(n){return e+n*t}}function C3(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function E3(e){return(e=+e)==1?Tb:function(t,n){return n-t?C3(t,n,e):_p(isNaN(t)?n:t)}}function Tb(e,t){var n=t-e;return n?S3(e,n):_p(isNaN(e)?t:e)}const Cd=function e(t){var n=E3(t);function r(a,i){var o=n((a=em(a)).r,(i=em(i)).r),l=n(a.g,i.g),c=n(a.b,i.b),d=Tb(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=l(h),a.b=c(h),a.opacity=d(h),a+""}}return r.gamma=e,r}(1);function M3(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function D3(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _3(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=Po(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(l){for(o=0;o<r;++o)i[o]=a[o](l);return i}}function P3(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function vr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function T3(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Po(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var tm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bh=new RegExp(tm.source,"g");function O3(e){return function(){return e}}function A3(e){return function(t){return e(t)+""}}function Ob(e,t){var n=tm.lastIndex=bh.lastIndex=0,r,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=tm.exec(e))&&(a=bh.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(r=r[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:vr(r,a)})),n=bh.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?A3(c[0].x):O3(t):(t=c.length,function(d){for(var h=0,u;h<t;++h)l[(u=c[h]).i]=u.x(d);return l.join("")})}function Po(e,t){var n=typeof t,r;return t==null||n==="boolean"?_p(t):(n==="number"?vr:n==="string"?(r=wa(t))?(t=r,Cd):Ob:t instanceof wa?Cd:t instanceof Date?P3:D3(t)?M3:Array.isArray(t)?_3:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?T3:vr)(e,t)}var qg=180/Math.PI,nm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ab(e,t,n,r,a,i){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*qg,skewX:Math.atan(c)*qg,scaleX:o,scaleY:l}}var dc;function z3(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?nm:Ab(t.a,t.b,t.c,t.d,t.e,t.f)}function $3(e){return e==null||(dc||(dc=document.createElementNS("http://www.w3.org/2000/svg","g")),dc.setAttribute("transform",e),!(e=dc.transform.baseVal.consolidate()))?nm:(e=e.matrix,Ab(e.a,e.b,e.c,e.d,e.e,e.f))}function zb(e,t,n,r){function a(d){return d.length?d.pop()+" ":""}function i(d,h,u,f,p,w){if(d!==u||h!==f){var v=p.push("translate(",null,t,null,n);w.push({i:v-4,x:vr(d,u)},{i:v-2,x:vr(h,f)})}else(u||f)&&p.push("translate("+u+t+f+n)}function o(d,h,u,f){d!==h?(d-h>180?h+=360:h-d>180&&(d+=360),f.push({i:u.push(a(u)+"rotate(",null,r)-2,x:vr(d,h)})):h&&u.push(a(u)+"rotate("+h+r)}function l(d,h,u,f){d!==h?f.push({i:u.push(a(u)+"skewX(",null,r)-2,x:vr(d,h)}):h&&u.push(a(u)+"skewX("+h+r)}function c(d,h,u,f,p,w){if(d!==u||h!==f){var v=p.push(a(p)+"scale(",null,",",null,")");w.push({i:v-4,x:vr(d,u)},{i:v-2,x:vr(h,f)})}else(u!==1||f!==1)&&p.push(a(p)+"scale("+u+","+f+")")}return function(d,h){var u=[],f=[];return d=e(d),h=e(h),i(d.translateX,d.translateY,h.translateX,h.translateY,u,f),o(d.rotate,h.rotate,u,f),l(d.skewX,h.skewX,u,f),c(d.scaleX,d.scaleY,h.scaleX,h.scaleY,u,f),d=h=null,function(p){for(var w=-1,v=f.length,j;++w<v;)u[(j=f[w]).i]=j.x(p);return u.join("")}}}var R3=zb(z3,"px, ","px)","deg)"),I3=zb($3,", ",")",")"),L3=1e-12;function Gg(e){return((e=Math.exp(e))+1/e)/2}function F3(e){return((e=Math.exp(e))-1/e)/2}function U3(e){return((e=Math.exp(2*e))-1)/(e+1)}const Bc=function e(t,n,r){function a(i,o){var l=i[0],c=i[1],d=i[2],h=o[0],u=o[1],f=o[2],p=h-l,w=u-c,v=p*p+w*w,j,g;if(v<L3)g=Math.log(f/d)/t,j=function(S){return[l+S*p,c+S*w,d*Math.exp(t*S*g)]};else{var y=Math.sqrt(v),x=(f*f-d*d+r*v)/(2*d*n*y),b=(f*f-d*d-r*v)/(2*f*n*y),N=Math.log(Math.sqrt(x*x+1)-x),k=Math.log(Math.sqrt(b*b+1)-b);g=(k-N)/t,j=function(S){var M=S*g,O=Gg(N),I=d/(n*y)*(O*U3(t*M+N)-F3(N));return[l+I*p,c+I*w,d*O/Gg(t*M+N)]}}return j.duration=g*1e3*t/Math.SQRT2,j}return a.rho=function(i){var o=Math.max(.001,+i),l=o*o,c=l*l;return e(o,l,c)},a}(Math.SQRT2,2,4);var Ei=0,wo=0,ro=0,$b=1e3,Ed,yo,Md=0,ya=0,uu=0,nl=typeof performance=="object"&&performance.now?performance:Date,Rb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Pp(){return ya||(Rb(B3),ya=nl.now()+uu)}function B3(){ya=0}function Dd(){this._call=this._time=this._next=null}Dd.prototype=Ib.prototype={constructor:Dd,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Pp():+n)+(t==null?0:+t),!this._next&&yo!==this&&(yo?yo._next=this:Ed=this,yo=this),this._call=e,this._time=n,rm()},stop:function(){this._call&&(this._call=null,this._time=1/0,rm())}};function Ib(e,t,n){var r=new Dd;return r.restart(e,t,n),r}function W3(){Pp(),++Ei;for(var e=Ed,t;e;)(t=ya-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ei}function Kg(){ya=(Md=nl.now())+uu,Ei=wo=0;try{W3()}finally{Ei=0,V3(),ya=0}}function H3(){var e=nl.now(),t=e-Md;t>$b&&(uu-=t,Md=e)}function V3(){for(var e,t=Ed,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ed=n);yo=e,rm(r)}function rm(e){if(!Ei){wo&&(wo=clearTimeout(wo));var t=e-ya;t>24?(e<1/0&&(wo=setTimeout(Kg,e-nl.now()-uu)),ro&&(ro=clearInterval(ro))):(ro||(Md=nl.now(),ro=setInterval(H3,$b)),Ei=1,Rb(Kg))}}function Qg(e,t,n){var r=new Dd;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var Y3=cu("start","end","cancel","interrupt"),X3=[],Lb=0,Zg=1,sm=2,Wc=3,Jg=4,am=5,Hc=6;function hu(e,t,n,r,a,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;q3(e,n,{name:t,index:r,group:a,on:Y3,tween:X3,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Lb})}function Tp(e,t){var n=lr(e,t);if(n.state>Lb)throw new Error("too late; already scheduled");return n}function _r(e,t){var n=lr(e,t);if(n.state>Wc)throw new Error("too late; already running");return n}function lr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function q3(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=Ib(i,0,n.time);function i(d){n.state=Zg,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var h,u,f,p;if(n.state!==Zg)return c();for(h in r)if(p=r[h],p.name===n.name){if(p.state===Wc)return Qg(o);p.state===Jg?(p.state=Hc,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[h]):+h<t&&(p.state=Hc,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[h])}if(Qg(function(){n.state===Wc&&(n.state=Jg,n.timer.restart(l,n.delay,n.time),l(d))}),n.state=sm,n.on.call("start",e,e.__data__,n.index,n.group),n.state===sm){for(n.state=Wc,a=new Array(f=n.tween.length),h=0,u=-1;h<f;++h)(p=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(a[++u]=p);a.length=u+1}}function l(d){for(var h=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=am,1),u=-1,f=a.length;++u<f;)a[u].call(e,h);n.state===am&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Hc,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Vc(e,t){var n=e.__transition,r,a,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){i=!1;continue}a=r.state>sm&&r.state<am,r.state=Hc,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function G3(e){return this.each(function(){Vc(this,e)})}function K3(e,t){var n,r;return function(){var a=_r(this,e),i=a.tween;if(i!==n){r=n=i;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}a.tween=r}}function Q3(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=_r(this,e),o=i.tween;if(o!==r){a=(r=o).slice();for(var l={name:t,value:n},c=0,d=a.length;c<d;++c)if(a[c].name===t){a[c]=l;break}c===d&&a.push(l)}i.tween=a}}function Z3(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=lr(this.node(),n).tween,a=0,i=r.length,o;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((t==null?K3:Q3)(n,e,t))}function Op(e,t,n){var r=e._id;return e.each(function(){var a=_r(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return lr(a,r).value[t]}}function Fb(e,t){var n;return(typeof t=="number"?vr:t instanceof wa?Cd:(n=wa(t))?(t=n,Cd):Ob)(e,t)}function J3(e){return function(){this.removeAttribute(e)}}function e5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function t5(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}}function n5(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}function r5(e,t,n){var r,a,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===r&&c===a?i:(a=c,i=t(r=o,l)))}}function s5(e,t,n){var r,a,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===r&&c===a?i:(a=c,i=t(r=o,l)))}}function a5(e,t){var n=du(e),r=n==="transform"?I3:Fb;return this.attrTween(e,typeof t=="function"?(n.local?s5:r5)(n,r,Op(this,"attr."+e,t)):t==null?(n.local?e5:J3)(n):(n.local?n5:t5)(n,r,t))}function i5(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function o5(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function l5(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&o5(e,i)),n}return a._value=t,a}function c5(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&i5(e,i)),n}return a._value=t,a}function d5(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 r=du(e);return this.tween(n,(r.local?l5:c5)(r,t))}function u5(e,t){return function(){Tp(this,e).delay=+t.apply(this,arguments)}}function h5(e,t){return t=+t,function(){Tp(this,e).delay=t}}function f5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?u5:h5)(t,e)):lr(this.node(),t).delay}function m5(e,t){return function(){_r(this,e).duration=+t.apply(this,arguments)}}function p5(e,t){return t=+t,function(){_r(this,e).duration=t}}function x5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?m5:p5)(t,e)):lr(this.node(),t).duration}function g5(e,t){if(typeof t!="function")throw new Error;return function(){_r(this,e).ease=t}}function v5(e){var t=this._id;return arguments.length?this.each(g5(t,e)):lr(this.node(),t).ease}function w5(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;_r(this,e).ease=n}}function y5(e){if(typeof e!="function")throw new Error;return this.each(w5(this._id,e))}function b5(e){typeof e!="function"&&(e=gb(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,l=r[a]=[],c,d=0;d<o;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&l.push(c);return new Jr(r,this._parents,this._name,this._id)}function j5(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,i=Math.min(r,a),o=new Array(r),l=0;l<i;++l)for(var c=t[l],d=n[l],h=c.length,u=o[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||d[p])&&(u[p]=f);for(;l<r;++l)o[l]=t[l];return new Jr(o,this._parents,this._name,this._id)}function N5(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 k5(e,t,n){var r,a,i=N5(t)?Tp:_r;return function(){var o=i(this,e),l=o.on;l!==r&&(a=(r=l).copy()).on(t,n),o.on=a}}function S5(e,t){var n=this._id;return arguments.length<2?lr(this.node(),n).on.on(e):this.each(k5(n,e,t))}function C5(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function E5(){return this.on("end.remove",C5(this._id))}function M5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ep(e));for(var r=this._groups,a=r.length,i=new Array(a),o=0;o<a;++o)for(var l=r[o],c=l.length,d=i[o]=new Array(c),h,u,f=0;f<c;++f)(h=l[f])&&(u=e.call(h,h.__data__,f,l))&&("__data__"in h&&(u.__data__=h.__data__),d[f]=u,hu(d[f],t,n,f,d,lr(h,n)));return new Jr(i,this._parents,t,n)}function D5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xb(e));for(var r=this._groups,a=r.length,i=[],o=[],l=0;l<a;++l)for(var c=r[l],d=c.length,h,u=0;u<d;++u)if(h=c[u]){for(var f=e.call(h,h.__data__,u,c),p,w=lr(h,n),v=0,j=f.length;v<j;++v)(p=f[v])&&hu(p,t,n,v,f,w);i.push(f),o.push(h)}return new Jr(i,o,t,n)}var _5=yl.prototype.constructor;function P5(){return new _5(this._groups,this._parents)}function T5(e,t){var n,r,a;return function(){var i=Ci(this,e),o=(this.style.removeProperty(e),Ci(this,e));return i===o?null:i===n&&o===r?a:a=t(n=i,r=o)}}function Ub(e){return function(){this.style.removeProperty(e)}}function O5(e,t,n){var r,a=n+"",i;return function(){var o=Ci(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}function A5(e,t,n){var r,a,i;return function(){var o=Ci(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Ci(this,e))),o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,l))}}function z5(e,t){var n,r,a,i="style."+t,o="end."+i,l;return function(){var c=_r(this,e),d=c.on,h=c.value[i]==null?l||(l=Ub(t)):void 0;(d!==n||a!==h)&&(r=(n=d).copy()).on(o,a=h),c.on=r}}function $5(e,t,n){var r=(e+="")=="transform"?R3:Fb;return t==null?this.styleTween(e,T5(e,r)).on("end.style."+e,Ub(e)):typeof t=="function"?this.styleTween(e,A5(e,r,Op(this,"style."+e,t))).each(z5(this._id,e)):this.styleTween(e,O5(e,r,t),n).on("end.style."+e,null)}function R5(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function I5(e,t,n){var r,a;function i(){var o=t.apply(this,arguments);return o!==a&&(r=(a=o)&&R5(e,o,n)),r}return i._value=t,i}function L5(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,I5(e,t,n??""))}function F5(e){return function(){this.textContent=e}}function U5(e){return function(){var t=e(this);this.textContent=t??""}}function B5(e){return this.tween("text",typeof e=="function"?U5(Op(this,"text",e)):F5(e==null?"":e+""))}function W5(e){return function(t){this.textContent=e.call(this,t)}}function H5(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&W5(a)),t}return r._value=e,r}function V5(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,H5(e))}function Y5(){for(var e=this._name,t=this._id,n=Bb(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],l=o.length,c,d=0;d<l;++d)if(c=o[d]){var h=lr(c,t);hu(c,e,n,d,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Jr(r,this._parents,e,n)}function X5(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(i,o){var l={value:o},c={value:function(){--a===0&&i()}};n.each(function(){var d=_r(this,r),h=d.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),d.on=t}),a===0&&i()})}var q5=0;function Jr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Bb(){return++q5}var zr=yl.prototype;Jr.prototype={constructor:Jr,select:M5,selectAll:D5,selectChild:zr.selectChild,selectChildren:zr.selectChildren,filter:b5,merge:j5,selection:P5,transition:Y5,call:zr.call,nodes:zr.nodes,node:zr.node,size:zr.size,empty:zr.empty,each:zr.each,on:S5,attr:a5,attrTween:d5,style:$5,styleTween:L5,text:B5,textTween:V5,remove:E5,tween:Z3,delay:f5,duration:x5,ease:v5,easeVarying:y5,end:X5,[Symbol.iterator]:zr[Symbol.iterator]};function G5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var K5={time:null,delay:0,duration:250,ease:G5};function Q5(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 Z5(e){var t,n;e instanceof Jr?(t=e._id,e=e._name):(t=Bb(),(n=K5).time=Pp(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],l=o.length,c,d=0;d<l;++d)(c=o[d])&&hu(c,e,t,d,o,n||Q5(c,t));return new Jr(r,this._parents,e,t)}yl.prototype.interrupt=G3;yl.prototype.transition=Z5;const uc=e=>()=>e;function J5(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){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:r,enumerable:!0,configurable:!0},_:{value:a}})}function Br(e,t,n){this.k=e,this.x=t,this.y=n}Br.prototype={constructor:Br,scale:function(e){return e===1?this:new Br(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Br(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 fu=new Br(1,0,0);Wb.prototype=Br.prototype;function Wb(e){for(;!e.__zoom;)if(!(e=e.parentNode))return fu;return e.__zoom}function jh(e){e.stopImmediatePropagation()}function so(e){e.preventDefault(),e.stopImmediatePropagation()}function eM(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tM(){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 e0(){return this.__zoom||fu}function nM(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rM(){return navigator.maxTouchPoints||"ontouchstart"in this}function sM(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=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(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function Hb(){var e=eM,t=tM,n=sM,r=nM,a=rM,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Bc,d=cu("start","zoom","end"),h,u,f,p=500,w=150,v=0,j=10;function g(C){C.property("__zoom",e0).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",I).filter(a).on("touchstart.zoom",B).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(C,A,_,P){var E=C.selection?C.selection():C;E.property("__zoom",e0),C!==E?N(C,A,_,P):E.interrupt().each(function(){k(this,arguments).event(P).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},g.scaleBy=function(C,A,_,P){g.scaleTo(C,function(){var E=this.__zoom.k,D=typeof A=="function"?A.apply(this,arguments):A;return E*D},_,P)},g.scaleTo=function(C,A,_,P){g.transform(C,function(){var E=t.apply(this,arguments),D=this.__zoom,$=_==null?b(E):typeof _=="function"?_.apply(this,arguments):_,H=D.invert($),T=typeof A=="function"?A.apply(this,arguments):A;return n(x(y(D,T),$,H),E,o)},_,P)},g.translateBy=function(C,A,_,P){g.transform(C,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),o)},null,P)},g.translateTo=function(C,A,_,P,E){g.transform(C,function(){var D=t.apply(this,arguments),$=this.__zoom,H=P==null?b(D):typeof P=="function"?P.apply(this,arguments):P;return n(fu.translate(H[0],H[1]).scale($.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof _=="function"?-_.apply(this,arguments):-_),D,o)},P,E)};function y(C,A){return A=Math.max(i[0],Math.min(i[1],A)),A===C.k?C:new Br(A,C.x,C.y)}function x(C,A,_){var P=A[0]-_[0]*C.k,E=A[1]-_[1]*C.k;return P===C.x&&E===C.y?C:new Br(C.k,P,E)}function b(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function N(C,A,_,P){C.on("start.zoom",function(){k(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(P).end()}).tween("zoom",function(){var E=this,D=arguments,$=k(E,D).event(P),H=t.apply(E,D),T=_==null?b(H):typeof _=="function"?_.apply(E,D):_,U=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),G=E.__zoom,Q=typeof A=="function"?A.apply(E,D):A,re=c(G.invert(T).concat(U/G.k),Q.invert(T).concat(U/Q.k));return function(ne){if(ne===1)ne=Q;else{var J=re(ne),R=U/J[2];ne=new Br(R,T[0]-J[0]*R,T[1]-J[1]*R)}$.zoom(null,ne)}})}function k(C,A,_){return!_&&C.__zooming||new S(C,A)}function S(C,A){this.that=C,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,A),this.taps=0}S.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,A){return this.mouse&&C!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var A=gn(this.that).datum();d.call(C,this.that,new J5(C,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),A)}};function M(C,...A){if(!e.apply(this,arguments))return;var _=k(this,A).event(C),P=this.__zoom,E=Math.max(i[0],Math.min(i[1],P.k*Math.pow(2,r.apply(this,arguments)))),D=Kn(C);if(_.wheel)(_.mouse[0][0]!==D[0]||_.mouse[0][1]!==D[1])&&(_.mouse[1]=P.invert(_.mouse[0]=D)),clearTimeout(_.wheel);else{if(P.k===E)return;_.mouse=[D,P.invert(D)],Vc(this),_.start()}so(C),_.wheel=setTimeout($,w),_.zoom("mouse",n(x(y(P,E),_.mouse[0],_.mouse[1]),_.extent,o));function $(){_.wheel=null,_.end()}}function O(C,...A){if(f||!e.apply(this,arguments))return;var _=C.currentTarget,P=k(this,A,!0).event(C),E=gn(C.view).on("mousemove.zoom",T,!0).on("mouseup.zoom",U,!0),D=Kn(C,_),$=C.clientX,H=C.clientY;Eb(C.view),jh(C),P.mouse=[D,this.__zoom.invert(D)],Vc(this),P.start();function T(G){if(so(G),!P.moved){var Q=G.clientX-$,re=G.clientY-H;P.moved=Q*Q+re*re>v}P.event(G).zoom("mouse",n(x(P.that.__zoom,P.mouse[0]=Kn(G,_),P.mouse[1]),P.extent,o))}function U(G){E.on("mousemove.zoom mouseup.zoom",null),Mb(G.view,P.moved),so(G),P.event(G).end()}}function I(C,...A){if(e.apply(this,arguments)){var _=this.__zoom,P=Kn(C.changedTouches?C.changedTouches[0]:C,this),E=_.invert(P),D=_.k*(C.shiftKey?.5:2),$=n(x(y(_,D),P,E),t.apply(this,A),o);so(C),l>0?gn(this).transition().duration(l).call(N,$,P,C):gn(this).call(g.transform,$,P,C)}}function B(C,...A){if(e.apply(this,arguments)){var _=C.touches,P=_.length,E=k(this,A,C.changedTouches.length===P).event(C),D,$,H,T;for(jh(C),$=0;$<P;++$)H=_[$],T=Kn(H,this),T=[T,this.__zoom.invert(T),H.identifier],E.touch0?!E.touch1&&E.touch0[2]!==T[2]&&(E.touch1=T,E.taps=0):(E.touch0=T,D=!0,E.taps=1+!!h);h&&(h=clearTimeout(h)),D&&(E.taps<2&&(u=T[0],h=setTimeout(function(){h=null},p)),Vc(this),E.start())}}function z(C,...A){if(this.__zooming){var _=k(this,A).event(C),P=C.changedTouches,E=P.length,D,$,H,T;for(so(C),D=0;D<E;++D)$=P[D],H=Kn($,this),_.touch0&&_.touch0[2]===$.identifier?_.touch0[0]=H:_.touch1&&_.touch1[2]===$.identifier&&(_.touch1[0]=H);if($=_.that.__zoom,_.touch1){var U=_.touch0[0],G=_.touch0[1],Q=_.touch1[0],re=_.touch1[1],ne=(ne=Q[0]-U[0])*ne+(ne=Q[1]-U[1])*ne,J=(J=re[0]-G[0])*J+(J=re[1]-G[1])*J;$=y($,Math.sqrt(ne/J)),H=[(U[0]+Q[0])/2,(U[1]+Q[1])/2],T=[(G[0]+re[0])/2,(G[1]+re[1])/2]}else if(_.touch0)H=_.touch0[0],T=_.touch0[1];else return;_.zoom("touch",n(x($,H,T),_.extent,o))}}function L(C,...A){if(this.__zooming){var _=k(this,A).event(C),P=C.changedTouches,E=P.length,D,$;for(jh(C),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),D=0;D<E;++D)$=P[D],_.touch0&&_.touch0[2]===$.identifier?delete _.touch0:_.touch1&&_.touch1[2]===$.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&($=Kn($,this),Math.hypot(u[0]-$[0],u[1]-$[1])<j)){var H=gn(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return g.wheelDelta=function(C){return arguments.length?(r=typeof C=="function"?C:uc(+C),g):r},g.filter=function(C){return arguments.length?(e=typeof C=="function"?C:uc(!!C),g):e},g.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:uc(!!C),g):a},g.extent=function(C){return arguments.length?(t=typeof C=="function"?C:uc([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),g):t},g.scaleExtent=function(C){return arguments.length?(i[0]=+C[0],i[1]=+C[1],g):[i[0],i[1]]},g.translateExtent=function(C){return arguments.length?(o[0][0]=+C[0][0],o[1][0]=+C[1][0],o[0][1]=+C[0][1],o[1][1]=+C[1][1],g):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},g.constrain=function(C){return arguments.length?(n=C,g):n},g.duration=function(C){return arguments.length?(l=+C,g):l},g.interpolate=function(C){return arguments.length?(c=C,g):c},g.on=function(){var C=d.on.apply(d,arguments);return C===d?g:C},g.clickDistance=function(C){return arguments.length?(v=(C=+C)*C,g):Math.sqrt(v)},g.tapDistance=function(C){return arguments.length?(j=+C,g):j},g}const Er={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:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", 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."},rl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Vb=["Enter"," ","Escape"],Yb={"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 Mi;(function(e){e.Strict="strict",e.Loose="loose"})(Mi||(Mi={}));var ca;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ca||(ca={}));var sl;(function(e){e.Partial="partial",e.Full="full"})(sl||(sl={}));const Xb={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var ws;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ws||(ws={}));var _d;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(_d||(_d={}));var Ne;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ne||(Ne={}));const t0={[Ne.Left]:Ne.Right,[Ne.Right]:Ne.Left,[Ne.Top]:Ne.Bottom,[Ne.Bottom]:Ne.Top};function qb(e){return e===null?null:e?"valid":"invalid"}const Gb=e=>"id"in e&&"source"in e&&"target"in e,aM=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ap=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),jl=(e,t=[0,0])=>{const{width:n,height:r}=rs(e),a=e.origin??t,i=n*a[0],o=r*a[1];return{x:e.position.x-i,y:e.position.y-o}},iM=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const i=typeof a=="string";let o=!t.nodeLookup&&!i?a:void 0;t.nodeLookup&&(o=i?t.nodeLookup.get(a):Ap(a)?a:t.nodeLookup.get(a.id));const l=o?Pd(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return mu(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return pu(n)},Nl=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const a=Pd(r);n=mu(n,a)}}),pu(n)},zp=(e,t,[n,r,a]=[0,0,1],i=!1,o=!1)=>{const l={...Sl(t,[n,r,a]),width:t.width/a,height:t.height/a},c=[];for(const d of e.values()){const{measured:h,selectable:u=!0,hidden:f=!1}=d;if(o&&!u||f)continue;const p=h.width??d.width??d.initialWidth??null,w=h.height??d.height??d.initialHeight??null,v=al(l,_i(d)),j=(p??0)*(w??0),g=i&&v>0;(!d.internals.handleBounds||g||v>=j||d.dragging)&&c.push(d)}return c},oM=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function lM(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function cM({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:i},o){if(e.size===0)return Promise.resolve(!0);const l=lM(e,o),c=Nl(l),d=$p(c,t,n,(o==null?void 0:o.minZoom)??a,(o==null?void 0:o.maxZoom)??i,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{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 Kb({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:i}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:d}=l?l.internals.positionAbsolute:{x:0,y:0},h=o.origin??r;let u=o.extent||a;if(o.extent==="parent"&&!o.expandParent)if(!l)i==null||i("005",Er.error005());else{const p=l.measured.width,w=l.measured.height;p&&w&&(u=[[c,d],[c+p,d+w]])}else l&&Pi(o.extent)&&(u=[[o.extent[0][0]+c,o.extent[0][1]+d],[o.extent[1][0]+c,o.extent[1][1]+d]]);const f=Pi(u)?ba(t,u,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(i==null||i("015",Er.error015())),{position:{x:f.x-c+(o.measured.width??0)*h[0],y:f.y-d+(o.measured.height??0)*h[1]},positionAbsolute:f}}async function dM({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const i=new Set(e.map(f=>f.id)),o=[];for(const f of n){if(f.deletable===!1)continue;const p=i.has(f.id),w=!p&&f.parentId&&o.find(v=>v.id===f.parentId);(p||w)&&o.push(f)}const l=new Set(t.map(f=>f.id)),c=r.filter(f=>f.deletable!==!1),h=oM(o,c);for(const f of c)l.has(f.id)&&!h.find(w=>w.id===f.id)&&h.push(f);if(!a)return{edges:h,nodes:o};const u=await a({nodes:o,edges:h});return typeof u=="boolean"?u?{edges:h,nodes:o}:{edges:[],nodes:[]}:u}const Di=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ba=(e={x:0,y:0},t,n)=>({x:Di(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Di(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Qb(e,t,n){const{width:r,height:a}=rs(n),{x:i,y:o}=n.internals.positionAbsolute;return ba(e,[[i,o],[i+r,o+a]],t)}const n0=(e,t,n)=>e<t?Di(Math.abs(e-t),1,t)/t:e>n?-Di(Math.abs(e-n),1,t)/t:0,Zb=(e,t,n=15,r=40)=>{const a=n0(e.x,r,t.width-r)*n,i=n0(e.y,r,t.height-r)*n;return[a,i]},mu=(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)}),im=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),pu=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),_i=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=Ap(e)?e.internals.positionAbsolute:jl(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Pd=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=Ap(e)?e.internals.positionAbsolute:jl(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Jb=(e,t)=>pu(mu(im(e),im(t))),al=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},r0=e=>Jn(e.width)&&Jn(e.height)&&Jn(e.x)&&Jn(e.y),Jn=e=>!isNaN(e)&&isFinite(e),uM=(e,t)=>{},kl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Sl=({x:e,y:t},[n,r,a],i=!1,o=[1,1])=>{const l={x:(e-n)/a,y:(t-r)/a};return i?kl(l,o):l},Td=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function Fa(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 hM(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Fa(e,n),a=Fa(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=Fa(e.top??e.y??0,n),a=Fa(e.bottom??e.y??0,n),i=Fa(e.left??e.x??0,t),o=Fa(e.right??e.x??0,t);return{top:r,right:o,bottom:a,left:i,x:i+o,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function fM(e,t,n,r,a,i){const{x:o,y:l}=Td(e,[t,n,r]),{x:c,y:d}=Td({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=a-c,u=i-d;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(u)}}const $p=(e,t,n,r,a,i)=>{const o=hM(i,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,d=Math.min(l,c),h=Di(d,r,a),u=e.x+e.width/2,f=e.y+e.height/2,p=t/2-u*h,w=n/2-f*h,v=fM(e,p,w,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:p-j.left+j.right,y:w-j.top+j.bottom,zoom:h}},il=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Pi(e){return e!=null&&e!=="parent"}function rs(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 e1(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 t1(e,t={width:0,height:0},n,r,a){const i={...e},o=r.get(n);if(o){const l=o.origin||a;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 s0(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function mM(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function pM(e){return{...Yb,...e||{}}}function To(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:i,y:o}=er(e),l=Sl({x:i-((a==null?void 0:a.left)??0),y:o-((a==null?void 0:a.top)??0)},r),{x:c,y:d}=n?kl(l,t):l;return{xSnapped:c,ySnapped:d,...l}}const Rp=e=>({width:e.offsetWidth,height:e.offsetHeight}),n1=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},xM=["INPUT","SELECT","TEXTAREA"];function r1(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:xM.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const s1=e=>"clientX"in e,er=(e,t)=>{var i,o;const n=s1(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,a=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},a0=(e,t,n,r,a)=>{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:a,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Rp(o)}})};function a1({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:i,targetControlX:o,targetControlY:l}){const c=e*.125+a*.375+o*.375+n*.125,d=t*.125+i*.375+l*.375+r*.125,h=Math.abs(c-e),u=Math.abs(d-t);return[c,d,h,u]}function hc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function i0({pos:e,x1:t,y1:n,x2:r,y2:a,c:i}){switch(e){case Ne.Left:return[t-hc(t-r,i),n];case Ne.Right:return[t+hc(r-t,i),n];case Ne.Top:return[t,n-hc(n-a,i)];case Ne.Bottom:return[t,n+hc(a-n,i)]}}function i1({sourceX:e,sourceY:t,sourcePosition:n=Ne.Bottom,targetX:r,targetY:a,targetPosition:i=Ne.Top,curvature:o=.25}){const[l,c]=i0({pos:n,x1:e,y1:t,x2:r,y2:a,c:o}),[d,h]=i0({pos:i,x1:r,y1:a,x2:e,y2:t,c:o}),[u,f,p,w]=a1({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${e},${t} C${l},${c} ${d},${h} ${r},${a}`,u,f,p,w]}function o1({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,i=n<e?n+a:n-a,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[i,l,a,o]}function gM({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r,elevateOnSelect:a=!1}){if(r!==void 0)return r;const i=a&&n?1e3:0,o=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return i+o}function vM({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const i=mu(Pd(e),Pd(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const o={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return al(o,pu(i))>0}const wM=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,yM=(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)),l1=(e,t)=>{if(!e.source||!e.target)return t;let n;return Gb(e)?n={...e}:n={...e,id:wM(e)},yM(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function c1({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,i,o,l]=o1({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,i,o,l]}const o0={[Ne.Left]:{x:-1,y:0},[Ne.Right]:{x:1,y:0},[Ne.Top]:{x:0,y:-1},[Ne.Bottom]:{x:0,y:1}},bM=({source:e,sourcePosition:t=Ne.Bottom,target:n})=>t===Ne.Left||t===Ne.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},l0=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function jM({source:e,sourcePosition:t=Ne.Bottom,target:n,targetPosition:r=Ne.Top,center:a,offset:i,stepPosition:o}){const l=o0[t],c=o0[r],d={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},u=bM({source:d,sourcePosition:t,target:h}),f=u.x!==0?"x":"y",p=u[f];let w=[],v,j;const g={x:0,y:0},y={x:0,y:0},[,,x,b]=o1({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*c[f]===-1){f==="x"?(v=a.x??d.x+(h.x-d.x)*o,j=a.y??(d.y+h.y)/2):(v=a.x??(d.x+h.x)/2,j=a.y??d.y+(h.y-d.y)*o);const k=[{x:v,y:d.y},{x:v,y:h.y}],S=[{x:d.x,y:j},{x:h.x,y:j}];l[f]===p?w=f==="x"?k:S:w=f==="x"?S:k}else{const k=[{x:d.x,y:h.y}],S=[{x:h.x,y:d.y}];if(f==="x"?w=l.x===p?S:k:w=l.y===p?k:S,t===r){const z=Math.abs(e[f]-n[f]);if(z<=i){const L=Math.min(i-1,i-z);l[f]===p?g[f]=(d[f]>e[f]?-1:1)*L:y[f]=(h[f]>n[f]?-1:1)*L}}if(t!==r){const z=f==="x"?"y":"x",L=l[f]===c[z],C=d[z]>h[z],A=d[z]<h[z];(l[f]===1&&(!L&&C||L&&A)||l[f]!==1&&(!L&&A||L&&C))&&(w=f==="x"?k:S)}const M={x:d.x+g.x,y:d.y+g.y},O={x:h.x+y.x,y:h.y+y.y},I=Math.max(Math.abs(M.x-w[0].x),Math.abs(O.x-w[0].x)),B=Math.max(Math.abs(M.y-w[0].y),Math.abs(O.y-w[0].y));I>=B?(v=(M.x+O.x)/2,j=w[0].y):(v=w[0].x,j=(M.y+O.y)/2)}return[[e,{x:d.x+g.x,y:d.y+g.y},...w,{x:h.x+y.x,y:h.y+y.y},n],v,j,x,b]}function NM(e,t,n,r){const a=Math.min(l0(e,t)/2,l0(t,n)/2,r),{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 d=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${i+a*d},${o}Q ${i},${o} ${i},${o+a*h}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${o+a*c}Q ${i},${o} ${i+a*l},${o}`}function om({sourceX:e,sourceY:t,sourcePosition:n=Ne.Bottom,targetX:r,targetY:a,targetPosition:i=Ne.Top,borderRadius:o=5,centerX:l,centerY:c,offset:d=20,stepPosition:h=.5}){const[u,f,p,w,v]=jM({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:i,center:{x:l,y:c},offset:d,stepPosition:h});return[u.reduce((g,y,x)=>{let b="";return x>0&&x<u.length-1?b=NM(u[x-1],y,u[x+1],o):b=`${x===0?"M":"L"}${y.x} ${y.y}`,g+=b,g},""),f,p,w,v]}function c0(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function kM(e){var u;const{sourceNode:t,targetNode:n}=e;if(!c0(t)||!c0(n))return null;const r=t.internals.handleBounds||d0(t.handles),a=n.internals.handleBounds||d0(n.handles),i=u0((r==null?void 0:r.source)??[],e.sourceHandle),o=u0(e.connectionMode===Mi.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!i||!o)return(u=e.onError)==null||u.call(e,"008",Er.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Ne.Bottom,c=(o==null?void 0:o.position)||Ne.Top,d=ol(t,i,l),h=ol(n,o,c);return{sourceX:d.x,sourceY:d.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function d0(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ol(e,t,n=Ne.Left,r=!1){const a=((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??rs(e);if(r)return{x:a+o/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Ne.Top:return{x:a+o/2,y:i};case Ne.Right:return{x:a+o,y:i+l/2};case Ne.Bottom:return{x:a+o/2,y:i+l};case Ne.Left:return{x:a,y:i+l/2}}}function u0(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function lm(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function SM(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const i=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const d=lm(c,t);i.has(d)||(o.push({id:d,color:c.color||n,...c}),i.add(d))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const Ip={nodeOrigin:[0,0],nodeExtent:rl,elevateNodesOnSelect:!0,defaults:{}},CM={...Ip,checkEquality:!0};function Lp(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function EM(e,t,n){const r=Lp(Ip,n);for(const a of e.values())if(a.parentId)Fp(a,e,t,r);else{const i=jl(a,r.nodeOrigin),o=Pi(a.extent)?a.extent:r.nodeExtent,l=ba(i,o,rs(a));a.internals.positionAbsolute=l}}function MM(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const i={width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(i):a.type==="target"&&r.push(i)}return{source:n,target:r}}function cm(e,t,n,r){var c,d;const a=Lp(CM,r);let i=e.length>0;const o=new Map(t),l=a!=null&&a.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const h of e){let u=o.get(h.id);if(a.checkEquality&&h===(u==null?void 0:u.internals.userNode))t.set(h.id,u);else{const f=jl(h,a.nodeOrigin),p=Pi(h.extent)?h.extent:a.nodeExtent,w=ba(f,p,rs(h));u={...a.defaults,...h,measured:{width:(c=h.measured)==null?void 0:c.width,height:(d=h.measured)==null?void 0:d.height},internals:{positionAbsolute:w,handleBounds:MM(h,u),z:d1(h,l),userNode:h}},t.set(h.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(i=!1),h.parentId&&Fp(u,t,n,r)}return i}function DM(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 Fp(e,t,n,r){const{elevateNodesOnSelect:a,nodeOrigin:i,nodeExtent:o}=Lp(Ip,r),l=e.parentId,c=t.get(l);if(!c){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}DM(e,n);const d=a?1e3:0,{x:h,y:u,z:f}=_M(e,c,i,o,d),{positionAbsolute:p}=e.internals,w=h!==p.x||u!==p.y;(w||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:u}:p,z:f}})}function d1(e,t){return(Jn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function _M(e,t,n,r,a){const{x:i,y:o}=t.internals.positionAbsolute,l=rs(e),c=jl(e,n),d=Pi(e.extent)?ba(c,e.extent,l):c;let h=ba({x:i+d.x,y:o+d.y},r,l);e.extent==="parent"&&(h=Qb(h,l,t));const u=d1(e,a),f=t.internals.z??0;return{x:h.x,y:h.y,z:f>=u?f+1:u}}function Up(e,t,n,r=[0,0]){var o;const a=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const d=((o=i.get(l.parentId))==null?void 0:o.expandedRect)??_i(c),h=Jb(d,l.rect);i.set(l.parentId,{expandedRect:h,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},d)=>{var x;const h=c.internals.positionAbsolute,u=rs(c),f=c.origin??r,p=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,w=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,v=Math.max(u.width,Math.round(l.width)),j=Math.max(u.height,Math.round(l.height)),g=(v-u.width)*f[0],y=(j-u.height)*f[1];(p>0||w>0||g||y)&&(a.push({id:d,type:"position",position:{x:c.position.x-p+g,y:c.position.y-w+y}}),(x=n.get(d))==null||x.forEach(b=>{e.some(N=>N.id===b.id)||a.push({id:b.id,type:"position",position:{x:b.position.x+p,y:b.position.y+w}})})),(u.width<l.width||u.height<l.height||p||w)&&a.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?f[0]*p-g:0),height:j+(w?f[1]*w-y:0)}})}),a}function PM(e,t,n,r,a,i){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const c=[],d=window.getComputedStyle(o),{m22:h}=new window.DOMMatrixReadOnly(d.transform),u=[];for(const f of e.values()){const p=t.get(f.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}const w=Rp(f.nodeElement),v=p.measured.width!==w.width||p.measured.height!==w.height;if(!!(w.width&&w.height&&(v||!p.internals.handleBounds||f.force))){const g=f.nodeElement.getBoundingClientRect(),y=Pi(p.extent)?p.extent:i;let{positionAbsolute:x}=p.internals;p.parentId&&p.extent==="parent"?x=Qb(x,w,t.get(p.parentId)):y&&(x=ba(x,y,w));const b={...p,measured:w,internals:{...p.internals,positionAbsolute:x,handleBounds:{source:a0("source",f.nodeElement,g,h,p.id),target:a0("target",f.nodeElement,g,h,p.id)}}};t.set(p.id,b),p.parentId&&Fp(b,t,n,{nodeOrigin:a}),l=!0,v&&(c.push({id:p.id,type:"dimensions",dimensions:w}),p.expandParent&&p.parentId&&u.push({id:p.id,parentId:p.parentId,rect:_i(b,a)}))}}if(u.length>0){const f=Up(u,t,n,a);c.push(...f)}return{changes:c,updatedInternals:l}}async function TM({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,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],[a,i]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function h0(e,t,n,r,a,i){let o=a;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${a}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),i){o=`${a}-${e}-${i}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function u1(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:i,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:a,target:i,sourceHandle:o,targetHandle:l},d=`${a}-${o}--${i}-${l}`,h=`${i}-${l}--${a}-${o}`;h0("source",c,h,e,a,o),h0("target",c,d,e,i,l),t.set(r.id,r)}}function h1(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:h1(n,t):!1}function f0(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function OM(e,t,n,r){const a=new Map;for(const[i,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!h1(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(i);l&&a.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 a}function Nh({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const a=[];for(const[d,h]of t){const u=(o=n.get(d))==null?void 0:o.internals.userNode;u&&a.push({...u,position:h.position,dragging:r})}if(!e)return[a[0],a];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:r}:a[0],a]}function AM({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const i={x:n-a.distance.x,y:r-a.distance.y},o=kl(i,t);return{x:o.x-i.x,y:o.y-i.y}}function zM({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let i={x:null,y:null},o=0,l=new Map,c=!1,d={x:0,y:0},h=null,u=!1,f=null,p=!1,w=!1,v=null;function j({noDragClassName:y,handleSelector:x,domNode:b,isSelectable:N,nodeId:k,nodeClickDistance:S=0}){f=gn(b);function M({x:z,y:L}){const{nodeLookup:C,nodeExtent:A,snapGrid:_,snapToGrid:P,nodeOrigin:E,onNodeDrag:D,onSelectionDrag:$,onError:H,updateNodePositions:T}=t();i={x:z,y:L};let U=!1;const G=l.size>1,Q=G&&A?im(Nl(l)):null,re=G&&P?AM({dragItems:l,snapGrid:_,x:z,y:L}):null;for(const[ne,J]of l){if(!C.has(ne))continue;let R={x:z-J.distance.x,y:L-J.distance.y};P&&(R=re?{x:Math.round(R.x+re.x),y:Math.round(R.y+re.y)}:kl(R,_));let ee=null;if(G&&A&&!J.extent&&Q){const{positionAbsolute:K}=J.internals,ie=K.x-Q.x+A[0][0],ce=K.x+J.measured.width-Q.x2+A[1][0],pe=K.y-Q.y+A[0][1],ke=K.y+J.measured.height-Q.y2+A[1][1];ee=[[ie,pe],[ce,ke]]}const{position:F,positionAbsolute:V}=Kb({nodeId:ne,nextPosition:R,nodeLookup:C,nodeExtent:ee||A,nodeOrigin:E,onError:H});U=U||J.position.x!==F.x||J.position.y!==F.y,J.position=F,J.internals.positionAbsolute=V}if(w=w||U,!!U&&(T(l,!0),v&&(r||D||!k&&$))){const[ne,J]=Nh({nodeId:k,dragItems:l,nodeLookup:C});r==null||r(v,l,ne,J),D==null||D(v,ne,J),k||$==null||$(v,J)}}async function O(){if(!h)return;const{transform:z,panBy:L,autoPanSpeed:C,autoPanOnNodeDrag:A}=t();if(!A){c=!1,cancelAnimationFrame(o);return}const[_,P]=Zb(d,h,C);(_!==0||P!==0)&&(i.x=(i.x??0)-_/z[2],i.y=(i.y??0)-P/z[2],await L({x:_,y:P})&&M(i)),o=requestAnimationFrame(O)}function I(z){var G;const{nodeLookup:L,multiSelectionActive:C,nodesDraggable:A,transform:_,snapGrid:P,snapToGrid:E,selectNodesOnDrag:D,onNodeDragStart:$,onSelectionDragStart:H,unselectNodesAndEdges:T}=t();u=!0,(!D||!N)&&!C&&k&&((G=L.get(k))!=null&&G.selected||T()),N&&D&&k&&(e==null||e(k));const U=To(z.sourceEvent,{transform:_,snapGrid:P,snapToGrid:E,containerBounds:h});if(i=U,l=OM(L,A,U,k),l.size>0&&(n||$||!k&&H)){const[Q,re]=Nh({nodeId:k,dragItems:l,nodeLookup:L});n==null||n(z.sourceEvent,l,Q,re),$==null||$(z.sourceEvent,Q,re),k||H==null||H(z.sourceEvent,re)}}const B=Db().clickDistance(S).on("start",z=>{const{domNode:L,nodeDragThreshold:C,transform:A,snapGrid:_,snapToGrid:P}=t();h=(L==null?void 0:L.getBoundingClientRect())||null,p=!1,w=!1,v=z.sourceEvent,C===0&&I(z),i=To(z.sourceEvent,{transform:A,snapGrid:_,snapToGrid:P,containerBounds:h}),d=er(z.sourceEvent,h)}).on("drag",z=>{const{autoPanOnNodeDrag:L,transform:C,snapGrid:A,snapToGrid:_,nodeDragThreshold:P,nodeLookup:E}=t(),D=To(z.sourceEvent,{transform:C,snapGrid:A,snapToGrid:_,containerBounds:h});if(v=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||k&&!E.has(k))&&(p=!0),!p){if(!c&&L&&u&&(c=!0,O()),!u){const $=er(z.sourceEvent,h),H=$.x-d.x,T=$.y-d.y;Math.sqrt(H*H+T*T)>P&&I(z)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&l&&u&&(d=er(z.sourceEvent,h),M(D))}}).on("end",z=>{if(!(!u||p)&&(c=!1,u=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:L,updateNodePositions:C,onNodeDragStop:A,onSelectionDragStop:_}=t();if(w&&(C(l,!1),w=!1),a||A||!k&&_){const[P,E]=Nh({nodeId:k,dragItems:l,nodeLookup:L,dragging:!1});a==null||a(z.sourceEvent,l,P,E),A==null||A(z.sourceEvent,P,E),k||_==null||_(z.sourceEvent,E)}}}).filter(z=>{const L=z.target;return!z.button&&(!y||!f0(L,`.${y}`,b))&&(!x||f0(L,x,b))});f.call(B)}function g(){f==null||f.on(".drag",null)}return{update:j,destroy:g}}function $M(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())al(a,_i(i))>0&&r.push(i);return r}const RM=250;function IM(e,t,n,r){var l,c;let a=[],i=1/0;const o=$M(e,n,t+RM);for(const d of o){const h=[...((l=d.internals.handleBounds)==null?void 0:l.source)??[],...((c=d.internals.handleBounds)==null?void 0:c.target)??[]];for(const u of h){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;const{x:f,y:p}=ol(d,u,u.position,!0),w=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(p-e.y,2));w>t||(w<i?(a=[{...u,x:f,y:p}],i=w):w===i&&a.push({...u,x:f,y:p}))}}if(!a.length)return null;if(a.length>1){const d=r.type==="source"?"target":"source";return a.find(h=>h.type===d)??a[0]}return a[0]}function f1(e,t,n,r,a,i=!1){var d,h,u;const o=r.get(e);if(!o)return null;const l=a==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((h=o.internals.handleBounds)==null?void 0:h.source)??[],...((u=o.internals.handleBounds)==null?void 0:u.target)??[]],c=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...ol(o,c,c.position,!0)}:c}function m1(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function LM(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const p1=()=>!0;function FM(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:i,isTarget:o,domNode:l,nodeLookup:c,lib:d,autoPanOnConnect:h,flowId:u,panBy:f,cancelConnection:p,onConnectStart:w,onConnect:v,onConnectEnd:j,isValidConnection:g=p1,onReconnectEnd:y,updateConnection:x,getTransform:b,getFromHandle:N,autoPanSpeed:k,dragThreshold:S=1,handleDomNode:M}){const O=n1(e.target);let I=0,B;const{x:z,y:L}=er(e),C=m1(i,M),A=l==null?void 0:l.getBoundingClientRect();let _=!1;if(!A||!C)return;const P=f1(a,C,r,c,t);if(!P)return;let E=er(e,A),D=!1,$=null,H=!1,T=null;function U(){if(!h||!A)return;const[F,V]=Zb(E,A,k);f({x:F,y:V}),I=requestAnimationFrame(U)}const G={...P,nodeId:a,type:C,position:P.position},Q=c.get(a);let ne={inProgress:!0,isValid:null,from:ol(Q,G,Ne.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:Q,to:E,toHandle:null,toPosition:t0[G.position],toNode:null};function J(){_=!0,x(ne),w==null||w(e,{nodeId:a,handleId:r,handleType:C})}S===0&&J();function R(F){if(!_){const{x:ce,y:pe}=er(F),ke=ce-z,Ie=pe-L;if(!(ke*ke+Ie*Ie>S*S))return;J()}if(!N()||!G){ee(F);return}const V=b();E=er(F,A),B=IM(Sl(E,V,!1,[1,1]),n,c,G),D||(U(),D=!0);const K=x1(F,{handle:B,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:o?"target":"source",isValidConnection:g,doc:O,lib:d,flowId:u,nodeLookup:c});T=K.handleDomNode,$=K.connection,H=LM(!!B,K.isValid);const ie={...ne,isValid:H,to:K.toHandle&&H?Td({x:K.toHandle.x,y:K.toHandle.y},V):E,toHandle:K.toHandle,toPosition:H&&K.toHandle?K.toHandle.position:t0[G.position],toNode:K.toHandle?c.get(K.toHandle.nodeId):null};H&&B&&ne.toHandle&&ie.toHandle&&ne.toHandle.type===ie.toHandle.type&&ne.toHandle.nodeId===ie.toHandle.nodeId&&ne.toHandle.id===ie.toHandle.id&&ne.to.x===ie.to.x&&ne.to.y===ie.to.y||(x(ie),ne=ie)}function ee(F){if(!("touches"in F&&F.touches.length>0)){if(_){(B||T)&&$&&H&&(v==null||v($));const{inProgress:V,...K}=ne,ie={...K,toPosition:ne.toHandle?ne.toPosition:null};j==null||j(F,ie),i&&(y==null||y(F,ie))}p(),cancelAnimationFrame(I),D=!1,H=!1,$=null,T=null,O.removeEventListener("mousemove",R),O.removeEventListener("mouseup",ee),O.removeEventListener("touchmove",R),O.removeEventListener("touchend",ee)}}O.addEventListener("mousemove",R),O.addEventListener("mouseup",ee),O.addEventListener("touchmove",R),O.addEventListener("touchend",ee)}function x1(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:i,doc:o,lib:l,flowId:c,isValidConnection:d=p1,nodeLookup:h}){const u=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:p,y:w}=er(e),v=o.elementFromPoint(p,w),j=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,g={handleDomNode:j,isValid:!1,connection:null,toHandle:null};if(j){const y=m1(void 0,j),x=j.getAttribute("data-nodeid"),b=j.getAttribute("data-handleid"),N=j.classList.contains("connectable"),k=j.classList.contains("connectableend");if(!x||!y)return g;const S={source:u?x:r,sourceHandle:u?b:a,target:u?r:x,targetHandle:u?a:b};g.connection=S;const O=N&&k&&(n===Mi.Strict?u&&y==="source"||!u&&y==="target":x!==r||b!==a);g.isValid=O&&d(S),g.toHandle=f1(x,y,b,h,n,!0)}return g}const dm={onPointerDown:FM,isValid:x1};function UM({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=gn(e);function i({translateExtent:l,width:c,height:d,zoomStep:h=1,pannable:u=!0,zoomable:f=!0,inversePan:p=!1}){const w=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const b=n(),N=x.sourceEvent.ctrlKey&&il()?10:1,k=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*h,S=b[2]*Math.pow(2,k*N);t.scaleTo(S)};let v=[0,0];const j=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(v=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},g=x=>{const b=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const N=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],k=[N[0]-v[0],N[1]-v[1]];v=N;const S=r()*Math.max(b[2],Math.log(b[2]))*(p?-1:1),M={x:b[0]-k[0]*S,y:b[1]-k[1]*S},O=[[0,0],[c,d]];t.setViewportConstrained({x:M.x,y:M.y,zoom:b[2]},O,l)},y=Hb().on("start",j).on("zoom",u?g:null).on("zoom.wheel",f?w:null);a.call(y,{})}function o(){a.on("zoom",null)}return{update:i,destroy:o,pointer:Kn}}const BM=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,xu=e=>({x:e.x,y:e.y,zoom:e.k}),kh=({x:e,y:t,zoom:n})=>fu.translate(e,t).scale(n),ii=(e,t)=>e.target.closest(`.${t}`),g1=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),WM=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Sh=(e,t=0,n=WM,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},v1=e=>{const t=e.ctrlKey&&il()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function HM({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:d}){return h=>{if(ii(h,t))return!1;h.preventDefault(),h.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(h.ctrlKey&&o){const j=Kn(h),g=v1(h),y=u*Math.pow(2,g);r.scaleTo(n,y,j,h);return}const f=h.deltaMode===1?20:1;let p=a===ca.Vertical?0:h.deltaX*f,w=a===ca.Horizontal?0:h.deltaY*f;!il()&&h.shiftKey&&a!==ca.Vertical&&(p=h.deltaY*f,w=0),r.translateBy(n,-(p/u)*i,-(w/u)*i,{internal:!0});const v=xu(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(h,v)),e.isPanScrolling&&(c==null||c(h,v),e.panScrollTimeout=setTimeout(()=>{d==null||d(h,v),e.isPanScrolling=!1},150))}}function VM({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const i=r.type==="wheel",o=!t&&i&&!r.ctrlKey,l=ii(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,a)}}function YM({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,o,l;if((i=r.sourceEvent)!=null&&i.internal)return;const a=xu(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function XM({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return i=>{var o,l;e.usedRightMouseButton=!!(n&&g1(t,e.mouseButton??0)),(o=i.sourceEvent)!=null&&o.sync||r([i.transform.x,i.transform.y,i.transform.k]),a&&!((l=i.sourceEvent)!=null&&l.internal)&&(a==null||a(i.sourceEvent,xu(i.transform)))}}function qM({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:i}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&g1(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&i(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),a&&BM(e.prevViewport,o.transform))){const c=xu(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(o.sourceEvent,c)},n?150:0)}}}function GM({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:d,connectionInProgress:h}){return u=>{var j;const f=e||t,p=n&&u.ctrlKey,w=u.type==="wheel";if(u.button===1&&u.type==="mousedown"&&(ii(u,`${d}-flow__node`)||ii(u,`${d}-flow__edge`)))return!0;if(!r&&!f&&!a&&!i&&!n||o||h&&!w||ii(u,l)&&w||ii(u,c)&&(!w||a&&w&&!e)||!n&&u.ctrlKey&&w)return!1;if(!n&&u.type==="touchstart"&&((j=u.touches)==null?void 0:j.length)>1)return u.preventDefault(),!1;if(!f&&!a&&!p&&w||!r&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(r)&&!r.includes(u.button)&&u.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||w)&&v}}function KM({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:a,viewport:i,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:d}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),f=Hb().clickDistance(!Jn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(a),p=gn(e).call(f);x({x:i.x,y:i.y,zoom:Di(i.zoom,t,n)},[[0,0],[u.width,u.height]],a);const w=p.on("wheel.zoom"),v=p.on("dblclick.zoom");f.wheelDelta(v1);function j(z,L){return p?new Promise(C=>{f==null||f.interpolate((L==null?void 0:L.interpolate)==="linear"?Po:Bc).transform(Sh(p,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>C(!0)),z)}):Promise.resolve(!1)}function g({noWheelClassName:z,noPanClassName:L,onPaneContextMenu:C,userSelectionActive:A,panOnScroll:_,panOnDrag:P,panOnScrollMode:E,panOnScrollSpeed:D,preventScrolling:$,zoomOnPinch:H,zoomOnScroll:T,zoomOnDoubleClick:U,zoomActivationKeyPressed:G,lib:Q,onTransformChange:re,connectionInProgress:ne}){A&&!h.isZoomingOrPanning&&y();const R=_&&!G&&!A?HM({zoomPanValues:h,noWheelClassName:z,d3Selection:p,d3Zoom:f,panOnScrollMode:E,panOnScrollSpeed:D,zoomOnPinch:H,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:c}):VM({noWheelClassName:z,preventScrolling:$,d3ZoomHandler:w});if(p.on("wheel.zoom",R,{passive:!1}),!A){const F=YM({zoomPanValues:h,onDraggingChange:d,onPanZoomStart:l});f.on("start",F);const V=XM({zoomPanValues:h,panOnDrag:P,onPaneContextMenu:!!C,onPanZoom:o,onTransformChange:re});f.on("zoom",V);const K=qM({zoomPanValues:h,panOnDrag:P,panOnScroll:_,onPaneContextMenu:C,onPanZoomEnd:c,onDraggingChange:d});f.on("end",K)}const ee=GM({zoomActivationKeyPressed:G,panOnDrag:P,zoomOnScroll:T,panOnScroll:_,zoomOnDoubleClick:U,zoomOnPinch:H,userSelectionActive:A,noPanClassName:L,noWheelClassName:z,lib:Q,connectionInProgress:ne});f.filter(ee),U?p.on("dblclick.zoom",v):p.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function x(z,L,C){const A=kh(z),_=f==null?void 0:f.constrain()(A,L,C);return _&&await j(_),new Promise(P=>P(_))}async function b(z,L){const C=kh(z);return await j(C,L),new Promise(A=>A(C))}function N(z){if(p){const L=kh(z),C=p.property("__zoom");(C.k!==z.zoom||C.x!==z.x||C.y!==z.y)&&(f==null||f.transform(p,L,null,{sync:!0}))}}function k(){const z=p?Wb(p.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function S(z,L){return p?new Promise(C=>{f==null||f.interpolate((L==null?void 0:L.interpolate)==="linear"?Po:Bc).scaleTo(Sh(p,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>C(!0)),z)}):Promise.resolve(!1)}function M(z,L){return p?new Promise(C=>{f==null||f.interpolate((L==null?void 0:L.interpolate)==="linear"?Po:Bc).scaleBy(Sh(p,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>C(!0)),z)}):Promise.resolve(!1)}function O(z){f==null||f.scaleExtent(z)}function I(z){f==null||f.translateExtent(z)}function B(z){const L=!Jn(z)||z<0?0:z;f==null||f.clickDistance(L)}return{update:g,destroy:y,setViewport:b,setViewportConstrained:x,getViewport:k,scaleTo:S,scaleBy:M,setScaleExtent:O,setTranslateExtent:I,syncViewport:N,setClickDistance:B}}var Ti;(function(e){e.Line="line",e.Handle="handle"})(Ti||(Ti={}));function QM({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:i}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&a&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function ZM(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function os(e,t){return Math.max(0,t-e)}function ls(e,t){return Math.max(0,e-t)}function fc(e,t,n){return Math.max(0,t-e,e-n)}function m0(e,t){return e?!t:t}function JM(e,t,n,r,a,i,o,l){let{affectsX:c,affectsY:d}=t;const{isHorizontal:h,isVertical:u}=t,f=h&&u,{xSnapped:p,ySnapped:w}=n,{minWidth:v,maxWidth:j,minHeight:g,maxHeight:y}=r,{x,y:b,width:N,height:k,aspectRatio:S}=e;let M=Math.floor(h?p-e.pointerX:0),O=Math.floor(u?w-e.pointerY:0);const I=N+(c?-M:M),B=k+(d?-O:O),z=-i[0]*N,L=-i[1]*k;let C=fc(I,v,j),A=fc(B,g,y);if(o){let E=0,D=0;c&&M<0?E=os(x+M+z,o[0][0]):!c&&M>0&&(E=ls(x+I+z,o[1][0])),d&&O<0?D=os(b+O+L,o[0][1]):!d&&O>0&&(D=ls(b+B+L,o[1][1])),C=Math.max(C,E),A=Math.max(A,D)}if(l){let E=0,D=0;c&&M>0?E=ls(x+M,l[0][0]):!c&&M<0&&(E=os(x+I,l[1][0])),d&&O>0?D=ls(b+O,l[0][1]):!d&&O<0&&(D=os(b+B,l[1][1])),C=Math.max(C,E),A=Math.max(A,D)}if(a){if(h){const E=fc(I/S,g,y)*S;if(C=Math.max(C,E),o){let D=0;!c&&!d||c&&!d&&f?D=ls(b+L+I/S,o[1][1])*S:D=os(b+L+(c?M:-M)/S,o[0][1])*S,C=Math.max(C,D)}if(l){let D=0;!c&&!d||c&&!d&&f?D=os(b+I/S,l[1][1])*S:D=ls(b+(c?M:-M)/S,l[0][1])*S,C=Math.max(C,D)}}if(u){const E=fc(B*S,v,j)/S;if(A=Math.max(A,E),o){let D=0;!c&&!d||d&&!c&&f?D=ls(x+B*S+z,o[1][0])/S:D=os(x+(d?O:-O)*S+z,o[0][0])/S,A=Math.max(A,D)}if(l){let D=0;!c&&!d||d&&!c&&f?D=os(x+B*S,l[1][0])/S:D=ls(x+(d?O:-O)*S,l[0][0])/S,A=Math.max(A,D)}}}O=O+(O<0?A:-A),M=M+(M<0?C:-C),a&&(f?I>B*S?O=(m0(c,d)?-M:M)/S:M=(m0(c,d)?-O:O)*S:h?(O=M/S,d=c):(M=O*S,c=d));const _=c?x+M:x,P=d?b+O:b;return{width:N+(c?-M:M),height:k+(d?-O:O),x:i[0]*M*(c?-1:1)+_,y:i[1]*O*(d?-1:1)+P}}const w1={width:0,height:0,x:0,y:0},eD={...w1,pointerX:0,pointerY:0,aspectRatio:1};function tD(e){return[[0,0],[e.measured.width,e.measured.height]]}function nD(e,t,n){const r=t.position.x+e.position.x,a=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[[r-l,a-c],[r+i-l,a+o-c]]}function rD({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const i=gn(e);function o({controlPosition:c,boundaries:d,keepAspectRatio:h,resizeDirection:u,onResizeStart:f,onResize:p,onResizeEnd:w,shouldResize:v}){let j={...w1},g={...eD};const y=ZM(c);let x,b=null,N=[],k,S,M,O=!1;const I=Db().on("start",B=>{const{nodeLookup:z,transform:L,snapGrid:C,snapToGrid:A,nodeOrigin:_,paneDomNode:P}=n();if(x=z.get(t),!x)return;b=(P==null?void 0:P.getBoundingClientRect())??null;const{xSnapped:E,ySnapped:D}=To(B.sourceEvent,{transform:L,snapGrid:C,snapToGrid:A,containerBounds:b});j={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},g={...j,pointerX:E,pointerY:D,aspectRatio:j.width/j.height},k=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(k=z.get(x.parentId),S=k&&x.extent==="parent"?tD(k):void 0),N=[],M=void 0;for(const[$,H]of z)if(H.parentId===t&&(N.push({id:$,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const T=nD(H,x,H.origin??_);M?M=[[Math.min(T[0][0],M[0][0]),Math.min(T[0][1],M[0][1])],[Math.max(T[1][0],M[1][0]),Math.max(T[1][1],M[1][1])]]:M=T}f==null||f(B,{...j})}).on("drag",B=>{const{transform:z,snapGrid:L,snapToGrid:C,nodeOrigin:A}=n(),_=To(B.sourceEvent,{transform:z,snapGrid:L,snapToGrid:C,containerBounds:b}),P=[];if(!x)return;const{x:E,y:D,width:$,height:H}=j,T={},U=x.origin??A,{width:G,height:Q,x:re,y:ne}=JM(g,y,_,d,h,U,S,M),J=G!==$,R=Q!==H,ee=re!==E&&J,F=ne!==D&&R;if(!ee&&!F&&!J&&!R)return;if((ee||F||U[0]===1||U[1]===1)&&(T.x=ee?re:j.x,T.y=F?ne:j.y,j.x=T.x,j.y=T.y,N.length>0)){const ce=re-E,pe=ne-D;for(const ke of N)ke.position={x:ke.position.x-ce+U[0]*(G-$),y:ke.position.y-pe+U[1]*(Q-H)},P.push(ke)}if((J||R)&&(T.width=J&&(!u||u==="horizontal")?G:j.width,T.height=R&&(!u||u==="vertical")?Q:j.height,j.width=T.width,j.height=T.height),k&&x.expandParent){const ce=U[0]*(T.width??0);T.x&&T.x<ce&&(j.x=ce,g.x=g.x-(T.x-ce));const pe=U[1]*(T.height??0);T.y&&T.y<pe&&(j.y=pe,g.y=g.y-(T.y-pe))}const V=QM({width:j.width,prevWidth:$,height:j.height,prevHeight:H,affectsX:y.affectsX,affectsY:y.affectsY}),K={...j,direction:V};(v==null?void 0:v(B,K))!==!1&&(O=!0,p==null||p(B,K),r(T,P))}).on("end",B=>{O&&(w==null||w(B,{...j}),a==null||a({...j}),O=!1)});i.call(I)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}var y1={exports:{}},b1={},j1={exports:{}},N1={};/**
68
- * @license React
69
- * use-sync-external-store-shim.production.js
70
- *
71
- * Copyright (c) Meta Platforms, Inc. and affiliates.
72
- *
73
- * This source code is licensed under the MIT license found in the
74
- * LICENSE file in the root directory of this source tree.
75
- */var Oi=m;function sD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aD=typeof Object.is=="function"?Object.is:sD,iD=Oi.useState,oD=Oi.useEffect,lD=Oi.useLayoutEffect,cD=Oi.useDebugValue;function dD(e,t){var n=t(),r=iD({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return lD(function(){a.value=n,a.getSnapshot=t,Ch(a)&&i({inst:a})},[e,n,t]),oD(function(){return Ch(a)&&i({inst:a}),e(function(){Ch(a)&&i({inst:a})})},[e]),cD(n),n}function Ch(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!aD(e,n)}catch{return!0}}function uD(e,t){return t()}var hD=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?uD:dD;N1.useSyncExternalStore=Oi.useSyncExternalStore!==void 0?Oi.useSyncExternalStore:hD;j1.exports=N1;var fD=j1.exports;/**
76
- * @license React
77
- * use-sync-external-store-shim/with-selector.production.js
78
- *
79
- * Copyright (c) Meta Platforms, Inc. and affiliates.
80
- *
81
- * This source code is licensed under the MIT license found in the
82
- * LICENSE file in the root directory of this source tree.
83
- */var gu=m,mD=fD;function pD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xD=typeof Object.is=="function"?Object.is:pD,gD=mD.useSyncExternalStore,vD=gu.useRef,wD=gu.useEffect,yD=gu.useMemo,bD=gu.useDebugValue;b1.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var i=vD(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=yD(function(){function c(p){if(!d){if(d=!0,h=p,p=r(p),a!==void 0&&o.hasValue){var w=o.value;if(a(w,p))return u=w}return u=p}if(w=u,xD(h,p))return w;var v=r(p);return a!==void 0&&a(w,v)?(h=p,w):(h=p,u=v)}var d=!1,h,u,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,r,a]);var l=gD(e,i[0],i[1]);return wD(function(){o.hasValue=!0,o.value=l},[l]),bD(l),l};y1.exports=b1;var jD=y1.exports;const ND=Em(jD),kD={},p0=e=>{let t;const n=new Set,r=(h,u)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(w=>w(t,p))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(kD?"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()}},d=t=e(r,a,c);return c},SD=e=>e?p0(e):p0,{useDebugValue:CD}=Z,{useSyncExternalStoreWithSelector:ED}=ND,MD=e=>e;function k1(e,t=MD,n){const r=ED(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return CD(r),r}const x0=(e,t)=>{const n=SD(e),r=(a,i=t)=>k1(n,a,i);return Object.assign(r,n),r},DD=(e,t)=>e?x0(e,t):x0;function gt(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[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const vu=m.createContext(null),_D=vu.Provider,S1=Er.error001();function Ue(e,t){const n=m.useContext(vu);if(n===null)throw new Error(S1);return k1(n,e,t)}function ct(){const e=m.useContext(vu);if(e===null)throw new Error(S1);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const g0={display:"none"},PD={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},C1="react-flow__node-desc",E1="react-flow__edge-desc",TD="react-flow__aria-live",OD=e=>e.ariaLiveMessage,AD=e=>e.ariaLabelConfig;function zD({rfId:e}){const t=Ue(OD);return s.jsx("div",{id:`${TD}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:PD,children:t})}function $D({rfId:e,disableKeyboardA11y:t}){const n=Ue(AD);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:`${C1}-${e}`,style:g0,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),s.jsx("div",{id:`${E1}-${e}`,style:g0,children:n["edge.a11yDescription.default"]}),!t&&s.jsx(zD,{rfId:e})]})}const wu=m.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},i)=>{const o=`${e}`.split("-");return s.jsx("div",{className:kt(["react-flow__panel",n,...o]),style:r,ref:i,...a,children:t})});wu.displayName="Panel";function RD({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:s.jsx(wu,{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:s.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ID=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},mc=e=>e.id;function LD(e,t){return gt(e.selectedNodes.map(mc),t.selectedNodes.map(mc))&&gt(e.selectedEdges.map(mc),t.selectedEdges.map(mc))}function FD({onSelectionChange:e}){const t=ct(),{selectedNodes:n,selectedEdges:r}=Ue(ID,LD);return m.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(i=>i(a))},[n,r,e]),null}const UD=e=>!!e.onSelectionChangeHandlers;function BD({onSelectionChange:e}){const t=Ue(UD);return e||t?s.jsx(FD,{onSelectionChange:e}):null}const M1=[0,0],WD={x:0,y:0,zoom:1},HD=["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","paneClickDistance","ariaLabelConfig"],v0=[...HD,"rfId"],VD=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,setPaneClickDistance:e.setPaneClickDistance}),w0={translateExtent:rl,nodeOrigin:M1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function YD(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:i,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=Ue(VD,gt),h=ct();m.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=w0,l()}),[]);const u=m.useRef(w0);return m.useEffect(()=>{for(const f of v0){const p=e[f],w=u.current[f];p!==w&&(typeof e[f]>"u"||(f==="nodes"?t(p):f==="edges"?n(p):f==="minZoom"?r(p):f==="maxZoom"?a(p):f==="translateExtent"?i(p):f==="nodeExtent"?o(p):f==="paneClickDistance"?d(p):f==="ariaLabelConfig"?h.setState({ariaLabelConfig:pM(p)}):f==="fitView"?h.setState({fitViewQueued:p}):f==="fitViewOptions"?h.setState({fitViewOptions:p}):h.setState({[f]:p})))}u.current=e},v0.map(f=>e[f])),null}function y0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function XD(e){var r;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const a=y0(),i=()=>n(a!=null&&a.matches?"dark":"light");return i(),a==null||a.addEventListener("change",i),()=>{a==null||a.removeEventListener("change",i)}},[e]),t!==null?t:(r=y0())!=null&&r.matches?"dark":"light"}const b0=typeof document<"u"?document:null;function ll(e=null,t={target:b0,actInsideInputWithModifier:!0}){const[n,r]=m.useState(!1),a=m.useRef(!1),i=m.useRef(new Set([])),[o,l]=m.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(u=>typeof u=="string").map(u=>u.replace("+",`
84
- `).replace(`
85
-
86
- `,`
87
- +`).split(`
88
- `)),h=d.reduce((u,f)=>u.concat(...f),[]);return[d,h]}return[[],[]]},[e]);return m.useEffect(()=>{const c=(t==null?void 0:t.target)??b0,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=p=>{var j,g;if(a.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!a.current||a.current&&!d)&&r1(p))return!1;const v=N0(p.code,l);if(i.current.add(p[v]),j0(o,i.current,!1)){const y=((g=(j=p.composedPath)==null?void 0:j.call(p))==null?void 0:g[0])||p.target,x=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(a.current||!x)&&p.preventDefault(),r(!0)}},u=p=>{const w=N0(p.code,l);j0(o,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[w]),p.key==="Meta"&&i.current.clear(),a.current=!1},f=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",u),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",u),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function j0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function N0(e,t){return t.includes(e)?"code":"key"}const qD=()=>{const e=ct();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:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,i],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:i,maxZoom:o,panZoom:l}=e.getState(),c=$p(t,r,a,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:r,snapGrid:a,snapToGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),d={x:t.x-l,y:t.y-c},h=n.snapGrid??a,u=n.snapToGrid??i;return Sl(d,r,u,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:i}=r.getBoundingClientRect(),o=Td(t,n);return{x:o.x+a,y:o.y+i}}}),[])};function D1(e,t){const n=[],r=new Map,a=[];for(const i of e)if(i.type==="add"){a.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const o=r.get(i.id);o?o.push(i):r.set(i.id,[i])}for(const i of t){const o=r.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)GD(c,l);n.push(l)}return a.length&&a.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function GD(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 _1(e,t){return D1(e,t)}function P1(e,t){return D1(e,t)}function Gs(e,t){return{id:e,type:"select",selected:t}}function oi(e,t=new Set,n=!1){const r=[];for(const[a,i]of e){const o=t.has(a);!(i.selected===void 0&&!o)&&i.selected!==o&&(n&&(i.selected=o),r.push(Gs(i.id,o)))}return r}function k0({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,o]of e.entries()){const l=t.get(o.id),c=((a=l==null?void 0:l.internals)==null?void 0:a.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)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function S0(e){return{id:e.id,type:"remove"}}const C0=e=>aM(e),KD=e=>Gb(e);function T1(e){return m.forwardRef(e)}const QD=typeof window<"u"?m.useLayoutEffect:m.useEffect;function E0(e){const[t,n]=m.useState(BigInt(0)),[r]=m.useState(()=>ZD(()=>n(a=>a+BigInt(1))));return QD(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function ZD(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const O1=m.createContext(null);function JD({children:e}){const t=ct(),n=m.useCallback(l=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:h,onNodesChange:u,nodeLookup:f,fitViewQueued:p}=t.getState();let w=c;for(const j of l)w=typeof j=="function"?j(w):j;const v=k0({items:w,lookup:f});h&&d(w),v.length>0?u==null||u(v):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:j,nodes:g,setNodes:y}=t.getState();j&&y(g)})},[]),r=E0(n),a=m.useCallback(l=>{const{edges:c=[],setEdges:d,hasDefaultEdges:h,onEdgesChange:u,edgeLookup:f}=t.getState();let p=c;for(const w of l)p=typeof w=="function"?w(p):w;h?d(p):u&&u(k0({items:p,lookup:f}))},[]),i=E0(a),o=m.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return s.jsx(O1.Provider,{value:o,children:e})}function e_(){const e=m.useContext(O1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const t_=e=>!!e.panZoom;function Bp(){const e=qD(),t=ct(),n=e_(),r=Ue(t_),a=m.useMemo(()=>{const i=u=>t.getState().nodeLookup.get(u),o=u=>{n.nodeQueue.push(u)},l=u=>{n.edgeQueue.push(u)},c=u=>{var g,y;const{nodeLookup:f,nodeOrigin:p}=t.getState(),w=C0(u)?u:f.get(u.id),v=w.parentId?t1(w.position,w.measured,w.parentId,f,p):w.position,j={...w,position:v,width:((g=w.measured)==null?void 0:g.width)??w.width,height:((y=w.measured)==null?void 0:y.height)??w.height};return _i(j)},d=(u,f,p={replace:!1})=>{o(w=>w.map(v=>{if(v.id===u){const j=typeof f=="function"?f(v):f;return p.replace&&C0(j)?j:{...v,...j}}return v}))},h=(u,f,p={replace:!1})=>{l(w=>w.map(v=>{if(v.id===u){const j=typeof f=="function"?f(v):f;return p.replace&&KD(j)?j:{...v,...j}}return v}))};return{getNodes:()=>t.getState().nodes.map(u=>({...u})),getNode:u=>{var f;return(f=i(u))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:u=[]}=t.getState();return u.map(f=>({...f}))},getEdge:u=>t.getState().edgeLookup.get(u),setNodes:o,setEdges:l,addNodes:u=>{const f=Array.isArray(u)?u:[u];n.nodeQueue.push(p=>[...p,...f])},addEdges:u=>{const f=Array.isArray(u)?u:[u];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:u=[],edges:f=[],transform:p}=t.getState(),[w,v,j]=p;return{nodes:u.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:w,y:v,zoom:j}}},deleteElements:async({nodes:u=[],edges:f=[]})=>{const{nodes:p,edges:w,onNodesDelete:v,onEdgesDelete:j,triggerNodeChanges:g,triggerEdgeChanges:y,onDelete:x,onBeforeDelete:b}=t.getState(),{nodes:N,edges:k}=await dM({nodesToRemove:u,edgesToRemove:f,nodes:p,edges:w,onBeforeDelete:b}),S=k.length>0,M=N.length>0;if(S){const O=k.map(S0);j==null||j(k),y(O)}if(M){const O=N.map(S0);v==null||v(N),g(O)}return(M||S)&&(x==null||x({nodes:N,edges:k})),{deletedNodes:N,deletedEdges:k}},getIntersectingNodes:(u,f=!0,p)=>{const w=r0(u),v=w?u:c(u),j=p!==void 0;return v?(p||t.getState().nodes).filter(g=>{const y=t.getState().nodeLookup.get(g.id);if(y&&!w&&(g.id===u.id||!y.internals.positionAbsolute))return!1;const x=_i(j?g:y),b=al(x,v);return f&&b>0||b>=x.width*x.height||b>=v.width*v.height}):[]},isNodeIntersecting:(u,f,p=!0)=>{const v=r0(u)?u:c(u);if(!v)return!1;const j=al(v,f);return p&&j>0||j>=f.width*f.height||j>=v.width*v.height},updateNode:d,updateNodeData:(u,f,p={replace:!1})=>{d(u,w=>{const v=typeof f=="function"?f(w):f;return p.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},p)},updateEdge:h,updateEdgeData:(u,f,p={replace:!1})=>{h(u,w=>{const v=typeof f=="function"?f(w):f;return p.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},p)},getNodesBounds:u=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return iM(u,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:u,id:f,nodeId:p})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${p}-${u}${f?`-${f}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:u,handleId:f,nodeId:p})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${p}${u?f?`-${u}-${f}`:`-${u}`:""}`))==null?void 0:w.values())??[])},fitView:async u=>{const f=t.getState().fitViewResolver??mM();return t.setState({fitViewQueued:!0,fitViewOptions:u,fitViewResolver:f}),n.nodeQueue.push(p=>[...p]),f.promise}}},[]);return m.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const M0=e=>e.selected,n_=typeof window<"u"?window:void 0;function r_({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ct(),{deleteElements:r}=Bp(),a=ll(e,{actInsideInputWithModifier:!1}),i=ll(t,{target:n_});m.useEffect(()=>{if(a){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(M0),edges:o.filter(M0)}),n.setState({nodesSelectionActive:!1})}},[a]),m.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function s_(e){const t=ct();m.useEffect(()=>{const n=()=>{var a,i,o,l;if(!e.current||!(((i=(a=e.current).checkVisibility)==null?void 0:i.call(a))??!0))return!1;const r=Rp(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Er.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const yu={position:"absolute",width:"100%",height:"100%",top:0,left:0},a_=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function i_({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:i=ca.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:d,minZoom:h,maxZoom:u,zoomActivationKeyCode:f,preventScrolling:p=!0,children:w,noWheelClassName:v,noPanClassName:j,onViewportChange:g,isControlledViewport:y,paneClickDistance:x}){const b=ct(),N=m.useRef(null),{userSelectionActive:k,lib:S,connectionInProgress:M}=Ue(a_,gt),O=ll(f),I=m.useRef();s_(N);const B=m.useCallback(z=>{g==null||g({x:z[0],y:z[1],zoom:z[2]}),y||b.setState({transform:z})},[g,y]);return m.useEffect(()=>{if(N.current){I.current=KM({domNode:N.current,minZoom:h,maxZoom:u,translateExtent:d,viewport:c,paneClickDistance:x,onDraggingChange:A=>b.setState({paneDragging:A}),onPanZoomStart:(A,_)=>{const{onViewportChangeStart:P,onMoveStart:E}=b.getState();E==null||E(A,_),P==null||P(_)},onPanZoom:(A,_)=>{const{onViewportChange:P,onMove:E}=b.getState();E==null||E(A,_),P==null||P(_)},onPanZoomEnd:(A,_)=>{const{onViewportChangeEnd:P,onMoveEnd:E}=b.getState();E==null||E(A,_),P==null||P(_)}});const{x:z,y:L,zoom:C}=I.current.getViewport();return b.setState({panZoom:I.current,transform:[z,L,C],domNode:N.current.closest(".react-flow")}),()=>{var A;(A=I.current)==null||A.destroy()}}},[]),m.useEffect(()=>{var z;(z=I.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:O,preventScrolling:p,noPanClassName:j,userSelectionActive:k,noWheelClassName:v,lib:S,onTransformChange:B,connectionInProgress:M})},[e,t,n,r,a,i,o,l,O,p,j,k,v,S,B,M]),s.jsx("div",{className:"react-flow__renderer",ref:N,style:yu,children:w})}const o_=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function l_(){const{userSelectionActive:e,userSelectionRect:t}=Ue(o_,gt);return e&&t?s.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 Eh=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},c_=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function d_({isSelecting:e,selectionKeyPressed:t,selectionMode:n=sl.Full,panOnDrag:r,selectionOnDrag:a,onSelectionStart:i,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:h,onPaneMouseMove:u,onPaneMouseLeave:f,children:p}){const w=ct(),{userSelectionActive:v,elementsSelectable:j,dragging:g,connectionInProgress:y}=Ue(c_,gt),x=j&&(e||v),b=m.useRef(null),N=m.useRef(),k=m.useRef(new Set),S=m.useRef(new Set),M=m.useRef(!1),O=m.useRef(!1),I=P=>{if(M.current||y){M.current=!1;return}l==null||l(P),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},B=P=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){P.preventDefault();return}c==null||c(P)},z=d?P=>d(P):void 0,L=P=>{var T,U;const{resetSelectedElements:E,domNode:D}=w.getState();if(N.current=D==null?void 0:D.getBoundingClientRect(),!j||!e||P.button!==0||P.target!==b.current||!N.current)return;(U=(T=P.target)==null?void 0:T.setPointerCapture)==null||U.call(T,P.pointerId),O.current=!0,M.current=!1;const{x:$,y:H}=er(P.nativeEvent,N.current);E(),w.setState({userSelectionRect:{width:0,height:0,startX:$,startY:H,x:$,y:H}}),i==null||i(P)},C=P=>{const{userSelectionRect:E,transform:D,nodeLookup:$,edgeLookup:H,connectionLookup:T,triggerNodeChanges:U,triggerEdgeChanges:G,defaultEdgeOptions:Q}=w.getState();if(!N.current||!E)return;M.current=!0;const{x:re,y:ne}=er(P.nativeEvent,N.current),{startX:J,startY:R}=E,ee={startX:J,startY:R,x:re<J?re:J,y:ne<R?ne:R,width:Math.abs(re-J),height:Math.abs(ne-R)},F=k.current,V=S.current;k.current=new Set(zp($,ee,D,n===sl.Partial,!0).map(ie=>ie.id)),S.current=new Set;const K=(Q==null?void 0:Q.selectable)??!0;for(const ie of k.current){const ce=T.get(ie);if(ce)for(const{edgeId:pe}of ce.values()){const ke=H.get(pe);ke&&(ke.selectable??K)&&S.current.add(pe)}}if(!s0(F,k.current)){const ie=oi($,k.current,!0);U(ie)}if(!s0(V,S.current)){const ie=oi(H,S.current);G(ie)}w.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},A=P=>{var D,$;if(P.button!==0||!O.current)return;($=(D=P.target)==null?void 0:D.releasePointerCapture)==null||$.call(D,P.pointerId);const{userSelectionRect:E}=w.getState();!v&&E&&P.target===b.current&&(I==null||I(P)),w.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),o==null||o(P),(t||a)&&(M.current=!1),O.current=!1},_=r===!0||Array.isArray(r)&&r.includes(0);return s.jsxs("div",{className:kt(["react-flow__pane",{draggable:_,dragging:g,selection:e}]),onClick:x?void 0:Eh(I,b),onContextMenu:Eh(B,b),onWheel:Eh(z,b),onPointerEnter:x?void 0:h,onPointerDown:x?L:u,onPointerMove:x?C:u,onPointerUp:x?A:void 0,onPointerLeave:f,ref:b,style:yu,children:[p,s.jsx(l_,{})]})}function um({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),d=l.get(e);if(!d){c==null||c("012",Er.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&o)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):a([e])}function A1({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:i,nodeClickDistance:o}){const l=ct(),[c,d]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=zM({getStoreItems:()=>l.getState(),onNodeMouseDown:u=>{um({id:u,store:l,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),m.useEffect(()=>{var u,f;if(t)(u=h.current)==null||u.destroy();else if(e.current)return(f=h.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:a,nodeClickDistance:o}),()=>{var p;(p=h.current)==null||p.destroy()}},[n,r,t,i,e,a]),c}const u_=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function z1(){const e=ct();return m.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:i,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:d,nodeOrigin:h}=e.getState(),u=new Map,f=u_(o),p=a?i[0]:5,w=a?i[1]:5,v=n.direction.x*p*n.factor,j=n.direction.y*w*n.factor;for(const[,g]of d){if(!f(g))continue;let y={x:g.internals.positionAbsolute.x+v,y:g.internals.positionAbsolute.y+j};a&&(y=kl(y,i));const{position:x,positionAbsolute:b}=Kb({nodeId:g.id,nextPosition:y,nodeLookup:d,nodeExtent:r,nodeOrigin:h,onError:l});g.position=x,g.internals.positionAbsolute=b,u.set(g.id,g)}c(u)},[])}const Wp=m.createContext(null),h_=Wp.Provider;Wp.Consumer;const $1=()=>m.useContext(Wp),f_=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),m_=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:i,connection:o}=r,{fromHandle:l,toHandle:c,isValid:d}=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:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:i===Mi.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:!!a,valid:h&&d}};function p_({type:e="source",position:t=Ne.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:o,onConnect:l,children:c,className:d,onMouseDown:h,onTouchStart:u,...f},p){var A,_;const w=o||null,v=e==="target",j=ct(),g=$1(),{connectOnClick:y,noPanClassName:x,rfId:b}=Ue(f_,gt),{connectingFrom:N,connectingTo:k,clickConnecting:S,isPossibleEndHandle:M,connectionInProcess:O,clickConnectionInProcess:I,valid:B}=Ue(m_(g,w,e),gt);g||(_=(A=j.getState()).onError)==null||_.call(A,"010",Er.error010());const z=P=>{const{defaultEdgeOptions:E,onConnect:D,hasDefaultEdges:$}=j.getState(),H={...E,...P};if($){const{edges:T,setEdges:U}=j.getState();U(l1(H,T))}D==null||D(H),l==null||l(H)},L=P=>{if(!g)return;const E=s1(P.nativeEvent);if(a&&(E&&P.button===0||!E)){const D=j.getState();dm.onPointerDown(P.nativeEvent,{handleDomNode:P.currentTarget,autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:v,handleId:w,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(P):u==null||u(P)},C=P=>{const{onClickConnectStart:E,onClickConnectEnd:D,connectionClickStartHandle:$,connectionMode:H,isValidConnection:T,lib:U,rfId:G,nodeLookup:Q,connection:re}=j.getState();if(!g||!$&&!a)return;if(!$){E==null||E(P.nativeEvent,{nodeId:g,handleId:w,handleType:e}),j.setState({connectionClickStartHandle:{nodeId:g,type:e,id:w}});return}const ne=n1(P.target),J=n||T,{connection:R,isValid:ee}=dm.isValid(P.nativeEvent,{handle:{nodeId:g,id:w,type:e},connectionMode:H,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:J,flowId:G,doc:ne,lib:U,nodeLookup:Q});ee&&R&&z(R);const F=structuredClone(re);delete F.inProgress,F.toPosition=F.toHandle?F.toHandle.position:null,D==null||D(P,F),j.setState({connectionClickStartHandle:null})};return s.jsx("div",{"data-handleid":w,"data-nodeid":g,"data-handlepos":t,"data-id":`${b}-${g}-${w}-${e}`,className:kt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,d,{source:!v,target:v,connectable:r,connectablestart:a,connectableend:i,clickconnecting:S,connectingfrom:N,connectingto:k,valid:B,connectionindicator:r&&(!O||M)&&(O||I?i:a)}]),onMouseDown:L,onTouchStart:L,onClick:y?C:void 0,ref:p,...f,children:c})}const da=m.memo(T1(p_));function x_({data:e,isConnectable:t,sourcePosition:n=Ne.Bottom}){return s.jsxs(s.Fragment,{children:[e==null?void 0:e.label,s.jsx(da,{type:"source",position:n,isConnectable:t})]})}function g_({data:e,isConnectable:t,targetPosition:n=Ne.Top,sourcePosition:r=Ne.Bottom}){return s.jsxs(s.Fragment,{children:[s.jsx(da,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,s.jsx(da,{type:"source",position:r,isConnectable:t})]})}function v_(){return null}function w_({data:e,isConnectable:t,targetPosition:n=Ne.Top}){return s.jsxs(s.Fragment,{children:[s.jsx(da,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Od={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},D0={input:x_,default:g_,output:w_,group:v_};function y_(e){var t,n,r,a;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??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const b_=e=>{const{width:t,height:n,x:r,y:a}=Nl(e.nodeLookup,{filter:i=>!!i.selected});return{width:Jn(t)?t:null,height:Jn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function j_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ct(),{width:a,height:i,transformString:o,userSelectionActive:l}=Ue(b_,gt),c=z1(),d=m.useRef(null);if(m.useEffect(()=>{var f;n||(f=d.current)==null||f.focus({preventScroll:!0})},[n]),A1({nodeRef:d}),l||!a||!i)return null;const h=e?f=>{const p=r.getState().nodes.filter(w=>w.selected);e(f,p)}:void 0,u=f=>{Object.prototype.hasOwnProperty.call(Od,f.key)&&(f.preventDefault(),c({direction:Od[f.key],factor:f.shiftKey?4:1}))};return s.jsx("div",{className:kt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:s.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:u,style:{width:a,height:i}})})}const _0=typeof window<"u"?window:void 0,N_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function R1({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:h,selectionMode:u,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:w,panActivationKeyCode:v,zoomActivationKeyCode:j,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:x,panOnScroll:b,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:M,defaultViewport:O,translateExtent:I,minZoom:B,maxZoom:z,preventScrolling:L,onSelectionContextMenu:C,noWheelClassName:A,noPanClassName:_,disableKeyboardA11y:P,onViewportChange:E,isControlledViewport:D}){const{nodesSelectionActive:$,userSelectionActive:H}=Ue(N_),T=ll(d,{target:_0}),U=ll(v,{target:_0}),G=U||M,Q=U||b,re=h&&G!==!0,ne=T||H||re;return r_({deleteKeyCode:c,multiSelectionKeyCode:w}),s.jsx(i_,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:x,panOnScroll:Q,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:!T&&G,defaultViewport:O,translateExtent:I,minZoom:B,maxZoom:z,zoomActivationKeyCode:j,preventScrolling:L,noWheelClassName:A,noPanClassName:_,onViewportChange:E,isControlledViewport:D,paneClickDistance:l,children:s.jsxs(d_,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:o,panOnDrag:G,isSelecting:!!ne,selectionMode:u,selectionKeyPressed:T,selectionOnDrag:re,children:[e,$&&s.jsx(j_,{onSelectionContextMenu:C,noPanClassName:_,disableKeyboardA11y:P})]})})}R1.displayName="FlowRenderer";const k_=m.memo(R1),S_=e=>t=>e?zp(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 C_(e){return Ue(m.useCallback(S_(e),[e]),gt)}const E_=e=>e.updateNodeInternals;function M_(){const e=Ue(E_),[t]=m.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const i=a.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:a.target,force:!0})}),e(r)}));return m.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function D_({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=ct(),i=m.useRef(null),o=m.useRef(null),l=m.useRef(e.sourcePosition),c=m.useRef(e.targetPosition),d=m.useRef(t),h=n&&!!e.internals.handleBounds;return m.useEffect(()=>{i.current&&!e.hidden&&(!h||o.current!==i.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(i.current),o.current=i.current)},[h,e.hidden]),m.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),m.useEffect(()=>{if(i.current){const u=d.current!==t,f=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(u||f||p)&&(d.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function __({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:i,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:d,nodesFocusable:h,resizeObserver:u,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:w,rfId:v,nodeTypes:j,nodeClickDistance:g,onError:y}){const{node:x,internals:b,isParent:N}=Ue(J=>{const R=J.nodeLookup.get(e),ee=J.parentLookup.has(e);return{node:R,internals:R.internals,isParent:ee}},gt);let k=x.type||"default",S=(j==null?void 0:j[k])||D0[k];S===void 0&&(y==null||y("003",Er.error003(k)),k="default",S=(j==null?void 0:j.default)||D0.default);const M=!!(x.draggable||l&&typeof x.draggable>"u"),O=!!(x.selectable||c&&typeof x.selectable>"u"),I=!!(x.connectable||d&&typeof x.connectable>"u"),B=!!(x.focusable||h&&typeof x.focusable>"u"),z=ct(),L=e1(x),C=D_({node:x,nodeType:k,hasDimensions:L,resizeObserver:u}),A=A1({nodeRef:C,disabled:x.hidden||!M,noDragClassName:f,handleSelector:x.dragHandle,nodeId:e,isSelectable:O,nodeClickDistance:g}),_=z1();if(x.hidden)return null;const P=rs(x),E=y_(x),D=O||M||t||n||r||a,$=n?J=>n(J,{...b.userNode}):void 0,H=r?J=>r(J,{...b.userNode}):void 0,T=a?J=>a(J,{...b.userNode}):void 0,U=i?J=>i(J,{...b.userNode}):void 0,G=o?J=>o(J,{...b.userNode}):void 0,Q=J=>{const{selectNodesOnDrag:R,nodeDragThreshold:ee}=z.getState();O&&(!R||!M||ee>0)&&um({id:e,store:z,nodeRef:C}),t&&t(J,{...b.userNode})},re=J=>{if(!(r1(J.nativeEvent)||w)){if(Vb.includes(J.key)&&O){const R=J.key==="Escape";um({id:e,store:z,unselect:R,nodeRef:C})}else if(M&&x.selected&&Object.prototype.hasOwnProperty.call(Od,J.key)){J.preventDefault();const{ariaLabelConfig:R}=z.getState();z.setState({ariaLiveMessage:R["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),_({direction:Od[J.key],factor:J.shiftKey?4:1})}}},ne=()=>{var ie;if(w||!((ie=C.current)!=null&&ie.matches(":focus-visible")))return;const{transform:J,width:R,height:ee,autoPanOnNodeFocus:F,setCenter:V}=z.getState();if(!F)return;zp(new Map([[e,x]]),{x:0,y:0,width:R,height:ee},J,!0).length>0||V(x.position.x+P.width/2,x.position.y+P.height/2,{zoom:J[2]})};return s.jsx("div",{className:kt(["react-flow__node",`react-flow__node-${k}`,{[p]:M},x.className,{selected:x.selected,selectable:O,parent:N,draggable:M,dragging:A}]),ref:C,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:L?"visible":"hidden",...x.style,...E},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:$,onMouseMove:H,onMouseLeave:T,onContextMenu:U,onClick:Q,onDoubleClick:G,onKeyDown:B?re:void 0,tabIndex:B?0:void 0,onFocus:B?ne:void 0,role:x.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${C1}-${v}`,"aria-label":x.ariaLabel,...x.domAttributes,children:s.jsx(h_,{value:e,children:s.jsx(S,{id:e,data:x.data,type:k,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:x.selected??!1,selectable:O,draggable:M,deletable:x.deletable??!0,isConnectable:I,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:A,dragHandle:x.dragHandle,zIndex:b.z,parentId:x.parentId,...P})})})}const P_=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function I1(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:i}=Ue(P_,gt),o=C_(e.onlyRenderVisibleElements),l=M_();return s.jsx("div",{className:"react-flow__nodes",style:yu,children:o.map(c=>s.jsx(__,{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:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}I1.displayName="NodeRenderer";const T_=m.memo(I1);function O_(e){return Ue(m.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const i=n.nodeLookup.get(a.source),o=n.nodeLookup.get(a.target);i&&o&&vM({sourceNode:i,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),gt)}const A_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return s.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},z_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return s.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},P0={[_d.Arrow]:A_,[_d.ArrowClosed]:z_};function $_(e){const t=ct();return m.useMemo(()=>{var a,i;return Object.prototype.hasOwnProperty.call(P0,e)?P0[e]:((i=(a=t.getState()).onError)==null||i.call(a,"009",Er.error009(e)),null)},[e])}const R_=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=$_(t);return c?s.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:s.jsx(c,{color:n,strokeWidth:o})}):null},L1=({defaultColor:e,rfId:t})=>{const n=Ue(i=>i.edges),r=Ue(i=>i.defaultEdgeOptions),a=m.useMemo(()=>SM(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?s.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:s.jsx("defs",{children:a.map(i=>s.jsx(R_,{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};L1.displayName="MarkerDefinitions";var I_=m.memo(L1);function F1({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:i,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:d,...h}){const[u,f]=m.useState({x:1,y:0,width:0,height:0}),p=kt(["react-flow__edge-textwrapper",d]),w=m.useRef(null);return m.useEffect(()=>{if(w.current){const v=w.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?s.jsxs("g",{transform:`translate(${e-u.width/2} ${t-u.height/2})`,className:p,visibility:u.width?"visible":"hidden",...h,children:[a&&s.jsx("rect",{width:u.width+2*o[0],x:-o[0],y:-o[1],height:u.height+2*o[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),s.jsx("text",{className:"react-flow__edge-text",y:u.height/2,dy:"0.3em",ref:w,style:r,children:n}),c]}):null}F1.displayName="EdgeText";const L_=m.memo(F1);function bu({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:d=20,...h}){return s.jsxs(s.Fragment,{children:[s.jsx("path",{...h,d:e,fill:"none",className:kt(["react-flow__edge-path",h.className])}),d?s.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&Jn(t)&&Jn(n)?s.jsx(L_,{x:t,y:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function T0({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Ne.Left||e===Ne.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function U1({sourceX:e,sourceY:t,sourcePosition:n=Ne.Bottom,targetX:r,targetY:a,targetPosition:i=Ne.Top}){const[o,l]=T0({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,d]=T0({pos:i,x1:r,y1:a,x2:e,y2:t}),[h,u,f,p]=a1({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${o},${l} ${c},${d} ${r},${a}`,h,u,f,p]}function B1(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:o,targetPosition:l,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:j,interactionWidth:g})=>{const[y,x,b]=U1({sourceX:n,sourceY:r,sourcePosition:o,targetX:a,targetY:i,targetPosition:l}),N=e.isInternal?void 0:t;return s.jsx(bu,{id:N,path:y,labelX:x,labelY:b,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:j,interactionWidth:g})})}const F_=B1({isInternal:!1}),W1=B1({isInternal:!0});F_.displayName="SimpleBezierEdge";W1.displayName="SimpleBezierEdgeInternal";function H1(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:u,style:f,sourcePosition:p=Ne.Bottom,targetPosition:w=Ne.Top,markerEnd:v,markerStart:j,pathOptions:g,interactionWidth:y})=>{const[x,b,N]=om({sourceX:n,sourceY:r,sourcePosition:p,targetX:a,targetY:i,targetPosition:w,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),k=e.isInternal?void 0:t;return s.jsx(bu,{id:k,path:x,labelX:b,labelY:N,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:u,style:f,markerEnd:v,markerStart:j,interactionWidth:y})})}const V1=H1({isInternal:!1}),Y1=H1({isInternal:!0});V1.displayName="SmoothStepEdge";Y1.displayName="SmoothStepEdgeInternal";function X1(e){return m.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return s.jsx(V1,{...n,id:r,pathOptions:m.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const U_=X1({isInternal:!1}),q1=X1({isInternal:!0});U_.displayName="StepEdge";q1.displayName="StepEdgeInternal";function G1(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:u,style:f,markerEnd:p,markerStart:w,interactionWidth:v})=>{const[j,g,y]=c1({sourceX:n,sourceY:r,targetX:a,targetY:i}),x=e.isInternal?void 0:t;return s.jsx(bu,{id:x,path:j,labelX:g,labelY:y,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:u,style:f,markerEnd:p,markerStart:w,interactionWidth:v})})}const B_=G1({isInternal:!1}),K1=G1({isInternal:!0});B_.displayName="StraightEdge";K1.displayName="StraightEdgeInternal";function Q1(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:o=Ne.Bottom,targetPosition:l=Ne.Top,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:j,pathOptions:g,interactionWidth:y})=>{const[x,b,N]=i1({sourceX:n,sourceY:r,sourcePosition:o,targetX:a,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),k=e.isInternal?void 0:t;return s.jsx(bu,{id:k,path:x,labelX:b,labelY:N,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:j,interactionWidth:y})})}const W_=Q1({isInternal:!1}),Z1=Q1({isInternal:!0});W_.displayName="BezierEdge";Z1.displayName="BezierEdgeInternal";const O0={default:Z1,straight:K1,step:q1,smoothstep:Y1,simplebezier:W1},A0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},H_=(e,t,n)=>n===Ne.Left?e-t:n===Ne.Right?e+t:e,V_=(e,t,n)=>n===Ne.Top?e-t:n===Ne.Bottom?e+t:e,z0="react-flow__edgeupdater";function $0({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:i,onMouseOut:o,type:l}){return s.jsx("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:o,className:kt([z0,`${z0}-${l}`]),cx:H_(t,r,e),cy:V_(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Y_({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:i,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:d,onReconnectStart:h,onReconnectEnd:u,setReconnecting:f,setUpdateHover:p}){const w=ct(),v=(b,N)=>{if(b.button!==0)return;const{autoPanOnConnect:k,domNode:S,isValidConnection:M,connectionMode:O,connectionRadius:I,lib:B,onConnectStart:z,onConnectEnd:L,cancelConnection:C,nodeLookup:A,rfId:_,panBy:P,updateConnection:E}=w.getState(),D=N.type==="target",$=(U,G)=>{f(!1),u==null||u(U,n,N.type,G)},H=U=>d==null?void 0:d(n,U),T=(U,G)=>{f(!0),h==null||h(b,n,N.type),z==null||z(U,G)};dm.onPointerDown(b.nativeEvent,{autoPanOnConnect:k,connectionMode:O,connectionRadius:I,domNode:S,handleId:N.id,nodeId:N.nodeId,nodeLookup:A,isTarget:D,edgeUpdaterType:N.type,lib:B,flowId:_,cancelConnection:C,panBy:P,isValidConnection:M,onConnect:H,onConnectStart:T,onConnectEnd:L,onReconnectEnd:$,updateConnection:E,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:b.currentTarget})},j=b=>v(b,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=b=>v(b,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>p(!0),x=()=>p(!1);return s.jsxs(s.Fragment,{children:[(e===!0||e==="source")&&s.jsx($0,{position:l,centerX:r,centerY:a,radius:t,onMouseDown:j,onMouseEnter:y,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&s.jsx($0,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:g,onMouseEnter:y,onMouseOut:x,type:"target"})]})}function X_({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,reconnectRadius:h,onReconnect:u,onReconnectStart:f,onReconnectEnd:p,rfId:w,edgeTypes:v,noPanClassName:j,onError:g,disableKeyboardA11y:y}){let x=Ue(V=>V.edgeLookup.get(e));const b=Ue(V=>V.defaultEdgeOptions);x=b?{...b,...x}:x;let N=x.type||"default",k=(v==null?void 0:v[N])||O0[N];k===void 0&&(g==null||g("011",Er.error011(N)),N="default",k=(v==null?void 0:v.default)||O0.default);const S=!!(x.focusable||t&&typeof x.focusable>"u"),M=typeof u<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),O=!!(x.selectable||r&&typeof x.selectable>"u"),I=m.useRef(null),[B,z]=m.useState(!1),[L,C]=m.useState(!1),A=ct(),{zIndex:_,sourceX:P,sourceY:E,targetX:D,targetY:$,sourcePosition:H,targetPosition:T}=Ue(m.useCallback(V=>{const K=V.nodeLookup.get(x.source),ie=V.nodeLookup.get(x.target);if(!K||!ie)return{zIndex:x.zIndex,...A0};const ce=kM({id:e,sourceNode:K,targetNode:ie,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:V.connectionMode,onError:g});return{zIndex:gM({selected:x.selected,zIndex:x.zIndex,sourceNode:K,targetNode:ie,elevateOnSelect:V.elevateEdgesOnSelect}),...ce||A0}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),gt),U=m.useMemo(()=>x.markerStart?`url('#${lm(x.markerStart,w)}')`:void 0,[x.markerStart,w]),G=m.useMemo(()=>x.markerEnd?`url('#${lm(x.markerEnd,w)}')`:void 0,[x.markerEnd,w]);if(x.hidden||P===null||E===null||D===null||$===null)return null;const Q=V=>{var pe;const{addSelectedEdges:K,unselectNodesAndEdges:ie,multiSelectionActive:ce}=A.getState();O&&(A.setState({nodesSelectionActive:!1}),x.selected&&ce?(ie({nodes:[],edges:[x]}),(pe=I.current)==null||pe.blur()):K([e])),a&&a(V,x)},re=i?V=>{i(V,{...x})}:void 0,ne=o?V=>{o(V,{...x})}:void 0,J=l?V=>{l(V,{...x})}:void 0,R=c?V=>{c(V,{...x})}:void 0,ee=d?V=>{d(V,{...x})}:void 0,F=V=>{var K;if(!y&&Vb.includes(V.key)&&O){const{unselectNodesAndEdges:ie,addSelectedEdges:ce}=A.getState();V.key==="Escape"?((K=I.current)==null||K.blur(),ie({edges:[x]})):ce([e])}};return s.jsx("svg",{style:{zIndex:_},children:s.jsxs("g",{className:kt(["react-flow__edge",`react-flow__edge-${N}`,x.className,j,{selected:x.selected,animated:x.animated,inactive:!O&&!a,updating:B,selectable:O}]),onClick:Q,onDoubleClick:re,onContextMenu:ne,onMouseEnter:J,onMouseMove:R,onMouseLeave:ee,onKeyDown:S?F:void 0,tabIndex:S?0:void 0,role:x.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":S?`${E1}-${w}`:void 0,ref:I,...x.domAttributes,children:[!L&&s.jsx(k,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:O,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:P,sourceY:E,targetX:D,targetY:$,sourcePosition:H,targetPosition:T,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:U,markerEnd:G,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),M&&s.jsx(Y_,{edge:x,isReconnectable:M,reconnectRadius:h,onReconnect:u,onReconnectStart:f,onReconnectEnd:p,sourceX:P,sourceY:E,targetX:D,targetY:$,sourcePosition:H,targetPosition:T,setUpdateHover:z,setReconnecting:C})]})})}const q_=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function J1({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:i,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:h,reconnectRadius:u,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:w,disableKeyboardA11y:v}){const{edgesFocusable:j,edgesReconnectable:g,elementsSelectable:y,onError:x}=Ue(q_,gt),b=O_(t);return s.jsxs("div",{className:"react-flow__edges",children:[s.jsx(I_,{defaultColor:e,rfId:n}),b.map(N=>s.jsx(X_,{id:N,edgesFocusable:j,edgesReconnectable:g,elementsSelectable:y,noPanClassName:a,onReconnect:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:h,reconnectRadius:u,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:w,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:v},N))]})}J1.displayName="EdgeRenderer";const G_=m.memo(J1),K_=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Q_({children:e}){const t=Ue(K_);return s.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Z_(e){const t=Bp(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const J_=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function eP(e){const t=Ue(J_),n=ct();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function tP(e){return e.connection.inProgress?{...e.connection,to:Sl(e.connection.to,e.transform)}:{...e.connection}}function nP(e){return tP}function rP(e){const t=nP();return Ue(t,gt)}const sP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function aP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:i,height:o,isValid:l,inProgress:c}=Ue(sP,gt);return!(i&&a&&c)?null:s.jsx("svg",{style:e,width:i,height:o,className:"react-flow__connectionline react-flow__container",children:s.jsx("g",{className:kt(["react-flow__connection",qb(l)]),children:s.jsx(ej,{style:t,type:n,CustomComponent:r,isValid:l})})})}const ej=({style:e,type:t=ws.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:i,fromNode:o,fromHandle:l,fromPosition:c,to:d,toNode:h,toHandle:u,toPosition:f}=rP();if(!a)return;if(n)return s.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:f,connectionStatus:qb(r),toNode:h,toHandle:u});let p="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:f};switch(t){case ws.Bezier:[p]=i1(w);break;case ws.SimpleBezier:[p]=U1(w);break;case ws.Step:[p]=om({...w,borderRadius:0});break;case ws.SmoothStep:[p]=om(w);break;default:[p]=c1(w)}return s.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};ej.displayName="ConnectionLine";const iP={};function R0(e=iP){m.useRef(e),ct(),m.useEffect(()=>{},[e])}function oP(){ct(),m.useRef(!1),m.useEffect(()=>{},[])}function tj({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:i,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:h,onSelectionContextMenu:u,onSelectionStart:f,onSelectionEnd:p,connectionLineType:w,connectionLineStyle:v,connectionLineComponent:j,connectionLineContainerStyle:g,selectionKeyCode:y,selectionOnDrag:x,selectionMode:b,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:S,deleteKeyCode:M,onlyRenderVisibleElements:O,elementsSelectable:I,defaultViewport:B,translateExtent:z,minZoom:L,maxZoom:C,preventScrolling:A,defaultMarkerColor:_,zoomOnScroll:P,zoomOnPinch:E,panOnScroll:D,panOnScrollSpeed:$,panOnScrollMode:H,zoomOnDoubleClick:T,panOnDrag:U,onPaneClick:G,onPaneMouseEnter:Q,onPaneMouseMove:re,onPaneMouseLeave:ne,onPaneScroll:J,onPaneContextMenu:R,paneClickDistance:ee,nodeClickDistance:F,onEdgeContextMenu:V,onEdgeMouseEnter:K,onEdgeMouseMove:ie,onEdgeMouseLeave:ce,reconnectRadius:pe,onReconnect:ke,onReconnectStart:Ie,onReconnectEnd:Ce,noDragClassName:tt,noWheelClassName:Je,noPanClassName:Le,disableKeyboardA11y:_e,nodeExtent:Ge,rfId:nt,viewport:ot,onViewportChange:St}){return R0(e),R0(t),oP(),Z_(n),eP(ot),s.jsx(k_,{onPaneClick:G,onPaneMouseEnter:Q,onPaneMouseMove:re,onPaneMouseLeave:ne,onPaneContextMenu:R,onPaneScroll:J,paneClickDistance:ee,deleteKeyCode:M,selectionKeyCode:y,selectionOnDrag:x,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:S,elementsSelectable:I,zoomOnScroll:P,zoomOnPinch:E,zoomOnDoubleClick:T,panOnScroll:D,panOnScrollSpeed:$,panOnScrollMode:H,panOnDrag:U,defaultViewport:B,translateExtent:z,minZoom:L,maxZoom:C,onSelectionContextMenu:u,preventScrolling:A,noDragClassName:tt,noWheelClassName:Je,noPanClassName:Le,disableKeyboardA11y:_e,onViewportChange:St,isControlledViewport:!!ot,children:s.jsxs(Q_,{children:[s.jsx(G_,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:o,onReconnect:ke,onReconnectStart:Ie,onReconnectEnd:Ce,onlyRenderVisibleElements:O,onEdgeContextMenu:V,onEdgeMouseEnter:K,onEdgeMouseMove:ie,onEdgeMouseLeave:ce,reconnectRadius:pe,defaultMarkerColor:_,noPanClassName:Le,disableKeyboardA11y:_e,rfId:nt}),s.jsx(aP,{style:v,type:w,component:j,containerStyle:g}),s.jsx("div",{className:"react-flow__edgelabel-renderer"}),s.jsx(T_,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:h,nodeClickDistance:F,onlyRenderVisibleElements:O,noPanClassName:Le,noDragClassName:tt,disableKeyboardA11y:_e,nodeExtent:Ge,rfId:nt}),s.jsx("div",{className:"react-flow__viewport-portal"})]})})}tj.displayName="GraphView";const lP=m.memo(tj),I0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:d=2,nodeOrigin:h,nodeExtent:u}={})=>{const f=new Map,p=new Map,w=new Map,v=new Map,j=r??t??[],g=n??e??[],y=h??[0,0],x=u??rl;u1(w,v,j);const b=cm(g,f,p,{nodeOrigin:y,nodeExtent:x,elevateNodesOnSelect:!1});let N=[0,0,1];if(o&&a&&i){const k=Nl(f,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:S,y:M,zoom:O}=$p(k,a,i,c,d,(l==null?void 0:l.padding)??.1);N=[S,M,O]}return{rfId:"1",width:a??0,height:i??0,transform:N,nodes:g,nodesInitialized:b,nodeLookup:f,parentLookup:p,edges:j,edgeLookup:v,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:rl,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mi.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:{...Xb},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:uM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Yb}},cP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:h,nodeExtent:u})=>DD((f,p)=>{async function w(){const{nodeLookup:v,panZoom:j,fitViewOptions:g,fitViewResolver:y,width:x,height:b,minZoom:N,maxZoom:k}=p();j&&(await cM({nodes:v,width:x,height:b,panZoom:j,minZoom:N,maxZoom:k},g),y==null||y.resolve(!0),f({fitViewResolver:null}))}return{...I0({nodes:e,edges:t,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:h,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:v=>{const{nodeLookup:j,parentLookup:g,nodeOrigin:y,elevateNodesOnSelect:x,fitViewQueued:b}=p(),N=cm(v,j,g,{nodeOrigin:y,nodeExtent:u,elevateNodesOnSelect:x,checkEquality:!0});b&&N?(w(),f({nodes:v,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:v,nodesInitialized:N})},setEdges:v=>{const{connectionLookup:j,edgeLookup:g}=p();u1(j,g,v),f({edges:v})},setDefaultNodesAndEdges:(v,j)=>{if(v){const{setNodes:g}=p();g(v),f({hasDefaultNodes:!0})}if(j){const{setEdges:g}=p();g(j),f({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:j,nodeLookup:g,parentLookup:y,domNode:x,nodeOrigin:b,nodeExtent:N,debug:k,fitViewQueued:S}=p(),{changes:M,updatedInternals:O}=PM(v,g,y,x,b,N);O&&(EM(g,y,{nodeOrigin:b,nodeExtent:N}),S?(w(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(M==null?void 0:M.length)>0&&(k&&console.log("React Flow: trigger node changes",M),j==null||j(M)))},updateNodePositions:(v,j=!1)=>{const g=[],y=[],{nodeLookup:x,triggerNodeChanges:b}=p();for(const[N,k]of v){const S=x.get(N),M=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(k!=null&&k.position)),O={id:N,type:"position",position:M?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:j};M&&S.parentId&&g.push({id:N,parentId:S.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),y.push(O)}if(g.length>0){const{parentLookup:N,nodeOrigin:k}=p(),S=Up(g,x,N,k);y.push(...S)}b(y)},triggerNodeChanges:v=>{const{onNodesChange:j,setNodes:g,nodes:y,hasDefaultNodes:x,debug:b}=p();if(v!=null&&v.length){if(x){const N=_1(v,y);g(N)}b&&console.log("React Flow: trigger node changes",v),j==null||j(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:j,setEdges:g,edges:y,hasDefaultEdges:x,debug:b}=p();if(v!=null&&v.length){if(x){const N=P1(v,y);g(N)}b&&console.log("React Flow: trigger edge changes",v),j==null||j(v)}},addSelectedNodes:v=>{const{multiSelectionActive:j,edgeLookup:g,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:b}=p();if(j){const N=v.map(k=>Gs(k,!0));x(N);return}x(oi(y,new Set([...v]),!0)),b(oi(g))},addSelectedEdges:v=>{const{multiSelectionActive:j,edgeLookup:g,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:b}=p();if(j){const N=v.map(k=>Gs(k,!0));b(N);return}b(oi(g,new Set([...v]))),x(oi(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:j}={})=>{const{edges:g,nodes:y,nodeLookup:x,triggerNodeChanges:b,triggerEdgeChanges:N}=p(),k=v||y,S=j||g,M=k.map(I=>{const B=x.get(I.id);return B&&(B.selected=!1),Gs(I.id,!1)}),O=S.map(I=>Gs(I.id,!1));b(M),N(O)},setMinZoom:v=>{const{panZoom:j,maxZoom:g}=p();j==null||j.setScaleExtent([v,g]),f({minZoom:v})},setMaxZoom:v=>{const{panZoom:j,minZoom:g}=p();j==null||j.setScaleExtent([g,v]),f({maxZoom:v})},setTranslateExtent:v=>{var j;(j=p().panZoom)==null||j.setTranslateExtent(v),f({translateExtent:v})},setPaneClickDistance:v=>{var j;(j=p().panZoom)==null||j.setClickDistance(v)},resetSelectedElements:()=>{const{edges:v,nodes:j,triggerNodeChanges:g,triggerEdgeChanges:y,elementsSelectable:x}=p();if(!x)return;const b=j.reduce((k,S)=>S.selected?[...k,Gs(S.id,!1)]:k,[]),N=v.reduce((k,S)=>S.selected?[...k,Gs(S.id,!1)]:k,[]);g(b),y(N)},setNodeExtent:v=>{const{nodes:j,nodeLookup:g,parentLookup:y,nodeOrigin:x,elevateNodesOnSelect:b,nodeExtent:N}=p();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(cm(j,g,y,{nodeOrigin:x,nodeExtent:v,elevateNodesOnSelect:b,checkEquality:!1}),f({nodeExtent:v}))},panBy:v=>{const{transform:j,width:g,height:y,panZoom:x,translateExtent:b}=p();return TM({delta:v,panZoom:x,transform:j,translateExtent:b,width:g,height:y})},setCenter:async(v,j,g)=>{const{width:y,height:x,maxZoom:b,panZoom:N}=p();if(!N)return Promise.resolve(!1);const k=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:b;return await N.setViewport({x:y/2-v*k,y:x/2-j*k,zoom:k},{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:{...Xb}})},updateConnection:v=>{f({connection:v})},reset:()=>f({...I0()})}},Object.is);function dP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:i,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:d,nodeOrigin:h,nodeExtent:u,children:f}){const[p]=m.useState(()=>cP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:d,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:h,nodeExtent:u}));return s.jsx(_D,{value:p,children:s.jsx(JD,{children:f})})}function uP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:i,height:o,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:h,nodeOrigin:u,nodeExtent:f}){return m.useContext(vu)?s.jsx(s.Fragment,{children:e}):s.jsx(dP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:i,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:h,nodeOrigin:u,nodeExtent:f,children:e})}const hP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function fP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:i,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:d,onMove:h,onMoveStart:u,onMoveEnd:f,onConnect:p,onConnectStart:w,onConnectEnd:v,onClickConnectStart:j,onClickConnectEnd:g,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:b,onNodeContextMenu:N,onNodeDoubleClick:k,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:O,onNodesDelete:I,onEdgesDelete:B,onDelete:z,onSelectionChange:L,onSelectionDragStart:C,onSelectionDrag:A,onSelectionDragStop:_,onSelectionContextMenu:P,onSelectionStart:E,onSelectionEnd:D,onBeforeDelete:$,connectionMode:H,connectionLineType:T=ws.Bezier,connectionLineStyle:U,connectionLineComponent:G,connectionLineContainerStyle:Q,deleteKeyCode:re="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:J=!1,selectionMode:R=sl.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:F=il()?"Meta":"Control",zoomActivationKeyCode:V=il()?"Meta":"Control",snapToGrid:K,snapGrid:ie,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:pe,nodesDraggable:ke,autoPanOnNodeFocus:Ie,nodesConnectable:Ce,nodesFocusable:tt,nodeOrigin:Je=M1,edgesFocusable:Le,edgesReconnectable:_e,elementsSelectable:Ge=!0,defaultViewport:nt=WD,minZoom:ot=.5,maxZoom:St=2,translateExtent:At=rl,preventScrolling:ae=!0,nodeExtent:me,defaultMarkerColor:Te="#b1b1b7",zoomOnScroll:q=!0,zoomOnPinch:le=!0,panOnScroll:W=!1,panOnScrollSpeed:te=.5,panOnScrollMode:he=ca.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:de,onPaneMouseEnter:De,onPaneMouseMove:Se,onPaneMouseLeave:Fe,onPaneScroll:yt,onPaneContextMenu:ue,paneClickDistance:rt=0,nodeClickDistance:ut=0,children:Ct,onReconnect:un,onReconnectStart:Qe,onReconnectEnd:Ft,onEdgeContextMenu:dr,onEdgeDoubleClick:Xt,onEdgeMouseEnter:zt,onEdgeMouseMove:za,onEdgeMouseLeave:hn,reconnectRadius:Al=10,onNodesChange:$a,onEdgesChange:zl,noDragClassName:Uu="nodrag",noWheelClassName:Ra="nowheel",noPanClassName:Hs="nopan",fitView:Vs,fitViewOptions:Vn,connectOnClick:Ar,attributionPosition:ss,proOptions:Ia,defaultEdgeOptions:$l,elevateNodesOnSelect:vx,elevateEdgesOnSelect:Bu,disableKeyboardA11y:En=!1,autoPanOnConnect:as,autoPanOnNodeDrag:Rl,autoPanSpeed:Il,connectionRadius:Wu,isValidConnection:qi,onError:Ll,style:Fl,id:Ys,nodeDragThreshold:Ul,connectionDragThreshold:se,viewport:fe,onViewportChange:ge,width:Ae,height:Pe,colorMode:ze="light",debug:Me,onScroll:we,ariaLabelConfig:We,...en},$t){const Mn=Ys||"1",Hu=XD(ze),Vu=m.useCallback(Bl=>{Bl.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),we==null||we(Bl)},[we]);return s.jsx("div",{"data-testid":"rf__wrapper",...en,onScroll:Vu,style:{...Fl,...hP},ref:$t,className:kt(["react-flow",a,Hu]),id:Ys,role:"application",children:s.jsxs(uP,{nodes:e,edges:t,width:Ae,height:Pe,fitView:Vs,fitViewOptions:Vn,minZoom:ot,maxZoom:St,nodeOrigin:Je,nodeExtent:me,children:[s.jsx(lP,{onInit:d,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:b,onNodeContextMenu:N,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:o,connectionLineType:T,connectionLineStyle:U,connectionLineComponent:G,connectionLineContainerStyle:Q,selectionKeyCode:ne,selectionOnDrag:J,selectionMode:R,deleteKeyCode:re,multiSelectionKeyCode:F,panActivationKeyCode:ee,zoomActivationKeyCode:V,onlyRenderVisibleElements:ce,defaultViewport:nt,translateExtent:At,minZoom:ot,maxZoom:St,preventScrolling:ae,zoomOnScroll:q,zoomOnPinch:le,zoomOnDoubleClick:ve,panOnScroll:W,panOnScrollSpeed:te,panOnScrollMode:he,panOnDrag:be,onPaneClick:de,onPaneMouseEnter:De,onPaneMouseMove:Se,onPaneMouseLeave:Fe,onPaneScroll:yt,onPaneContextMenu:ue,paneClickDistance:rt,nodeClickDistance:ut,onSelectionContextMenu:P,onSelectionStart:E,onSelectionEnd:D,onReconnect:un,onReconnectStart:Qe,onReconnectEnd:Ft,onEdgeContextMenu:dr,onEdgeDoubleClick:Xt,onEdgeMouseEnter:zt,onEdgeMouseMove:za,onEdgeMouseLeave:hn,reconnectRadius:Al,defaultMarkerColor:Te,noDragClassName:Uu,noWheelClassName:Ra,noPanClassName:Hs,rfId:Mn,disableKeyboardA11y:En,nodeExtent:me,viewport:fe,onViewportChange:ge}),s.jsx(YD,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:w,onConnectEnd:v,onClickConnectStart:j,onClickConnectEnd:g,nodesDraggable:ke,autoPanOnNodeFocus:Ie,nodesConnectable:Ce,nodesFocusable:tt,edgesFocusable:Le,edgesReconnectable:_e,elementsSelectable:Ge,elevateNodesOnSelect:vx,elevateEdgesOnSelect:Bu,minZoom:ot,maxZoom:St,nodeExtent:me,onNodesChange:$a,onEdgesChange:zl,snapToGrid:K,snapGrid:ie,connectionMode:H,translateExtent:At,connectOnClick:Ar,defaultEdgeOptions:$l,fitView:Vs,fitViewOptions:Vn,onNodesDelete:I,onEdgesDelete:B,onDelete:z,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:O,onSelectionDrag:A,onSelectionDragStart:C,onSelectionDragStop:_,onMove:h,onMoveStart:u,onMoveEnd:f,noPanClassName:Hs,nodeOrigin:Je,rfId:Mn,autoPanOnConnect:as,autoPanOnNodeDrag:Rl,autoPanSpeed:Il,onError:Ll,connectionRadius:Wu,isValidConnection:qi,selectNodesOnDrag:pe,nodeDragThreshold:Ul,connectionDragThreshold:se,onBeforeDelete:$,paneClickDistance:rt,debug:Me,ariaLabelConfig:We}),s.jsx(BD,{onSelectionChange:L}),Ct,s.jsx(RD,{proOptions:Ia,position:ss}),s.jsx($D,{rfId:Mn,disableKeyboardA11y:En})]})})}var mP=T1(fP);function pP(e){const[t,n]=m.useState(e),r=m.useCallback(a=>n(i=>_1(a,i)),[]);return[t,n,r]}function xP(e){const[t,n]=m.useState(e),r=m.useCallback(a=>n(i=>P1(a,i)),[]);return[t,n,r]}function gP({dimensions:e,lineWidth:t,variant:n,className:r}){return s.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:kt(["react-flow__background-pattern",n,r])})}function vP({radius:e,className:t}){return s.jsx("circle",{cx:e,cy:e,r:e,className:kt(["react-flow__background-pattern","dots",t])})}var Xr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Xr||(Xr={}));const wP={[Xr.Dots]:1,[Xr.Lines]:1,[Xr.Cross]:6},yP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function nj({id:e,variant:t=Xr.Dots,gap:n=20,size:r,lineWidth:a=1,offset:i=0,color:o,bgColor:l,style:c,className:d,patternClassName:h}){const u=m.useRef(null),{transform:f,patternId:p}=Ue(yP,gt),w=r||wP[t],v=t===Xr.Dots,j=t===Xr.Cross,g=Array.isArray(n)?n:[n,n],y=[g[0]*f[2]||1,g[1]*f[2]||1],x=w*f[2],b=Array.isArray(i)?i:[i,i],N=j?[x,x]:y,k=[b[0]*f[2]||1+N[0]/2,b[1]*f[2]||1+N[1]/2],S=`${p}${e||""}`;return s.jsxs("svg",{className:kt(["react-flow__background",d]),style:{...c,...yu,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:u,"data-testid":"rf__background",children:[s.jsx("pattern",{id:S,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:v?s.jsx(vP,{radius:x/2,className:h}):s.jsx(gP,{dimensions:N,lineWidth:a,variant:t,className:h})}),s.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${S})`})]})}nj.displayName="Background";const bP=m.memo(nj);function jP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:s.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function NP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:s.jsx("path",{d:"M0 0h32v4.2H0z"})})}function kP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:s.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 SP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:s.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 CP(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:s.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 pc({children:e,className:t,...n}){return s.jsx("button",{type:"button",className:kt(["react-flow__controls-button",t]),...n,children:e})}const EP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function rj({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:d,children:h,position:u="bottom-left",orientation:f="vertical","aria-label":p}){const w=ct(),{isInteractive:v,minZoomReached:j,maxZoomReached:g,ariaLabelConfig:y}=Ue(EP,gt),{zoomIn:x,zoomOut:b,fitView:N}=Bp(),k=()=>{x(),i==null||i()},S=()=>{b(),o==null||o()},M=()=>{N(a),l==null||l()},O=()=>{w.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),c==null||c(!v)},I=f==="horizontal"?"horizontal":"vertical";return s.jsxs(wu,{className:kt(["react-flow__controls",I,d]),position:u,style:e,"data-testid":"rf__controls","aria-label":p??y["controls.ariaLabel"],children:[t&&s.jsxs(s.Fragment,{children:[s.jsx(pc,{onClick:k,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:g,children:s.jsx(jP,{})}),s.jsx(pc,{onClick:S,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:j,children:s.jsx(NP,{})})]}),n&&s.jsx(pc,{className:"react-flow__controls-fitview",onClick:M,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:s.jsx(kP,{})}),r&&s.jsx(pc,{className:"react-flow__controls-interactive",onClick:O,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:v?s.jsx(CP,{}):s.jsx(SP,{})}),h]})}rj.displayName="Controls";const MP=m.memo(rj);function DP({id:e,x:t,y:n,width:r,height:a,style:i,color:o,strokeColor:l,strokeWidth:c,className:d,borderRadius:h,shapeRendering:u,selected:f,onClick:p}){const{background:w,backgroundColor:v}=i||{},j=o||w||v;return s.jsx("rect",{className:kt(["react-flow__minimap-node",{selected:f},d]),x:t,y:n,rx:h,ry:h,width:r,height:a,style:{fill:j,stroke:l,strokeWidth:c},shapeRendering:u,onClick:p?g=>p(g,e):void 0})}const _P=m.memo(DP),PP=e=>e.nodes.map(t=>t.id),Mh=e=>e instanceof Function?e:()=>e;function TP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:i=_P,onClick:o}){const l=Ue(PP,gt),c=Mh(t),d=Mh(e),h=Mh(n),u=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return s.jsx(s.Fragment,{children:l.map(f=>s.jsx(AP,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:i,onClick:o,shapeRendering:u},f))})}function OP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:i,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:d,x:h,y:u,width:f,height:p}=Ue(w=>{const{internals:v}=w.nodeLookup.get(e),j=v.userNode,{x:g,y}=v.positionAbsolute,{width:x,height:b}=rs(j);return{node:j,x:g,y,width:x,height:b}},gt);return!d||d.hidden||!e1(d)?null:s.jsx(l,{x:h,y:u,width:f,height:p,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:a,strokeColor:n(d),strokeWidth:i,shapeRendering:o,onClick:c,id:d.id})}const AP=m.memo(OP);var zP=m.memo(TP);const $P=200,RP=150,IP=e=>!e.hidden,LP=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?Jb(Nl(e.nodeLookup,{filter:IP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},FP="react-flow__minimap-desc";function sj({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:d,maskStrokeColor:h,maskStrokeWidth:u,position:f="bottom-right",onClick:p,onNodeClick:w,pannable:v=!1,zoomable:j=!1,ariaLabel:g,inversePan:y,zoomStep:x=1,offsetScale:b=5}){const N=ct(),k=m.useRef(null),{boundingRect:S,viewBB:M,rfId:O,panZoom:I,translateExtent:B,flowWidth:z,flowHeight:L,ariaLabelConfig:C}=Ue(LP,gt),A=(e==null?void 0:e.width)??$P,_=(e==null?void 0:e.height)??RP,P=S.width/A,E=S.height/_,D=Math.max(P,E),$=D*A,H=D*_,T=b*D,U=S.x-($-S.width)/2-T,G=S.y-(H-S.height)/2-T,Q=$+T*2,re=H+T*2,ne=`${FP}-${O}`,J=m.useRef(0),R=m.useRef();J.current=D,m.useEffect(()=>{if(k.current&&I)return R.current=UM({domNode:k.current,panZoom:I,getTransform:()=>N.getState().transform,getViewScale:()=>J.current}),()=>{var K;(K=R.current)==null||K.destroy()}},[I]),m.useEffect(()=>{var K;(K=R.current)==null||K.update({translateExtent:B,width:z,height:L,inversePan:y,pannable:v,zoomStep:x,zoomable:j})},[v,j,y,x,B,z,L]);const ee=p?K=>{var pe;const[ie,ce]=((pe=R.current)==null?void 0:pe.pointer(K))||[0,0];p(K,{x:ie,y:ce})}:void 0,F=w?m.useCallback((K,ie)=>{const ce=N.getState().nodeLookup.get(ie).internals.userNode;w(K,ce)},[]):void 0,V=g??C["minimap.ariaLabel"];return s.jsx(wu,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof u=="number"?u*D:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r: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:kt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:s.jsxs("svg",{width:A,height:_,viewBox:`${U} ${G} ${Q} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:k,onClick:ee,children:[V&&s.jsx("title",{id:ne,children:V}),s.jsx(zP,{onClick:F,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:o,nodeComponent:l}),s.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-T},${G-T}h${Q+T*2}v${re+T*2}h${-Q-T*2}z
89
- M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}sj.displayName="MiniMap";const UP=m.memo(sj),BP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,WP={[Ti.Line]:"right",[Ti.Handle]:"bottom-right"};function HP({nodeId:e,position:t,variant:n=Ti.Handle,className:r,style:a=void 0,children:i,color:o,minWidth:l=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:u=!1,resizeDirection:f,autoScale:p=!0,shouldResize:w,onResizeStart:v,onResize:j,onResizeEnd:g}){const y=$1(),x=typeof e=="string"?e:y,b=ct(),N=m.useRef(null),k=n===Ti.Handle,S=Ue(m.useCallback(BP(k&&p),[k,p]),gt),M=m.useRef(null),O=t??WP[n];m.useEffect(()=>{if(!(!N.current||!x))return M.current||(M.current=rD({domNode:N.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:B,transform:z,snapGrid:L,snapToGrid:C,nodeOrigin:A,domNode:_}=b.getState();return{nodeLookup:B,transform:z,snapGrid:L,snapToGrid:C,nodeOrigin:A,paneDomNode:_}},onChange:(B,z)=>{const{triggerNodeChanges:L,nodeLookup:C,parentLookup:A,nodeOrigin:_}=b.getState(),P=[],E={x:B.x,y:B.y},D=C.get(x);if(D&&D.expandParent&&D.parentId){const $=D.origin??_,H=B.width??D.measured.width??0,T=B.height??D.measured.height??0,U={id:D.id,parentId:D.parentId,rect:{width:H,height:T,...t1({x:B.x??D.position.x,y:B.y??D.position.y},{width:H,height:T},D.parentId,C,$)}},G=Up([U],C,A,_);P.push(...G),E.x=B.x?Math.max($[0]*H,B.x):void 0,E.y=B.y?Math.max($[1]*T,B.y):void 0}if(E.x!==void 0&&E.y!==void 0){const $={id:x,type:"position",position:{...E}};P.push($)}if(B.width!==void 0&&B.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};P.push(H)}for(const $ of z){const H={...$,type:"position"};P.push(H)}L(P)},onEnd:({width:B,height:z})=>{const L={id:x,type:"dimensions",resizing:!1,dimensions:{width:B,height:z}};b.getState().triggerNodeChanges([L])}})),M.current.update({controlPosition:O,boundaries:{minWidth:l,minHeight:c,maxWidth:d,maxHeight:h},keepAspectRatio:u,resizeDirection:f,onResizeStart:v,onResize:j,onResizeEnd:g,shouldResize:w}),()=>{var B;(B=M.current)==null||B.destroy()}},[O,l,c,d,h,u,v,j,g,w]);const I=O.split("-");return s.jsx("div",{className:kt(["react-flow__resize-control","nodrag",...I,n,r]),ref:N,style:{...a,scale:S,...o&&{[k?"backgroundColor":"borderColor"]:o}},children:i})}m.memo(HP);/**
90
- * @license lucide-react v0.294.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */var VP={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"};/**
95
- * @license lucide-react v0.294.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */const YP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),je=(e,t)=>{const n=m.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...d},h)=>m.createElement("svg",{ref:h,...VP,width:a,height:a,stroke:r,strokeWidth:o?Number(i)*24/Number(a):i,className:["lucide",`lucide-${YP(e)}`,l].join(" "),...d},[...t.map(([u,f])=>m.createElement(u,f)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
100
- * @license lucide-react v0.294.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const fr=je("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"}]]);/**
105
- * @license lucide-react v0.294.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */const XP=je("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
110
- * @license lucide-react v0.294.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const qP=je("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
115
- * @license lucide-react v0.294.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const xc=je("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
120
- * @license lucide-react v0.294.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const L0=je("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"}]]);/**
125
- * @license lucide-react v0.294.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const GP=je("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"}]]);/**
130
- * @license lucide-react v0.294.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const gr=je("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"}]]);/**
135
- * @license lucide-react v0.294.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const Ad=je("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"}]]);/**
140
- * @license lucide-react v0.294.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const Et=je("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"}]]);/**
145
- * @license lucide-react v0.294.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const KP=je("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
150
- * @license lucide-react v0.294.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const ju=je("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
155
- * @license lucide-react v0.294.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const aj=je("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
160
- * @license lucide-react v0.294.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const Hp=je("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
165
- * @license lucide-react v0.294.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const QP=je("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
170
- * @license lucide-react v0.294.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const F0=je("Clock1",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 14.5 8",key:"12zbmj"}]]);/**
175
- * @license lucide-react v0.294.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const gc=je("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
180
- * @license lucide-react v0.294.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const U0=je("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
185
- * @license lucide-react v0.294.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const mt=je("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"}]]);/**
190
- * @license lucide-react v0.294.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const ZP=je("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
195
- * @license lucide-react v0.294.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const ij=je("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"}]]);/**
200
- * @license lucide-react v0.294.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const JP=je("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"}]]);/**
205
- * @license lucide-react v0.294.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const Cl=je("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"}]]);/**
210
- * @license lucide-react v0.294.0 - ISC
211
- *
212
- * This source code is licensed under the ISC license.
213
- * See the LICENSE file in the root directory of this source tree.
214
- */const Vp=je("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
215
- * @license lucide-react v0.294.0 - ISC
216
- *
217
- * This source code is licensed under the ISC license.
218
- * See the LICENSE file in the root directory of this source tree.
219
- */const eT=je("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"}]]);/**
220
- * @license lucide-react v0.294.0 - ISC
221
- *
222
- * This source code is licensed under the ISC license.
223
- * See the LICENSE file in the root directory of this source tree.
224
- */const tT=je("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"}]]);/**
225
- * @license lucide-react v0.294.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const Wt=je("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"}]]);/**
230
- * @license lucide-react v0.294.0 - ISC
231
- *
232
- * This source code is licensed under the ISC license.
233
- * See the LICENSE file in the root directory of this source tree.
234
- */const nT=je("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"}]]);/**
235
- * @license lucide-react v0.294.0 - ISC
236
- *
237
- * This source code is licensed under the ISC license.
238
- * See the LICENSE file in the root directory of this source tree.
239
- */const vc=je("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
240
- * @license lucide-react v0.294.0 - ISC
241
- *
242
- * This source code is licensed under the ISC license.
243
- * See the LICENSE file in the root directory of this source tree.
244
- */const zd=je("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"}]]);/**
245
- * @license lucide-react v0.294.0 - ISC
246
- *
247
- * This source code is licensed under the ISC license.
248
- * See the LICENSE file in the root directory of this source tree.
249
- */const rT=je("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"}]]);/**
250
- * @license lucide-react v0.294.0 - ISC
251
- *
252
- * This source code is licensed under the ISC license.
253
- * See the LICENSE file in the root directory of this source tree.
254
- */const qr=je("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"}]]);/**
255
- * @license lucide-react v0.294.0 - ISC
256
- *
257
- * This source code is licensed under the ISC license.
258
- * See the LICENSE file in the root directory of this source tree.
259
- */const Yc=je("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"}]]);/**
260
- * @license lucide-react v0.294.0 - ISC
261
- *
262
- * This source code is licensed under the ISC license.
263
- * See the LICENSE file in the root directory of this source tree.
264
- */const $d=je("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"}]]);/**
265
- * @license lucide-react v0.294.0 - ISC
266
- *
267
- * This source code is licensed under the ISC license.
268
- * See the LICENSE file in the root directory of this source tree.
269
- */const sT=je("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"}]]);/**
270
- * @license lucide-react v0.294.0 - ISC
271
- *
272
- * This source code is licensed under the ISC license.
273
- * See the LICENSE file in the root directory of this source tree.
274
- */const aT=je("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"}]]);/**
275
- * @license lucide-react v0.294.0 - ISC
276
- *
277
- * This source code is licensed under the ISC license.
278
- * See the LICENSE file in the root directory of this source tree.
279
- */const ja=je("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"}]]);/**
280
- * @license lucide-react v0.294.0 - ISC
281
- *
282
- * This source code is licensed under the ISC license.
283
- * See the LICENSE file in the root directory of this source tree.
284
- */const Ts=je("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
285
- * @license lucide-react v0.294.0 - ISC
286
- *
287
- * This source code is licensed under the ISC license.
288
- * See the LICENSE file in the root directory of this source tree.
289
- */const wc=je("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"}]]);/**
290
- * @license lucide-react v0.294.0 - ISC
291
- *
292
- * This source code is licensed under the ISC license.
293
- * See the LICENSE file in the root directory of this source tree.
294
- */const B0=je("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"}]]);/**
295
- * @license lucide-react v0.294.0 - ISC
296
- *
297
- * This source code is licensed under the ISC license.
298
- * See the LICENSE file in the root directory of this source tree.
299
- */const Na=je("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
300
- * @license lucide-react v0.294.0 - ISC
301
- *
302
- * This source code is licensed under the ISC license.
303
- * See the LICENSE file in the root directory of this source tree.
304
- */const ra=je("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"}]]);/**
305
- * @license lucide-react v0.294.0 - ISC
306
- *
307
- * This source code is licensed under the ISC license.
308
- * See the LICENSE file in the root directory of this source tree.
309
- */const Dn=je("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
310
- * @license lucide-react v0.294.0 - ISC
311
- *
312
- * This source code is licensed under the ISC license.
313
- * See the LICENSE file in the root directory of this source tree.
314
- */const iT=je("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
315
- * @license lucide-react v0.294.0 - ISC
316
- *
317
- * This source code is licensed under the ISC license.
318
- * See the LICENSE file in the root directory of this source tree.
319
- */const oT=je("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
320
- * @license lucide-react v0.294.0 - ISC
321
- *
322
- * This source code is licensed under the ISC license.
323
- * See the LICENSE file in the root directory of this source tree.
324
- */const W0=je("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"}]]);/**
325
- * @license lucide-react v0.294.0 - ISC
326
- *
327
- * This source code is licensed under the ISC license.
328
- * See the LICENSE file in the root directory of this source tree.
329
- */const Yp=je("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"}]]);/**
330
- * @license lucide-react v0.294.0 - ISC
331
- *
332
- * This source code is licensed under the ISC license.
333
- * See the LICENSE file in the root directory of this source tree.
334
- */const hm=je("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"}]]);/**
335
- * @license lucide-react v0.294.0 - ISC
336
- *
337
- * This source code is licensed under the ISC license.
338
- * See the LICENSE file in the root directory of this source tree.
339
- */const H0=je("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"}]]);/**
340
- * @license lucide-react v0.294.0 - ISC
341
- *
342
- * This source code is licensed under the ISC license.
343
- * See the LICENSE file in the root directory of this source tree.
344
- */const ka=je("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"}]]);/**
345
- * @license lucide-react v0.294.0 - ISC
346
- *
347
- * This source code is licensed under the ISC license.
348
- * See the LICENSE file in the root directory of this source tree.
349
- */const oj=je("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"}]]);/**
350
- * @license lucide-react v0.294.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */const Zs=je("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"}]]);/**
355
- * @license lucide-react v0.294.0 - ISC
356
- *
357
- * This source code is licensed under the ISC license.
358
- * See the LICENSE file in the root directory of this source tree.
359
- */const Tt=je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
360
- * @license lucide-react v0.294.0 - ISC
361
- *
362
- * This source code is licensed under the ISC license.
363
- * See the LICENSE file in the root directory of this source tree.
364
- */const yc=je("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function lj(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=lj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function cj(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=lj(e))&&(r&&(r+=" "),r+=t);return r}const Xp="-",lT=e=>{const t=dT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(Xp);return l[0]===""&&l.length!==1&&l.shift(),dj(l,t)||cT(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},dj=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?dj(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Xp);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},V0=/^\[(.+)\]$/,cT=e=>{if(V0.test(e)){const t=V0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},dT=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return hT(Object.entries(e.classGroups),n).forEach(([i,o])=>{fm(o,r,i,t)}),r},fm=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:Y0(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(uT(a)){fm(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{fm(o,Y0(t,i),n,r)})})},Y0=(e,t)=>{let n=e;return t.split(Xp).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},uT=e=>e.isThemeGetter,hT=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,a]}):e,fT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},uj="!",mT=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let d=0,h=0,u;for(let j=0;j<l.length;j++){let g=l[j];if(d===0){if(g===a&&(r||l.slice(j,j+i)===t)){c.push(l.slice(h,j)),h=j+i;continue}if(g==="/"){u=j;continue}}g==="["?d++:g==="]"&&d--}const f=c.length===0?l:l.substring(h),p=f.startsWith(uj),w=p?f.substring(1):f,v=u&&u>h?u-h:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:o}):o},pT=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},xT=e=>({cache:fT(e.cacheSize),parseClassName:mT(e),...lT(e)}),gT=/\s+/,vT=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(gT);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:h,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:p}=n(d);let w=!!p,v=r(w?f.substring(0,p):f);if(!v){if(!w){l=d+(l.length>0?" "+l:l);continue}if(v=r(f),!v){l=d+(l.length>0?" "+l:l);continue}w=!1}const j=pT(h).join(":"),g=u?j+uj:j,y=g+v;if(i.includes(y))continue;i.push(y);const x=a(v,w);for(let b=0;b<x.length;++b){const N=x[b];i.push(g+N)}l=d+(l.length>0?" "+l:l)}return l};function wT(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=hj(t))&&(r&&(r+=" "),r+=n);return r}const hj=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=hj(e[r]))&&(n&&(n+=" "),n+=t);return n};function yT(e,...t){let n,r,a,i=o;function o(c){const d=t.reduce((h,u)=>u(h),e());return n=xT(d),r=n.cache.get,a=n.cache.set,i=l,l(c)}function l(c){const d=r(c);if(d)return d;const h=vT(c,n);return a(c,h),h}return function(){return i(wT.apply(null,arguments))}}const st=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},fj=/^\[(?:([a-z-]+):)?(.+)\]$/i,bT=/^\d+\/\d+$/,jT=new Set(["px","full","screen"]),NT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kT=/\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$/,ST=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,CT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ET=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$r=e=>xi(e)||jT.has(e)||bT.test(e),cs=e=>Hi(e,"length",zT),xi=e=>!!e&&!Number.isNaN(Number(e)),Dh=e=>Hi(e,"number",xi),ao=e=>!!e&&Number.isInteger(Number(e)),MT=e=>e.endsWith("%")&&xi(e.slice(0,-1)),Oe=e=>fj.test(e),ds=e=>NT.test(e),DT=new Set(["length","size","percentage"]),_T=e=>Hi(e,DT,mj),PT=e=>Hi(e,"position",mj),TT=new Set(["image","url"]),OT=e=>Hi(e,TT,RT),AT=e=>Hi(e,"",$T),io=()=>!0,Hi=(e,t,n)=>{const r=fj.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},zT=e=>kT.test(e)&&!ST.test(e),mj=()=>!1,$T=e=>CT.test(e),RT=e=>ET.test(e),IT=()=>{const e=st("colors"),t=st("spacing"),n=st("blur"),r=st("brightness"),a=st("borderColor"),i=st("borderRadius"),o=st("borderSpacing"),l=st("borderWidth"),c=st("contrast"),d=st("grayscale"),h=st("hueRotate"),u=st("invert"),f=st("gap"),p=st("gradientColorStops"),w=st("gradientColorStopPositions"),v=st("inset"),j=st("margin"),g=st("opacity"),y=st("padding"),x=st("saturate"),b=st("scale"),N=st("sepia"),k=st("skew"),S=st("space"),M=st("translate"),O=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",Oe,t],z=()=>[Oe,t],L=()=>["",$r,cs],C=()=>["auto",xi,Oe],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],P=()=>["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",Oe],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[xi,Oe];return{cacheSize:500,separator:":",theme:{colors:[io],spacing:[$r,cs],blur:["none","",ds,Oe],brightness:H(),borderColor:[e],borderRadius:["none","","full",ds,Oe],borderSpacing:z(),borderWidth:L(),contrast:H(),grayscale:D(),hueRotate:H(),invert:D(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[MT,cs],inset:B(),margin:B(),opacity:H(),padding:z(),saturate:H(),scale:H(),sepia:D(),skew:H(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",Oe]}],container:["container"],columns:[{columns:[ds]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],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:[...A(),Oe]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],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",ao,Oe]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Oe]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",ao,Oe]}],"grid-cols":[{"grid-cols":[io]}],"col-start-end":[{col:["auto",{span:["full",ao,Oe]},Oe]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[io]}],"row-start-end":[{row:["auto",{span:[ao,Oe]},Oe]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Oe]}],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":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Oe,t]}],"min-w":[{"min-w":[Oe,t,"min","max","fit"]}],"max-w":[{"max-w":[Oe,t,"none","full","min","max","fit","prose",{screen:[ds]},ds]}],h:[{h:[Oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ds,cs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dh]}],"font-family":[{font:[io]}],"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",Oe]}],"line-clamp":[{"line-clamp":["none",xi,Dh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$r,Oe]}],"list-image":[{"list-image":["none",Oe]}],"list-style-type":[{list:["none","disc","decimal",Oe]}],"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:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$r,cs]}],"underline-offset":[{"underline-offset":["auto",$r,Oe]}],"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",Oe]}],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",Oe]}],"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:[...A(),PT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_T]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[..._(),"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:_()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[$r,Oe]}],"outline-w":[{outline:[$r,cs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[$r,cs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ds,AT]}],"shadow-color":[{shadow:[io]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...P(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":P()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ds,Oe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"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",Oe]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Oe]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ao,Oe]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Oe]}],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",Oe]}],"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",Oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$r,cs,Dh]}],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"]}}},LT=yT(IT);function Ee(...e){return LT(cj(e))}function Dt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function X0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sa(...e){return t=>{let n=!1;const r=e.map(a=>{const i=X0(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():X0(e[a],null)}}}}function Cn(...e){return m.useCallback(Sa(...e),e)}function FT(e,t){const n=m.createContext(t),r=i=>{const{children:o,...l}=i,c=m.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function a(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[r,a]}function Nu(e,t=[]){let n=[];function r(i,o){const l=m.createContext(o),c=n.length;n=[...n,o];const d=u=>{var g;const{scope:f,children:p,...w}=u,v=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,j=m.useMemo(()=>w,Object.values(w));return s.jsx(v.Provider,{value:j,children:p})};d.displayName=i+"Provider";function h(u,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,w=m.useContext(p);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[d,h]}const a=()=>{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 a.scopeName=e,[r,UT(a,...t)]}function UT(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...l,...u}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function ku(e){const t=WT(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,l=m.Children.toArray(i),c=l.find(VT);if(c){const d=c.props.children,h=l.map(u=>u===c?m.Children.count(d)>1?m.Children.only(null):m.isValidElement(d)?d.props.children:null:u);return s.jsx(t,{...o,ref:a,children:m.isValidElement(d)?m.cloneElement(d,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var BT=ku("Slot");function WT(e){const t=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=XT(a),l=YT(i,a.props);return a.type!==m.Fragment&&(l.ref=r?Sa(r,o):o),m.cloneElement(a,l)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pj=Symbol("radix.slottable");function HT(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=pj,t}function VT(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pj}function YT(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function XT(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dt=qT.reduce((e,t)=>{const n=ku(`Primitive.${t}`),r=m.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function GT(e,t){e&&ou.flushSync(()=>e.dispatchEvent(t))}function Ai(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function KT(e,t=globalThis==null?void 0:globalThis.document){const n=Ai(e);m.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var QT="DismissableLayer",mm="dismissableLayer.update",ZT="dismissableLayer.pointerDownOutside",JT="dismissableLayer.focusOutside",q0,xj=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Su=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=m.useContext(xj),[h,u]=m.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),w=Cn(t,S=>u(S)),v=Array.from(d.layers),[j]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(j),y=h?v.indexOf(h):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,b=y>=g,N=nO(S=>{const M=S.target,O=[...d.branches].some(I=>I.contains(M));!b||O||(a==null||a(S),o==null||o(S),S.defaultPrevented||l==null||l())},f),k=rO(S=>{const M=S.target;[...d.branches].some(I=>I.contains(M))||(i==null||i(S),o==null||o(S),S.defaultPrevented||l==null||l())},f);return KT(S=>{y===d.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},f),m.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(q0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),G0(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=q0)}},[h,f,n,d]),m.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),G0())},[h,d]),m.useEffect(()=>{const S=()=>p({});return document.addEventListener(mm,S),()=>document.removeEventListener(mm,S)},[]),s.jsx(dt.div,{...c,ref:w,style:{pointerEvents:x?b?"auto":"none":void 0,...e.style},onFocusCapture:Dt(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Dt(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Dt(e.onPointerDownCapture,N.onPointerDownCapture)})});Su.displayName=QT;var eO="DismissableLayerBranch",tO=m.forwardRef((e,t)=>{const n=m.useContext(xj),r=m.useRef(null),a=Cn(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(dt.div,{...e,ref:a})});tO.displayName=eO;function nO(e,t=globalThis==null?void 0:globalThis.document){const n=Ai(e),r=m.useRef(!1),a=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){gj(ZT,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function rO(e,t=globalThis==null?void 0:globalThis.document){const n=Ai(e),r=m.useRef(!1);return m.useEffect(()=>{const a=i=>{i.target&&!r.current&&gj(JT,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function G0(){const e=new CustomEvent(mm);document.dispatchEvent(e)}function gj(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?GT(a,i):a.dispatchEvent(i)}var zs=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},sO=Tm[" useId ".trim().toString()]||(()=>{}),aO=0;function sr(e){const[t,n]=m.useState(sO());return zs(()=>{n(r=>r??String(aO++))},[e]),e||(t?`radix-${t}`:"")}const iO=["top","right","bottom","left"],$s=Math.min,xn=Math.max,Rd=Math.round,bc=Math.floor,Cr=e=>({x:e,y:e}),oO={left:"right",right:"left",bottom:"top",top:"bottom"},lO={start:"end",end:"start"};function pm(e,t,n){return xn(e,$s(t,n))}function es(e,t){return typeof e=="function"?e(t):e}function ts(e){return e.split("-")[0]}function Vi(e){return e.split("-")[1]}function qp(e){return e==="x"?"y":"x"}function Gp(e){return e==="y"?"height":"width"}const cO=new Set(["top","bottom"]);function br(e){return cO.has(ts(e))?"y":"x"}function Kp(e){return qp(br(e))}function dO(e,t,n){n===void 0&&(n=!1);const r=Vi(e),a=Kp(e),i=Gp(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Id(o)),[o,Id(o)]}function uO(e){const t=Id(e);return[xm(e),t,xm(t)]}function xm(e){return e.replace(/start|end/g,t=>lO[t])}const K0=["left","right"],Q0=["right","left"],hO=["top","bottom"],fO=["bottom","top"];function mO(e,t,n){switch(e){case"top":case"bottom":return n?t?Q0:K0:t?K0:Q0;case"left":case"right":return t?hO:fO;default:return[]}}function pO(e,t,n,r){const a=Vi(e);let i=mO(ts(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(xm)))),i}function Id(e){return e.replace(/left|right|bottom|top/g,t=>oO[t])}function xO(e){return{top:0,right:0,bottom:0,left:0,...e}}function vj(e){return typeof e!="number"?xO(e):{top:e,right:e,bottom:e,left:e}}function Ld(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function Z0(e,t,n){let{reference:r,floating:a}=e;const i=br(t),o=Kp(t),l=Gp(o),c=ts(t),d=i==="y",h=r.x+r.width/2-a.width/2,u=r.y+r.height/2-a.height/2,f=r[l]/2-a[l]/2;let p;switch(c){case"top":p={x:h,y:r.y-a.height};break;case"bottom":p={x:h,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-a.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Vi(t)){case"start":p[o]-=f*(n&&d?-1:1);break;case"end":p[o]+=f*(n&&d?-1:1);break}return p}const gO=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:u}=Z0(d,r,c),f=r,p={},w=0;for(let v=0;v<l.length;v++){const{name:j,fn:g}=l[v],{x:y,y:x,data:b,reset:N}=await g({x:h,y:u,initialPlacement:r,placement:f,strategy:a,middlewareData:p,rects:d,platform:o,elements:{reference:e,floating:t}});h=y??h,u=x??u,p={...p,[j]:{...p[j],...b}},N&&w<=50&&(w++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(d=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:h,y:u}=Z0(d,f,c)),v=-1)}return{x:h,y:u,placement:f,strategy:a,middlewareData:p}};async function cl(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=es(t,e),w=vj(p),j=l[f?u==="floating"?"reference":"floating":u],g=Ld(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:d,rootBoundary:h,strategy:c})),y=u==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},N=Ld(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:c}):y);return{top:(g.top-N.top+w.top)/b.y,bottom:(N.bottom-g.bottom+w.bottom)/b.y,left:(g.left-N.left+w.left)/b.x,right:(N.right-g.right+w.right)/b.x}}const vO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=es(e,t)||{};if(d==null)return{};const u=vj(h),f={x:n,y:r},p=Kp(a),w=Gp(p),v=await o.getDimensions(d),j=p==="y",g=j?"top":"left",y=j?"bottom":"right",x=j?"clientHeight":"clientWidth",b=i.reference[w]+i.reference[p]-f[p]-i.floating[w],N=f[p]-i.reference[p],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let S=k?k[x]:0;(!S||!await(o.isElement==null?void 0:o.isElement(k)))&&(S=l.floating[x]||i.floating[w]);const M=b/2-N/2,O=S/2-v[w]/2-1,I=$s(u[g],O),B=$s(u[y],O),z=I,L=S-v[w]-B,C=S/2-v[w]/2+M,A=pm(z,C,L),_=!c.arrow&&Vi(a)!=null&&C!==A&&i.reference[w]/2-(C<z?I:B)-v[w]/2<0,P=_?C<z?C-z:C-L:0;return{[p]:f[p]+P,data:{[p]:A,centerOffset:C-A-P,..._&&{alignmentOffset:P}},reset:_}}}),wO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...j}=es(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=ts(a),y=br(l),x=ts(l)===l,b=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=f||(x||!v?[Id(l)]:uO(l)),k=w!=="none";!f&&k&&N.push(...pO(l,v,w,b));const S=[l,...N],M=await cl(t,j),O=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&O.push(M[g]),u){const C=dO(a,o,b);O.push(M[C[0]],M[C[1]])}if(I=[...I,{placement:a,overflows:O}],!O.every(C=>C<=0)){var B,z;const C=(((B=i.flip)==null?void 0:B.index)||0)+1,A=S[C];if(A&&(!(u==="alignment"?y!==br(A):!1)||I.every(E=>br(E.placement)===y?E.overflows[0]>0:!0)))return{data:{index:C,overflows:I},reset:{placement:A}};let _=(z=I.filter(P=>P.overflows[0]<=0).sort((P,E)=>P.overflows[1]-E.overflows[1])[0])==null?void 0:z.placement;if(!_)switch(p){case"bestFit":{var L;const P=(L=I.filter(E=>{if(k){const D=br(E.placement);return D===y||D==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(D=>D>0).reduce((D,$)=>D+$,0)]).sort((E,D)=>E[1]-D[1])[0])==null?void 0:L[0];P&&(_=P);break}case"initialPlacement":_=l;break}if(a!==_)return{reset:{placement:_}}}return{}}}};function J0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ev(e){return iO.some(t=>e[t]>=0)}const yO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=es(e,t);switch(r){case"referenceHidden":{const i=await cl(t,{...a,elementContext:"reference"}),o=J0(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:ev(o)}}}case"escaped":{const i=await cl(t,{...a,altBoundary:!0}),o=J0(i,n.floating);return{data:{escapedOffsets:o,escaped:ev(o)}}}default:return{}}}}},wj=new Set(["left","top"]);async function bO(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=ts(n),l=Vi(n),c=br(n)==="y",d=wj.has(o)?-1:1,h=i&&c?-1:1,u=es(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:w}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof w=="number"&&(p=l==="end"?w*-1:w),c?{x:p*h,y:f*d}:{x:f*d,y:p*h}}const jO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await bO(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},NO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:j=>{let{x:g,y}=j;return{x:g,y}}},...c}=es(e,t),d={x:n,y:r},h=await cl(t,c),u=br(ts(a)),f=qp(u);let p=d[f],w=d[u];if(i){const j=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=p+h[j],x=p-h[g];p=pm(y,p,x)}if(o){const j=u==="y"?"top":"left",g=u==="y"?"bottom":"right",y=w+h[j],x=w-h[g];w=pm(y,w,x)}const v=l.fn({...t,[f]:p,[u]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[u]:o}}}}}},kO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=es(e,t),h={x:n,y:r},u=br(a),f=qp(u);let p=h[f],w=h[u];const v=es(l,t),j=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const x=f==="y"?"height":"width",b=i.reference[f]-i.floating[x]+j.mainAxis,N=i.reference[f]+i.reference[x]-j.mainAxis;p<b?p=b:p>N&&(p=N)}if(d){var g,y;const x=f==="y"?"width":"height",b=wj.has(ts(a)),N=i.reference[u]-i.floating[x]+(b&&((g=o.offset)==null?void 0:g[u])||0)+(b?0:j.crossAxis),k=i.reference[u]+i.reference[x]+(b?0:((y=o.offset)==null?void 0:y[u])||0)-(b?j.crossAxis:0);w<N?w=N:w>k&&(w=k)}return{[f]:p,[u]:w}}}},SO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...d}=es(e,t),h=await cl(t,d),u=ts(a),f=Vi(a),p=br(a)==="y",{width:w,height:v}=i.floating;let j,g;u==="top"||u==="bottom"?(j=u,g=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=u,j=f==="end"?"top":"bottom");const y=v-h.top-h.bottom,x=w-h.left-h.right,b=$s(v-h[j],y),N=$s(w-h[g],x),k=!t.middlewareData.shift;let S=b,M=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=y),k&&!f){const I=xn(h.left,0),B=xn(h.right,0),z=xn(h.top,0),L=xn(h.bottom,0);p?M=w-2*(I!==0||B!==0?I+B:xn(h.left,h.right)):S=v-2*(z!==0||L!==0?z+L:xn(h.top,h.bottom))}await c({...t,availableWidth:M,availableHeight:S});const O=await o.getDimensions(l.floating);return w!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function Cu(){return typeof window<"u"}function Yi(e){return yj(e)?(e.nodeName||"").toLowerCase():"#document"}function yn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pr(e){var t;return(t=(yj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yj(e){return Cu()?e instanceof Node||e instanceof yn(e).Node:!1}function ir(e){return Cu()?e instanceof Element||e instanceof yn(e).Element:!1}function Mr(e){return Cu()?e instanceof HTMLElement||e instanceof yn(e).HTMLElement:!1}function tv(e){return!Cu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yn(e).ShadowRoot}const CO=new Set(["inline","contents"]);function El(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=or(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!CO.has(a)}const EO=new Set(["table","td","th"]);function MO(e){return EO.has(Yi(e))}const DO=[":popover-open",":modal"];function Eu(e){return DO.some(t=>{try{return e.matches(t)}catch{return!1}})}const _O=["transform","translate","scale","rotate","perspective"],PO=["transform","translate","scale","rotate","perspective","filter"],TO=["paint","layout","strict","content"];function Qp(e){const t=Zp(),n=ir(e)?or(e):e;return _O.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||PO.some(r=>(n.willChange||"").includes(r))||TO.some(r=>(n.contain||"").includes(r))}function OO(e){let t=Rs(e);for(;Mr(t)&&!zi(t);){if(Qp(t))return t;if(Eu(t))return null;t=Rs(t)}return null}function Zp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const AO=new Set(["html","body","#document"]);function zi(e){return AO.has(Yi(e))}function or(e){return yn(e).getComputedStyle(e)}function Mu(e){return ir(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rs(e){if(Yi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tv(e)&&e.host||Pr(e);return tv(t)?t.host:t}function bj(e){const t=Rs(e);return zi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mr(t)&&El(t)?t:bj(t)}function dl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=bj(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=yn(a);if(i){const l=gm(o);return t.concat(o,o.visualViewport||[],El(a)?a:[],l&&n?dl(l):[])}return t.concat(a,dl(a,[],n))}function gm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jj(e){const t=or(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Mr(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,l=Rd(n)!==i||Rd(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function Jp(e){return ir(e)?e:e.contextElement}function gi(e){const t=Jp(e);if(!Mr(t))return Cr(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=jj(t);let o=(i?Rd(n.width):n.width)/r,l=(i?Rd(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const zO=Cr(0);function Nj(e){const t=yn(e);return!Zp()||!t.visualViewport?zO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $O(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yn(e)?!1:t}function Ca(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=Jp(e);let o=Cr(1);t&&(r?ir(r)&&(o=gi(r)):o=gi(e));const l=$O(i,n,r)?Nj(i):Cr(0);let c=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,h=a.width/o.x,u=a.height/o.y;if(i){const f=yn(i),p=r&&ir(r)?yn(r):r;let w=f,v=gm(w);for(;v&&r&&p!==w;){const j=gi(v),g=v.getBoundingClientRect(),y=or(v),x=g.left+(v.clientLeft+parseFloat(y.paddingLeft))*j.x,b=g.top+(v.clientTop+parseFloat(y.paddingTop))*j.y;c*=j.x,d*=j.y,h*=j.x,u*=j.y,c+=x,d+=b,w=yn(v),v=gm(w)}}return Ld({width:h,height:u,x:c,y:d})}function Du(e,t){const n=Mu(e).scrollLeft;return t?t.left+n:Ca(Pr(e)).left+n}function kj(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Du(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function RO(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Pr(r),l=t?Eu(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=Cr(1);const h=Cr(0),u=Mr(r);if((u||!u&&!i)&&((Yi(r)!=="body"||El(o))&&(c=Mu(r)),Mr(r))){const p=Ca(r);d=gi(r),h.x=p.x+r.clientLeft,h.y=p.y+r.clientTop}const f=o&&!u&&!i?kj(o,c):Cr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+f.x,y:n.y*d.y-c.scrollTop*d.y+h.y+f.y}}function IO(e){return Array.from(e.getClientRects())}function LO(e){const t=Pr(e),n=Mu(e),r=e.ownerDocument.body,a=xn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Du(e);const l=-n.scrollTop;return or(r).direction==="rtl"&&(o+=xn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:l}}const nv=25;function FO(e,t){const n=yn(e),r=Pr(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const h=Zp();(!h||h&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=Du(r);if(d<=0){const h=r.ownerDocument,u=h.body,f=getComputedStyle(u),p=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,w=Math.abs(r.clientWidth-u.clientWidth-p);w<=nv&&(i-=w)}else d<=nv&&(i+=d);return{width:i,height:o,x:l,y:c}}const UO=new Set(["absolute","fixed"]);function BO(e,t){const n=Ca(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Mr(e)?gi(e):Cr(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,d=r*i.y;return{width:o,height:l,x:c,y:d}}function rv(e,t,n){let r;if(t==="viewport")r=FO(e,n);else if(t==="document")r=LO(Pr(e));else if(ir(t))r=BO(t,n);else{const a=Nj(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ld(r)}function Sj(e,t){const n=Rs(e);return n===t||!ir(n)||zi(n)?!1:or(n).position==="fixed"||Sj(n,t)}function WO(e,t){const n=t.get(e);if(n)return n;let r=dl(e,[],!1).filter(l=>ir(l)&&Yi(l)!=="body"),a=null;const i=or(e).position==="fixed";let o=i?Rs(e):e;for(;ir(o)&&!zi(o);){const l=or(o),c=Qp(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&UO.has(a.position)||El(o)&&!c&&Sj(e,o))?r=r.filter(h=>h!==o):a=l,o=Rs(o)}return t.set(e,r),r}function HO(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Eu(t)?[]:WO(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((d,h)=>{const u=rv(t,h,a);return d.top=xn(u.top,d.top),d.right=$s(u.right,d.right),d.bottom=$s(u.bottom,d.bottom),d.left=xn(u.left,d.left),d},rv(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function VO(e){const{width:t,height:n}=jj(e);return{width:t,height:n}}function YO(e,t,n){const r=Mr(t),a=Pr(t),i=n==="fixed",o=Ca(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Cr(0);function d(){c.x=Du(a)}if(r||!r&&!i)if((Yi(t)!=="body"||El(a))&&(l=Mu(t)),r){const p=Ca(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else a&&d();i&&!r&&a&&d();const h=a&&!r&&!i?kj(a,l):Cr(0),u=o.left+l.scrollLeft-c.x-h.x,f=o.top+l.scrollTop-c.y-h.y;return{x:u,y:f,width:o.width,height:o.height}}function _h(e){return or(e).position==="static"}function sv(e,t){if(!Mr(e)||or(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pr(e)===n&&(n=n.ownerDocument.body),n}function Cj(e,t){const n=yn(e);if(Eu(e))return n;if(!Mr(e)){let a=Rs(e);for(;a&&!zi(a);){if(ir(a)&&!_h(a))return a;a=Rs(a)}return n}let r=sv(e,t);for(;r&&MO(r)&&_h(r);)r=sv(r,t);return r&&zi(r)&&_h(r)&&!Qp(r)?n:r||OO(e)||n}const XO=async function(e){const t=this.getOffsetParent||Cj,n=this.getDimensions,r=await n(e.floating);return{reference:YO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qO(e){return or(e).direction==="rtl"}const GO={convertOffsetParentRelativeRectToViewportRelativeRect:RO,getDocumentElement:Pr,getClippingRect:HO,getOffsetParent:Cj,getElementRects:XO,getClientRects:IO,getDimensions:VO,getScale:gi,isElement:ir,isRTL:qO};function Ej(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function KO(e,t){let n=null,r;const a=Pr(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:h,top:u,width:f,height:p}=d;if(l||t(),!f||!p)return;const w=bc(u),v=bc(a.clientWidth-(h+f)),j=bc(a.clientHeight-(u+p)),g=bc(h),x={rootMargin:-w+"px "+-v+"px "+-j+"px "+-g+"px",threshold:xn(0,$s(1,c))||1};let b=!0;function N(k){const S=k[0].intersectionRatio;if(S!==c){if(!b)return o();S?o(!1,S):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!Ej(d,e.getBoundingClientRect())&&o(),b=!1}try{n=new IntersectionObserver(N,{...x,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return o(!0),i}function QO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Jp(e),h=a||i?[...d?dl(d):[],...dl(t)]:[];h.forEach(g=>{a&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const u=d&&l?KO(d,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(g=>{let[y]=g;y&&y.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),d&&!c&&p.observe(d),p.observe(t));let w,v=c?Ca(e):null;c&&j();function j(){const g=Ca(e);v&&!Ej(v,g)&&n(),v=g,w=requestAnimationFrame(j)}return n(),()=>{var g;h.forEach(y=>{a&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),u==null||u(),(g=p)==null||g.disconnect(),p=null,c&&cancelAnimationFrame(w)}}const ZO=jO,JO=NO,eA=wO,tA=SO,nA=yO,av=vO,rA=kO,sA=(e,t,n)=>{const r=new Map,a={platform:GO,...n},i={...a.platform,_c:r};return gO(e,t,{...a,platform:i})};var aA=typeof document<"u",iA=function(){},Xc=aA?m.useLayoutEffect:iA;function Fd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fd(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Fd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Mj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iv(e,t){const n=Mj(e);return Math.round(t*n)/n}function Ph(e){const t=m.useRef(e);return Xc(()=>{t.current=e}),t}function oA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[h,u]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);Fd(f,r)||p(r);const[w,v]=m.useState(null),[j,g]=m.useState(null),y=m.useCallback(E=>{E!==k.current&&(k.current=E,v(E))},[]),x=m.useCallback(E=>{E!==S.current&&(S.current=E,g(E))},[]),b=i||w,N=o||j,k=m.useRef(null),S=m.useRef(null),M=m.useRef(h),O=c!=null,I=Ph(c),B=Ph(a),z=Ph(d),L=m.useCallback(()=>{if(!k.current||!S.current)return;const E={placement:t,strategy:n,middleware:f};B.current&&(E.platform=B.current),sA(k.current,S.current,E).then(D=>{const $={...D,isPositioned:z.current!==!1};C.current&&!Fd(M.current,$)&&(M.current=$,ou.flushSync(()=>{u($)}))})},[f,t,n,B,z]);Xc(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,u(E=>({...E,isPositioned:!1})))},[d]);const C=m.useRef(!1);Xc(()=>(C.current=!0,()=>{C.current=!1}),[]),Xc(()=>{if(b&&(k.current=b),N&&(S.current=N),b&&N){if(I.current)return I.current(b,N,L);L()}},[b,N,L,I,O]);const A=m.useMemo(()=>({reference:k,floating:S,setReference:y,setFloating:x}),[y,x]),_=m.useMemo(()=>({reference:b,floating:N}),[b,N]),P=m.useMemo(()=>{const E={position:n,left:0,top:0};if(!_.floating)return E;const D=iv(_.floating,h.x),$=iv(_.floating,h.y);return l?{...E,transform:"translate("+D+"px, "+$+"px)",...Mj(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:$}},[n,l,_.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:L,refs:A,elements:_,floatingStyles:P}),[h,L,A,_,P])}const lA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?av({element:r.current,padding:a}).fn(n):{}:r?av({element:r,padding:a}).fn(n):{}}}},cA=(e,t)=>({...ZO(e),options:[e,t]}),dA=(e,t)=>({...JO(e),options:[e,t]}),uA=(e,t)=>({...rA(e),options:[e,t]}),hA=(e,t)=>({...eA(e),options:[e,t]}),fA=(e,t)=>({...tA(e),options:[e,t]}),mA=(e,t)=>({...nA(e),options:[e,t]}),pA=(e,t)=>({...lA(e),options:[e,t]});var xA="Arrow",Dj=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(dt.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dj.displayName=xA;var gA=Dj;function vA(e){const[t,n]=m.useState(void 0);return zs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ex="Popper",[_j,_u]=Nu(ex),[wA,Pj]=_j(ex),Tj=e=>{const{__scopePopper:t,children:n}=e,[r,a]=m.useState(null);return s.jsx(wA,{scope:t,anchor:r,onAnchorChange:a,children:n})};Tj.displayName=ex;var Oj="PopperAnchor",Aj=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=Pj(Oj,n),o=m.useRef(null),l=Cn(t,o),c=m.useRef(null);return m.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||o.current,d!==c.current&&i.onAnchorChange(c.current)}),r?null:s.jsx(dt.div,{...a,ref:l})});Aj.displayName=Oj;var tx="PopperContent",[yA,bA]=_j(tx),zj=m.forwardRef((e,t)=>{var ne,J,R,ee,F,V;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:w,...v}=e,j=Pj(tx,n),[g,y]=m.useState(null),x=Cn(t,K=>y(K)),[b,N]=m.useState(null),k=vA(b),S=(k==null?void 0:k.width)??0,M=(k==null?void 0:k.height)??0,O=r+(i!=="center"?"-"+i:""),I=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},B=Array.isArray(d)?d:[d],z=B.length>0,L={padding:I,boundary:B.filter(NA),altBoundary:z},{refs:C,floatingStyles:A,placement:_,isPositioned:P,middlewareData:E}=oA({strategy:"fixed",placement:O,whileElementsMounted:(...K)=>QO(...K,{animationFrame:p==="always"}),elements:{reference:j.anchor},middleware:[cA({mainAxis:a+M,alignmentAxis:o}),c&&dA({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?uA():void 0,...L}),c&&hA({...L}),fA({...L,apply:({elements:K,rects:ie,availableWidth:ce,availableHeight:pe})=>{const{width:ke,height:Ie}=ie.reference,Ce=K.floating.style;Ce.setProperty("--radix-popper-available-width",`${ce}px`),Ce.setProperty("--radix-popper-available-height",`${pe}px`),Ce.setProperty("--radix-popper-anchor-width",`${ke}px`),Ce.setProperty("--radix-popper-anchor-height",`${Ie}px`)}}),b&&pA({element:b,padding:l}),kA({arrowWidth:S,arrowHeight:M}),f&&mA({strategy:"referenceHidden",...L})]}),[D,$]=Ij(_),H=Ai(w);zs(()=>{P&&(H==null||H())},[P,H]);const T=(ne=E.arrow)==null?void 0:ne.x,U=(J=E.arrow)==null?void 0:J.y,G=((R=E.arrow)==null?void 0:R.centerOffset)!==0,[Q,re]=m.useState();return zs(()=>{g&&re(window.getComputedStyle(g).zIndex)},[g]),s.jsx("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:P?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ee=E.transformOrigin)==null?void 0:ee.x,(F=E.transformOrigin)==null?void 0:F.y].join(" "),...((V=E.hide)==null?void 0:V.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(yA,{scope:n,placedSide:D,onArrowChange:N,arrowX:T,arrowY:U,shouldHideArrow:G,children:s.jsx(dt.div,{"data-side":D,"data-align":$,...v,ref:x,style:{...v.style,animation:P?void 0:"none"}})})})});zj.displayName=tx;var $j="PopperArrow",jA={top:"bottom",right:"left",bottom:"top",left:"right"},Rj=m.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=bA($j,r),o=jA[i.placedSide];return s.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:s.jsx(gA,{...a,ref:n,style:{...a.style,display:"block"}})})});Rj.displayName=$j;function NA(e){return e!==null}var kA=e=>({name:"transformOrigin",options:e,fn(t){var j,g,y;const{placement:n,rects:r,middlewareData:a}=t,o=((j=a.arrow)==null?void 0:j.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,h]=Ij(n),u={start:"0%",center:"50%",end:"100%"}[h],f=(((g=a.arrow)==null?void 0:g.x)??0)+l/2,p=(((y=a.arrow)==null?void 0:y.y)??0)+c/2;let w="",v="";return d==="bottom"?(w=o?u:`${f}px`,v=`${-c}px`):d==="top"?(w=o?u:`${f}px`,v=`${r.floating.height+c}px`):d==="right"?(w=`${-c}px`,v=o?u:`${p}px`):d==="left"&&(w=`${r.floating.width+c}px`,v=o?u:`${p}px`),{data:{x:w,y:v}}}});function Ij(e){const[t,n="center"]=e.split("-");return[t,n]}var Lj=Tj,nx=Aj,Fj=zj,Uj=Rj,SA="Portal",rx=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,i]=m.useState(!1);zs(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?nb.createPortal(s.jsx(dt.div,{...r,ref:t}),o):null});rx.displayName=SA;function CA(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Aa=e=>{const{present:t,children:n}=e,r=EA(t),a=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Cn(r.ref,MA(a));return typeof n=="function"||r.isPresent?m.cloneElement(a,{ref:i}):null};Aa.displayName="Presence";function EA(e){const[t,n]=m.useState(),r=m.useRef(null),a=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=CA(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const d=jc(r.current);i.current=l==="mounted"?d:"none"},[l]),zs(()=>{const d=r.current,h=a.current;if(h!==e){const f=i.current,p=jc(d);e?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&f!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),zs(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,u=p=>{const v=jc(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&v&&(c("ANIMATION_END"),!a.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},f=p=>{p.target===t&&(i.current=jc(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function jc(e){return(e==null?void 0:e.animationName)||"none"}function MA(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var DA=Tm[" useInsertionEffect ".trim().toString()]||zs;function sx({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=_A({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const h=m.useRef(e!==void 0);m.useEffect(()=>{const u=h.current;u!==l&&console.warn(`${r} is changing from ${u?"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,r])}const d=m.useCallback(h=>{var u;if(l){const f=PA(h)?h(e):h;f!==e&&((u=o.current)==null||u.call(o,f))}else i(h)},[l,e,i,o]);return[c,d]}function _A({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),a=m.useRef(n),i=m.useRef(t);return DA(()=>{i.current=t},[t]),m.useEffect(()=>{var o;a.current!==n&&((o=i.current)==null||o.call(i,n),a.current=n)},[n,a]),[n,r,i]}function PA(e){return typeof e=="function"}var TA=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"}),OA="VisuallyHidden",Bj=m.forwardRef((e,t)=>s.jsx(dt.span,{...e,ref:t,style:{...TA,...e.style}}));Bj.displayName=OA;var AA=Bj,[Pu]=Nu("Tooltip",[_u]),Tu=_u(),Wj="TooltipProvider",zA=700,vm="tooltip.open",[$A,ax]=Pu(Wj),Hj=e=>{const{__scopeTooltip:t,delayDuration:n=zA,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=m.useRef(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx($A,{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,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:a,children:i})};Hj.displayName=Wj;var ul="Tooltip",[RA,Ou]=Pu(ul),Vj=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=ax(ul,e.__scopeTooltip),d=Tu(t),[h,u]=m.useState(null),f=sr(),p=m.useRef(0),w=o??c.disableHoverableContent,v=l??c.delayDuration,j=m.useRef(!1),[g,y]=sx({prop:r,defaultProp:a??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(vm))):c.onClose(),i==null||i(S)},caller:ul}),x=m.useMemo(()=>g?j.current?"delayed-open":"instant-open":"closed",[g]),b=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,j.current=!1,y(!0)},[y]),N=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{j.current=!0,y(!0),p.current=0},v)},[v,y]);return m.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),s.jsx(Lj,{...d,children:s.jsx(RA,{scope:t,contentId:f,open:g,stateAttribute:x,trigger:h,onTriggerChange:u,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?k():b()},[c.isOpenDelayedRef,k,b]),onTriggerLeave:m.useCallback(()=>{w?N():(window.clearTimeout(p.current),p.current=0)},[N,w]),onOpen:b,onClose:N,disableHoverableContent:w,children:n})})};Vj.displayName=ul;var wm="TooltipTrigger",Yj=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Ou(wm,n),i=ax(wm,n),o=Tu(n),l=m.useRef(null),c=Cn(t,l,a.onTriggerChange),d=m.useRef(!1),h=m.useRef(!1),u=m.useCallback(()=>d.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),s.jsx(nx,{asChild:!0,...o,children:s.jsx(dt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:Dt(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Dt(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Dt(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:Dt(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:Dt(e.onBlur,a.onClose),onClick:Dt(e.onClick,a.onClose)})})});Yj.displayName=wm;var IA="TooltipPortal",[PL,LA]=Pu(IA,{forceMount:void 0}),$i="TooltipContent",Xj=m.forwardRef((e,t)=>{const n=LA($i,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Ou($i,e.__scopeTooltip);return s.jsx(Aa,{present:r||o.open,children:o.disableHoverableContent?s.jsx(qj,{side:a,...i,ref:t}):s.jsx(FA,{side:a,...i,ref:t})})}),FA=m.forwardRef((e,t)=>{const n=Ou($i,e.__scopeTooltip),r=ax($i,e.__scopeTooltip),a=m.useRef(null),i=Cn(t,a),[o,l]=m.useState(null),{trigger:c,onClose:d}=n,h=a.current,{onPointerInTransitChange:u}=r,f=m.useCallback(()=>{l(null),u(!1)},[u]),p=m.useCallback((w,v)=>{const j=w.currentTarget,g={x:w.clientX,y:w.clientY},y=VA(g,j.getBoundingClientRect()),x=YA(g,y),b=XA(v.getBoundingClientRect()),N=GA([...x,...b]);l(N),u(!0)},[u]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&h){const w=j=>p(j,h),v=j=>p(j,c);return c.addEventListener("pointerleave",w),h.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",w),h.removeEventListener("pointerleave",v)}}},[c,h,p,f]),m.useEffect(()=>{if(o){const w=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)),x=!qA(g,o);y?f():x&&(f(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,h,o,d,f]),s.jsx(qj,{...e,ref:i})}),[UA,BA]=Pu(ul,{isInside:!1}),WA=HT("TooltipContent"),qj=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=Ou($i,n),d=Tu(n),{onClose:h}=c;return m.useEffect(()=>(document.addEventListener(vm,h),()=>document.removeEventListener(vm,h)),[h]),m.useEffect(()=>{if(c.trigger){const u=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&h()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,h]),s.jsx(Su,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:h,children:s.jsxs(Fj,{"data-state":c.stateAttribute,...d,...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:[s.jsx(WA,{children:r}),s.jsx(UA,{scope:n,isInside:!0,children:s.jsx(AA,{id:c.contentId,role:"tooltip",children:a||r})})]})})});Xj.displayName=$i;var Gj="TooltipArrow",HA=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Tu(n);return BA(Gj,n).isInside?null:s.jsx(Uj,{...a,...r,ref:t})});HA.displayName=Gj;function VA(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function YA(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function XA(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function qA(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],d=l.x,h=l.y,u=c.x,f=c.y;h>r!=f>r&&n<(u-d)*(r-h)/(f-h)+d&&(a=!a)}return a}function GA(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),KA(t)}function KA(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}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 QA=Hj,ZA=Vj,JA=Yj,Kj=Xj;const Th=QA,Oh=ZA,Ah=JA,qc=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Kj,{ref:r,sideOffset:t,className:Ee("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}));qc.displayName=Kj.displayName;const e6=320,t6=32,n6=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",ym=({data:e,targetPosition:t,sourcePosition:n})=>{const r=e,[a,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",d=n6(r.plugin||"core");return r.isForeign?s.jsx("div",{className:"relative",children:s.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:`${r.name}-foreign-key`,children:[s.jsx(mt,{size:12,className:"text-gray-400"}),s.jsx("span",{className:"font-medium",children:r.displayName||r.name}),t&&s.jsx(da,{type:"target",id:r.name,position:t,className:Ee(c)})]})}):s.jsx("div",{className:"relative",children:s.jsxs("div",{className:Ee("border border-gray-700 overflow-hidden shadow-xl bg-gray-900 rounded-lg","hover:border-gray-600 transition-colors duration-200"),style:{width:e6},id:`${r.name}-schema-node`,children:[s.jsxs("div",{className:Ee("px-4 py-3 bg-black border-b border-gray-700 flex items-center justify-between","cursor-pointer select-none"),onClick:()=>i(!a),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mt,{size:16,className:"text-white"}),s.jsx("span",{className:"text-white font-semibold text-sm",children:r.displayName||r.name})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:h=>{h.stopPropagation(),l(!o)},className:"p-1 hover:bg-gray-800 rounded transition-colors",children:o?s.jsx(JP,{size:12,className:"text-gray-400"}):s.jsx(Cl,{size:12,className:"text-gray-400"})}),a?s.jsx(Hp,{size:14,className:"text-gray-400"}):s.jsx(ju,{size:14,className:"text-gray-400"})]})]}),!a&&s.jsx("div",{className:"max-h-96 bg-black overflow-y-auto",children:r.columns.map(h=>s.jsxs("div",{className:Ee("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:t6},children:[s.jsxs("div",{className:"flex items-center gap-1 mr-3 min-w-[40px]",children:[h.isPrimary&&s.jsx(Th,{delayDuration:100,children:s.jsxs(Oh,{children:[s.jsx(Ah,{asChild:!0,children:s.jsx(zd,{size:10,className:"text-yellow-400 flex-shrink-0"})}),s.jsx(qc,{className:"bg-black border-gray-600 text-white text-xs",children:"Primary Key"})]})}),h.isUnique&&!h.isPrimary&&s.jsx(Th,{delayDuration:100,children:s.jsxs(Oh,{children:[s.jsx(Ah,{asChild:!0,children:s.jsx(eT,{size:10,className:"text-green-400 flex-shrink-0"})}),s.jsx(qc,{className:"bg-black border-gray-600 text-white text-xs",children:"Unique"})]})}),h.isIdentity&&s.jsx(Th,{delayDuration:100,children:s.jsxs(Oh,{children:[s.jsx(Ah,{asChild:!0,children:s.jsx(nT,{size:10,className:"text-blue-400 flex-shrink-0"})}),s.jsx(qc,{className:"bg-black border-gray-600 text-white text-xs",children:"Identity"})]})})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[!h.isNullable&&s.jsx("span",{className:"text-red-400 text-xs",children:"*"}),s.jsx("span",{className:"text-white font-medium truncate",children:h.name}),s.jsx("span",{className:"text-gray-400 font-mono text-xs",children:h.format})]}),o&&h.description&&s.jsx("div",{className:"text-gray-500 text-xs mt-1 truncate",children:h.description})]}),s.jsx("div",{className:"ml-2",children:s.jsx("span",{className:Ee("px-2 py-1 rounded text-xs font-medium",d),children:h.plugin})}),s.jsx(da,{type:"target",id:h.id,position:t||"left",className:Ee(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)"}}),s.jsx(da,{type:"source",id:h.id,position:n||"right",className:Ee(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))}),r.relationships&&r.relationships.length>0&&s.jsx("div",{className:"px-4 py-2 bg-gray-800 border-t border-gray-700",children:s.jsxs("span",{className:"text-xs text-gray-400",children:[r.relationships.length," relationship",r.relationships.length!==1?"s":""]})})]})})},r6={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"}]},s6={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 a6(){return s.jsx("div",{className:"min-h-screen bg-black p-8",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-3xl font-light text-white mb-4",children:"Database Schema Node Demo"}),s.jsx("p",{className:"text-gray-400",children:"Enhanced database schema nodes with dark mode theming, collapsible views, and detailed tooltips."})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl text-white mb-4",children:"Core User Table"}),s.jsx(ym,{data:r6,targetPosition:"left",sourcePosition:"right"})]}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl text-white mb-4",children:"Organization Plugin Table"}),s.jsx(ym,{data:s6,targetPosition:"left",sourcePosition:"right"})]})]}),s.jsxs("div",{className:"mt-12 p-6 bg-gray-900 rounded-lg border border-gray-700",children:[s.jsx("h3",{className:"text-lg text-white mb-4",children:"Features"}),s.jsxs("ul",{className:"space-y-2 text-gray-300",children:[s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Dark Mode Optimized:"})," Designed specifically for dark themes"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Collapsible Views:"})," Click the header to collapse/expand table contents"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Detail Toggle:"})," Show/hide column descriptions with the eye icon"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Plugin Badges:"})," Color-coded plugin indicators"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Interactive Icons:"})," Hover tooltips for primary keys, unique constraints, etc."]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Relationship Counter:"})," Shows number of relationships in footer"]}),s.jsxs("li",{children:["• ",s.jsx("strong",{children:"Connection Handles:"})," Invisible handles for React Flow connections"]})]})]})]})})}const Qj=m.createContext(void 0);function i6({children:e}){const[t,n]=m.useState({users:0,organizations:0,sessions:0,teams:0}),[r,a]=m.useState(!0),i=m.useCallback(async()=>{try{const c=await(await fetch("/api/counts")).json();n(c)}catch{}finally{a(!1)}},[]),o=m.useCallback(async()=>{a(!0),await i()},[i]);return m.useEffect(()=>{i()},[i]),s.jsx(Qj.Provider,{value:{counts:t,loading:r,refetchCounts:o},children:e})}function Au(){const e=m.useContext(Qj);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}var ov=1,o6=.9,l6=.8,c6=.17,zh=.1,$h=.999,d6=.9999,u6=.99,h6=/[\\\/_+.#"@\[\(\{&]/,f6=/[\\\/_+.#"@\[\(\{&]/g,m6=/[\s-]/,Zj=/[\s-]/g;function bm(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?ov:u6;var l=`${a},${i}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(i),d=n.indexOf(c,a),h=0,u,f,p,w;d>=0;)u=bm(e,t,n,r,d+1,i+1,o),u>h&&(d===a?u*=ov:h6.test(e.charAt(d-1))?(u*=l6,p=e.slice(a,d-1).match(f6),p&&a>0&&(u*=Math.pow($h,p.length))):m6.test(e.charAt(d-1))?(u*=o6,w=e.slice(a,d-1).match(Zj),w&&a>0&&(u*=Math.pow($h,w.length))):(u*=c6,a>0&&(u*=Math.pow($h,d-a))),e.charAt(d)!==t.charAt(i)&&(u*=d6)),(u<zh&&n.charAt(d-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(d-1)!==r.charAt(i))&&(f=bm(e,t,n,r,d+1,i+2,o),f*zh>u&&(u=f*zh)),u>h&&(h=u),d=n.indexOf(c,d+1);return o[l]=h,h}function lv(e){return e.toLowerCase().replace(Zj," ")}function p6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,bm(e,t,lv(e),lv(t),0,0,{})}var Rh="focusScope.autoFocusOnMount",Ih="focusScope.autoFocusOnUnmount",cv={bubbles:!1,cancelable:!0},x6="FocusScope",ix=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),d=Ai(a),h=Ai(i),u=m.useRef(null),f=Cn(t,v=>c(v)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let v=function(x){if(p.paused||!l)return;const b=x.target;l.contains(b)?u.current=b:fs(u.current,{select:!0})},j=function(x){if(p.paused||!l)return;const b=x.relatedTarget;b!==null&&(l.contains(b)||fs(u.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&fs(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()}}},[r,l,p.paused]),m.useEffect(()=>{if(l){uv.add(p);const v=document.activeElement;if(!l.contains(v)){const g=new CustomEvent(Rh,cv);l.addEventListener(Rh,d),l.dispatchEvent(g),g.defaultPrevented||(g6(j6(Jj(l)),{select:!0}),document.activeElement===v&&fs(l))}return()=>{l.removeEventListener(Rh,d),setTimeout(()=>{const g=new CustomEvent(Ih,cv);l.addEventListener(Ih,h),l.dispatchEvent(g),g.defaultPrevented||fs(v??document.body,{select:!0}),l.removeEventListener(Ih,h),uv.remove(p)},0)}}},[l,d,h,p]);const w=m.useCallback(v=>{if(!n&&!r||p.paused)return;const j=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(j&&g){const y=v.currentTarget,[x,b]=v6(y);x&&b?!v.shiftKey&&g===b?(v.preventDefault(),n&&fs(x,{select:!0})):v.shiftKey&&g===x&&(v.preventDefault(),n&&fs(b,{select:!0})):g===y&&v.preventDefault()}},[n,r,p.paused]);return s.jsx(dt.div,{tabIndex:-1,...o,ref:f,onKeyDown:w})});ix.displayName=x6;function g6(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fs(r,{select:t}),document.activeElement!==n)return}function v6(e){const t=Jj(e),n=dv(t,e),r=dv(t.reverse(),e);return[n,r]}function Jj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dv(e,t){for(const n of e)if(!w6(n,{upTo:t}))return n}function w6(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 y6(e){return e instanceof HTMLInputElement&&"select"in e}function fs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&y6(e)&&t&&e.select()}}var uv=b6();function b6(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=hv(e,t),e.unshift(t)},remove(t){var n;e=hv(e,t),(n=e[0])==null||n.resume()}}}function hv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function j6(e){return e.filter(t=>t.tagName!=="A")}var Lh=0;function eN(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fv()),document.body.insertAdjacentElement("beforeend",e[1]??fv()),Lh++,()=>{Lh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Lh--}},[])}function fv(){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 yr=function(){return yr=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},yr.apply(this,arguments)};function tN(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function N6(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Gc="right-scroll-bar-position",Kc="width-before-scroll-bar",k6="with-scroll-bars-hidden",S6="--removed-body-scroll-bar-size";function Fh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function C6(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var E6=typeof window<"u"?m.useLayoutEffect:m.useEffect,mv=new WeakMap;function M6(e,t){var n=C6(null,function(r){return e.forEach(function(a){return Fh(a,r)})});return E6(function(){var r=mv.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||Fh(l,null)}),i.forEach(function(l){a.has(l)||Fh(l,o)})}mv.set(n,e)},[e]),n}function D6(e){return e}function _6(e,t){t===void 0&&(t=D6);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!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)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){o.push(h),d()},filter:function(h){return o=o.filter(h),n}}}};return a}function P6(e){e===void 0&&(e={});var t=_6(null);return t.options=yr({async:!0,ssr:!1},e),t}var nN=function(e){var t=e.sideCar,n=tN(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,yr({},n))};nN.isSideCarExport=!0;function T6(e,t){return e.useMedium(t),nN}var rN=P6(),Uh=function(){},zu=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Uh,onWheelCapture:Uh,onTouchMoveCapture:Uh}),a=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,h=e.enabled,u=e.shards,f=e.sideCar,p=e.noRelative,w=e.noIsolation,v=e.inert,j=e.allowPinchZoom,g=e.as,y=g===void 0?"div":g,x=e.gapMode,b=tN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=f,k=M6([n,t]),S=yr(yr({},b),a);return m.createElement(m.Fragment,null,h&&m.createElement(N,{sideCar:rN,removeScrollBar:d,shards:u,noRelative:p,noIsolation:w,inert:v,setCallbacks:i,allowPinchZoom:!!j,lockRef:n,gapMode:x}),o?m.cloneElement(m.Children.only(l),yr(yr({},S),{ref:k})):m.createElement(y,yr({},S,{className:c,ref:k}),l))});zu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zu.classNames={fullWidth:Kc,zeroRight:Gc};var O6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function A6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=O6();return t&&e.setAttribute("nonce",t),e}function z6(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $6(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var R6=function(){var e=0,t=null;return{add:function(n){e==0&&(t=A6())&&(z6(t,n),$6(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},I6=function(){var e=R6();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},sN=function(){var e=I6(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},L6={left:0,top:0,right:0,gap:0},Bh=function(e){return parseInt(e||"",10)||0},F6=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Bh(n),Bh(r),Bh(a)]},U6=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return L6;var t=F6(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},B6=sN(),vi="data-scroll-locked",W6=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
365
- .`.concat(k6,` {
366
- overflow: hidden `).concat(r,`;
367
- padding-right: `).concat(l,"px ").concat(r,`;
368
- }
369
- body[`).concat(vi,`] {
370
- overflow: hidden `).concat(r,`;
371
- overscroll-behavior: contain;
372
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
373
- padding-left: `.concat(a,`px;
374
- padding-top: `).concat(i,`px;
375
- padding-right: `).concat(o,`px;
376
- margin-left:0;
377
- margin-top:0;
378
- margin-right: `).concat(l,"px ").concat(r,`;
379
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
380
- }
381
-
382
- .`).concat(Gc,` {
383
- right: `).concat(l,"px ").concat(r,`;
384
- }
385
-
386
- .`).concat(Kc,` {
387
- margin-right: `).concat(l,"px ").concat(r,`;
388
- }
389
-
390
- .`).concat(Gc," .").concat(Gc,` {
391
- right: 0 `).concat(r,`;
392
- }
393
-
394
- .`).concat(Kc," .").concat(Kc,` {
395
- margin-right: 0 `).concat(r,`;
396
- }
397
-
398
- body[`).concat(vi,`] {
399
- `).concat(S6,": ").concat(l,`px;
400
- }
401
- `)},pv=function(){var e=parseInt(document.body.getAttribute(vi)||"0",10);return isFinite(e)?e:0},H6=function(){m.useEffect(function(){return document.body.setAttribute(vi,(pv()+1).toString()),function(){var e=pv()-1;e<=0?document.body.removeAttribute(vi):document.body.setAttribute(vi,e.toString())}},[])},V6=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;H6();var i=m.useMemo(function(){return U6(a)},[a]);return m.createElement(B6,{styles:W6(i,!t,a,n?"":"!important")})},jm=!1;if(typeof window<"u")try{var Nc=Object.defineProperty({},"passive",{get:function(){return jm=!0,!0}});window.addEventListener("test",Nc,Nc),window.removeEventListener("test",Nc,Nc)}catch{jm=!1}var Ua=jm?{passive:!1}:!1,Y6=function(e){return e.tagName==="TEXTAREA"},aN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Y6(e)&&n[t]==="visible")},X6=function(e){return aN(e,"overflowY")},q6=function(e){return aN(e,"overflowX")},xv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=iN(e,r);if(a){var i=oN(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},G6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},K6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},iN=function(e,t){return e==="v"?X6(t):q6(t)},oN=function(e,t){return e==="v"?G6(t):K6(t)},Q6=function(e,t){return e==="h"&&t==="rtl"?-1:1},Z6=function(e,t,n,r,a){var i=Q6(e,window.getComputedStyle(t).direction),o=i*r,l=n.target,c=t.contains(l),d=!1,h=o>0,u=0,f=0;do{if(!l)break;var p=oN(e,l),w=p[0],v=p[1],j=p[2],g=v-j-i*w;(w||g)&&iN(e,l)&&(u+=g,f+=w);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(u)<1||!h&&Math.abs(f)<1)&&(d=!0),d},kc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gv=function(e){return[e.deltaX,e.deltaY]},vv=function(e){return e&&"current"in e?e.current:e},J6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ez=function(e){return`
402
- .block-interactivity-`.concat(e,` {pointer-events: none;}
403
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
404
- `)},tz=0,Ba=[];function nz(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),a=m.useState(tz++)[0],i=m.useState(sN)[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(a));var v=N6([e.lockRef.current],(e.shards||[]).map(vv),!0).filter(Boolean);return v.forEach(function(j){return j.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(a))})}}},[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=kc(v),y=n.current,x="deltaX"in v?v.deltaX:y[0]-g[0],b="deltaY"in v?v.deltaY:y[1]-g[1],N,k=v.target,S=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in v&&S==="h"&&k.type==="range")return!1;var M=xv(S,k);if(!M)return!0;if(M?N=S:(N=S==="v"?"h":"v",M=xv(S,k)),!M)return!1;if(!r.current&&"changedTouches"in v&&(x||b)&&(r.current=N),!N)return!0;var O=r.current||N;return Z6(O,j,v,O==="h"?x:b)},[]),c=m.useCallback(function(v){var j=v;if(!(!Ba.length||Ba[Ba.length-1]!==i)){var g="deltaY"in j?gv(j):kc(j),y=t.current.filter(function(N){return N.name===j.type&&(N.target===j.target||j.target===N.shadowParent)&&J6(N.delta,g)})[0];if(y&&y.should){j.cancelable&&j.preventDefault();return}if(!y){var x=(o.current.shards||[]).map(vv).filter(Boolean).filter(function(N){return N.contains(j.target)}),b=x.length>0?l(j,x[0]):!o.current.noIsolation;b&&j.cancelable&&j.preventDefault()}}},[]),d=m.useCallback(function(v,j,g,y){var x={name:v,delta:j,target:g,should:y,shadowParent:rz(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),h=m.useCallback(function(v){n.current=kc(v),r.current=void 0},[]),u=m.useCallback(function(v){d(v.type,gv(v),v.target,l(v,e.lockRef.current))},[]),f=m.useCallback(function(v){d(v.type,kc(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Ba.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Ua),document.addEventListener("touchmove",c,Ua),document.addEventListener("touchstart",h,Ua),function(){Ba=Ba.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ua),document.removeEventListener("touchmove",c,Ua),document.removeEventListener("touchstart",h,Ua)}},[]);var p=e.removeScrollBar,w=e.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:ez(a)}):null,p?m.createElement(V6,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sz=T6(rN,nz);var ox=m.forwardRef(function(e,t){return m.createElement(zu,yr({},e,{ref:t,sideCar:sz}))});ox.classNames=zu.classNames;var az=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wa=new WeakMap,Sc=new WeakMap,Cc={},Wh=0,lN=function(e){return e&&(e.host||lN(e.parentNode))},iz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=lN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},oz=function(e,t,n,r){var a=iz(t,Array.isArray(e)?e:[e]);Cc[n]||(Cc[n]=new WeakMap);var i=Cc[n],o=[],l=new Set,c=new Set(a),d=function(u){!u||l.has(u)||(l.add(u),d(u.parentNode))};a.forEach(d);var h=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(f){if(l.has(f))h(f);else try{var p=f.getAttribute(r),w=p!==null&&p!=="false",v=(Wa.get(f)||0)+1,j=(i.get(f)||0)+1;Wa.set(f,v),i.set(f,j),o.push(f),v===1&&w&&Sc.set(f,!0),j===1&&f.setAttribute(n,"true"),w||f.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return h(t),l.clear(),Wh++,function(){o.forEach(function(u){var f=Wa.get(u)-1,p=i.get(u)-1;Wa.set(u,f),i.set(u,p),f||(Sc.has(u)||u.removeAttribute(r),Sc.delete(u)),p||u.removeAttribute(n)}),Wh--,Wh||(Wa=new WeakMap,Wa=new WeakMap,Sc=new WeakMap,Cc={})}},cN=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=az(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),oz(r,a,n,"aria-hidden")):function(){return null}},$u="Dialog",[dN]=Nu($u),[lz,cr]=dN($u),uN=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=m.useRef(null),c=m.useRef(null),[d,h]=sx({prop:r,defaultProp:a??!1,onChange:i,caller:$u});return s.jsx(lz,{scope:t,triggerRef:l,contentRef:c,contentId:sr(),titleId:sr(),descriptionId:sr(),open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(u=>!u),[h]),modal:o,children:n})};uN.displayName=$u;var hN="DialogTrigger",cz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=cr(hN,n),i=Cn(t,a.triggerRef);return s.jsx(dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":dx(a.open),...r,ref:i,onClick:Dt(e.onClick,a.onOpenToggle)})});cz.displayName=hN;var lx="DialogPortal",[dz,fN]=dN(lx,{forceMount:void 0}),mN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=cr(lx,t);return s.jsx(dz,{scope:t,forceMount:n,children:m.Children.map(r,o=>s.jsx(Aa,{present:n||i.open,children:s.jsx(rx,{asChild:!0,container:a,children:o})}))})};mN.displayName=lx;var Ud="DialogOverlay",pN=m.forwardRef((e,t)=>{const n=fN(Ud,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=cr(Ud,e.__scopeDialog);return i.modal?s.jsx(Aa,{present:r||i.open,children:s.jsx(hz,{...a,ref:t})}):null});pN.displayName=Ud;var uz=ku("DialogOverlay.RemoveScroll"),hz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=cr(Ud,n);return s.jsx(ox,{as:uz,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(dt.div,{"data-state":dx(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ea="DialogContent",xN=m.forwardRef((e,t)=>{const n=fN(Ea,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=cr(Ea,e.__scopeDialog);return s.jsx(Aa,{present:r||i.open,children:i.modal?s.jsx(fz,{...a,ref:t}):s.jsx(mz,{...a,ref:t})})});xN.displayName=Ea;var fz=m.forwardRef((e,t)=>{const n=cr(Ea,e.__scopeDialog),r=m.useRef(null),a=Cn(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return cN(i)},[]),s.jsx(gN,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Dt(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Dt(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:Dt(e.onFocusOutside,i=>i.preventDefault())})}),mz=m.forwardRef((e,t)=>{const n=cr(Ea,e.__scopeDialog),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(gN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),gN=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=cr(Ea,n),c=m.useRef(null),d=Cn(t,c);return eN(),s.jsxs(s.Fragment,{children:[s.jsx(ix,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Su,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":dx(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(vz,{titleId:l.titleId}),s.jsx(yz,{contentRef:c,descriptionId:l.descriptionId})]})]})}),cx="DialogTitle",pz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=cr(cx,n);return s.jsx(dt.h2,{id:a.titleId,...r,ref:t})});pz.displayName=cx;var vN="DialogDescription",xz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=cr(vN,n);return s.jsx(dt.p,{id:a.descriptionId,...r,ref:t})});xz.displayName=vN;var wN="DialogClose",gz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=cr(wN,n);return s.jsx(dt.button,{type:"button",...r,ref:t,onClick:Dt(e.onClick,()=>a.onOpenChange(!1))})});gz.displayName=wN;function dx(e){return e?"open":"closed"}var yN="DialogTitleWarning",[TL,bN]=FT(yN,{contentName:Ea,titleName:cx,docsSlug:"dialog"}),vz=({titleId:e})=>{const t=bN(yN),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
405
-
406
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
407
-
408
- 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},wz="DialogDescriptionWarning",yz=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${bN(wz).contentName}}.`;return m.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},bz=uN,jz=mN,Nz=pN,kz=xN,oo='[cmdk-group=""]',Hh='[cmdk-group-items=""]',Sz='[cmdk-group-heading=""]',jN='[cmdk-item=""]',wv=`${jN}:not([aria-disabled="true"])`,Nm="cmdk-item-select",Ya="data-value",Cz=(e,t,n)=>p6(e,t,n),NN=m.createContext(void 0),Ml=()=>m.useContext(NN),kN=m.createContext(void 0),ux=()=>m.useContext(kN),SN=m.createContext(void 0),CN=m.forwardRef((e,t)=>{let n=Xa(()=>{var T,U;return{search:"",value:(U=(T=e.value)!=null?T:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Xa(()=>new Set),a=Xa(()=>new Map),i=Xa(()=>new Map),o=Xa(()=>new Set),l=EN(e),{label:c,children:d,value:h,onValueChange:u,filter:f,shouldFilter:p,loop:w,disablePointerSelection:v=!1,vimBindings:j=!0,...g}=e,y=sr(),x=sr(),b=sr(),N=m.useRef(null),k=Rz();Ma(()=>{if(h!==void 0){let T=h.trim();n.current.value=T,S.emit()}},[h]),Ma(()=>{k(6,L)},[]);let S=m.useMemo(()=>({subscribe:T=>(o.current.add(T),()=>o.current.delete(T)),snapshot:()=>n.current,setState:(T,U,G)=>{var Q,re,ne,J;if(!Object.is(n.current[T],U)){if(n.current[T]=U,T==="search")z(),I(),k(1,B);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let R=document.getElementById(b);R?R.focus():(Q=document.getElementById(y))==null||Q.focus()}if(k(7,()=>{var R;n.current.selectedItemId=(R=C())==null?void 0:R.id,S.emit()}),G||k(5,L),((re=l.current)==null?void 0:re.value)!==void 0){let R=U??"";(J=(ne=l.current).onValueChange)==null||J.call(ne,R);return}}S.emit()}},emit:()=>{o.current.forEach(T=>T())}}),[]),M=m.useMemo(()=>({value:(T,U,G)=>{var Q;U!==((Q=i.current.get(T))==null?void 0:Q.value)&&(i.current.set(T,{value:U,keywords:G}),n.current.filtered.items.set(T,O(U,G)),k(2,()=>{I(),S.emit()}))},item:(T,U)=>(r.current.add(T),U&&(a.current.has(U)?a.current.get(U).add(T):a.current.set(U,new Set([T]))),k(3,()=>{z(),I(),n.current.value||B(),S.emit()}),()=>{i.current.delete(T),r.current.delete(T),n.current.filtered.items.delete(T);let G=C();k(4,()=>{z(),(G==null?void 0:G.getAttribute("id"))===T&&B(),S.emit()})}),group:T=>(a.current.has(T)||a.current.set(T,new Set),()=>{i.current.delete(T),a.current.delete(T)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:b,labelId:x,listInnerRef:N}),[]);function O(T,U){var G,Q;let re=(Q=(G=l.current)==null?void 0:G.filter)!=null?Q:Cz;return T?re(T,n.current.search,U):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let T=n.current.filtered.items,U=[];n.current.filtered.groups.forEach(Q=>{let re=a.current.get(Q),ne=0;re.forEach(J=>{let R=T.get(J);ne=Math.max(R,ne)}),U.push([Q,ne])});let G=N.current;A().sort((Q,re)=>{var ne,J;let R=Q.getAttribute("id"),ee=re.getAttribute("id");return((ne=T.get(ee))!=null?ne:0)-((J=T.get(R))!=null?J:0)}).forEach(Q=>{let re=Q.closest(Hh);re?re.appendChild(Q.parentElement===re?Q:Q.closest(`${Hh} > *`)):G.appendChild(Q.parentElement===G?Q:Q.closest(`${Hh} > *`))}),U.sort((Q,re)=>re[1]-Q[1]).forEach(Q=>{var re;let ne=(re=N.current)==null?void 0:re.querySelector(`${oo}[${Ya}="${encodeURIComponent(Q[0])}"]`);ne==null||ne.parentElement.appendChild(ne)})}function B(){let T=A().find(G=>G.getAttribute("aria-disabled")!=="true"),U=T==null?void 0:T.getAttribute(Ya);S.setState("value",U||void 0)}function z(){var T,U,G,Q;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let re=0;for(let ne of r.current){let J=(U=(T=i.current.get(ne))==null?void 0:T.value)!=null?U:"",R=(Q=(G=i.current.get(ne))==null?void 0:G.keywords)!=null?Q:[],ee=O(J,R);n.current.filtered.items.set(ne,ee),ee>0&&re++}for(let[ne,J]of a.current)for(let R of J)if(n.current.filtered.items.get(R)>0){n.current.filtered.groups.add(ne);break}n.current.filtered.count=re}function L(){var T,U,G;let Q=C();Q&&(((T=Q.parentElement)==null?void 0:T.firstChild)===Q&&((G=(U=Q.closest(oo))==null?void 0:U.querySelector(Sz))==null||G.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function C(){var T;return(T=N.current)==null?void 0:T.querySelector(`${jN}[aria-selected="true"]`)}function A(){var T;return Array.from(((T=N.current)==null?void 0:T.querySelectorAll(wv))||[])}function _(T){let U=A()[T];U&&S.setState("value",U.getAttribute(Ya))}function P(T){var U;let G=C(),Q=A(),re=Q.findIndex(J=>J===G),ne=Q[re+T];(U=l.current)!=null&&U.loop&&(ne=re+T<0?Q[Q.length-1]:re+T===Q.length?Q[0]:Q[re+T]),ne&&S.setState("value",ne.getAttribute(Ya))}function E(T){let U=C(),G=U==null?void 0:U.closest(oo),Q;for(;G&&!Q;)G=T>0?zz(G,oo):$z(G,oo),Q=G==null?void 0:G.querySelector(wv);Q?S.setState("value",Q.getAttribute(Ya)):P(T)}let D=()=>_(A().length-1),$=T=>{T.preventDefault(),T.metaKey?D():T.altKey?E(1):P(1)},H=T=>{T.preventDefault(),T.metaKey?_(0):T.altKey?E(-1):P(-1)};return m.createElement(dt.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:T=>{var U;(U=g.onKeyDown)==null||U.call(g,T);let G=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||G))switch(T.key){case"n":case"j":{j&&T.ctrlKey&&$(T);break}case"ArrowDown":{$(T);break}case"p":case"k":{j&&T.ctrlKey&&H(T);break}case"ArrowUp":{H(T);break}case"Home":{T.preventDefault(),_(0);break}case"End":{T.preventDefault(),D();break}case"Enter":{T.preventDefault();let Q=C();if(Q){let re=new Event(Nm);Q.dispatchEvent(re)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:Lz},c),Ru(e,T=>m.createElement(kN.Provider,{value:S},m.createElement(NN.Provider,{value:M},T))))}),Ez=m.forwardRef((e,t)=>{var n,r;let a=sr(),i=m.useRef(null),o=m.useContext(SN),l=Ml(),c=EN(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Ma(()=>{if(!d)return l.item(a,o==null?void 0:o.id)},[d]);let h=MN(a,i,[e.value,e.children,i],e.keywords),u=ux(),f=Is(k=>k.value&&k.value===h.current),p=Is(k=>d||l.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);m.useEffect(()=>{let k=i.current;if(!(!k||e.disabled))return k.addEventListener(Nm,w),()=>k.removeEventListener(Nm,w)},[p,e.onSelect,e.disabled]);function w(){var k,S;v(),(S=(k=c.current).onSelect)==null||S.call(k,h.current)}function v(){u.setState("value",h.current,!0)}if(!p)return null;let{disabled:j,value:g,onSelect:y,forceMount:x,keywords:b,...N}=e;return m.createElement(dt.div,{ref:Sa(i,t),...N,id:a,"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:w},e.children)}),Mz=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=sr(),l=m.useRef(null),c=m.useRef(null),d=sr(),h=Ml(),u=Is(p=>a||h.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Ma(()=>h.group(o),[]),MN(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:a}),[a]);return m.createElement(dt.div,{ref:Sa(l,t),...i,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Ru(e,p=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},m.createElement(SN.Provider,{value:f},p))))}),Dz=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=m.useRef(null),i=Is(o=>!o.search);return!n&&!i?null:m.createElement(dt.div,{ref:Sa(a,t),...r,"cmdk-separator":"",role:"separator"})}),_z=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=ux(),o=Is(d=>d.search),l=Is(d=>d.selectedItemId),c=Ml();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(dt.input,{ref:t,...r,"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:a?e.value:o,onChange:d=>{a||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),Pz=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=m.useRef(null),o=m.useRef(null),l=Is(d=>d.selectedItemId),c=Ml();return m.useEffect(()=>{if(o.current&&i.current){let d=o.current,h=i.current,u,f=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let p=d.offsetHeight;h.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(d),()=>{cancelAnimationFrame(u),f.unobserve(d)}}},[]),m.createElement(dt.div,{ref:Sa(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Ru(e,d=>m.createElement("div",{ref:Sa(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),Tz=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...l}=e;return m.createElement(bz,{open:n,onOpenChange:r},m.createElement(jz,{container:o},m.createElement(Nz,{"cmdk-overlay":"",className:a}),m.createElement(kz,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(CN,{ref:t,...l}))))}),Oz=m.forwardRef((e,t)=>Is(n=>n.filtered.count===0)?m.createElement(dt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Az=m.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return m.createElement(dt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Ru(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),lo=Object.assign(CN,{List:Pz,Item:Ez,Input:_z,Group:Mz,Separator:Dz,Dialog:Tz,Empty:Oz,Loading:Az});function zz(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function $z(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function EN(e){let t=m.useRef(e);return Ma(()=>{t.current=e}),t}var Ma=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Xa(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Is(e){let t=ux(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function MN(e,t,n,r=[]){let a=m.useRef(),i=Ml();return Ma(()=>{var o;let l=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():a.current}})(),c=r.map(d=>d.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(Ya,l),a.current=l}),a}var Rz=()=>{let[e,t]=m.useState(),n=Xa(()=>new Map);return Ma(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Iz(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ru({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(Iz(t),{ref:t.ref},n(t.props.children)):n(t)}var Lz={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Fz({isOpen:e,onClose:t}){const n=Dr(),[r,a]=m.useState(""),[i,o]=m.useState(null);m.useEffect(()=>{(async()=>{try{const p=await(await fetch("/api/plugins")).json();o(p)}catch(f){console.error("Failed to fetch plugins:",f)}})()},[]);const l=u=>i!=null&&i.plugins?i.plugins.some(f=>f.id===u):!1,h=[{id:"users",title:"Users",description:"Manage users and their accounts",icon:ka,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:gr,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:L0,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:ra,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:L0,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:hm,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:Ts,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:$d,action:()=>n("/organizations"),category:"Actions",keywords:["invite","email","send"],requiresPlugin:"organization",disabled:!l("organization"),disabledMessage:"Enable organization plugin in settings"}].filter(u=>{var p;const f=r.toLowerCase();return u.title.toLowerCase().includes(f)||u.description.toLowerCase().includes(f)||((p=u.keywords)==null?void 0:p.some(w=>w.toLowerCase().includes(f)))}).reduce((u,f)=>(u[f.category]||(u[f.category]=[]),u[f.category].push(f),u),{});return m.useEffect(()=>{const u=f=>{(f.metaKey||f.ctrlKey)&&f.key==="k"&&f.preventDefault()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[]),m.useEffect(()=>{const u=f=>{f.key==="Escape"&&t()};if(e)return document.body.style.overflow="hidden",document.addEventListener("keydown",u),()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",u)}},[e,t]),e?s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center pt-[20vh] z-50 overflow-hidden",onClick:t,children:s.jsx("div",{className:"bg-black/90 overflow-hidden border border-white/10 rounded-none w-full max-w-2xl mx-4",onClick:u=>u.stopPropagation(),children:s.jsxs(lo,{className:"p-2",children:[s.jsxs("div",{className:"flex items-center border-b border-dashed border-white/10 px-3 pb-3",children:[s.jsx(Na,{className:"w-4 h-4 text-gray-400 mr-3"}),s.jsx(lo.Input,{value:r,onValueChange:a,placeholder:"Search for actions, pages, or commands...",className:"flex-1 placeholder:text-xs bg-transparent text-white placeholder-gray-400 outline-none",autoFocus:!0}),s.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"})]}),s.jsx(lo.List,{className:"max-h-96 overflow-y-auto p-2",children:Object.keys(h).length===0?s.jsxs("div",{className:"text-center py-8 text-gray-400",children:[s.jsx(Na,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{children:"No results found"}),s.jsx("p",{className:"text-sm",children:"Try a different search term"})]}):Object.entries(h).map(([u,f])=>s.jsx("div",{className:"mb-4",children:s.jsx(lo.Group,{heading:u,className:"text-xs text-gray-400 font-medium mb-2 px-2",children:f.map(p=>{const w=p.icon,v=p.disabled;return s.jsxs(lo.Item,{value:p.id,disabled:v,onSelect:()=>{v||(p.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:[s.jsx(w,{className:"w-4 h-4 text-white"}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"text-white text-[13px] font-light flex items-center gap-2",children:[p.title,v&&s.jsx(Yc,{className:"w-3 h-3 text-yellow-500"})]}),s.jsx("div",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:v?p.disabledMessage:p.description})]}),!v&&s.jsx(XP,{className:"w-4 h-4 text-gray-400"})]},p.id)})})},u))}),s.jsx("div",{className:"border-t border-dashed border-white/10 px-3 py-2 text-xs text-gray-400",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{children:["Press"," ",s.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"↑↓"})," ","to navigate"]}),s.jsxs("span",{children:["Press"," ",s.jsx("kbd",{className:"px-1 py-0.5 border border-dashed border-white/20 rounded-sm",children:"Enter"})," ","to select"]})]})})]})})}):null}const yv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,bv=cj,DN=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return bv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(d=>{const h=n==null?void 0:n[d],u=i==null?void 0:i[d];if(h===null)return null;const f=yv(h)||yv(u);return a[d][f]}),l=n&&Object.entries(n).reduce((d,h)=>{let[u,f]=h;return f===void 0||(d[u]=f),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:u,className:f,...p}=h;return Object.entries(p).every(w=>{let[v,j]=w;return Array.isArray(j)?j.includes({...i,...l}[v]):{...i,...l}[v]===j})?[...d,u,f]:d},[]);return bv(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},km=DN("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"}}),X=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?BT:"button";return s.jsx(o,{className:Ee(km({variant:t,size:n,className:e})),ref:i,...a})});X.displayName="Button";function Uz({children:e}){const t=Wi(),{counts:n,loading:r}=Au(),[a,i]=m.useState(!1),[o,l]=m.useState("v1.0.0");m.useEffect(()=>{const h=u=>{(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),i(!0))};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[]),m.useEffect(()=>{(async()=>{var u;try{const p=await(await fetch("/api/config")).json();(u=p.studio)!=null&&u.version&&l(`v${p.studio.version}`)}catch{}})()},[]);const c=h=>h>=1e3?`${(h/1e3).toFixed(1).replace(/\.0$/,"")}k`:h.toString(),d=[{name:"Dashboard",href:"/",icon:rT},{name:"Users",href:"/users",icon:ka,badge:r?"...":c(n.users)},{name:"Organizations",href:"/organizations",icon:gr,badge:r?"...":c(n.organizations)},{name:"Database",href:"/database",icon:mt},{name:"Tools",href:"/tools",icon:oj},{name:"Settings",href:"/settings",icon:ra}];return s.jsxs("div",{className:"min-h-screen bg-black",children:[s.jsx("div",{className:"bg-black/70 border-b border-white/15",children:s.jsxs("div",{className:"flex items-center justify-between px-6 py-4",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsxs("div",{className:"flex items-end justify-end space-x-2",children:[s.jsx("div",{className:"w-7 h-7 border border-dashed border-white/20 rounded-lg flex items-center justify-center",children:s.jsx("span",{className:"text-black font-bold text-md",children:"⚡"})}),s.jsx("div",{className:"mb-0",children:s.jsxs("h1",{className:"text-md inline-flex mb-0 items-start font-light font-mono uppercase text-white",children:["Better-Auth Studio",s.jsxs("sup",{className:"text-sm text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 lowercase font-mono text-xs",children:o}),s.jsx("span",{className:"ml-1",children:"]"})]})]})})]})}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Na,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx("input",{type:"text",placeholder:"Search...",onClick:()=>i(!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}),s.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"})]}),s.jsx("a",{href:"https://better-auth.com/docs",target:"_blank",rel:"noopener",children:s.jsx(X,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Docs"})}),s.jsx("a",{href:"https://better-auth.com/support",target:"_blank",rel:"noopener",children:s.jsx(X,{variant:"ghost",className:"text-gray-300 bg-transparent hover:bg-transparent hover:bg-gray-900 border-dashed",children:"Support"})})]})]})}),s.jsx("div",{className:"bg-black/50 border-b border-white/10",children:s.jsx("div",{className:"px-6",children:s.jsx("nav",{className:"flex space-x-8",children:d.map(h=>{const u=t.pathname===h.href;return s.jsxs(Cp,{to:h.href,className:`flex items-center space-x-2 px-3 py-4 text-sm font-medium border-b-2 transition-all duration-200 ${u?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[s.jsx(h.icon,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:[h.name,h.badge&&s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:h.badge}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},h.name)})})})}),s.jsx("div",{className:"flex-1 p-0",children:e}),s.jsx(Fz,{isOpen:a,onClose:()=>i(!1)})]})}function Bd(e){"@babel/helpers - typeof";return Bd=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},Bd(e)}function Da(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 Jt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Tr(e){Jt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Bd(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 Bz(e,t){Jt(2,arguments);var n=Tr(e).getTime(),r=Da(t);return new Date(n+r)}var Wz={};function Iu(){return Wz}function Hz(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 Vz(e){return Jt(1,arguments),e instanceof Date||Bd(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Yz(e){if(Jt(1,arguments),!Vz(e)&&typeof e!="number")return!1;var t=Tr(e);return!isNaN(Number(t))}function Xz(e,t){Jt(2,arguments);var n=Da(t);return Bz(e,-n)}var qz=864e5;function Gz(e){Jt(1,arguments);var t=Tr(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),a=n-r;return Math.floor(a/qz)+1}function Wd(e){Jt(1,arguments);var t=1,n=Tr(e),r=n.getUTCDay(),a=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-a),n.setUTCHours(0,0,0,0),n}function _N(e){Jt(1,arguments);var t=Tr(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var a=Wd(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=Wd(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Kz(e){Jt(1,arguments);var t=_N(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Wd(n);return r}var Qz=6048e5;function Zz(e){Jt(1,arguments);var t=Tr(e),n=Wd(t).getTime()-Kz(t).getTime();return Math.round(n/Qz)+1}function Hd(e,t){var n,r,a,i,o,l,c,d;Jt(1,arguments);var h=Iu(),u=Da((n=(r=(a=(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&&a!==void 0?a:h.weekStartsOn)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&n!==void 0?n:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Tr(e),p=f.getUTCDay(),w=(p<u?7:0)+p-u;return f.setUTCDate(f.getUTCDate()-w),f.setUTCHours(0,0,0,0),f}function PN(e,t){var n,r,a,i,o,l,c,d;Jt(1,arguments);var h=Tr(e),u=h.getUTCFullYear(),f=Iu(),p=Da((n=(r=(a=(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&&a!==void 0?a:f.firstWeekContainsDate)!==null&&r!==void 0?r:(c=f.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=new Date(0);w.setUTCFullYear(u+1,0,p),w.setUTCHours(0,0,0,0);var v=Hd(w,t),j=new Date(0);j.setUTCFullYear(u,0,p),j.setUTCHours(0,0,0,0);var g=Hd(j,t);return h.getTime()>=v.getTime()?u+1:h.getTime()>=g.getTime()?u:u-1}function Jz(e,t){var n,r,a,i,o,l,c,d;Jt(1,arguments);var h=Iu(),u=Da((n=(r=(a=(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&&a!==void 0?a:h.firstWeekContainsDate)!==null&&r!==void 0?r:(c=h.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=PN(e,t),p=new Date(0);p.setUTCFullYear(f,0,u),p.setUTCHours(0,0,0,0);var w=Hd(p,t);return w}var e$=6048e5;function t$(e,t){Jt(1,arguments);var n=Tr(e),r=Hd(n,t).getTime()-Jz(n,t).getTime();return Math.round(r/e$)+1}function Ye(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var us={y:function(t,n){var r=t.getUTCFullYear(),a=r>0?r:1-r;return Ye(n==="yy"?a%100:a,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):Ye(r+1,2)},d:function(t,n){return Ye(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return Ye(t.getUTCHours()%12||12,n.length)},H:function(t,n){return Ye(t.getUTCHours(),n.length)},m:function(t,n){return Ye(t.getUTCMinutes(),n.length)},s:function(t,n){return Ye(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,a=t.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,r-3));return Ye(i,n.length)}},Ha={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},n$={G:function(t,n,r){var a=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var a=t.getUTCFullYear(),i=a>0?a:1-a;return r.ordinalNumber(i,{unit:"year"})}return us.y(t,n)},Y:function(t,n,r,a){var i=PN(t,a),o=i>0?i:1-i;if(n==="YY"){var l=o%100;return Ye(l,2)}return n==="Yo"?r.ordinalNumber(o,{unit:"year"}):Ye(o,n.length)},R:function(t,n){var r=_N(t);return Ye(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return Ye(r,n.length)},Q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(a);case"QQ":return Ye(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(a);case"qq":return Ye(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,n,r){var a=t.getUTCMonth();switch(n){case"M":case"MM":return us.M(t,n);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,n,r){var a=t.getUTCMonth();switch(n){case"L":return String(a+1);case"LL":return Ye(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,n,r,a){var i=t$(t,a);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):Ye(i,n.length)},I:function(t,n,r){var a=Zz(t);return n==="Io"?r.ordinalNumber(a,{unit:"week"}):Ye(a,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):us.d(t,n)},D:function(t,n,r){var a=Gz(t);return n==="Do"?r.ordinalNumber(a,{unit:"dayOfYear"}):Ye(a,n.length)},E:function(t,n,r){var a=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});case"EEEE":default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return Ye(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return Ye(o,n.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var a=t.getUTCDay(),i=a===0?7:a;switch(n){case"i":return String(i);case"ii":return Ye(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});case"iiii":default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,n,r){var a=t.getUTCHours(),i=a/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var a=t.getUTCHours(),i;switch(a===12?i=Ha.noon:a===0?i=Ha.midnight:i=a/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var a=t.getUTCHours(),i;switch(a>=17?i=Ha.evening:a>=12?i=Ha.afternoon:a>=4?i=Ha.morning:i=Ha.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var a=t.getUTCHours()%12;return a===0&&(a=12),r.ordinalNumber(a,{unit:"hour"})}return us.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):us.H(t,n)},K:function(t,n,r){var a=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(a,{unit:"hour"}):Ye(a,n.length)},k:function(t,n,r){var a=t.getUTCHours();return a===0&&(a=24),n==="ko"?r.ordinalNumber(a,{unit:"hour"}):Ye(a,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):us.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):us.s(t,n)},S:function(t,n){return us.S(t,n)},X:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Nv(o);case"XXXX":case"XX":return Ks(o);case"XXXXX":case"XXX":default:return Ks(o,":")}},x:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Nv(o);case"xxxx":case"xx":return Ks(o);case"xxxxx":case"xxx":default:return Ks(o,":")}},O:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+jv(o,":");case"OOOO":default:return"GMT"+Ks(o,":")}},z:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+jv(o,":");case"zzzz":default:return"GMT"+Ks(o,":")}},t:function(t,n,r,a){var i=a._originalDate||t,o=Math.floor(i.getTime()/1e3);return Ye(o,n.length)},T:function(t,n,r,a){var i=a._originalDate||t,o=i.getTime();return Ye(o,n.length)}};function jv(e,t){var n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(i===0)return n+String(a);var o=t;return n+String(a)+o+Ye(i,2)}function Nv(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Ye(Math.abs(e)/60,2)}return Ks(e,t)}function Ks(e,t){var n=t||"",r=e>0?"-":"+",a=Math.abs(e),i=Ye(Math.floor(a/60),2),o=Ye(a%60,2);return r+i+n+o}var kv=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"})}},TN=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"})}},r$=function(t,n){var r=t.match(/(P+)(p+)?/)||[],a=r[1],i=r[2];if(!i)return kv(t,n);var o;switch(a){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}}",kv(a,n)).replace("{{time}}",TN(i,n))},s$={p:TN,P:r$},a$=["D","DD"],i$=["YY","YYYY"];function o$(e){return a$.indexOf(e)!==-1}function l$(e){return i$.indexOf(e)!==-1}function Sv(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 c$={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"}},d$=function(t,n,r){var a,i=c$[t];return typeof i=="string"?a=i:n===1?a=i.one:a=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};function Vh(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var u$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},h$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},f$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},m$={date:Vh({formats:u$,defaultWidth:"full"}),time:Vh({formats:h$,defaultWidth:"full"}),dateTime:Vh({formats:f$,defaultWidth:"full"})},p$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},x$=function(t,n,r,a){return p$[t]};function co(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",a;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{var l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[c]||e.values[l]}var d=e.argumentCallback?e.argumentCallback(t):t;return a[d]}}var g$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},v$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},w$={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"]},y$={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"]},b$={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"}},j$={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"}},N$=function(t,n){var r=Number(t),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},k$={ordinalNumber:N$,era:co({values:g$,defaultWidth:"wide"}),quarter:co({values:v$,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:co({values:w$,defaultWidth:"wide"}),day:co({values:y$,defaultWidth:"wide"}),dayPeriod:co({values:b$,defaultWidth:"wide",formattingValues:j$,defaultFormattingWidth:"wide"})};function uo(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?C$(l,function(u){return u.test(o)}):S$(l,function(u){return u.test(o)}),d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;var h=t.slice(o.length);return{value:d,rest:h}}}function S$(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function C$(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function E$(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var a=r[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(a.length);return{value:o,rest:l}}}var M$=/^(\d+)(th|st|nd|rd)?/i,D$=/\d+/i,_$={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},P$={any:[/^b/i,/^(a|c)/i]},T$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},O$={any:[/1/i,/2/i,/3/i,/4/i]},A$={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},z$={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]},$$={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},R$={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]},I$={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},L$={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}},F$={ordinalNumber:E$({matchPattern:M$,parsePattern:D$,valueCallback:function(t){return parseInt(t,10)}}),era:uo({matchPatterns:_$,defaultMatchWidth:"wide",parsePatterns:P$,defaultParseWidth:"any"}),quarter:uo({matchPatterns:T$,defaultMatchWidth:"wide",parsePatterns:O$,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:uo({matchPatterns:A$,defaultMatchWidth:"wide",parsePatterns:z$,defaultParseWidth:"any"}),day:uo({matchPatterns:$$,defaultMatchWidth:"wide",parsePatterns:R$,defaultParseWidth:"any"}),dayPeriod:uo({matchPatterns:I$,defaultMatchWidth:"any",parsePatterns:L$,defaultParseWidth:"any"})},U$={code:"en-US",formatDistance:d$,formatLong:m$,formatRelative:x$,localize:k$,match:F$,options:{weekStartsOn:0,firstWeekContainsDate:1}},B$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,W$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,H$=/^'([^]*?)'?$/,V$=/''/g,Y$=/[a-zA-Z]/;function An(e,t,n){var r,a,i,o,l,c,d,h,u,f,p,w,v,j;Jt(2,arguments);var g=String(t),y=Iu(),x=(r=(a=void 0)!==null&&a!==void 0?a:y.locale)!==null&&r!==void 0?r:U$,b=Da((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:(d=y.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(b>=1&&b<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=Da((u=(f=(p=(w=void 0)!==null&&w!==void 0?w:void 0)!==null&&p!==void 0?p: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&&u!==void 0?u:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var k=Tr(e);if(!Yz(k))throw new RangeError("Invalid time value");var S=Hz(k),M=Xz(k,S),O={firstWeekContainsDate:b,weekStartsOn:N,locale:x,_originalDate:k},I=g.match(W$).map(function(B){var z=B[0];if(z==="p"||z==="P"){var L=s$[z];return L(B,x.formatLong)}return B}).join("").match(B$).map(function(B){if(B==="''")return"'";var z=B[0];if(z==="'")return X$(B);var L=n$[z];if(L)return l$(B)&&Sv(B,t,String(e)),o$(B)&&Sv(B,t,String(e)),L(M,B,x.localize,O);if(z.match(Y$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return B}).join("");return I}function X$(e){var t=e.match(H$);return t?t[1].replace(V$,"'"):e}function q$(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 Yh={},bo={};function sa(e,t){try{const r=(Yh[e]||(Yh[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in bo?bo[r]:Cv(r,r.split(":"))}catch{if(e in bo)return bo[e];const n=e==null?void 0:e.match(G$);return n?Cv(e,n.slice(1)):NaN}}const G$=/([+-]\d\d):?(\d\d)?/;function Cv(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return bo[e]=n*60+r>0?n*60+r+a:n*60-r-a}class jr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(sa(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)),ON(this),Sm(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new jr(...n,t):new jr(Date.now(),t)}withTimeZone(t){return new jr(+this,t)}getTimezoneOffset(){const t=-sa(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Sm(this),+this}[Symbol.for("constructDateFrom")](t){return new jr(+new Date(t),this.timeZone)}}const Ev=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Ev.test(e))return;const t=e.replace(Ev,"$1UTC");jr.prototype[t]&&(e.startsWith("get")?jr.prototype[e]=function(){return this.internal[t]()}:(jr.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),K$(this),+this},jr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Sm(this),+this}))});function Sm(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-sa(e.timeZone,e)*60))}function K$(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()),ON(e)}function ON(e){const t=sa(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),o=a-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=a-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const h=a>0?d.getSeconds():(d.getSeconds()-60)%60,u=Math.round(-(sa(e.timeZone,e)*60))%60;(u||h)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+h));const f=sa(e.timeZone,e),p=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-p,j=p!==n,g=v-c;if(j&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const y=sa(e.timeZone,e),x=y>0?Math.floor(y):Math.ceil(y),b=p-x;b&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+b),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+b))}}class Ht extends jr{static tz(t,...n){return n.length?new Ht(...n,t):new Ht(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${q$(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?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new Ht(+this,t)}[Symbol.for("constructDateFrom")](t){return new Ht(+new Date(t),this.timeZone)}}const AN=6048e5,Q$=864e5,Mv=Symbol.for("constructDateFrom");function Nt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Mv in e?e[Mv](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ke(e,t){return Nt(t||e,e)}function zN(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(t)?Nt(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function $N(e,t,n){const r=Ke(e,n==null?void 0:n.in);if(isNaN(t))return Nt(e,NaN);if(!t)return r;const a=r.getDate(),i=Nt(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const o=i.getDate();return a>=o?i:(r.setFullYear(i.getFullYear(),i.getMonth(),a),r)}let Z$={};function Dl(){return Z$}function Ri(e,t){var l,c,d,h;const n=Dl(),r=(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=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function hl(e,t){return Ri(e,{...t,weekStartsOn:1})}function RN(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=Nt(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=hl(a),o=Nt(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const l=hl(o);return n.getTime()>=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function Dv(e){const t=Ke(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Xi(e,...t){const n=Nt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function fl(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function IN(e,t,n){const[r,a]=Xi(n==null?void 0:n.in,e,t),i=fl(r),o=fl(a),l=+i-Dv(i),c=+o-Dv(o);return Math.round((l-c)/Q$)}function J$(e,t){const n=RN(e,t),r=Nt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),hl(r)}function eR(e,t,n){return zN(e,t*7,n)}function tR(e,t,n){return $N(e,t*12,n)}function nR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=Nt.bind(null,a));const i=Ke(a,r);(!n||n<i||isNaN(+i))&&(n=i)}),Nt(r,n||NaN)}function rR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=Nt.bind(null,a));const i=Ke(a,r);(!n||n>i||isNaN(+i))&&(n=i)}),Nt(r,n||NaN)}function sR(e,t,n){const[r,a]=Xi(n==null?void 0:n.in,e,t);return+fl(r)==+fl(a)}function LN(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function aR(e){return!(!LN(e)&&typeof e!="number"||isNaN(+Ke(e)))}function iR(e,t,n){const[r,a]=Xi(n==null?void 0:n.in,e,t),i=r.getFullYear()-a.getFullYear(),o=r.getMonth()-a.getMonth();return i*12+o}function oR(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function FN(e,t){const[n,r]=Xi(e,t.start,t.end);return{start:n,end:r}}function lR(e,t){const{start:n,end:r}=FN(t==null?void 0:t.in,e);let a=+n>+r;const i=a?+n:+r,o=a?r:n;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(Nt(n,o)),o.setMonth(o.getMonth()+l);return a?c.reverse():c}function cR(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function dR(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function UN(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function uR(e,t){const{start:n,end:r}=FN(t==null?void 0:t.in,e);let a=+n>+r;const i=a?+n:+r,o=a?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(Nt(n,o)),o.setFullYear(o.getFullYear()+l);return a?c.reverse():c}function BN(e,t){var l,c,d,h;const n=Dl(),r=(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=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Ke(e,t==null?void 0:t.in),i=a.getDay(),o=(i<r?-7:0)+6-(i-r);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function hR(e,t){return BN(e,{...t,weekStartsOn:1})}const fR={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"}},mR=(e,t,n)=>{let r;const a=fR[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Xh(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const pR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xR={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vR={date:Xh({formats:pR,defaultWidth:"full"}),time:Xh({formats:xR,defaultWidth:"full"}),dateTime:Xh({formats:gR,defaultWidth:"full"})},wR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yR=(e,t,n,r)=>wR[e];function ho(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const bR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},NR={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"]},kR={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"]},SR={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"}},CR={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"}},ER=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},MR={ordinalNumber:ER,era:ho({values:bR,defaultWidth:"wide"}),quarter:ho({values:jR,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ho({values:NR,defaultWidth:"wide"}),day:ho({values:kR,defaultWidth:"wide"}),dayPeriod:ho({values:SR,defaultWidth:"wide",formattingValues:CR,defaultFormattingWidth:"wide"})};function fo(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?_R(l,u=>u.test(o)):DR(l,u=>u.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(o.length);return{value:d,rest:h}}}function DR(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function _R(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function PR(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[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(a.length);return{value:o,rest:l}}}const TR=/^(\d+)(th|st|nd|rd)?/i,OR=/\d+/i,AR={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},zR={any:[/^b/i,/^(a|c)/i]},$R={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},RR={any:[/1/i,/2/i,/3/i,/4/i]},IR={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},LR={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]},FR={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},UR={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]},BR={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},WR={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}},HR={ordinalNumber:PR({matchPattern:TR,parsePattern:OR,valueCallback:e=>parseInt(e,10)}),era:fo({matchPatterns:AR,defaultMatchWidth:"wide",parsePatterns:zR,defaultParseWidth:"any"}),quarter:fo({matchPatterns:$R,defaultMatchWidth:"wide",parsePatterns:RR,defaultParseWidth:"any",valueCallback:e=>e+1}),month:fo({matchPatterns:IR,defaultMatchWidth:"wide",parsePatterns:LR,defaultParseWidth:"any"}),day:fo({matchPatterns:FR,defaultMatchWidth:"wide",parsePatterns:UR,defaultParseWidth:"any"}),dayPeriod:fo({matchPatterns:BR,defaultMatchWidth:"any",parsePatterns:WR,defaultParseWidth:"any"})},hx={code:"en-US",formatDistance:mR,formatLong:vR,formatRelative:yR,localize:MR,match:HR,options:{weekStartsOn:0,firstWeekContainsDate:1}};function VR(e,t){const n=Ke(e,t==null?void 0:t.in);return IN(n,UN(n))+1}function WN(e,t){const n=Ke(e,t==null?void 0:t.in),r=+hl(n)-+J$(n);return Math.round(r/AN)+1}function HN(e,t){var h,u,f,p;const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=Dl(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(f=a.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=Nt((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=Ri(o,t),c=Nt((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Ri(c,t);return+n>=+l?r+1:+n>=+d?r:r-1}function YR(e,t){var l,c,d,h;const n=Dl(),r=(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=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,a=HN(e,t),i=Nt((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),Ri(i,t)}function VN(e,t){const n=Ke(e,t==null?void 0:t.in),r=+Ri(n,t)-+YR(n,t);return Math.round(r/AN)+1}function Xe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const hs={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Xe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Xe(n+1,2)},d(e,t){return Xe(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 Xe(e.getHours()%12||12,t.length)},H(e,t){return Xe(e.getHours(),t.length)},m(e,t){return Xe(e.getMinutes(),t.length)},s(e,t){return Xe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Xe(a,t.length)}},Va={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},_v={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return hs.y(e,t)},Y:function(e,t,n,r){const a=HN(e,r),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return Xe(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Xe(i,t.length)},R:function(e,t){const n=RN(e);return Xe(n,t.length)},u:function(e,t){const n=e.getFullYear();return Xe(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Xe(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Xe(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return hs.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Xe(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=VN(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Xe(a,t.length)},I:function(e,t,n){const r=WN(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Xe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):hs.d(e,t)},D:function(e,t,n){const r=VR(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Xe(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Xe(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Xe(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Xe(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Va.noon:r===0?a=Va.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Va.evening:r>=12?a=Va.afternoon:r>=4?a=Va.morning:a=Va.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return hs.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):hs.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Xe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Xe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):hs.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):hs.s(e,t)},S:function(e,t){return hs.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Tv(r);case"XXXX":case"XX":return Qs(r);case"XXXXX":case"XXX":default:return Qs(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Tv(r);case"xxxx":case"xx":return Qs(r);case"xxxxx":case"xxx":default:return Qs(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pv(r,":");case"OOOO":default:return"GMT"+Qs(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pv(r,":");case"zzzz":default:return"GMT"+Qs(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Xe(r,t.length)},T:function(e,t,n){return Xe(+e,t.length)}};function Pv(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+Xe(i,2)}function Tv(e,t){return e%60===0?(e>0?"-":"+")+Xe(Math.abs(e)/60,2):Qs(e,t)}function Qs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Xe(Math.trunc(r/60),2),i=Xe(r%60,2);return n+a+t+i}const Ov=(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"})}},YN=(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"})}},XR=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Ov(e,t);let i;switch(r){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}}",Ov(r,t)).replace("{{time}}",YN(a,t))},qR={p:YN,P:XR},GR=/^D+$/,KR=/^Y+$/,QR=["D","DD","YY","YYYY"];function ZR(e){return GR.test(e)}function JR(e){return KR.test(e)}function eI(e,t,n){const r=tI(e,t,n);if(console.warn(r),QR.includes(e))throw new RangeError(r)}function tI(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const nI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sI=/^'([^]*?)'?$/,aI=/''/g,iI=/[a-zA-Z]/;function oI(e,t,n){var h,u,f,p,w,v,j,g;const r=Dl(),a=(n==null?void 0:n.locale)??r.locale??hx,i=(n==null?void 0:n.firstWeekContainsDate)??((u=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(w=n==null?void 0:n.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((g=(j=r.locale)==null?void 0:j.options)==null?void 0:g.weekStartsOn)??0,l=Ke(e,n==null?void 0:n.in);if(!aR(l))throw new RangeError("Invalid time value");let c=t.match(rI).map(y=>{const x=y[0];if(x==="p"||x==="P"){const b=qR[x];return b(y,a.formatLong)}return y}).join("").match(nI).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:lI(y)};if(_v[x])return{isToken:!0,value:y};if(x.match(iI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:y}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(y=>{if(!y.isToken)return y.value;const x=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&JR(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&ZR(x))&&eI(x,t,String(e));const b=_v[x[0]];return b(l,x,a.localize,d)}).join("")}function lI(e){const t=e.match(sI);return t?t[1].replace(aI,"'"):e}function cI(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=n.getMonth(),i=Nt(n,0);return i.setFullYear(r,a+1,0),i.setHours(0,0,0,0),i.getDate()}function dI(e,t){return Ke(e,t==null?void 0:t.in).getMonth()}function uI(e,t){return Ke(e,t==null?void 0:t.in).getFullYear()}function hI(e,t){return+Ke(e)>+Ke(t)}function fI(e,t){return+Ke(e)<+Ke(t)}function mI(e,t,n){const[r,a]=Xi(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function pI(e,t,n){const[r,a]=Xi(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()}function xI(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=r.getFullYear(),i=r.getDate(),o=Nt(e,0);o.setFullYear(a,t,15),o.setHours(0,0,0,0);const l=cI(o);return r.setMonth(t,Math.min(i,l)),r}function gI(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(+r)?Nt(e,NaN):(r.setFullYear(t),r)}const Av=5,vI=4;function wI(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),i=t.addDays(a,Av*7-1);return t.getMonth(e)===t.getMonth(i)?Av:vI}function XN(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function yI(e,t){const n=XN(e,t),r=wI(e,t);return t.addDays(n,r*7-1)}class Nn{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Ht.tz(this.options.timeZone):new this.Date},this.newDate=(r,a,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(r,a,i):this.options.timeZone?new Ht(r,a,i,this.options.timeZone):new Date(r,a,i)},this.addDays=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(r,a):zN(r,a)},this.addMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,a):$N(r,a)},this.addWeeks=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,a):eR(r,a)},this.addYears=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,a):tR(r,a)},this.differenceInCalendarDays=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):IN(r,a)},this.differenceInCalendarMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):iR(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):lR(r)},this.eachYearOfInterval=r=>{var l;const a=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(r):uR(r),i=new Set(a.map(c=>this.getYear(c)));if(i.size===a.length)return a;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):yI(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):hR(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):oR(r)},this.endOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,a):BN(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):dR(r)},this.format=(r,a,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(r,a,this.options):oI(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(r):WN(r)},this.getMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):dI(r,this.options)},this.getYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):uI(r,this.options)},this.getWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):VN(r,this.options)},this.isAfter=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,a):hI(r,a)},this.isBefore=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,a):fI(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):LN(r)},this.isSameDay=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,a):sR(r,a)},this.isSameMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,a):mI(r,a)},this.isSameYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,a):pI(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):nR(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):rR(r)},this.setMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,a):xI(r,a)},this.setYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,a):gI(r,a)},this.startOfBroadcastWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):XN(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):fl(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):hl(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):cR(r)},this.startOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):Ri(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):UN(r)},this.options={locale:hx,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&Nn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,i=n==null?void 0:n.code;if(i&&Nn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}Nn.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 Or=new Nn;class qN{constructor(t,n,r=Or){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class bI{constructor(t,n){this.date=t,this.weeks=n}}class jI{constructor(t,n){this.days=n,this.weekNumber=t}}function NI(e){return Z.createElement("button",{...e})}function kI(e){return Z.createElement("span",{...e})}function SI(e){const{size:t=24,orientation:n="left",className:r}=e;return Z.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Z.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Z.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Z.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Z.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function CI(e){const{day:t,modifiers:n,...r}=e;return Z.createElement("td",{...r})}function EI(e){const{day:t,modifiers:n,...r}=e,a=Z.useRef(null);return Z.useEffect(()=>{var i;n.focused&&((i=a.current)==null||i.focus())},[n.focused]),Z.createElement("button",{ref:a,...r})}var ye;(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"})(ye||(ye={}));var ht;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ht||(ht={}));var tr;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(tr||(tr={}));var mn;(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"})(mn||(mn={}));function MI(e){const{options:t,className:n,components:r,classNames:a,...i}=e,o=[a[ye.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return Z.createElement("span",{"data-disabled":i.disabled,className:a[ye.DropdownRoot]},Z.createElement(r.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:h})=>Z.createElement(r.Option,{key:c,value:c,disabled:h},d))),Z.createElement("span",{className:a[ye.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,Z.createElement(r.Chevron,{orientation:"down",size:18,className:a[ye.Chevron]})))}function DI(e){return Z.createElement("div",{...e})}function _I(e){return Z.createElement("div",{...e})}function PI(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Z.createElement("div",{...r},e.children)}function TI(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Z.createElement("div",{...r})}function OI(e){return Z.createElement("table",{...e})}function AI(e){return Z.createElement("div",{...e})}const GN=m.createContext(void 0);function _l(){const e=m.useContext(GN);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function zI(e){const{components:t}=_l();return Z.createElement(t.Dropdown,{...e})}function $I(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=_l(),h=m.useCallback(f=>{a&&(n==null||n(f))},[a,n]),u=m.useCallback(f=>{r&&(t==null||t(f))},[r,t]);return Z.createElement("nav",{...i},Z.createElement(o.PreviousMonthButton,{type:"button",className:l[ye.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:u},Z.createElement(o.Chevron,{disabled:r?void 0:!0,className:l[ye.Chevron],orientation:"left"})),Z.createElement(o.NextMonthButton,{type:"button",className:l[ye.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":d(a),onClick:h},Z.createElement(o.Chevron,{disabled:a?void 0:!0,orientation:"right",className:l[ye.Chevron]})))}function RI(e){const{components:t}=_l();return Z.createElement(t.Button,{...e})}function II(e){return Z.createElement("option",{...e})}function LI(e){const{components:t}=_l();return Z.createElement(t.Button,{...e})}function FI(e){const{rootRef:t,...n}=e;return Z.createElement("div",{...n,ref:t})}function UI(e){return Z.createElement("select",{...e})}function BI(e){const{week:t,...n}=e;return Z.createElement("tr",{...n})}function WI(e){return Z.createElement("th",{...e})}function HI(e){return Z.createElement("thead",{"aria-hidden":!0},Z.createElement("tr",{...e}))}function VI(e){const{week:t,...n}=e;return Z.createElement("th",{...n})}function YI(e){return Z.createElement("th",{...e})}function XI(e){return Z.createElement("tbody",{...e})}function qI(e){const{components:t}=_l();return Z.createElement(t.Dropdown,{...e})}const GI=Object.freeze(Object.defineProperty({__proto__:null,Button:NI,CaptionLabel:kI,Chevron:SI,Day:CI,DayButton:EI,Dropdown:MI,DropdownNav:DI,Footer:_I,Month:PI,MonthCaption:TI,MonthGrid:OI,Months:AI,MonthsDropdown:zI,Nav:$I,NextMonthButton:RI,Option:II,PreviousMonthButton:LI,Root:FI,Select:UI,Week:BI,WeekNumber:VI,WeekNumberHeader:YI,Weekday:WI,Weekdays:HI,Weeks:XI,YearsDropdown:qI},Symbol.toStringTag,{value:"Module"}));function Wr(e,t,n=!1,r=Or){let{from:a,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=r;return a&&i?(o(i,a)<0&&([a,i]=[i,a]),o(t,a)>=(n?1:0)&&o(i,t)>=(n?1:0)):!n&&i?l(i,t):!n&&a?l(a,t):!1}function KN(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function fx(e){return!!(e&&typeof e=="object"&&"from"in e)}function QN(e){return!!(e&&typeof e=="object"&&"after"in e)}function ZN(e){return!!(e&&typeof e=="object"&&"before"in e)}function JN(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function e2(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Hr(e,t,n=Or){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:i,isAfter:o}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return a(e,l);if(e2(l,n))return l.includes(e);if(fx(l))return Wr(l,e,!1,n);if(JN(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(KN(l)){const c=i(l.before,e),d=i(l.after,e),h=c>0,u=d<0;return o(l.before,l.after)?u&&h:h||u}return QN(l)?i(e,l.after)>0:ZN(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function KI(e,t,n,r,a){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:h}=t,{isSameDay:u,isSameMonth:f,startOfMonth:p,isBefore:w,endOfMonth:v,isAfter:j}=a,g=n&&p(n),y=r&&v(r),x={[ht.focused]:[],[ht.outside]:[],[ht.disabled]:[],[ht.hidden]:[],[ht.today]:[]},b={};for(const N of e){const{date:k,displayMonth:S}=N,M=!!(S&&!f(k,S)),O=!!(g&&w(k,g)),I=!!(y&&j(k,y)),B=!!(i&&Hr(k,i,a)),z=!!(o&&Hr(k,o,a))||O||I||!d&&!c&&M||d&&c===!1&&M,L=u(k,h??a.today());M&&x.outside.push(N),B&&x.disabled.push(N),z&&x.hidden.push(N),L&&x.today.push(N),l&&Object.keys(l).forEach(C=>{const A=l==null?void 0:l[C];A&&Hr(k,A,a)&&(b[C]?b[C].push(N):b[C]=[N])})}return N=>{const k={[ht.focused]:!1,[ht.disabled]:!1,[ht.hidden]:!1,[ht.outside]:!1,[ht.today]:!1},S={};for(const M in x){const O=x[M];k[M]=O.some(I=>I===N)}for(const M in b)S[M]=b[M].some(O=>O===N);return{...k,...S}}}function QI(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[i])=>(n[i]?a.push(n[i]):t[ht[i]]?a.push(t[ht[i]]):t[tr[i]]&&a.push(t[tr[i]]),a),[t[ye.Day]])}function ZI(e){return{...GI,...e}}function JI(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function mx(){const e={};for(const t in ye)e[ye[t]]=`rdp-${ye[t]}`;for(const t in ht)e[ht[t]]=`rdp-${ht[t]}`;for(const t in tr)e[tr[t]]=`rdp-${tr[t]}`;for(const t in mn)e[mn[t]]=`rdp-${mn[t]}`;return e}function t2(e,t,n){return(n??new Nn(t)).formatMonthYear(e)}const e8=t2;function t8(e,t,n){return(n??new Nn(t)).format(e,"d")}function n8(e,t=Or){return t.format(e,"LLLL")}function r8(e,t,n){return(n??new Nn(t)).format(e,"cccccc")}function s8(e,t=Or){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function a8(){return""}function n2(e,t=Or){return t.format(e,"yyyy")}const i8=n2,o8=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:t2,formatDay:t8,formatMonthCaption:e8,formatMonthDropdown:n8,formatWeekNumber:s8,formatWeekNumberHeader:a8,formatWeekdayName:r8,formatYearCaption:i8,formatYearDropdown:n2},Symbol.toStringTag,{value:"Module"}));function l8(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...o8,...e}}function c8(e,t,n,r,a){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=a;return c({start:o(e),end:l(e)}).map(f=>{const p=r.formatMonthDropdown(f,a),w=d(f),v=t&&f<i(t)||n&&f>i(n)||!1;return{value:w,label:p,disabled:v}})}function d8(e,t={},n={}){let r={...t==null?void 0:t[ye.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function u8(e,t,n){const r=e.today(),a=t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let o=0;o<7;o++){const l=e.addDays(a,o);i.push(l)}return i}function h8(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=r,d=i(e),h=o(t),u=l({start:d,end:h});return a&&u.reverse(),u.map(f=>{const p=n.formatYearDropdown(f,r);return{value:c(f),label:p,disabled:!1}})}function r2(e,t,n,r){let a=(r??new Nn(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const f8=r2;function s2(e,t,n){return(n??new Nn(t)).formatMonthYear(e)}const m8=s2;function p8(e,t,n,r){let a=(r??new Nn(n)).format(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a}function x8(e){return"Choose the Month"}function g8(){return""}function v8(e){return"Go to the Next Month"}function w8(e){return"Go to the Previous Month"}function y8(e,t,n){return(n??new Nn(t)).format(e,"cccc")}function b8(e,t){return`Week ${e}`}function j8(e){return"Week Number"}function N8(e){return"Choose the Year"}const k8=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:m8,labelDay:f8,labelDayButton:r2,labelGrid:s2,labelGridcell:p8,labelMonthDropdown:x8,labelNav:g8,labelNext:v8,labelPrevious:w8,labelWeekNumber:b8,labelWeekNumberHeader:j8,labelWeekday:y8,labelYearDropdown:N8},Symbol.toStringTag,{value:"Module"})),Pl=e=>e instanceof HTMLElement?e:null,qh=e=>[...e.querySelectorAll("[data-animated-month]")??[]],S8=e=>Pl(e.querySelector("[data-animated-month]")),Gh=e=>Pl(e.querySelector("[data-animated-caption]")),Kh=e=>Pl(e.querySelector("[data-animated-weeks]")),C8=e=>Pl(e.querySelector("[data-animated-nav]")),E8=e=>Pl(e.querySelector("[data-animated-weekdays]"));function M8(e,t,{classNames:n,months:r,focused:a,dateLib:i}){const o=m.useRef(null),l=m.useRef(r),c=m.useRef(!1);m.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const h=i.isSameMonth(r[0].date,d[0].date),u=i.isAfter(r[0].date,d[0].date),f=u?n[mn.caption_after_enter]:n[mn.caption_before_enter],p=u?n[mn.weeks_after_enter]:n[mn.weeks_before_enter],w=o.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(qh(v).forEach(x=>{if(!(x instanceof HTMLElement))return;const b=S8(x);b&&x.contains(b)&&x.removeChild(b);const N=Gh(x);N&&N.classList.remove(f);const k=Kh(x);k&&k.classList.remove(p)}),o.current=v):o.current=null,c.current||h||a)return;const j=w instanceof HTMLElement?qh(w):[],g=qh(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=C8(e.current);y&&(y.style.zIndex="1"),g.forEach((x,b)=>{const N=j[b];if(!N)return;x.style.position="relative",x.style.overflow="hidden";const k=Gh(x);k&&k.classList.add(f);const S=Kh(x);S&&S.classList.add(p);const M=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),y&&(y.style.zIndex=""),k&&k.classList.remove(f),S&&S.classList.remove(p),x.style.position="",x.style.overflow="",x.contains(N)&&x.removeChild(N)};N.style.pointerEvents="none",N.style.position="absolute",N.style.overflow="hidden",N.setAttribute("aria-hidden","true");const O=E8(N);O&&(O.style.opacity="0");const I=Gh(N);I&&(I.classList.add(u?n[mn.caption_before_exit]:n[mn.caption_after_exit]),I.addEventListener("animationend",M));const B=Kh(N);B&&B.classList.add(u?n[mn.weeks_before_exit]:n[mn.weeks_after_exit]),x.insertBefore(N,x.firstChild)})}})}function D8(e,t,n,r){const a=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:h,differenceInCalendarMonths:u,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:w,endOfWeek:v,isAfter:j,startOfBroadcastWeek:g,startOfISOWeek:y,startOfWeek:x}=r,b=c?g(a,r):o?y(a):x(a),N=c?f(i):o?p(w(i)):v(w(i)),k=h(N,b),S=u(i,a)+1,M=[];for(let B=0;B<=k;B++){const z=d(b,B);if(t&&j(z,t))break;M.push(z)}const I=(c?35:42)*S;if(l&&M.length<I){const B=I-M.length;for(let z=0;z<B;z++){const L=d(M[M.length-1],1);M.push(L)}}return M}function _8(e){const t=[];return e.reduce((n,r)=>{const a=r.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function P8(e,t,n,r){const{numberOfMonths:a=1}=n,i=[];for(let o=0;o<a;o++){const l=r.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function zv(e,t,n,r){const{month:a,defaultMonth:i,today:o=r.today(),numberOfMonths:l=1}=e;let c=a||i||o;const{differenceInCalendarMonths:d,addMonths:h,startOfMonth:u}=r;if(n&&d(n,c)<l-1){const f=-1*(l-1);c=h(n,f)}return t&&d(c,t)<0&&(c=t),u(c)}function T8(e,t,n,r){const{addDays:a,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:h,startOfBroadcastWeek:u,startOfISOWeek:f,startOfWeek:p}=r,w=e.reduce((v,j)=>{const g=n.broadcastCalendar?u(j,r):n.ISOWeek?f(j):p(j),y=n.broadcastCalendar?i(j):n.ISOWeek?o(l(j)):c(l(j)),x=t.filter(S=>S>=g&&S<=y),b=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<b){const S=t.filter(M=>{const O=b-x.length;return M>y&&M<=a(y,O)});x.push(...S)}const N=x.reduce((S,M)=>{const O=n.ISOWeek?d(M):h(M),I=S.find(z=>z.weekNumber===O),B=new qN(M,j,r);return I?I.days.push(B):S.push(new jI(O,[B])),S},[]),k=new bI(j,N);return v.push(k),v},[]);return n.reverseMonths?w.reverse():w}function O8(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:d,newDate:h,today:u}=t,{fromYear:f,toYear:p,fromMonth:w,toMonth:v}=e;!n&&w&&(n=w),!n&&f&&(n=t.newDate(f,0,1)),!r&&v&&(r=v),!r&&p&&(r=h(p,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=a(c(e.today??u(),-100))),r?r=l(r):p?r=h(p,11,31):!r&&j&&(r=d(e.today??u())),[n&&i(n),r&&i(r)]}function A8(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i=1}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=a?i:1,h=o(e);if(!t)return l(h,d);if(!(c(t,e)<i))return l(h,d)}function z8(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i}=n,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=r,d=a?i??1:1,h=o(e);if(!t)return l(h,-d);if(!(c(h,t)<=0))return l(h,-d)}function $8(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Lu(e,t){const[n,r]=m.useState(e);return[t===void 0?n:t,r]}function R8(e,t){const[n,r]=O8(e,t),{startOfMonth:a,endOfMonth:i}=t,o=zv(e,n,r,t),[l,c]=Lu(o,e.month?o:void 0);m.useEffect(()=>{const k=zv(e,n,r,t);c(k)},[e.timeZone]);const d=P8(l,r,e,t),h=D8(d,e.endMonth?i(e.endMonth):void 0,e,t),u=T8(d,h,e,t),f=$8(u),p=_8(u),w=z8(l,n,e,t),v=A8(l,r,e,t),{disableNavigation:j,onMonthChange:g}=e,y=k=>f.some(S=>S.days.some(M=>M.isEqualTo(k))),x=k=>{if(j)return;let S=a(k);n&&S<a(n)&&(S=a(n)),r&&S>a(r)&&(S=a(r)),c(S),g==null||g(S)};return{months:u,weeks:f,days:p,navStart:n,navEnd:r,previousMonth:w,nextMonth:v,goToMonth:x,goToDay:k=>{y(k)||x(k.date)}}}var xr;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(xr||(xr={}));function $v(e){return!e[ht.disabled]&&!e[ht.hidden]&&!e[ht.outside]}function I8(e,t,n,r){let a,i=-1;for(const o of e){const l=t(o);$v(l)&&(l[ht.focused]&&i<xr.FocusedModifier?(a=o,i=xr.FocusedModifier):r!=null&&r.isEqualTo(o)&&i<xr.LastFocused?(a=o,i=xr.LastFocused):n(o.date)&&i<xr.Selected?(a=o,i=xr.Selected):l[ht.today]&&i<xr.Today&&(a=o,i=xr.Today))}return a||(a=e.find(o=>$v(t(o)))),a}function L8(e,t,n,r,a,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:h,addWeeks:u,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:w,endOfWeek:v,max:j,min:g,startOfBroadcastWeek:y,startOfISOWeek:x,startOfWeek:b}=o;let k={day:d,week:u,month:h,year:f,startOfWeek:S=>c?y(S,o):l?x(S):b(S),endOfWeek:S=>c?p(S):l?w(S):v(S)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=j([r,k]):t==="after"&&a&&(k=g([a,k])),k}function a2(e,t,n,r,a,i,o,l=0){if(l>365)return;const c=L8(e,t,n.date,r,a,i,o),d=!!(i.disabled&&Hr(c,i.disabled,o)),h=!!(i.hidden&&Hr(c,i.hidden,o)),u=c,f=new qN(c,u,o);return!d&&!h?f:a2(e,t,f,r,a,i,o,l+1)}function F8(e,t,n,r,a){const{autoFocus:i}=e,[o,l]=m.useState(),c=I8(t.days,n,r||(()=>!1),o),[d,h]=m.useState(i?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:h,focused:d,blur:()=>{l(d),h(void 0)},moveFocus:(v,j)=>{if(!d)return;const g=a2(v,j,d,t.navStart,t.navEnd,e,a);g&&(e.disableNavigation&&!t.days.some(x=>x.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function U8(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=Lu(n,a?n:void 0),l=a?n:i,{isSameDay:c}=t,d=p=>(l==null?void 0:l.some(w=>c(w,p)))??!1,{min:h,max:u}=e;return{selected:l,select:(p,w,v)=>{let j=[...l??[]];if(d(p)){if((l==null?void 0:l.length)===h||r&&(l==null?void 0:l.length)===1)return;j=l==null?void 0:l.filter(g=>!c(g,p))}else(l==null?void 0:l.length)===u?j=[p]:j=[...j,p];return a||o(j),a==null||a(j,p,w,v),j},isSelected:d}}function B8(e,t,n=0,r=0,a=!1,i=Or){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:d,isBefore:h}=i;let u;if(!o&&!l)u={from:e,to:n>0?void 0:e};else if(o&&!l)c(o,e)?n===0?u={from:o,to:e}:a?u={from:o,to:void 0}:u=void 0:h(e,o)?u={from:e,to:o}:u={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))a?u={from:o,to:l}:u=void 0;else if(c(o,e))u={from:o,to:n>0?void 0:e};else if(c(l,e))u={from:e,to:n>0?void 0:e};else if(h(e,o))u={from:e,to:l};else if(d(e,o))u={from:o,to:e};else if(d(e,l))u={from:o,to:e};else throw new Error("Invalid range");if(u!=null&&u.from&&(u!=null&&u.to)){const f=i.differenceInCalendarDays(u.to,u.from);r>0&&f>r?u={from:e,to:void 0}:n>1&&f<n&&(u={from:e,to:void 0})}return u}function W8(e,t,n=Or){const r=Array.isArray(t)?t:[t];let a=e.from;const i=n.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function Rv(e,t,n=Or){return Wr(e,t.from,!1,n)||Wr(e,t.to,!1,n)||Wr(t,e.from,!1,n)||Wr(t,e.to,!1,n)}function H8(e,t,n=Or){const r=Array.isArray(t)?t:[t];if(r.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?Wr(e,l,!1,n):e2(l,n)?l.some(c=>Wr(e,c,!1,n)):fx(l)?l.from&&l.to?Rv(e,{from:l.from,to:l.to},n):!1:JN(l)?W8(e,l.dayOfWeek,n):KN(l)?n.isAfter(l.before,l.after)?Rv(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Hr(e.from,l,n)||Hr(e.to,l,n):QN(l)||ZN(l)?Hr(e.from,l,n)||Hr(e.to,l,n):!1))return!0;const o=r.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(o.some(h=>h(l)))return!0;l=n.addDays(l,1)}}return!1}function V8(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:i,onSelect:o}=e,[l,c]=Lu(a,o?a:void 0),d=o?a:l;return{selected:d,select:(f,p,w)=>{const{min:v,max:j}=e,g=f?B8(f,d,v,j,i,t):void 0;return r&&n&&(g!=null&&g.from)&&g.to&&H8({from:g.from,to:g.to},n,t)&&(g.from=f,g.to=void 0),o||c(g),o==null||o(g,f,p,w),g},isSelected:f=>d&&Wr(d,f,!1,t)}}function Y8(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=Lu(n,a?n:void 0),l=a?n:i,{isSameDay:c}=t;return{selected:l,select:(u,f,p)=>{let w=u;return!r&&l&&l&&c(u,l)&&(w=void 0),a||o(w),a==null||a(w,u,f,p),w},isSelected:u=>l?c(l,u):!1}}function X8(e,t){const n=Y8(e,t),r=U8(e,t),a=V8(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function q8(e){var be;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new Ht(t.today,t.timeZone)),t.month&&(t.month=new Ht(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new Ht(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new Ht(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new Ht(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new Ht(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(be=t.selected)==null?void 0:be.map(de=>new Ht(de,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new Ht(t.selected.from,t.timeZone):void 0,to:t.selected.to?new Ht(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const de={...hx,...t.locale};return{dateLib:new Nn({locale:de,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:ZI(t.components),formatters:l8(t.formatters),labels:{...k8,...t.labels},locale:de,classNames:{...mx(),...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:d,navLayout:h,numberOfMonths:u=1,onDayBlur:f,onDayClick:p,onDayFocus:w,onDayKeyDown:v,onDayMouseEnter:j,onDayMouseLeave:g,onNextClick:y,onPrevClick:x,showWeekNumber:b,styles:N}=t,{formatCaption:k,formatDay:S,formatMonthDropdown:M,formatWeekNumber:O,formatWeekNumberHeader:I,formatWeekdayName:B,formatYearDropdown:z}=r,L=R8(t,i),{days:C,months:A,navStart:_,navEnd:P,previousMonth:E,nextMonth:D,goToMonth:$}=L,H=KI(C,t,_,P,i),{isSelected:T,select:U,selected:G}=X8(t,i)??{},{blur:Q,focused:re,isFocusTarget:ne,moveFocus:J,setFocused:R}=F8(t,L,H,T??(()=>!1),i),{labelDayButton:ee,labelGridcell:F,labelGrid:V,labelMonthDropdown:K,labelNav:ie,labelPrevious:ce,labelNext:pe,labelWeekday:ke,labelWeekNumber:Ie,labelWeekNumberHeader:Ce,labelYearDropdown:tt}=a,Je=m.useMemo(()=>u8(i,t.ISOWeek),[i,t.ISOWeek]),Le=d!==void 0||p!==void 0,_e=m.useCallback(()=>{E&&($(E),x==null||x(E))},[E,$,x]),Ge=m.useCallback(()=>{D&&($(D),y==null||y(D))},[$,D,y]),nt=m.useCallback((de,De)=>Se=>{Se.preventDefault(),Se.stopPropagation(),R(de),U==null||U(de.date,De,Se),p==null||p(de.date,De,Se)},[U,p,R]),ot=m.useCallback((de,De)=>Se=>{R(de),w==null||w(de.date,De,Se)},[w,R]),St=m.useCallback((de,De)=>Se=>{Q(),f==null||f(de.date,De,Se)},[Q,f]),At=m.useCallback((de,De)=>Se=>{const Fe={ArrowLeft:[Se.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Se.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Se.shiftKey?"year":"week","after"],ArrowUp:[Se.shiftKey?"year":"week","before"],PageUp:[Se.shiftKey?"year":"month","before"],PageDown:[Se.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Fe[Se.key]){Se.preventDefault(),Se.stopPropagation();const[yt,ue]=Fe[Se.key];J(yt,ue)}v==null||v(de.date,De,Se)},[J,v,t.dir]),ae=m.useCallback((de,De)=>Se=>{j==null||j(de.date,De,Se)},[j]),me=m.useCallback((de,De)=>Se=>{g==null||g(de.date,De,Se)},[g]),Te=m.useCallback(de=>De=>{const Se=Number(De.target.value),Fe=i.setMonth(i.startOfMonth(de),Se);$(Fe)},[i,$]),q=m.useCallback(de=>De=>{const Se=Number(De.target.value),Fe=i.setYear(i.startOfMonth(de),Se);$(Fe)},[i,$]),{className:le,style:W}=m.useMemo(()=>({className:[l[ye.Root],t.className].filter(Boolean).join(" "),style:{...N==null?void 0:N[ye.Root],...t.style}}),[l,t.className,t.style,N]),te=JI(t),he=m.useRef(null);M8(he,!!t.animate,{classNames:l,months:A,focused:re,dateLib:i});const ve={dayPickerProps:t,selected:G,select:U,isSelected:T,months:A,nextMonth:D,previousMonth:E,goToMonth:$,getModifiers:H,components:n,classNames:l,styles:N,labels:a,formatters:r};return Z.createElement(GN.Provider,{value:ve},Z.createElement(n.Root,{rootRef:t.animate?he:void 0,className:le,style:W,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"],...te},Z.createElement(n.Months,{className:l[ye.Months],style:N==null?void 0:N[ye.Months]},!t.hideNavigation&&!h&&Z.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ye.Nav],style:N==null?void 0:N[ye.Nav],"aria-label":ie(),onPreviousClick:_e,onNextClick:Ge,previousMonth:E,nextMonth:D}),A.map((de,De)=>Z.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[ye.Month],style:N==null?void 0:N[ye.Month],key:De,displayIndex:De,calendarMonth:de},h==="around"&&!t.hideNavigation&&De===0&&Z.createElement(n.PreviousMonthButton,{type:"button",className:l[ye.PreviousMonthButton],tabIndex:E?void 0:-1,"aria-disabled":E?void 0:!0,"aria-label":ce(E),onClick:_e,"data-animated-button":t.animate?"true":void 0},Z.createElement(n.Chevron,{disabled:E?void 0:!0,className:l[ye.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Z.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[ye.MonthCaption],style:N==null?void 0:N[ye.MonthCaption],calendarMonth:de,displayIndex:De},c!=null&&c.startsWith("dropdown")?Z.createElement(n.DropdownNav,{className:l[ye.Dropdowns],style:N==null?void 0:N[ye.Dropdowns]},(()=>{const Se=c==="dropdown"||c==="dropdown-months"?Z.createElement(n.MonthsDropdown,{key:"month",className:l[ye.MonthsDropdown],"aria-label":K(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:Te(de.date),options:c8(de.date,_,P,r,i),style:N==null?void 0:N[ye.Dropdown],value:i.getMonth(de.date)}):Z.createElement("span",{key:"month"},M(de.date,i)),Fe=c==="dropdown"||c==="dropdown-years"?Z.createElement(n.YearsDropdown,{key:"year",className:l[ye.YearsDropdown],"aria-label":tt(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:q(de.date),options:h8(_,P,r,i,!!t.reverseYears),style:N==null?void 0:N[ye.Dropdown],value:i.getYear(de.date)}):Z.createElement("span",{key:"year"},z(de.date,i));return i.getMonthYearOrder()==="year-first"?[Fe,Se]:[Se,Fe]})(),Z.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(de.date,i.options,i))):Z.createElement(n.CaptionLabel,{className:l[ye.CaptionLabel],role:"status","aria-live":"polite"},k(de.date,i.options,i))),h==="around"&&!t.hideNavigation&&De===u-1&&Z.createElement(n.NextMonthButton,{type:"button",className:l[ye.NextMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":pe(D),onClick:Ge,"data-animated-button":t.animate?"true":void 0},Z.createElement(n.Chevron,{disabled:D?void 0:!0,className:l[ye.Chevron],orientation:t.dir==="rtl"?"left":"right"})),De===u-1&&h==="after"&&!t.hideNavigation&&Z.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ye.Nav],style:N==null?void 0:N[ye.Nav],"aria-label":ie(),onPreviousClick:_e,onNextClick:Ge,previousMonth:E,nextMonth:D}),Z.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":V(de.date,i.options,i)||void 0,className:l[ye.MonthGrid],style:N==null?void 0:N[ye.MonthGrid]},!t.hideWeekdays&&Z.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[ye.Weekdays],style:N==null?void 0:N[ye.Weekdays]},b&&Z.createElement(n.WeekNumberHeader,{"aria-label":Ce(i.options),className:l[ye.WeekNumberHeader],style:N==null?void 0:N[ye.WeekNumberHeader],scope:"col"},I()),Je.map(Se=>Z.createElement(n.Weekday,{"aria-label":ke(Se,i.options,i),className:l[ye.Weekday],key:String(Se),style:N==null?void 0:N[ye.Weekday],scope:"col"},B(Se,i.options,i)))),Z.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[ye.Weeks],style:N==null?void 0:N[ye.Weeks]},de.weeks.map(Se=>Z.createElement(n.Week,{className:l[ye.Week],key:Se.weekNumber,style:N==null?void 0:N[ye.Week],week:Se},b&&Z.createElement(n.WeekNumber,{week:Se,style:N==null?void 0:N[ye.WeekNumber],"aria-label":Ie(Se.weekNumber,{locale:o}),className:l[ye.WeekNumber],scope:"row",role:"rowheader"},O(Se.weekNumber,i)),Se.days.map(Fe=>{const{date:yt}=Fe,ue=H(Fe);if(ue[ht.focused]=!ue.hidden&&!!(re!=null&&re.isEqualTo(Fe)),ue[tr.selected]=(T==null?void 0:T(yt))||ue.selected,fx(G)){const{from:un,to:Qe}=G;ue[tr.range_start]=!!(un&&Qe&&i.isSameDay(yt,un)),ue[tr.range_end]=!!(un&&Qe&&i.isSameDay(yt,Qe)),ue[tr.range_middle]=Wr(G,yt,!0,i)}const rt=d8(ue,N,t.modifiersStyles),ut=QI(ue,l,t.modifiersClassNames),Ct=!Le&&!ue.hidden?F(yt,ue,i.options,i):void 0;return Z.createElement(n.Day,{key:`${i.format(yt,"yyyy-MM-dd")}_${i.format(Fe.displayMonth,"yyyy-MM")}`,day:Fe,modifiers:ue,className:ut.join(" "),style:rt,role:"gridcell","aria-selected":ue.selected||void 0,"aria-label":Ct,"data-day":i.format(yt,"yyyy-MM-dd"),"data-month":Fe.outside?i.format(yt,"yyyy-MM"):void 0,"data-selected":ue.selected||void 0,"data-disabled":ue.disabled||void 0,"data-hidden":ue.hidden||void 0,"data-outside":Fe.outside||void 0,"data-focused":ue.focused||void 0,"data-today":ue.today||void 0},!ue.hidden&&Le?Z.createElement(n.DayButton,{className:l[ye.DayButton],style:N==null?void 0:N[ye.DayButton],type:"button",day:Fe,modifiers:ue,disabled:ue.disabled||void 0,tabIndex:ne(Fe)?0:-1,"aria-label":ee(yt,ue,i.options,i),onClick:nt(Fe,ue),onBlur:St(Fe,ue),onFocus:ot(Fe,ue),onKeyDown:At(Fe,ue),onMouseEnter:ae(Fe,ue),onMouseLeave:me(Fe,ue)},S(yt,i.options,i)):!ue.hidden&&S(Fe.date,i.options,i))})))))))),t.footer&&Z.createElement(n.Footer,{className:l[ye.Footer],style:N==null?void 0:N[ye.Footer],role:"status","aria-live":"polite"},t.footer)))}function zn({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:o,...l}){const c=mx();return s.jsx(q8,{showOutsideDays:n,className:Ee("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:Ee("w-fit",c.root),months:Ee("relative flex flex-col gap-4 md:flex-row",c.months),month:Ee("flex w-full flex-col gap-4",c.month),nav:Ee("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:Ee(km({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:Ee(km({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:Ee("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:Ee("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:Ee("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:Ee("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:Ee("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:Ee("flex",c.weekdays),weekday:Ee("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:Ee("mt-2 flex w-full",c.week),week_number_header:Ee("w-[--cell-size] select-none",c.week_number_header),week_number:Ee("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:Ee("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:Ee("bg-accent rounded-l-md",c.range_start),range_middle:Ee("rounded-none",c.range_middle),range_end:Ee("bg-accent rounded-r-md",c.range_end),today:Ee("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:Ee("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:Ee("text-muted-foreground opacity-50",c.disabled),hidden:Ee("invisible",c.hidden),...t},components:{Root:({className:d,rootRef:h,...u})=>s.jsx("div",{"data-slot":"calendar",ref:h,className:Ee(d),...u}),Chevron:({className:d,orientation:h,...u})=>h==="left"?s.jsx(aj,{className:Ee("size-4",d),...u}):h==="right"?s.jsx(Hp,{className:Ee("size-4",d),...u}):s.jsx(ju,{className:Ee("size-4",d),...u}),DayButton:G8,WeekNumber:({children:d,...h})=>s.jsx("td",{...h,children:s.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:d})}),...o},...l})}function G8({className:e,day:t,modifiers:n,...r}){const a=mx(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),s.jsx(X,{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:Ee("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",a.day,e),...r})}var Fu="Popover",[i2]=Nu(Fu,[_u]),Tl=_u(),[K8,Ws]=i2(Fu),o2=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=Tl(t),c=m.useRef(null),[d,h]=m.useState(!1),[u,f]=sx({prop:r,defaultProp:a??!1,onChange:i,caller:Fu});return s.jsx(Lj,{...l,children:s.jsx(K8,{scope:t,contentId:sr(),triggerRef:c,open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:o,children:n})})};o2.displayName=Fu;var l2="PopoverAnchor",Q8=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ws(l2,n),i=Tl(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return m.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(nx,{...i,...r,ref:t})});Q8.displayName=l2;var c2="PopoverTrigger",d2=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ws(c2,n),i=Tl(n),o=Cn(t,a.triggerRef),l=s.jsx(dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":p2(a.open),...r,ref:o,onClick:Dt(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(nx,{asChild:!0,...i,children:l})});d2.displayName=c2;var px="PopoverPortal",[Z8,J8]=i2(px,{forceMount:void 0}),u2=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Ws(px,t);return s.jsx(Z8,{scope:t,forceMount:n,children:s.jsx(Aa,{present:n||i.open,children:s.jsx(rx,{asChild:!0,container:a,children:r})})})};u2.displayName=px;var Ii="PopoverContent",h2=m.forwardRef((e,t)=>{const n=J8(Ii,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Ws(Ii,e.__scopePopover);return s.jsx(Aa,{present:r||i.open,children:i.modal?s.jsx(tL,{...a,ref:t}):s.jsx(nL,{...a,ref:t})})});h2.displayName=Ii;var eL=ku("PopoverContent.RemoveScroll"),tL=m.forwardRef((e,t)=>{const n=Ws(Ii,e.__scopePopover),r=m.useRef(null),a=Cn(t,r),i=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return cN(o)},[]),s.jsx(ox,{as:eL,allowPinchZoom:!0,children:s.jsx(f2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Dt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Dt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Dt(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),nL=m.forwardRef((e,t)=>{const n=Ws(Ii,e.__scopePopover),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(f2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),f2=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...u}=e,f=Ws(Ii,n),p=Tl(n);return eN(),s.jsx(ix,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Su,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:s.jsx(Fj,{"data-state":p2(f.open),role:"dialog",id:f.contentId,...p,...u,ref:t,style:{...u.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)"}})})})}),m2="PopoverClose",rL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ws(m2,n);return s.jsx(dt.button,{type:"button",...r,ref:t,onClick:Dt(e.onClick,()=>a.onOpenChange(!1))})});rL.displayName=m2;var sL="PopoverArrow",aL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Tl(n);return s.jsx(Uj,{...a,...r,ref:t})});aL.displayName=sL;function p2(e){return e?"open":"closed"}var iL=o2,oL=d2,lL=u2,x2=h2;const $n=iL,Rn=oL,pn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},a)=>s.jsx(lL,{children:s.jsx(x2,{ref:a,align:t,sideOffset:n,className:Ee("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),...r})}));pn.displayName=x2.displayName;const Iv=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M20 3H2v14h8v2H8v2h8v-2h-2v-2h8V3h-2zm-6 12H4V5h16v10h-6z",fill:"currentColor"})}),Ec=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M7 8H5v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2V8h-2v2h-2v2h-2v2h-2v-2H9v-2H7V8z",fill:"currentColor"})}),cL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M8 5v2h2V5H8zm4 4V7h-2v2h2zm2 2V9h-2v2h2zm0 2h2v-2h-2v2zm-2 2v-2h2v2h-2zm0 0h-2v2h2v-2zm-4 4v-2h2v2H8z",fill:"currentColor"})}),qn=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2h2v2h4v18H3V4h4V2h2v2h6V2zM9 6H5v2h14V6H9zm-4 4v10h14V10H5zm2 2h8v2H7v-2zm4 6v-2H7v2h4z",fill:"currentColor"})}),dL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),uL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z",fill:"currentColor"})}),xs=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M4 11v2h12v2h2v-2h2v-2h-2V9h-2v2H4zm10-4h2v2h-2V7zm0 0h-2V5h2v2zm0 10h2v-2h-2v2zm0 0h-2v2h2v-2z",fill:"currentColor"})}),hL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M3 3h18v18H3V3zm16 2H5v14h14V5zM7 12h2v5H7v-5zm10-5h-2v10h2V7zm-6 3h2v2h-2v-2zm2 4h-2v3h2v-3z",fill:"currentColor"})}),Ir=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M22 4H2v16h20V4zM4 18V6h16v12H4zM8 8H6v2h2v2h2v2h4v-2h2v-2h2V8h-2v2h-2v2h-4v-2H8V8z",fill:"currentColor"})}),g2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),Mc=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h12v2H6v4h12v-4h2v6H4v-6z",fill:"currentColor"})}),Ze=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),Gt=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),v2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2h-2v2h2v2h-2v2h-2v2H9V8H7V6H5V4H3v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2V8h2V6h2V4h-2v2h-2v2h-2v2h-2V6h2V4h2V2zm-2 12h2v2h-2v-2zm-2-2h2v2h-2v-2zm-2-2h2v2H9v-2zm-2-2h2v2H7v-2zm8 6h2v2h-2v-2zm2-2h2v2h-2v-2zm2-2h2v2h-2v-2zm2-2h-2v-2h2v2z",fill:"currentColor"})}),Vr=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 4h20v4H2V4zm18 2v2H4V6h16zm0 6H2v4h18v-4zm-2 2v2H4v-2h14zM2 16h20v4H2v-4zm18 2v2H4v-2h16z",fill:"currentColor"})}),fL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),Lv=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm10-4h-2v2h2v-2z",fill:"currentColor"})}),Oo=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M15 2H9v2H7v6h2V4h6V2zm0 8H9v2h6v-2zm0-6h2v6h-2V4zM4 16h2v-2h8v2H6v4h8v-4h2v6H4v-6zm12-6h-2v2h2v2h2v-2h-2v-2z",fill:"currentColor"})}),Qh=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),aa=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2v4h2V2h-2zm0 16v4h2v-4h-2zm8-8h4v2h-4v-2zM2 10h4v2H2v-2zm15.07-5.07l2.83 2.83-1.41 1.41-2.83-2.83 1.41-1.41zm-8.28 8.28l2.83 2.83-1.41 1.41-2.83-2.83 1.41-1.41zm8.28 8.28l1.41 1.41-2.83 2.83-1.41-1.41 2.83-2.83zm-8.28-8.28l1.41 1.41-2.83 2.83-1.41-1.41 2.83-2.83z",fill:"currentColor"})}),mL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M6 2h12v2H6V2zm0 2v16h12V4H6zm8 2H10v2h4V6zm-4 4h4v8h-4v-8z",fill:"currentColor"})}),pL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M8 4h2v4h4V4h2v4h4v2h-4v4h4v2h-4v4h-2v-4H8v4H6v-4H2v-2h4V8H2V6h4V4zm2 6v4h4v-4h-4z",fill:"currentColor"})}),Fn=({className:e="",size:t=24})=>s.jsx(dL,{className:e,size:t}),xL=({className:e="",size:t=24})=>s.jsx(hL,{className:e,size:t}),Cm=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M4 2h12v2H4v12H2V2h2zm4 4h12v16H8V6zm2 2v12h8V8h-8z",fill:"currentColor"})}),w2=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),gL=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M12 2h2v2h-2V2zm-2 4h6v2h-2v6h-2V8H8V6zm-4 8h12v2H4v-2zm0 4h12v2H4v-2z",fill:"currentColor"})}),Qc=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M10 2h4v2h6v2h-2v14H6V6H4V4h6V2zM8 6v14h8V6H8zm2 2h2v10h-2V8zm4 0h2v10h-2V8z",fill:"currentColor"})}),Fv=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.jsx("path",{d:"M2 4h20v2H2V4zm0 4h18v2H2V8zm0 4h16v2H2v-2zm0 4h14v2H2v-2z",fill:"currentColor"})}),xx=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})}),Uv=({className:e="",size:t=24})=>s.jsx("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,width:t,height:t,children:s.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"})});function _a({title:e="Seeding Terminal",lines:t,isRunning:n=!1,className:r="",defaultCollapsed:a=!1}){const[i,o]=m.useState(a),l=m.useRef(null);m.useEffect(()=>{const u=l.current;!u||i||u.scrollTo({top:u.scrollHeight,behavior:"smooth"})},[t,n,i]);const c=u=>{switch(u.type){case"success":return s.jsx(Et,{className:"w-3 h-3 text-green-400"});case"error":return s.jsx(Zs,{className:"w-3 h-3 text-red-400"});case"progress":return u.status==="running"?s.jsx(qr,{className:"w-3 h-3 text-blue-400 animate-spin"}):u.status==="completed"?s.jsx(Et,{className:"w-3 h-3 text-green-400"}):u.status==="failed"?s.jsx(Zs,{className:"w-3 h-3 text-red-400"}):s.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"});default:return s.jsx("div",{className:"w-3 h-3 border border-gray-500 rounded-full"})}},d=u=>{switch(u.type){case"success":return"text-green-400";case"error":return"text-red-400";case"progress":return u.status==="running"?"text-blue-400":u.status==="completed"?"text-green-400":u.status==="failed"?"text-red-400":"text-gray-400";default:return"text-gray-300"}},h=u=>u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+u.getMilliseconds().toString().padStart(3,"0");return s.jsxs("div",{className:`bg-black/90 border border-dashed border-white/20 rounded-none font-mono text-xs ${r}`,children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-dashed border-white/10",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(oT,{className:"w-3 h-3 text-green-400"}),s.jsx("span",{className:"text-green-400 font-medium text-xs",children:e})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[n&&s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full animate-pulse"}),s.jsx("span",{className:"text-green-400 text-xs",children:"RUNNING"})]}),s.jsxs("div",{className:"text-gray-400 text-xs",children:[t.length," / ",t.length]}),s.jsx("button",{onClick:()=>o(!i),className:"text-gray-400 hover:text-white transition-colors",children:i?s.jsx(ju,{className:"w-3 h-3"}):s.jsx(QP,{className:"w-3 h-3"})})]})]}),!i&&s.jsxs("div",{ref:l,className:"p-3 space-y-0.5 h-56 overflow-y-auto",children:[t.length===0?s.jsxs("div",{className:"text-gray-500 italic text-xs",children:[s.jsx("span",{className:"text-green-400",children:"$"})," Waiting for operations..."]}):t.map(u=>s.jsxs("div",{className:`flex items-start space-x-3 py-1 ${d(u)} text-xs`,children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(u.timestamp)}),s.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),s.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c(u)}),s.jsx("span",{className:"flex-1 min-w-0 break-words",children:u.message})]},u.id)),n&&s.jsxs("div",{className:"flex items-start space-x-3 py-1 text-green-400 text-xs",children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:h(new Date)}),s.jsx("span",{className:"text-green-400 flex-shrink-0",children:"$"}),s.jsx("div",{className:"w-3 h-3 flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"flex-1 flex items-center",children:s.jsx("span",{className:"animate-pulse",children:"█"})})]})]}),!i&&s.jsx("div",{className:"px-3 py-1.5 border-t border-dashed border-white/10 bg-black/50",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("span",{children:["Status: ",n?"Active":"Idle"]}),s.jsxs("span",{children:["Lines: ",t.length]})]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 bg-green-400 rounded-full"}),s.jsx("span",{children:"Better Auth Studio"})]})]})})]})}const y2=document.createElement("style");y2.textContent=`
409
- @keyframes fadeIn {
410
- from {
411
- opacity: 0;
412
- transform: translateX(-10px);
413
- }
414
- to {
415
- opacity: 1;
416
- transform: translateX(0);
417
- }
418
- }
419
-
420
- .animate-fadeIn {
421
- animation: fadeIn 0.3s ease-out forwards;
422
- }
423
- `;document.head.appendChild(y2);const Re=m.forwardRef(({className:e,type:t,...n},r)=>s.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:r,...n}));Re.displayName="Input";const Ve=m.forwardRef(({className:e,...t},n)=>s.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));Ve.displayName="Label";function b2({currentPage:e,totalPages:t,onPageChange:n,totalItems:r,startIndex:a,endIndex:i}){const o=()=>{const d=[],h=[];for(let u=Math.max(2,e-2);u<=Math.min(t-1,e+2);u++)d.push(u);return e-2>2?h.push(1,"..."):h.push(1),h.push(...d),e+2<t-1?h.push("...",t):t>1&&h.push(t),h};if(t<=1)return null;const l=o();return s.jsxs("div",{className:"flex items-center justify-between mt-6",children:[s.jsxs("div",{className:"text-sm text-gray-400",children:["Showing ",a+1," to ",Math.min(i,r)," of ",r," items"]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsxs(X,{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:[s.jsx(aj,{className:"w-4 h-4"}),"Previous"]}),l.map((c,d)=>{if(c==="...")return s.jsx(X,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:s.jsx(sT,{className:"w-4 h-4"})},`dots-${d}`);const h=c,u=e===h;return s.jsx(X,{variant:u?"default":"outline",size:"sm",onClick:()=>n(h),className:u?"bg-white text-black rounded-none":"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:h},h)}),s.jsxs(X,{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",s.jsx(Hp,{className:"w-4 h-4"})]})]})]})}const Ol=m.createContext({isOpen:!1,setIsOpen:()=>{}}),ua=m.forwardRef(({className:e,value:t,onValueChange:n,children:r,...a},i)=>{const[o,l]=m.useState(!1);return s.jsx(Ol.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:s.jsx("div",{ref:i,className:`relative ${e}`,...a,children:r})})});ua.displayName="Select";const ha=m.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:a,setIsOpen:i}=m.useContext(Ol);return s.jsxs("button",{ref:r,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(!a),...n,children:[t,s.jsx(ju,{className:`h-4 w-4 text-gray-400 transition-transform ${a?"rotate-180":""}`})]})});ha.displayName="SelectTrigger";const gx=m.forwardRef(({className:e,placeholder:t,...n},r)=>{const{value:a}=m.useContext(Ol);return s.jsx("span",{ref:r,className:`text-sm text-white ${e}`,...n,children:a||t})});gx.displayName="SelectValue";const fa=m.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:a}=m.useContext(Ol);return a?s.jsx("div",{ref:r,className:`absolute top-full left-0 right-0 z-50 mt-1 border border-dashed border-white/20 bg-black/90 rounded-none shadow-lg ${e}`,...n,children:t}):null});fa.displayName="SelectContent";const rn=m.forwardRef(({className:e,children:t,value:n,...r},a)=>{const{onValueChange:i,setIsOpen:o}=m.useContext(Ol);return s.jsx("div",{ref:a,className:`px-3 py-2 text-sm text-white hover:bg-white/10 cursor-pointer ${e}`,onClick:()=>{i==null||i(n),o(!1)},...r,children:t})});rn.displayName="SelectItem";function j2(){const e=Dr(),{counts:t,refetchCounts:n}=Au(),[r,a]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(null),[d,h]=m.useState(""),[u,f]=m.useState("all"),[p,w]=m.useState([]),[v,j]=m.useState(1),[g]=m.useState(20),[y,x]=m.useState(!1),[b,N]=m.useState(!1),[k,S]=m.useState(!1),[M,O]=m.useState(!1),[I,B]=m.useState(!1),[z,L]=m.useState(!1),[C,A]=m.useState(null),[_,P]=m.useState([]),[E,D]=m.useState(!1),[$,H]=m.useState({name:"",slug:""}),[T,U]=m.useState({name:"",slug:""});m.useEffect(()=>{R()},[]);const G=ae=>ae.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),Q=ae=>{const me=G(ae);H({name:ae,slug:me})},re=ae=>{H(me=>({...me,slug:G(ae)}))},ne=ae=>{const me=G(ae);U({name:ae,slug:me})},J=ae=>{U(me=>({...me,slug:G(ae)}))},R=async()=>{try{const me=await(await fetch("/api/plugins")).json(),Te=(me==null?void 0:me.plugins).find(q=>q.id==="organization");c({enabled:!!Te,availablePlugins:(me==null?void 0:me.plugins).map(q=>q.id),configPath:me.configPath,organizationPlugin:(me==null?void 0:me.plugins).find(q=>q.id==="organization")}),Te?await ee():o(!1)}catch(ae){console.error("Failed to check plugin status:",ae),c({enabled:!1,error:"Failed to check plugin status"}),o(!1)}},ee=async()=>{try{const me=await(await fetch("/api/organizations?limit=10000")).json();console.log({lenght:me.organizations.length}),a(me.organizations||[])}catch(ae){console.error("Failed to fetch organizations:",ae),Y.error("Failed to fetch organizations")}finally{o(!1)}},F=async ae=>{P([]),D(!0),P([{id:"start",type:"info",message:`Starting organization seeding process for ${ae} organizations...`,timestamp:new Date}]);try{const Te=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:ae})})).json();if(Te.success){const q=Te.results.map((W,te)=>W.success?{id:`org-${te}`,type:"progress",message:`Creating organization: ${W.organization.name} (${W.organization.slug})`,timestamp:new Date,status:"completed"}:{id:`org-${te}`,type:"error",message:`Failed to create organization ${te+1}: ${W.error}`,timestamp:new Date});P(W=>[...W,...q]);const le=Te.results.filter(W=>W.success).length;P(W=>[...W,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${le}/${ae} organizations successfully`,timestamp:new Date}]),await ee(),await n()}else P(q=>[...q,{id:"error",type:"error",message:`❌ Seeding failed: ${Te.error||"Unknown error"}`,timestamp:new Date}])}catch(me){P(Te=>[...Te,{id:"error",type:"error",message:`❌ Network error: ${me}`,timestamp:new Date}])}finally{D(!1)}},V=ae=>{A(ae),B(!0)},K=ae=>{A(ae),U({name:ae.name,slug:ae.slug}),S(!0)},ie=ae=>{A(ae),O(!0)},ce=async()=>{if(!$.name){Y.error("Please fill in the organization name");return}const ae=Y.loading("Creating organization...");try{const Te=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:$.name,slug:$.slug})})).json();Te.success?(await ee(),x(!1),H({name:"",slug:""}),Y.success("Organization created successfully!",{id:ae})):Y.error(`Error creating organization: ${Te.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error creating organization:",me),Y.error("Error creating organization",{id:ae})}},pe=async()=>{if(!C){Y.error("No organization selected");return}if(!T.name){Y.error("Please fill in the organization name");return}const ae=Y.loading("Updating organization...");try{const Te=await(await fetch(`/api/organizations/${C.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T.name,slug:T.slug})})).json();Te.success?(await ee(),S(!1),A(null),U({name:"",slug:""}),Y.success("Organization updated successfully!",{id:ae})):Y.error(`Error updating organization: ${Te.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error updating organization:",me),Y.error("Error updating organization",{id:ae})}},ke=async()=>{if(!C){Y.error("No organization selected");return}const ae=Y.loading("Deleting organization...");try{const Te=await(await fetch(`/api/organizations/${C.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Te.success?(await ee(),await n(),O(!1),A(null),Y.success("Organization deleted successfully!",{id:ae})):Y.error(`Error deleting organization: ${Te.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error deleting organization:",me),Y.error("Error deleting organization",{id:ae})}},Ie=()=>{if(r.length===0){Y.error("No organizations to export");return}const ae=["ID","Name","Slug","Created At","Updated At"],me=r.map(te=>[te.id,te.name||"",te.slug||"",new Date(te.createdAt).toLocaleString(),new Date(te.updatedAt).toLocaleString()]),Te=[ae.join(","),...me.map(te=>te.map(he=>`"${he}"`).join(","))].join(`
424
- `),q=new Blob([Te],{type:"text/csv;charset=utf-8;"}),le=document.createElement("a"),W=URL.createObjectURL(q);le.setAttribute("href",W),le.setAttribute("download",`organizations-export-${new Date().toISOString().split("T")[0]}.csv`),le.style.visibility="hidden",document.body.appendChild(le),le.click(),document.body.removeChild(le),Y.success(`Exported ${r.length} organizations to CSV`)},Ce=ae=>{p.some(me=>me.type===ae)||w([...p,{type:ae}])},tt=ae=>{w(p.filter(me=>me.type!==ae))},Je=()=>{w([])},Le=(ae,me)=>{w(Te=>Te.map(q=>q.type===ae?{...q,dateRange:me}:q))},_e=r.filter(ae=>{const me=ae.name.toLowerCase().includes(d.toLowerCase())||ae.slug.toLowerCase().includes(d.toLowerCase());if(p.length===0)return me;const Te=p.every(q=>{var le,W,te,he;switch(q.type){case"createdAt":{if(!((le=q.dateRange)!=null&&le.from)&&!((W=q.dateRange)!=null&&W.to))return!0;const ve=new Date(ae.createdAt);return!((te=q.dateRange)!=null&&te.from&&q.dateRange.from>ve||(he=q.dateRange)!=null&&he.to&&q.dateRange.to<ve)}default:return!0}});return me&&Te}),Ge=Math.ceil(_e.length/g),nt=(v-1)*g,ot=nt+g,St=_e.slice(nt,ot),At=ae=>{j(ae)};return i?s.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(qr,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading organizations..."})]})}):l&&!l.enabled?s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl text-white font-light",children:"Organizations"}),s.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx(gr,{className:"w-12 h-12 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),s.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."}),s.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[s.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),s.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:s.jsxs("li",{children:["Import the plugin in your auth configuration file",l.configPath&&s.jsxs("span",{className:"text-gray-400",children:[" (",l.configPath,")"]}),":"]})}),s.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:s.jsxs("pre",{className:"text-sm text-gray-300",children:[s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"export const"})," ",s.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",s.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",s.jsx("br",{}),s.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",s.jsx("br",{}),s.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),s.jsx("br",{}),s.jsx("span",{className:"pl-10",children:"]"})," ",s.jsx("br",{}),"}",") ",s.jsx("br",{})]})}),s.jsx("div",{className:"mt-4",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),s.jsx("div",{className:"mt-2",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),l.availablePlugins&&l.availablePlugins.length>0&&s.jsx("div",{className:"mb-4",children:s.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",l.availablePlugins.join(", ")]})}),s.jsx(X,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),s.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",s.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"})]})]})]})})]}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Organizations",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-sm",children:t.organizations}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your organizations and teams"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(X,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:Ie,children:[s.jsx(ij,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),s.jsxs(X,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>L(!0),children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(X,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>x(!0),children:[s.jsx(Ts,{className:"w-4 h-4 mr-2"}),"Add Organization"]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Na,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Re,{placeholder:"Search organizations...",value:d,onChange:ae=>h(ae.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(ua,{value:"",onValueChange:Ce,children:[s.jsx(ha,{className:"w-[180px]",children:s.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[s.jsx(Ts,{className:"w-4 h-4"}),s.jsx("span",{children:"Add Filter"})]})}),s.jsx(fa,{children:!p.some(ae=>ae.type==="createdAt")&&s.jsx(rn,{value:"createdAt",children:"Created Date"})})]})}),p.length>0&&s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(X,{onClick:Je,children:"Clear all"})})]}),p.length>0&&s.jsx("div",{className:"space-y-3",children:s.jsx("div",{className:"flex flex-wrap gap-3",children:p.map(ae=>{var me,Te,q,le;return s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[s.jsx(Vp,{className:"w-3 h-3 text-white"}),ae.type==="createdAt"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Created:"}),s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(Ad,{className:"mr-1 h-3 w-3"}),(me=ae.dateRange)!=null&&me.from?An(ae.dateRange.from,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:(Te=ae.dateRange)==null?void 0:Te.from,onSelect:W=>{var te;return Le("createdAt",{from:W,to:(te=ae.dateRange)==null?void 0:te.to})},initialFocus:!0,className:"rounded-none"})})]}),s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(Ad,{className:"mr-1 h-3 w-3"}),(q=ae.dateRange)!=null&&q.to?An(ae.dateRange.to,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:(le=ae.dateRange)==null?void 0:le.to,onSelect:W=>{var te;return Le("createdAt",{from:(te=ae.dateRange)==null?void 0:te.from,to:W})},initialFocus:!0,disabled:W=>{var te;return(te=ae.dateRange)!=null&&te.from?W<ae.dateRange.from:!1},className:"rounded-none"})})]})]}),s.jsx("button",{onClick:()=>tt(ae.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:s.jsx(Tt,{className:"w-3 h-3 text-white"})})]},ae.type)})})})]}),s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Organization"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Slug"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:_e.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:s.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(gr,{className:"w-8 h-8 text-white/50"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium text-lg",children:"No organizations found"}),s.jsx("p",{className:"text-gray-400 text-sm mt-1",children:d||u!=="all"?"Try adjusting your search or filter criteria":"Get started by creating your first organization"})]}),!d&&u==="all"&&s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(X,{onClick:()=>x(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[s.jsx(Ts,{className:"w-4 h-4 mr-2"}),"Create Organization"]}),s.jsxs(X,{onClick:()=>L(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):St.map(ae=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>e(`/organizations/${ae.id}`),children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(gr,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:ae.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",ae.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:ae.slug}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:s.jsxs("div",{className:"flex flex-col",children:[new Date(ae.createdAt).toLocaleDateString(),s.jsx("p",{className:"text-xs",children:new Date(ae.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsx(X,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:me=>{me.stopPropagation(),V(ae)},children:s.jsx(Cl,{className:"w-4 h-4"})}),s.jsx(X,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:me=>{me.stopPropagation(),K(ae)},children:s.jsx(ja,{className:"w-4 h-4"})}),s.jsx(X,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:me=>{me.stopPropagation(),ie(ae)},children:s.jsx(Yp,{className:"w-4 h-4"})})]})})]},ae.id))})]})}),s.jsx(b2,{currentPage:v,totalPages:Ge,onPageChange:At,totalItems:_e.length,startIndex:nt,endIndex:ot})]}),z&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.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:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[s.jsx("span",{className:"text-white/50 mr-2",children:"["}),s.jsx(gr,{className:"inline mr-2 w-3.5 h-3.5 text-white"}),s.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Organizations"}),s.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>L(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(Ve,{htmlFor:"organization-count",className:"text-sm text-gray-400 font-light",children:"Number of organizations"}),s.jsx(Re,{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"})]}),s.jsx(X,{onClick:()=>{var me;const ae=parseInt(((me=document.getElementById("organization-count"))==null?void 0:me.value)||"5",10);F(ae)},disabled:E,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?s.jsxs(s.Fragment,{children:[s.jsx(qr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{className:"w-3 h-3 mr-2"}),"Seed Organizations"]})})]})}),_.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(_a,{title:"Organization Seeding Terminal",lines:_,isRunning:E,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),s.jsx("div",{className:"flex justify-end mt-6 pt-6",children:s.jsx(X,{variant:"outline",onClick:()=>L(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create Organization"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Re,{id:"create-name",value:$.name,onChange:ae=>Q(ae.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"create-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),s.jsx(Re,{id:"create-slug",value:$.slug,onChange:ae=>re(ae.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>{x(!1),H({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),k&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Organization"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(gr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsx("div",{className:"text-sm text-gray-400",children:C.slug})]})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Re,{id:"edit-name",value:T.name,onChange:ae=>ne(ae.target.value),placeholder:"e.g. Acme Corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),s.jsx(Re,{id:"edit-slug",value:T.slug,onChange:ae=>J(ae.target.value),placeholder:"e.g. acme-corp",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Auto-generated from name. You can edit it manually."})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>{S(!1),U({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:pe,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),M&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Organization"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>O(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(gr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsx("div",{className:"text-sm text-gray-400",children:C.slug})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this organization? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>O(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:ke,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),I&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Organization Details"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>B(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(gr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsx("div",{className:"text-sm text-gray-400",children:C.slug})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"ID:"}),s.jsx("span",{className:"text-white text-sm",children:C.id})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Created:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(C.createdAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Updated:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(C.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(X,{onClick:()=>B(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function N2(){const e=Dr(),{counts:t,refetchCounts:n}=Au(),[r,a]=m.useState([]),[i,o]=m.useState(!0),[l,c]=m.useState(""),[d,h]=m.useState([]),[u,f]=m.useState(1),[p]=m.useState(20),[w,v]=m.useState(!1),[j,g]=m.useState(!1),[y,x]=m.useState(!1),[b,N]=m.useState(!1),[k,S]=m.useState(!1),[M,O]=m.useState(!1),[I,B]=m.useState(!1),[z,L]=m.useState(!1),[C,A]=m.useState(null),[_,P]=m.useState(null),[E,D]=m.useState(""),[$,H]=m.useState(),[T,U]=m.useState(!1),[G,Q]=m.useState([]),[re,ne]=m.useState(!1),J=m.useCallback(async()=>{try{const le=await(await fetch("/api/users?limit=10000")).json();a(le.users||[])}catch{}finally{o(!1)}},[]),R=m.useCallback(async()=>{try{const le=await(await fetch("/api/admin/status")).json();U(le.enabled)}catch{U(!1)}},[]);m.useEffect(()=>{J(),R();const q=()=>{_&&P(null)};return document.addEventListener("click",q),()=>document.removeEventListener("click",q)},[_,R,J]);const ee=async q=>{Q([]),ne(!0),Q([{id:"start",type:"info",message:`Starting user seeding process for ${q} users...`,timestamp:new Date}]);try{const W=await(await fetch("/api/seed/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:q})})).json();if(W.success){const te=W.results.map((ve,be)=>ve.success?{id:`user-${be}`,type:"progress",message:`Creating user: ${ve.user.name} (${ve.user.email})`,timestamp:new Date,status:"completed"}:{id:`user-${be}`,type:"error",message:`Failed to create user ${be+1}: ${ve.error}`,timestamp:new Date});Q(ve=>[...ve,...te]);const he=W.results.filter(ve=>ve.success).length;Q(ve=>[...ve,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${he}/${q} users successfully`,timestamp:new Date}]),await J(),await n()}else Q(te=>[...te,{id:"error",type:"error",message:`❌ Seeding failed: ${W.error||"Unknown error"}`,timestamp:new Date}])}catch(le){Q(W=>[...W,{id:"error",type:"error",message:`❌ Network error: ${le}`,timestamp:new Date}])}finally{ne(!1)}},F=q=>{A(q),N(!0)},V=q=>{A(q),g(!0)},K=q=>{A(q),x(!0)},ie=async()=>{var he,ve,be;const q=(he=document.getElementById("create-name"))==null?void 0:he.value,le=(ve=document.getElementById("create-email"))==null?void 0:ve.value,W=(be=document.getElementById("create-password"))==null?void 0:be.value;if(!q||!le||!W){Y.error("Please fill in all fields");return}const te=Y.loading("Creating user...");try{const De=await(await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:q,email:le,password:W})})).json();De.success?(await J(),v(!1),document.getElementById("create-name").value="",document.getElementById("create-email").value="",document.getElementById("create-password").value="",Y.success("User created successfully!",{id:te})):Y.error(`Error creating user: ${De.error||"Unknown error"}`,{id:te})}catch{Y.error("Error creating user",{id:te})}},ce=async()=>{var te,he;if(!C){Y.error("No user selected");return}const q=(te=document.getElementById("edit-name"))==null?void 0:te.value,le=(he=document.getElementById("edit-email"))==null?void 0:he.value;if(!q||!le){Y.error("Please fill in all fields");return}const W=Y.loading("Updating user...");try{const be=await(await fetch(`/api/users/${C.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:q,email:le})})).json();be.success?(await J(),g(!1),A(null),Y.success("User updated successfully!",{id:W})):Y.error(`Error updating user: ${be.error||"Unknown error"}`,{id:W})}catch{Y.error("Error updating user",{id:W})}},pe=async()=>{if(!C){Y.error("No user selected");return}const q=Y.loading("Deleting user...");try{const W=await(await fetch(`/api/users/${C.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();W.success?(await J(),await n(),x(!1),A(null),Y.success("User deleted successfully!",{id:q})):Y.error(`Error deleting user: ${W.error||"Unknown error"}`,{id:q})}catch{Y.error("Error deleting user",{id:q})}},ke=async()=>{if(!C)return;if(!T){Y.error("Admin plugin is not enabled");return}const q=Y.loading("Banning user...");try{const le=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:C.id,banReason:E||"No reason provided",banExpiresIn:$})}),W=await le.json();le.ok?(Y.success("User banned successfully!",{id:q}),O(!1),D(""),H(void 0),A(null),P(null),J()):Y.error(`Error banning user: ${W.error||W.message||"Unknown error"}`,{id:q})}catch{Y.error("Error banning user",{id:q})}},Ie=async()=>{if(!C)return;if(!T){Y.error("Admin plugin is not enabled");return}const q=Y.loading("Unbanning user...");try{const le=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:C.id})}),W=await le.json();le.ok?(Y.success("User unbanned successfully!",{id:q}),B(!1),A(null),P(null),J()):Y.error(`Error unbanning user: ${W.error||W.message||"Unknown error"}`,{id:q})}catch{Y.error("Error unbanning user",{id:q})}},Ce=async()=>{var W;if(!C){Y.error("No user selected");return}const q=(W=document.getElementById("update-password"))==null?void 0:W.value;if(!q){Y.error("Please enter a new password");return}const le=Y.loading("Updating password...");try{const te=await fetch(`/api/users/${C.id}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:q})}),he=await te.json();te.ok&&he.success?(Y.success("Password updated successfully!",{id:le}),L(!1),A(null),document.getElementById("update-password").value=""):Y.error(`Error updating password: ${he.error||"Unknown error"}`,{id:le})}catch{Y.error("Error updating password",{id:le})}},tt=()=>{if(r.length===0){Y.error("No users to export");return}const q=["ID","Name","Email","Email Verified","Created At","Updated At"],le=r.map(be=>[be.id,be.name||"",be.email||"",!!be.emailVerified,new Date(be.createdAt).toLocaleString(),new Date(be.updatedAt).toLocaleString()]),W=[q.join(","),...le.map(be=>be.map(de=>`"${de}"`).join(","))].join(`
425
- `),te=new Blob([W],{type:"text/csv;charset=utf-8;"}),he=document.createElement("a"),ve=URL.createObjectURL(te);he.setAttribute("href",ve),he.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),he.style.visibility="hidden",document.body.appendChild(he),he.click(),document.body.removeChild(he),Y.success(`Exported ${r.length} users to CSV`)},Je=q=>{d.some(W=>W.type===q)||(h(W=>[...W,{type:q}]),f(1))},Le=q=>{h(le=>le.filter(W=>W.type!==q)),f(1)},_e=(q,le)=>{h(W=>W.map(te=>te.type===q?{...te,value:le}:te))},Ge=(q,le)=>{h(W=>W.map(te=>te.type===q?{...te,dateRange:le}:te))},nt=r.filter(q=>{const le=q.name.toLowerCase().includes(l.toLowerCase())||q.email.toLowerCase().includes(l.toLowerCase());if(d.length===0)return le;const W=d.every(te=>{var he,ve,be,de,De;switch(te.type){case"emailVerified":return te.value===void 0?!0:q.emailVerified===(te.value==="true");case"banned":return te.value===void 0?!0:q.banned===(te.value==="true");case"active":return q.banned!==!0;case"createdAt":{if(!((he=te.dateRange)!=null&&he.from)&&!((ve=te.dateRange)!=null&&ve.to))return!0;const Se=new Date(q.createdAt);return!((be=te.dateRange)!=null&&be.from&&te.dateRange.from>Se||(de=te.dateRange)!=null&&de.to&&te.dateRange.to<Se)}case"role":return te.value?(De=q.role)==null?void 0:De.toLowerCase().includes(te.value.toLowerCase()):!0;default:return!0}});return le&&W}),ot=r.filter(q=>q.banned).length,St=Math.ceil(nt.length/p),At=(u-1)*p,ae=At+p,me=nt.slice(At,ae),Te=q=>{f(q)};return i?s.jsx("div",{className:"flex min-h-screen items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(qr,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading users..."})]})}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Users",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-sm",children:t.users}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("p",{className:"text-gray-400 font-light text-sm mt-1 uppercase font-mono",children:"Manage your application users"}),s.jsx("div",{className:"flex items-center space-x-4 mt-2",children:ot>0&&s.jsxs("span",{className:"text-sm text-red-400 flex items-center space-x-1",children:[s.jsx(xc,{className:"w-3 h-3"}),s.jsxs("span",{children:[ot," Banned"]})]})})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(X,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:tt,children:[s.jsx(ij,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),s.jsxs(X,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>S(!0),children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(X,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>v(!0),children:[s.jsx(hm,{className:"w-4 h-4 mr-2"}),"Add User"]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Na,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Re,{placeholder:"Search users...",value:l,onChange:q=>c(q.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(ua,{value:"",onValueChange:Je,children:[s.jsx(ha,{className:"w-[180px]",children:s.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[s.jsx(Ts,{className:"w-4 h-4"}),s.jsx("span",{children:"Add Filter"})]})}),s.jsxs(fa,{children:[!d.some(q=>q.type==="emailVerified")&&s.jsx(rn,{value:"emailVerified",children:"Email Verified"}),!d.some(q=>q.type==="banned")&&s.jsx(rn,{value:"banned",children:"Banned Status"}),!d.some(q=>q.type==="createdAt")&&s.jsx(rn,{value:"createdAt",children:"Created Date"}),!d.some(q=>q.type==="role")&&s.jsx(rn,{value:"role",children:"Role"})]})]})}),d.length>0&&s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(X,{onClick:()=>h([]),className:"",children:"Clear all"})})]}),d.length>0&&s.jsx("div",{className:"space-y-3",children:s.jsx("div",{className:"flex flex-wrap gap-3",children:d.map(q=>{var le,W,te,he;return s.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 bg-white/10 border border-white/20 rounded-sm",children:[s.jsx(Vp,{className:"w-3 h-3 text-white"}),q.type==="emailVerified"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Email Verified:"}),s.jsxs(ua,{value:q.value||"",onValueChange:ve=>_e("emailVerified",ve),children:[s.jsx(ha,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:q.value==="true"?"True":q.value==="false"?"False":"Select"})}),s.jsxs(fa,{children:[s.jsx(rn,{value:"true",children:"True"}),s.jsx(rn,{value:"false",children:"False"})]})]})]}),q.type==="banned"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Banned:"}),s.jsxs(ua,{value:q.value||"",onValueChange:ve=>_e("banned",ve),children:[s.jsx(ha,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:q.value==="true"?"Yes":q.value==="false"?"No":"Select"})}),s.jsxs(fa,{children:[s.jsx(rn,{value:"true",children:"Yes"}),s.jsx(rn,{value:"false",children:"No"})]})]})]}),q.type==="createdAt"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Created:"}),s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(Ad,{className:"mr-1 h-3 w-3"}),(le=q.dateRange)!=null&&le.from?An(q.dateRange.from,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:(W=q.dateRange)==null?void 0:W.from,onSelect:ve=>{var be;return Ge("createdAt",{from:ve,to:(be=q.dateRange)==null?void 0:be.to})},initialFocus:!0,className:"rounded-none"})})]}),s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(Ad,{className:"mr-1 h-3 w-3"}),(te=q.dateRange)!=null&&te.to?An(q.dateRange.to,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:(he=q.dateRange)==null?void 0:he.to,onSelect:ve=>{var be;return Ge("createdAt",{from:(be=q.dateRange)==null?void 0:be.from,to:ve})},initialFocus:!0,disabled:ve=>{var be;return(be=q.dateRange)!=null&&be.from?ve<q.dateRange.from:!1},className:"rounded-none"})})]})]}),q.type==="role"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Role:"}),s.jsx(Re,{type:"text",value:q.value||"",onChange:ve=>_e("role",ve.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),s.jsx("button",{onClick:()=>Le(q.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:s.jsx(Tt,{className:"w-3 h-3 text-white"})})]},q.type)})})})]}),s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email Status"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:me.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"py-12 px-4 text-center",children:s.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(ka,{className:"w-8 h-8 text-white/50"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium text-lg",children:"No users found"}),s.jsx("p",{className:"text-gray-400 text-sm mt-1",children:l||d.length>0?"Try adjusting your search or filter criteria":"Get started by creating your first user or seeding some data"})]}),!l&&d.length===0&&s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(X,{onClick:()=>v(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[s.jsx(hm,{className:"w-4 h-4 mr-2"}),"Create User"]}),s.jsxs(X,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):me.map(q=>s.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${q.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${q.id}`),children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:q.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${q.id}`,alt:q.name,className:`w-10 h-10 rounded-none border border-dashed ${q.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),q.banned&&s.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:s.jsx(xc,{className:"w-3 h-3 text-white"})})]}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"text-white font-light",children:q.name}),q.banned&&s.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"})]}),s.jsx("div",{className:"text-sm text-gray-400 mt-0.5",children:q.email})]})]})}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[q.emailVerified?s.jsx(KP,{className:"w-4 h-4 text-green-400"}):s.jsx($d,{className:"w-4 h-4 text-yellow-400"}),s.jsx("span",{className:"text-sm text-gray-400",children:q.emailVerified?"Verified":"Not Verified"})]})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:s.jsxs("div",{className:"flex flex-col",children:[new Date(q.createdAt).toLocaleDateString(),s.jsx("p",{className:"text-xs",children:new Date(q.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"relative flex items-center justify-end",children:[s.jsx(X,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:le=>{le.stopPropagation(),P(_===q.id?null:q.id)},children:s.jsx(aT,{className:"w-4 h-4"})}),_===q.id&&s.jsxs("div",{className:"absolute right-0 top-full mt-1 w-48 bg-black border border-white/20 rounded-none shadow-lg z-50",onClick:le=>le.stopPropagation(),children:[s.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:le=>{le.stopPropagation(),P(null),F(q)},children:[s.jsx(Cl,{className:"w-4 h-4"}),s.jsx("span",{children:"View Details"})]}),s.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:le=>{le.stopPropagation(),P(null),V(q)},children:[s.jsx(ja,{className:"w-4 h-4"}),s.jsx("span",{children:"Edit User"})]}),s.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:le=>{le.stopPropagation(),P(null),A(q),L(!0)},children:[s.jsx(Dn,{className:"w-4 h-4"}),s.jsx("span",{children:"Update Password"})]}),T&&(q.banned?s.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:le=>{le.stopPropagation(),A(q),B(!0),P(null)},children:[s.jsx(xc,{className:"w-4 h-4"}),s.jsx("span",{children:"Unban User"})]}):s.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:le=>{le.stopPropagation(),A(q),O(!0),P(null)},children:[s.jsx(xc,{className:"w-4 h-4"}),s.jsx("span",{children:"Ban User"})]})),s.jsx("div",{className:"border-t border-white/10 my-1"}),s.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:le=>{le.stopPropagation(),P(null),K(q)},children:[s.jsx(Yp,{className:"w-4 h-4"}),s.jsx("span",{children:"Delete User"})]})]})]})})]},q.id))})]})}),s.jsx(b2,{currentPage:u,totalPages:St,onPageChange:Te,totalItems:nt.length,startIndex:At,endIndex:ae})]}),k&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.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:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[s.jsx("span",{className:"text-white/50 mr-2",children:"["}),s.jsx(ka,{className:"inline mr-2 w-3 h-3 text-white"}),s.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed User"}),s.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center space-x-2"}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(Ve,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),s.jsx(Re,{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"})]}),s.jsx(X,{onClick:()=>{var le;const q=parseInt(((le=document.getElementById("user-count"))==null?void 0:le.value)||"5",10);ee(q)},disabled:re,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:re?s.jsxs(s.Fragment,{children:[s.jsx(qr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),G.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(_a,{title:"User Seeding Terminal",lines:G,isRunning:re,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),s.jsx("div",{className:"flex justify-end mt-6 pt-6",children:s.jsx(X,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),w&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-white/10 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create User"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Re,{id:"create-name",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Re,{id:"create-email",type:"email",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),s.jsx(Re,{id:"create-password",type:"password",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:ie,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),j&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:C.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${C.id}`,alt:C.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsx("div",{className:"text-sm text-gray-400",children:C.email})]})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Re,{id:"edit-name",defaultValue:C.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Re,{id:"edit-email",type:"email",defaultValue:C.email,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),y&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete User"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:C.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${C.id}`,alt:C.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsx("div",{className:"text-sm text-gray-400",children:C.email})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this user? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:pe,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),b&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"User Details"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:C.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${C.id}`,alt:C.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsx("div",{className:"text-sm text-gray-400",children:C.email})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"ID:"}),s.jsx("span",{className:"text-white text-sm",children:C.id})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Email Verified:"}),s.jsx("span",{className:"text-white text-sm",children:C.emailVerified?"Yes":"No"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Created:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(C.createdAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Updated:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(C.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(X,{onClick:()=>N(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),M&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),s.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",s.jsx("strong",{children:C.name})," from accessing the system."]}),s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),s.jsx(Re,{id:"banReason",value:E,onChange:q=>D(q.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),s.jsx(Re,{id:"banExpires",type:"number",value:$||"",onChange:q=>H(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"}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(X,{variant:"outline",onClick:()=>{O(!1),D(""),H(void 0),A(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:ke,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),I&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-dashed border-green-400/50 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),s.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",s.jsx("strong",{children:C.name}),"? This will restore their access to the system."]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(X,{variant:"outline",onClick:()=>{B(!1),A(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:Ie,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),z&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Update Password"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{L(!1),A(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:C.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${C.id}`,alt:C.name,className:"w-16 h-16 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsx("div",{className:"text-sm text-gray-400",children:C.email})]})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),s.jsx(Re,{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"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>{L(!1),A(null),document.getElementById("update-password").value=""},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:Ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}function vL(){const[e]=m.useState("overview"),[t,n]=m.useState(!1),[r,a]=m.useState(0),[i,o]=m.useState(0),[l,c]=m.useState("1D"),[d,h]=m.useState("1D"),[u,f]=m.useState(1243.22),[p,w]=m.useState(null),[v,j]=m.useState(!1),[g,y]=m.useState("Daily"),[x,b]=m.useState("Daily"),[N,k]=m.useState("Daily"),[S,M]=m.useState("Daily"),[O,I]=m.useState(!1),[B,z]=m.useState(!1),[L,C]=m.useState(!1),[A,_]=m.useState(!1),[P,E]=m.useState(null),[D,$]=m.useState(null),[H,T]=m.useState(null),[U,G]=m.useState(null),[Q,re]=m.useState(null),[ne,J]=m.useState(void 0),[R,ee]=m.useState(void 0),[F,V]=m.useState(void 0),[K,ie]=m.useState(void 0),[ce,pe]=m.useState(void 0),[ke,Ie]=m.useState(void 0),[Ce,tt]=m.useState(void 0),[Je,Le]=m.useState(void 0),[_e,Ge]=m.useState([]),[nt,ot]=m.useState([]),[St,At]=m.useState(0),[ae,me]=m.useState([]),[Te,q]=m.useState([]),[le,W]=m.useState(0),[te,he]=m.useState(0),[ve,be]=m.useState(0),[de,De]=m.useState(0),[Se,Fe]=m.useState(0),[yt,ue]=m.useState(0),[rt,ut]=m.useState(!1),[Ct,un]=m.useState(!1),[Qe,Ft]=m.useState(0),[dr,Xt]=m.useState(0),[zt,za]=m.useState(0),[hn,Al]=m.useState(0),[$a,zl]=m.useState([]),[Uu,Ra]=m.useState(0),[Hs,Vs]=m.useState(0),{counts:Vn,loading:Ar}=Au(),ss=Dr(),Ia=["Daily","Weekly","Monthly","Yearly","Custom"],$l={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},Bu=(()=>{const se=[];return P!=null&&P.isOutdated?se.push({id:"version-check",title:`Update Better-Auth to v${P.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: `npm install better-auth@latest`",affectedComponents:["All Components"],status:"pending",cve:""}):P&&se.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:""}),se.push({id:"1",title:"Session Token Rotation",severity:"high",date:"2024-01-15",description:"Ensure session tokens are rotated regularly to prevent session fixation attacks. Better-auth supports automatic token rotation on security-sensitive operations.",affectedComponents:["Session Management","Auth Core"],status:"applied",cve:""}),se})(),En=async(se,fe,ge,Ae)=>{try{const Pe=new URLSearchParams({type:se,period:fe});return ge&&Pe.append("from",ge.toISOString()),Ae&&Pe.append("to",Ae.toISOString()),await(await fetch(`/api/analytics?${Pe.toString()}`)).json()}catch(Pe){return console.error("Failed to fetch analytics:",Pe),null}};m.useEffect(()=>{(async()=>{try{const ge=await(await fetch("/api/users/all")).json();ge&&ge.success&&ge.users&&zl(ge.users)}catch{zl([])}})()},[]),m.useEffect(()=>{(async()=>{try{const ge=await(await fetch("/api/stats")).json();ge&&(a(ge.activeUsers||0),o(ge.totalUsers||0),f(ge.totalUsers||0))}catch{a(0),o(0),f(0)}})()},[]),m.useEffect(()=>{(async()=>{const fe=await En("users",l,ne,R);fe&&(Ge(fe.data||[]),ot(fe.labels||[]),At(fe.percentageChange||0))})()},[l,ne,R]),m.useEffect(()=>{const se={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"};x&&se[x]&&h(se[x])},[x]),m.useEffect(()=>{if($a.length===0){Ra(0),Vs(0);return}const se=new Date;let fe,ge=se,Ae,Pe;if(x==="Custom"){if(!F||!K){Ra(0),Vs(0);return}fe=new Date(F),ge=new Date(K),ge.setHours(23,59,59,999);const $t=ge.getTime()-fe.getTime();Pe=new Date(fe.getTime()-1),Ae=new Date(Pe.getTime()-$t)}else switch(x){case"Daily":fe=new Date(se),fe.setHours(0,0,0,0),Pe=new Date(fe.getTime()-1),Ae=new Date(Pe.getTime()-24*60*60*1e3);break;case"Weekly":fe=new Date(se),fe.setDate(se.getDate()-se.getDay()),fe.setHours(0,0,0,0),Pe=new Date(fe.getTime()-1),Ae=new Date(Pe.getTime()-7*24*60*60*1e3);break;case"Monthly":fe=new Date(se.getFullYear(),se.getMonth(),1),fe.setHours(0,0,0,0),Pe=new Date(fe.getTime()-1),Ae=new Date(se.getFullYear(),se.getMonth()-1,1),Ae.setHours(0,0,0,0);break;case"Yearly":fe=new Date(se.getFullYear(),0,1),fe.setHours(0,0,0,0),Pe=new Date(fe.getTime()-1),Ae=new Date(se.getFullYear()-1,0,1),Ae.setHours(0,0,0,0);break;default:Ra(0),Vs(0);return}const ze=$a.filter($t=>{if(!$t.createdAt)return!1;const Mn=new Date($t.createdAt);return Mn>=fe&&Mn<=ge}),Me=$a.filter($t=>{if(!$t.createdAt)return!1;const Mn=new Date($t.createdAt);return Mn>=Ae&&Mn<=Pe}),we=ze.length,We=Me.length;let en=0;We>0?en=(we-We)/We*100:we>0&&(en=100),Ra(we),Vs(en)},[$a,x,F,K]),m.useEffect(()=>{(async()=>{if(d==="Custom"&&(!F||!K))return;const fe=await En("newUsers",d,F,K);fe&&(me(fe.data||[]),q(fe.labels||[]),W(fe.percentageChange||0))})()},[d,F,K]),m.useEffect(()=>{(async()=>{const fe=await En("activeUsers","1D");fe&&he(fe.percentageChange||0)})()},[]),m.useEffect(()=>{Ar||(Fe(Vn.organizations||0),ue(Vn.teams||0))},[Vn.organizations,Vn.teams,Ar]),m.useEffect(()=>{(async()=>{const fe=$l[N]||"1D",ge=fe==="Custom";if(!(ge&&(!ce||!ke))){ut(!0);try{const Ae=await En("organizations",fe,ge?ce:void 0,ge?ke:void 0);Ae&&(Fe(Ae.total||0),be(Ae.percentageChange||0))}catch{Fe(0),be(0)}finally{ut(!1)}}})()},[N,ce,ke]),m.useEffect(()=>{(async()=>{const fe=$l[S]||"1D",ge=fe==="Custom";if(!(ge&&(!Ce||!Je))){un(!0);try{const Ae=await En("teams",fe,ge?Ce:void 0,ge?Je:void 0);Ae&&(ue(Ae.total||0),De(Ae.percentageChange||0))}catch{ue(0),De(0)}finally{un(!1)}}})()},[S,Ce,Je]),m.useEffect(()=>{(async()=>{const fe=await En("users","1D");fe&&Ft(fe.percentageChange||0);const ge=await En("organizations","1D");ge&&Xt(ge.percentageChange||0);const Ae=await En("activeUsers","1D");Ae&&za(Ae.percentageChange||0);const Pe=await En("newUsers","1D");Pe&&Al(Pe.percentageChange||0)})()},[]),m.useEffect(()=>{(async()=>{try{const ge=await(await fetch("/api/version-check")).json();ge&&E({current:ge.current||"1.0.0",latest:ge.latest||"1.0.0",isOutdated:ge.isOutdated||!1})}catch{try{const Pe=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",ze="1.5.0";E({current:Pe,latest:ze,isOutdated:Pe!==ze})}catch{E({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const as=se=>se>=1e3?`${(se/1e3).toFixed(1)}k`:se.toString(),Rl=se=>{switch(se){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"}},Il=se=>{switch(se){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"}},Wu=se=>{w(se),j(!0)},qi=()=>{j(!1),setTimeout(()=>w(null),300)},Ll=(se,fe="users")=>{const ge=fe==="users"?nt:Te,Pe={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[se]||7;if(ge&&ge.length>0&&ge.length===Pe)return se==="1D"?ge.filter((Me,we)=>we%4===0).map(Me=>{const we=parseInt(Me.replace("h",""));return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):se==="1W"?ge.map(Me=>Me.length>3?Me.substring(0,3):Me):se==="1M"?ge.map(Me=>{const we=Me.split(" ");return we.length>=2?we[1]:Me}):se==="1Y"||se==="3M"||se==="6M"?ge.map(Me=>Me.length>3?Me.substring(0,3):Me):ge.map(Me=>Me.length>3?Me.substring(0,3):Me);const ze=new Date;switch(se){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(Me,we)=>new Date(ze.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(Me,we)=>new Date(ze.getTime()-(29-we)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(Me,we)=>new Date(ze.getFullYear(),ze.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(Me,we)=>new Date(ze.getFullYear(),ze.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(Me,we)=>new Date(ze.getFullYear(),ze.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(Me,we)=>new Date(ze.getFullYear(),ze.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},Fl=(se,fe="users")=>{const ge=fe==="users"?nt:Te,Pe={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[se]||7;if(ge&&ge.length>0&&ge.length===Pe)return se==="1D"?ge.map(Me=>{const we=parseInt(Me.replace("h",""));return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):se==="1Y"||se==="3M"||se==="6M"?ge.map(Me=>{const we=["January","February","March","April","May","June","July","August","September","October","November","December"],en=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].findIndex($t=>$t===Me);return en!==-1?we[en]:Me}):ge;const ze=new Date;switch(se){case"1D":return Array.from({length:24},(Me,we)=>{const We=new Date;return We.setHours(we,0,0,0),We.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(Me,we)=>new Date(ze.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(Me,we)=>{const We=new Date(ze.getTime()-(29-we)*24*60*60*1e3),en=We.toLocaleDateString("en-US",{month:"short"}),$t=We.getDate();return`${en} ${$t}`});case"3M":return Array.from({length:3},(Me,we)=>new Date(ze.getFullYear(),ze.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(Me,we)=>new Date(ze.getFullYear(),ze.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(Me,we)=>new Date(ze.getFullYear(),ze.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(Me,we)=>new Date(ze.getFullYear(),ze.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},Ys=(se,fe="users")=>{const ge=fe==="users"?_e:ae,Pe={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[se]||7;if(!ge||ge.length===0)return Array(Pe).fill(0);const ze=[...ge];for(;ze.length<Pe;)ze.push(0);const Me=ze.slice(0,Pe),we=Math.max(...Me,1);return Me.map(We=>We/we*100)},Ul=()=>s.jsxs("div",{className:"space-y-6 min-h-screen h-full mt-5 flex-1 overflow-y-hidden overflow-x-hidden px-0",children:[s.jsx("div",{className:"px-6 overflow-hidden",children:s.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:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Users"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Ar?"...":as(Vn.users)}),s.jsxs("div",{className:`flex items-center gap-1 ${Qe>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${Qe<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(Qe).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(Fn,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Organizations"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Ar?"...":as(Vn.organizations)}),s.jsxs("div",{className:`flex items-center gap-1 ${dr>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${dr<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(dr).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(Uv,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Sessions"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Ar?"...":as(Vn.sessions)}),s.jsxs("div",{className:`flex items-center gap-1 ${zt>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${zt<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(zt).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(ZP,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Revenue"}),s.jsxs("span",{className:"text-white text-lg font-medium",children:["$",u!==null?as(u):"1.2k"]}),s.jsxs("div",{className:`flex items-center gap-1 ${hn>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${hn<0?"rotate-180":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:"text-sm font-medium",children:[Math.abs(hn).toFixed(1),"%"]})]})]})]}),s.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),s.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[s.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:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"New Users"}),s.jsx("span",{className:"text-white text-lg font-medium",children:Ar?"...":i!==null?as(i):"89"}),s.jsxs("div",{className:"flex items-center gap-1 text-green-500",children:[s.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsx("span",{className:"text-sm font-medium",children:"18%"})]})]})]})]})}),s.jsxs("div",{className:"px-6 pb-10 space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL USER"}),s.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y"].map(se=>s.jsx("button",{onClick:()=>c(se),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===se?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:se},se))})]}),s.jsxs("div",{className:"flex justify-between items-end mb-6",children:[s.jsx("p",{className:"text-4xl text-white font-light",children:Ar?"...":as(Vn.users)}),s.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[s.jsx("svg",{className:`w-3 h-3 ${St>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${St>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(St).toFixed(1),"%"]})]})]}),s.jsxs("div",{className:"space-y-2 relative",children:[s.jsxs("div",{className:"h-32 relative",children:[s.jsx("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:s.jsx("defs",{children:s.jsxs("linearGradient",{id:"usersBarGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),s.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})})}),s.jsx("div",{className:"h-32 flex items-end justify-between space-x-1 relative z-10",children:Ys(l,"users").map((se,fe)=>{const ge=D===fe;return s.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${se}%`,background:"url(#usersBarGradient)"},onMouseEnter:Ae=>{const Pe=Ae.currentTarget.getBoundingClientRect(),ze=Pe.left+Pe.width/2,Me=Pe.top,we=150,We=60,en=Math.max(we/2,Math.min(window.innerWidth-we/2,ze)),$t=Math.max(We+10,Math.min(window.innerHeight-10,Me));$(fe),T({x:en,y:$t})},onMouseLeave:()=>{$(null),T(null)},children:s.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:ge?1:.8}})},fe)})}),D!==null&&H&&s.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${H.x}px`,top:`${H.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:s.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[s.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:Fl(l,"users")[D]}),s.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[_e[D]!==void 0?_e[D].toLocaleString():"0"," ",s.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),s.jsx("div",{className:`flex justify-between ${l==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:Ll(l,"users").map((se,fe)=>s.jsx("span",{className:"flex-1 text-center truncate",children:se},fe))})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"TOTAL SUBSCRIPTION"}),s.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","6M","1Y","ALL"].map(se=>s.jsx("button",{onClick:()=>h(se),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${d===se?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:se},se))})]}),s.jsxs("div",{className:"flex justify-between items-end mb-6",children:[s.jsxs("p",{className:"text-4xl text-white font-light",children:["$",u.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]}),s.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[s.jsx("svg",{className:`w-3 h-3 ${le>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${le>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(le).toFixed(1),"%"]})]})]}),s.jsxs("div",{className:"space-y-2 relative",children:[s.jsxs("div",{className:"h-32 relative",children:[s.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"areaGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:"rgba(255, 255, 255, 0.3)",stopOpacity:1}}),s.jsx("stop",{offset:"100%",style:{stopColor:"rgba(255, 255, 255, 0.05)",stopOpacity:1}})]})}),s.jsx("polygon",{points:`0,100 ${Ys(d,"newUsers").map((se,fe,ge)=>{const Ae=fe/(ge.length-1)*100,Pe=100-se;return`${Ae},${Pe}`}).join(" ")} 100,100`,fill:"url(#areaGradient)"}),s.jsx("polyline",{points:Ys(d,"newUsers").map((se,fe,ge)=>{const Ae=fe/(ge.length-1)*100,Pe=100-se;return`${Ae},${Pe}`}).join(" "),fill:"none",stroke:"rgba(255, 255, 255, 0.3)",strokeWidth:"0.5"}),Ys(d,"newUsers").map((se,fe,ge)=>{const Ae=fe/(ge.length-1)*100,Pe=100-se,ze=U===fe;return s.jsxs("g",{children:[s.jsx("circle",{cx:Ae,cy:Pe,r:"0.5",fill:"white",opacity:ze?1:0,className:"transition-all duration-200 ease-out",style:{filter:ze?"drop-shadow(0 0 3px rgba(255, 255, 255, 0.6))":"none",pointerEvents:"none"}}),s.jsx("circle",{cx:Ae,cy:Pe,r:"8",fill:"transparent",className:"cursor-pointer",onMouseEnter:Me=>{const we=Me.currentTarget.ownerSVGElement;if(we){const We=we.getBoundingClientRect(),en=We.left+Ae/100*We.width,$t=We.top+Pe/100*We.height,Mn=150,Hu=60,Vu=Math.max(Mn/2,Math.min(window.innerWidth-Mn/2,en)),Bl=Math.max(Hu+10,Math.min(window.innerHeight-10,$t));G(fe),re({x:Vu,y:Bl})}},onMouseLeave:()=>{G(null),re(null)}})]},`dot-${fe}`)})]}),U!==null&&Q&&s.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${Q.x}px`,top:`${Q.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:s.jsxs("div",{className:"bg-black border border-white/20 rounded-sm px-3 py-2 shadow-lg whitespace-nowrap",children:[s.jsx("div",{className:"text-xs text-gray-400 mb-1 font-mono uppercase",children:Fl(d,"newUsers")[U]}),s.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[ae[U]!==void 0?ae[U].toLocaleString():"0"," ",s.jsx("span",{className:"font-mono text-xs text-gray-400",children:"users"})]})]})})]}),s.jsx("div",{className:`flex justify-between ${d==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:Ll(d,"newUsers").map((se,fe)=>s.jsx("span",{className:"flex-1 text-center truncate",children:se},fe))})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>I(!O),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(Ec,{className:"w-3 h-3"}),s.jsx("span",{children:g})]}),O&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Ia.map(se=>s.jsx("button",{onClick:()=>{y(se),I(!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:se},se))})]}),g==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(qn,{className:"mr-1 h-3 w-3"}),ne?An(ne,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:ne,onSelect:J,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(qn,{className:"mr-1 h-3 w-3"}),R?An(R,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:R,onSelect:ee,initialFocus:!0,disabled:se=>ne?se<ne:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Active Users"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Users with active session in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light mb-2",children:r.toLocaleString()}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 border-white/5 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${te>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${te>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(te).toFixed(1),"%"]})]})})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>z(!B),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(Ec,{className:"w-3 h-3"}),s.jsx("span",{children:x})]}),B&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Ia.map(se=>s.jsx("button",{onClick:()=>{b(se),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:se},se))})]}),x==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(qn,{className:"mr-1 h-3 w-3"}),F?An(F,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:F,onSelect:V,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(qn,{className:"mr-1 h-3 w-3"}),K?An(K,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:K,onSelect:ie,initialFocus:!0,disabled:se=>F?se<F:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"New Users"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Newly registered Users in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light mb-2",children:Uu}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${Hs>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:Hs<0?{transform:"rotate(180deg)"}:{},children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${Hs>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Hs).toFixed(1),"%"]})]})})]})]})]}),s.jsxs("div",{className:"space-y-4 overflow-x-hidden",children:[s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>C(!L),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(Ec,{className:"w-3 h-3"}),s.jsx("span",{children:N})]}),L&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Ia.map(se=>s.jsx("button",{onClick:()=>{k(se),C(!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:se},se))})]}),N==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(qn,{className:"mr-1 h-3 w-3"}),ce?An(ce,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:ce,onSelect:pe,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(qn,{className:"mr-1 h-3 w-3"}),ke?An(ke,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:ke,onSelect:Ie,initialFocus:!0,disabled:se=>ce?se<ce:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Organizations"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total organizations in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light mb-2",children:rt?"...":Se.toLocaleString()}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${ve>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${ve>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ve).toFixed(1),"%"]})]})})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pb-2 relative",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsxs("div",{className:"flex items-center justify-between mb-2 relative -mt-2 pb-1",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>_(!A),className:"text-xs h-full font-mono uppercase text-gray-400 flex items-center space-x-1 hover:text-white transition-colors",children:[s.jsx(Ec,{className:"w-3 h-3"}),s.jsx("span",{children:S})]}),A&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Ia.map(se=>s.jsx("button",{onClick:()=>{M(se),_(!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:se},se))})]}),S==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(qn,{className:"mr-1 h-3 w-3"}),Ce?An(Ce,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:Ce,onSelect:tt,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs($n,{children:[s.jsx(Rn,{asChild:!0,children:s.jsxs(X,{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:[s.jsx(qn,{className:"mr-1 h-3 w-3"}),Je?An(Je,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(zn,{mode:"single",selected:Je,onSelect:Le,initialFocus:!0,disabled:se=>Ce?se<Ce:!1,className:"rounded-none"})})]})]})]}),s.jsx("hr",{className:"mb-2 -mx-10 border-white/10"}),s.jsx("h4",{className:"text-md text-white/80 uppercase font-mono font-light mb-1",children:"Teams"}),s.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"Total teams in the time frame"}),s.jsxs("div",{className:"flex pt-4 justify-between items-end",children:[s.jsx("p",{className:"text-3xl text-white font-light mb-2",children:Ct?"...":yt.toLocaleString()}),s.jsx("div",{className:"mt-2 mb-1 flex items-center gap-2",children:s.jsxs("div",{className:"flex items-center -mr-5 gap-1 px-2 py-1 rounded-none",children:[s.jsx("svg",{className:`w-3 h-3 ${de>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${de>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(de).toFixed(1),"%"]})]})})]})]})]}),s.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 pt-4 overflow-hidden relative rounded-none flex flex-col",children:[s.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/30"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/30"}),s.jsx("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Dn,{className:"w-4 h-4 text-white/60"}),s.jsx("h4",{className:"text-xs text-gray-400 uppercase font-mono font-light",children:"Security Insights"})]})}),s.jsx("hr",{className:"-mx-10 -mt-1 border-white/10"}),s.jsx("div",{className:"space-y-3 overflow-y-auto custom-scrollbar max-h-[400px]",children:Bu.map((se,fe)=>s.jsx("div",{onClick:()=>Wu(se),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 ${fe*.1}s both`},children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:s.jsx("span",{className:"text-sm text-white/90 font-light truncate group-hover:text-white transition-colors",children:se.title})}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm uppercase font-mono ${Rl(se.severity)}`,children:se.severity}),s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${Il(se.status)}`,children:se.status})]})]}),s.jsx(qP,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},se.id))})]})]})]})]});return s.jsxs("div",{className:"h-screen bg-black text-white overflow-hidden flex flex-col",style:{overflowX:"hidden"},children:[s.jsx("div",{className:"flex-1 overflow-hidden",children:e==="overview"?Ul():e==="users"?s.jsx(N2,{}):e==="organizations"?s.jsx(j2,{}):Ul()}),t&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-3xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Uv,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Ze,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View All Users"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Manage user accounts"})]}),s.jsx(xs,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Fn,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View Organizations"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Manage organizations"})]}),s.jsx(xs,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(xL,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"View Sessions"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Monitor active sessions"})]}),s.jsx(xs,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(Vr,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Database Schema"}),s.jsx("p",{className:"text-sm text-gray-400",children:"View schema visualizer"})]}),s.jsx(xs,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(w2,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Settings"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Configure system"})]}),s.jsx(xs,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]}),s.jsxs("button",{onClick:()=>{n(!1),ss("/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:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:s.jsx(g2,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:"Search Users"}),s.jsx("p",{className:"text-sm text-gray-400",children:"Find specific users"})]}),s.jsx(xs,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]})]}),s.jsx("div",{className:"mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[s.jsx("span",{children:"Tip: Press Ctrl+K or Cmd+K for command palette"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),v&&p&&s.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:qi,children:s.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:se=>se.stopPropagation(),children:[s.jsx("div",{className:"sticky top-0 bg-black border-b border-white/10 p-6 z-10",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(Dn,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light",children:p.title})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("span",{className:`text-xs px-2 py-1 border rounded-none uppercase font-medium ${Rl(p.severity)}`,children:[p.severity," Severity"]}),s.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${Il(p.status)}`,children:p.status}),p.cve&&s.jsx("span",{className:"text-xs text-gray-400 font-mono bg-white/5 px-2 py-1 border border-white/10 rounded-none",children:p.cve})]})]}),s.jsx("button",{onClick:qi,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:s.jsx(Gt,{className:"w-5 h-5 text-gray-400 hover:text-white"})})]})}),s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Release Date"}),s.jsx("p",{className:"text-white",children:new Date(p.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-2",children:"Description"}),p.description.includes("npm install")?s.jsxs("div",{children:[s.jsx("p",{className:"text-white leading-relaxed mb-3",children:p.description.split("Run:")[0]}),s.jsx("div",{className:"relative group",children:s.jsx("div",{className:"bg-black border border-white/20 rounded-none p-3 font-mono text-sm",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("code",{children:[s.jsx("span",{className:"text-green-400",children:"$"})," ",s.jsx("span",{className:"text-cyan-400",children:"npm"})," ",s.jsx("span",{className:"text-yellow-400",children:"install"})," ",s.jsx("span",{className:"text-white",children:"better-auth@latest"})]}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText("npm install better-auth@latest"),Y.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:s.jsx(Cm,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):s.jsx("p",{className:"text-white leading-relaxed",children:p.description})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm text-gray-400 uppercase tracking-wide mb-3",children:"Affected Components"}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:p.affectedComponents.map((se,fe)=>s.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 ${fe*.1}s both`},children:[s.jsx("div",{className:"w-2 h-2 bg-white rounded-none flex-shrink-0"}),s.jsx("span",{className:"text-sm text-white",children:se})]},fe))})]}),s.jsx("div",{className:"p-4 bg-white/5 border border-white/10 rounded-none",children:s.jsxs("div",{className:"flex items-start gap-3",children:[p.status==="applied"&&s.jsxs(s.Fragment,{children:[s.jsx(xx,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Patch Applied"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This security patch has been successfully applied to your system."})]})]}),p.status==="scheduled"&&s.jsxs(s.Fragment,{children:[s.jsx(v2,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Scheduled"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This patch is scheduled for deployment in the next maintenance window."})]})]}),p.status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(gL,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm text-white font-medium mb-1",children:"Action Required"}),s.jsx("p",{className:"text-xs text-gray-400",children:"This patch is pending review and requires manual approval before deployment."})]})]})]})}),s.jsx("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-white/10",children:s.jsx(X,{variant:"ghost",onClick:qi,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),s.jsx("style",{children:`
426
- @keyframes fadeIn {
427
- from {
428
- opacity: 0;
429
- }
430
- to {
431
- opacity: 1;
432
- }
433
- }
434
-
435
- @keyframes slideUp {
436
- from {
437
- opacity: 0;
438
- transform: translateY(20px);
439
- }
440
- to {
441
- opacity: 1;
442
- transform: translateY(0);
443
- }
444
- }
445
-
446
- @keyframes slideIn {
447
- from {
448
- opacity: 0;
449
- transform: translateX(-10px);
450
- }
451
- to {
452
- opacity: 1;
453
- transform: translateX(0);
454
- }
455
- }
456
-
457
- .custom-scrollbar::-webkit-scrollbar {
458
- width: 6px;
459
- }
460
-
461
- .custom-scrollbar::-webkit-scrollbar-track {
462
- background: rgba(255, 255, 255, 0.05);
463
- }
464
-
465
- .custom-scrollbar::-webkit-scrollbar-thumb {
466
- background: rgba(255, 255, 255, 0.2);
467
- border-radius: 3px;
468
- }
469
-
470
- .custom-scrollbar::-webkit-scrollbar-thumb:hover {
471
- background: rgba(255, 255, 255, 0.3);
472
- }
473
- `})]})}const _n=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ee("rounded-lg border border-gray-700 bg-gray-900 text-white shadow-sm",e),...t}));_n.displayName="Card";const Pn=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ee("flex flex-col space-y-1.5 p-6",e),...t}));Pn.displayName="CardHeader";const Tn=m.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Ee("text-2xl font-semibold leading-none tracking-tight text-white",e),...t}));Tn.displayName="CardTitle";const mr=m.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Ee("text-sm text-gray-300",e),...t}));mr.displayName="CardDescription";const On=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ee("p-6 pt-0",e),...t}));On.displayName="CardContent";const wL=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ee("flex items-center p-6 pt-0",e),...t}));wL.displayName="CardFooter";const yL={databaseSchemaNode:ym},Bv=[{name:"organization",displayName:"Organization",description:"Multi-tenant organization support",color:"bg-blue-500"},{name:"teams",displayName:"Teams",description:"Team management within organizations",color:"bg-green-500"},{name:"twoFactor",displayName:"Two Factor",description:"Two-factor authentication support",color:"bg-purple-500"},{name:"apiKey",displayName:"API Key",description:"API key authentication",color:"bg-orange-500"},{name:"passkey",displayName:"Passkey",description:"WebAuthn passkey support",color:"bg-pink-500"}];function bL(){const[e,t]=m.useState(null),[n,r]=m.useState(!0),[a,i]=m.useState(null),[o,l]=m.useState([]),[c,d]=m.useState([]),[h,u,f]=pP([]),[p,w,v]=xP([]),j=m.useCallback(k=>{const S=Bv.find(M=>M.name===k);return(S==null?void 0:S.color)||"bg-gray-500"},[]),g=m.useCallback((k,S,M)=>{if(k==="user"||k==="session"||k==="account"||k==="verification")return"core";for(const O of M)if(k===O||k.includes(O))return O;return"core"},[]),y=m.useCallback(async()=>{try{const S=await(await fetch("/api/plugins")).json();if(S.plugins&&Array.isArray(S.plugins)){const M=S.plugins.map(O=>({name:O.id,displayName:O.name||O.id,description:O.description||`${O.id} plugin for Better Auth`,color:j(O.id)}));d(M),l(M.map(O=>O.name))}}catch{d(Bv),l(["organization"])}},[j]),x=m.useCallback(async k=>{try{r(!0);const S=k.length>0?`?plugins=${k.join(",")}`:"",O=await(await fetch(`/api/database/schema${S}`)).json();O.success?t(O.schema):i(O.error||"Failed to fetch schema")}catch{i("Failed to fetch database schema")}finally{r(!1)}},[]);m.useEffect(()=>{y()},[y]),m.useEffect(()=>{o.length>0&&x(o)},[o,x]),m.useEffect(()=>{if(!e)return;const k=[],S=[];e.tables.forEach((M,O)=>{const I=M.fields.map(B=>({id:`${M.name}-${B.name}`,isPrimary:B.primaryKey||!1,isNullable:!B.required,isUnique:B.unique||!1,isIdentity:!1,name:B.name,format:B.type,plugin:g(M.name,B.name,o)}));k.push({id:M.name,type:"databaseSchemaNode",position:{x:O%3*380,y:Math.floor(O/3)*320},data:{name:M.name,displayName:M.displayName,isForeign:!1,plugin:g(M.name,"",o),columns:I.map(B=>{var z;return{...B,description:((z=M.fields.find(L=>L.name===B.name))==null?void 0:z.description)||""}}),relationships:M.relationships}})}),e.tables.forEach(M=>{M.relationships.forEach(O=>{if(O.type==="many-to-one")return;const I=M.name,B=O.target,z=k.find(C=>C.id===I),L=k.find(C=>C.id===B);if(z&&L){const C=O.type==="one-to-one"?"1:1":"1:N";S.push({id:`${I}-${B}-${O.field}`,source:I,target:B,type:"smoothstep",animated:!1,style:{stroke:"#6b7280",strokeWidth:2,strokeDasharray:"0"},label:C,labelStyle:{fontSize:"11px",fill:"#9ca3af",fontWeight:"500"},labelBgStyle:{fill:"rgba(0, 0, 0, 0.9)",fillOpacity:1,rx:4,ry:4},markerEnd:{type:"arrowclosed",color:"#6b7280",width:12,height:12}})}})}),u(k),w(S)},[e,o,u,w,g]);const b=m.useCallback(k=>w(S=>l1(k,S)),[w]);if(n)return s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"animate-pulse",children:[s.jsx("div",{className:"h-8 bg-gray-700 rounded w-1/3 mb-6"}),s.jsx("div",{className:"h-96 bg-gray-700 rounded"})]}),s.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 mt-4",children:"Loading plugins and schema..."})]});if(a)return s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"bg-red-900/20 border border-red-500/20 rounded-none p-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-red-400 mb-2",children:"Error Loading Schema"}),s.jsx("p",{className:"text-gray-300",children:a})]})});const N=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("div",{className:"flex items-center justify-between mb-1",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-6 h-6 text-white"}),s.jsx("h1",{className:"text-2xl font-light text-white",children:"Schema Visualizer"})]})}),s.jsx("p",{className:"text-gray-400",children:"Visualize your Better Auth database schema with interactive tables and relationships."})]}),s.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-6",children:[s.jsxs("div",{className:"col-span-1",children:[s.jsxs(_n,{className:"rounded-none bg-black h-fit shadow-sm",children:[s.jsx(Pn,{children:s.jsxs(Tn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[s.jsx(ra,{className:"w-5 h-5"}),s.jsx("span",{children:"Plugins"})]})}),s.jsx(On,{className:"space-y-3",children:c.length>0?c.map(k=>s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${k.color}`}),s.jsx("label",{htmlFor:k.name,className:"text-sm font-medium text-white cursor-pointer",children:k.displayName.slice(0,1).toUpperCase()+k.displayName.slice(1).replace("-"," ")})]},k.name)):s.jsx("div",{className:"text-sm text-white/70",children:"No plugins detected in configuration"})})]}),e&&s.jsxs(_n,{className:"rounded-none bg-black mt-4 shadow-sm",children:[s.jsx(Pn,{children:s.jsx(Tn,{className:"text-white text-sm",children:"Schema Info"})}),s.jsxs(On,{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-white/70",children:"Tables:"}),s.jsx("span",{className:"text-white",children:e.tables.length})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-white/70",children:"Relationships:"}),s.jsx("span",{className:"text-white",children:e.tables.reduce((k,S)=>k+S.relationships.length,0)})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-white/70",children:"Available Plugins:"}),s.jsx("span",{className:"text-white",children:c.length})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-white/70",children:"Selected Plugins:"}),s.jsx("span",{className:"text-white",children:o.length})]})]})]})]}),s.jsx("div",{className:"col-span-3",children:s.jsx("div",{className:"h-full bg-black border border-gray-700 rounded-lg overflow-hidden shadow-xl",children:s.jsxs(mP,{nodes:h,edges:p,onNodesChange:f,onEdgesChange:v,onConnect:b,nodeTypes:yL,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:[s.jsx(MP,{className:"bg-gray-900 border-gray-700 [&>button]:bg-gray-800 [&>button]:border-gray-600 [&>button]:text-white [&>button:hover]:bg-gray-700"}),s.jsx(UP,{className:"bg-gray-900 border-gray-700",nodeColor:k=>{var S;return(S=k.data)!=null&&S.isForeign?"#374151":"#1f2937"},maskColor:"rgba(0, 0, 0, 0.9)"}),s.jsx(bP,{variant:Xr.Dots,gap:20,size:1,color:"#374151"})]})})})]})]});return s.jsxs("div",{className:"overflow-hidden p-6 h-[90vh] flex flex-col opacity-70 bg-black relative",children:[s.jsxs("div",{className:"absolute inset-0 z-50 flex items-center justify-center pointer-events-none",children:[s.jsx("div",{className:"absolute inset-0 backdrop-blur-sm",style:{WebkitBackdropFilter:"blur(8px)",backdropFilter:"blur(8px)"}}),s.jsxs("div",{className:"relative -mt-6 bg-black/50 border border-dashed border-white/20 rounded-none p-12 max-w-2xl mx-6 text-center pointer-events-auto",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsxs("div",{className:"relative",children:[s.jsx(mt,{className:"w-16 h-16 text-white opacity-50"}),s.jsx(iT,{className:"w-8 h-8 text-white opacity-80 absolute -top-2 -right-2 animate-pulse"})]})}),s.jsx("h2",{className:"text-3xl font-mono uppercase font-light text-white mb-3",children:"Coming Soon"}),s.jsx("p",{className:"text-lg text-gray-300 font-light mb-6 leading-relaxed",children:"We will be having this feature soon. This feature will allow you to explore your Better Auth database structure with beautiful, interactive graphs showing all tables, relationships, and data flow."}),s.jsxs("div",{className:"flex items-center justify-center space-x-6 text-sm text-gray-400",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),s.jsx("span",{children:"Interactive Tables"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),s.jsx("span",{children:"Relationship Mapping"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),s.jsx("span",{children:"Real-time Updates"})]})]})]})]}),s.jsx("div",{className:"blur-sm opacity-50 pointer-events-none",children:N})]})}const jL=DN("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 He({className:e,variant:t,...n}){return s.jsx("div",{className:Ee(jL({variant:t}),e),...n})}function NL(){const{orgId:e}=Sp(),t=Dr(),[n,r]=m.useState(null),[a,i]=m.useState([]),[o,l]=m.useState([]),[c,d]=m.useState([]),[h,u]=m.useState(!0),[f,p]=m.useState("details"),[w,v]=m.useState(!1),[j,g]=m.useState(!1),[y,x]=m.useState(!1),[b,N]=m.useState(!1),[k,S]=m.useState(!1),[M,O]=m.useState(!1),[I,B]=m.useState(!1),[z,L]=m.useState(!1),[C,A]=m.useState(null),[_,P]=m.useState(""),[E,D]=m.useState(""),[$,H]=m.useState([]),[T,U]=m.useState({name:""}),[G,Q]=m.useState(!1),[re,ne]=m.useState([]),[J,R]=m.useState(!1),[ee,F]=m.useState([]),[V,K]=m.useState(!1);m.useEffect(()=>{e&&(ce(),ke(),pe(),Ce(),tt(),Ie())},[e]),m.useEffect(()=>{w&&e&&Ie()},[]),m.useEffect(()=>{f==="members"&&e&&tt()},[f,e]),m.useEffect(()=>{f==="invitations"&&e&&Ce()},[f,e]);const ie=W=>{U({name:W})},ce=async()=>{try{const te=await(await fetch(`/api/organizations/${e}`)).json();te.success&&te.organization||te.organization?r(te.organization):Y.error("Organization not found")}catch(W){console.error("Failed to fetch organization:",W),Y.error("Failed to load organization")}finally{u(!1)}},pe=async()=>{try{const te=await(await fetch("/api/plugins/teams/status")).json();v(te.enabled)}catch(W){console.error("Failed to check teams status:",W),v(!1)}},ke=async()=>{try{const te=await(await fetch("/api/plugins/organization/status")).json();g(te.enabled)}catch(W){console.error("Failed to check organization status:",W),g(!1)}},Ie=async()=>{try{const te=await(await fetch(`/api/organizations/${e}/teams`)).json();te.success&&i(te.teams||[])}catch(W){console.error("Failed to fetch teams:",W),Y.error("Failed to load teams")}},Ce=async()=>{try{const te=await(await fetch(`/api/organizations/${e}/invitations`)).json();te.success&&l(te.invitations||[])}catch(W){console.error("Failed to fetch invitations:",W),Y.error("Failed to load invitations")}},tt=async()=>{try{const te=await(await fetch(`/api/organizations/${e}/members`)).json();te.success&&d(te.members||[])}catch(W){console.error("Failed to fetch members:",W),Y.error("Failed to load members")}},Je=async W=>{ne([]),R(!0),ne([{id:"start",type:"info",message:`Starting member seeding process for ${W} members...`,timestamp:new Date}]);try{const he=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(he.success){const ve=he.results.map((de,De)=>de.success?{id:`member-${De}`,type:"progress",message:`Adding member: ${de.member.user.name} (${de.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${De}`,type:"error",message:`Failed to add member ${De+1}: ${de.error}`,timestamp:new Date});ne(de=>[...de,...ve]);const be=he.results.filter(de=>de.success).length;ne(de=>[...de,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${be}/${W} members successfully`,timestamp:new Date}]),await tt(),Y.success(`Successfully added ${be} members!`)}else ne(ve=>[...ve,{id:"error",type:"error",message:`❌ Seeding failed: ${he.error||"Unknown error"}`,timestamp:new Date}]),Y.error(he.error||"Failed to seed members")}catch(te){ne(he=>[...he,{id:"error",type:"error",message:`❌ Network error: ${te}`,timestamp:new Date}]),Y.error("Failed to seed members")}finally{R(!1)}},Le=async W=>{F([]),K(!0),F([{id:"start",type:"info",message:`Starting team seeding process for ${W} teams...`,timestamp:new Date}]);try{const he=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(he.success){const ve=he.results.map((de,De)=>de.success?{id:`team-${De}`,type:"progress",message:`Creating team: ${de.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${De}`,type:"error",message:`Failed to create team ${De+1}: ${de.error}`,timestamp:new Date});F(de=>[...de,...ve]);const be=he.results.filter(de=>de.success).length;F(de=>[...de,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${be}/${W} teams successfully`,timestamp:new Date}]),await Ie(),Y.success(`Successfully created ${be} teams!`)}else F(ve=>[...ve,{id:"error",type:"error",message:`❌ Seeding failed: ${he.error||"Unknown error"}`,timestamp:new Date}]),Y.error(he.error||"Failed to seed teams")}catch(te){F(he=>[...he,{id:"error",type:"error",message:`❌ Network error: ${te}`,timestamp:new Date}]),Y.error("Failed to seed teams")}finally{K(!1)}},_e=async()=>{try{const te=await(await fetch("/api/users/all")).json();te.success&&H(te.users||[])}catch(W){console.error("Failed to fetch users:",W)}},Ge=()=>{_e(),x(!0)},nt=async()=>{if(!_){Y.error("Please enter an email address");return}if(!E){Y.error("Please select an inviter");return}Q(!0);const W=Y.loading("Sending invitation...");try{const he=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:_,role:"member",inviterId:E})})).json();he.success?(await Ce(),x(!1),P(""),D(""),Y.success("Invitation sent successfully!",{id:W})):Y.error(`Error sending invitation: ${he.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error sending invitation:",te),Y.error("Error sending invitation",{id:W})}finally{Q(!1)}},ot=async W=>{const te=Y.loading("Cancelling invitation...");try{const ve=await(await fetch(`/api/invitations/${W}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ve.success?(await Ce(),Y.success("Invitation cancelled successfully!",{id:te})):Y.error(`Error cancelling invitation: ${ve.error||"Unknown error"}`,{id:te})}catch(he){console.error("Error cancelling invitation:",he),Y.error("Error cancelling invitation",{id:te})}},St=async(W,te)=>{const he=Y.loading("Resending invitation...");try{const be=await(await fetch(`/api/invitations/${W}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();be.success?(await Ce(),Y.success(`Invitation resent to ${te}!`,{id:he})):Y.error(`Error resending invitation: ${be.error||"Unknown error"}`,{id:he})}catch(ve){console.error("Error resending invitation:",ve),Y.error("Error resending invitation",{id:he})}},At=async(W,te)=>{const he=Y.loading(`Removing ${te}...`);try{const be=await(await fetch(`/api/members/${W}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();be.success?(await tt(),Y.success(`${te} removed from organization!`,{id:he})):Y.error(`Error removing member: ${be.error||"Unknown error"}`,{id:he})}catch(ve){console.error("Error removing member:",ve),Y.error("Error removing member",{id:he})}},ae=async()=>{if(!T.name){Y.error("Please enter a team name");return}const W=Y.loading("Creating team...");try{const he=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T.name,organizationId:e})})).json();he.success?(await Ie(),O(!1),U({name:""}),Y.success("Team created successfully!",{id:W})):Y.error(`Error creating team: ${he.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error creating team:",te),Y.error("Error creating team",{id:W})}},me=async()=>{if(!C||!T.name){Y.error("Please enter a team name");return}const W=Y.loading("Updating team...");try{const he=await(await fetch(`/api/teams/${C.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:T.name})})).json();he.success?(await Ie(),B(!1),A(null),U({name:""}),Y.success("Team updated successfully!",{id:W})):Y.error(`Error updating team: ${he.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error updating team:",te),Y.error("Error updating team",{id:W})}},Te=async()=>{if(!C){Y.error("No team selected");return}const W=Y.loading("Deleting team...");try{const he=await(await fetch(`/api/teams/${C.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();he.success?(await Ie(),L(!1),A(null),Y.success("Team deleted successfully!",{id:W})):Y.error(`Error deleting team: ${he.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error deleting team:",te),Y.error("Error deleting team",{id:W})}},q=W=>{A(W),U({name:W.name}),B(!0)},le=W=>{A(W),L(!0)};return h?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(aa,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading organization details..."})]})}):n?s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:s.jsxs("span",{className:"font-light",children:[s.jsxs("span",{onClick:()=>t("/organizations"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["orgs /"," "]}),s.jsx("span",{className:"text-white font-mono text-sm",children:e})]})})}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(X,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[s.jsx(Ze,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),s.jsxs(X,{onClick:Ge,className:"border border-dashed border-white/20 text-white bg-transparent hover:bg-white/10 rounded-none",children:[s.jsx(Ir,{className:"w-4 h-4 mr-2"}),"Invite User"]}),s.jsxs(X,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(ja,{className:"w-4 h-4 mr-2"}),"Edit Organization"]})]})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Fn,{className:"w-6 h-6 text-white"})}),s.jsx("div",{children:s.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[n.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:n.slug}),s.jsx("span",{className:"ml-1",children:"]"})]})]})})]}),s.jsx("div",{className:"border-b border-white/10",children:s.jsxs("nav",{className:"flex space-x-8",children:[s.jsxs("button",{onClick:()=>p("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:[s.jsx(Fn,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Details",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:"0"}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]}),s.jsxs("button",{onClick:()=>p("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:[s.jsx(Ze,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Members",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:c.length}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]}),s.jsxs("button",{onClick:()=>p("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:[s.jsx(Ir,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Invitations",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:o.length}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]}),s.jsxs("button",{onClick:()=>p("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:[s.jsx(Ze,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Teams",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:a.length}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]})]})}),f==="details"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[s.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Organization Information"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),s.jsx("p",{className:"text-white font-sans mt-1",children:n.name})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Slug"}),s.jsx("p",{className:"text-white font-mono mt-1",children:n.slug})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),s.jsx("p",{className:"text-white font-sans mt-1",children:new Date(n.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ze,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:c.length}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ze,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:a.length}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Teams"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ir,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:o.length}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Invitations"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(qn,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.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))}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})})]})]}),f==="teams"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Teams",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-xs",children:a.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-xs font-light",children:"Manage teams within this organization"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(X,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(Vr,{className:"w-4 h-4 mr-2"}),"Seed Teams"]}),s.jsxs(X,{onClick:()=>O(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Create Team"]})]})]}),w?a.length>0?s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Team"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Members"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Created"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:a.map(W=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5 cursor-pointer",onClick:()=>t(`/organizations/${e}/teams/${W.id}`),children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:W.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",W.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:W.memberCount||0}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(W.createdAt).toLocaleDateString()}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsxs(X,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:te=>{te.stopPropagation(),q(W)},children:[s.jsx(ja,{className:"w-4 h-4 mr-1"}),"Edit"]}),s.jsxs(X,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:te=>{te.stopPropagation(),le(W)},children:[s.jsx(Qc,{className:"w-4 h-4 mr-1"}),"Delete"]})]})})]},W.id))})]})})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Ze,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Teams Yet"}),s.jsx("p",{className:"text-gray-400 mb-6",children:"Create your first team to start organizing members within this organization."}),s.jsxs(X,{onClick:()=>O(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Create First Team"]})]})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx(Ze,{className:"w-12 h-12 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Teams Feature Required"}),s.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."}),s.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[s.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),s.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:s.jsx("li",{children:"Update your auth configuration file to enable teams:"})}),s.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:s.jsxs("pre",{className:"text-sm text-gray-300",children:[s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"export const"})," ",s.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",s.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",s.jsx("br",{}),s.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",s.jsx("br",{}),s.jsx("span",{className:"text-yellow-300 pl-12",children:"organization"}),"(","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-red-300 pl-16",children:"teams"}),": ","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-yellow-300 pl-20",children:"enabled"}),":"," ",s.jsx("span",{className:"text-blue-400",children:"true"})," ",s.jsx("br",{}),s.jsx("span",{className:"pl-16",children:"}"})," ",s.jsx("br",{}),s.jsx("span",{className:"pl-12",children:"})"})," ",s.jsx("br",{}),s.jsx("span",{className:"pl-10",children:"]"})," ",s.jsx("br",{}),"}",") ",s.jsx("br",{})]})}),s.jsx("div",{className:"mt-4",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"2. Run migrations to create the teams table"})}),s.jsx("div",{className:"mt-2",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"3. Restart your application to apply the changes"})})]}),s.jsx(X,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),s.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",s.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"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Members",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-xs",children:c.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.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?s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:c.map(W=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("img",{src:W.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${W.user.id}`,alt:W.user.name,className:"w-10 h-10 rounded-none border border-dashed border-white/20"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:W.user.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",W.user.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:W.user.email}),s.jsx("td",{className:"py-4 px-4",children:s.jsx(He,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed rounded-none border-blue-500/30 text-blue-400/70 capitalize",children:W.role})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(W.joinedAt).toLocaleDateString()}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.jsxs(X,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>At(W.id,W.user.name),children:[s.jsx(Qc,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},W.id))})]})})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Ze,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),s.jsx("p",{className:"text-gray-400 mb-6",children:"Invite users or seed members from existing users to get started."}),s.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[s.jsxs(X,{onClick:()=>N(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(Ze,{className:"w-4 h-4 mr-2"}),"Seed Members"]}),s.jsxs(X,{onClick:Ge,className:"bg-white text-white hover:bg-white/90 bg-transparent border border-white/20 rounded-none",children:[s.jsx(Ir,{className:"w-4 h-4 mr-2"}),"Invite User"]})]})]})})]}),f==="invitations"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Invitations",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-xs",children:o.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.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?s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:o.map(W=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-10 h-10 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ir,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:W.email}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Expires on"," ",new Date(W.expiresAt).toLocaleDateString("en-US",{month:"short",year:"numeric",day:"numeric"})]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white capitalize",children:W.role}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs(He,{variant:"secondary",className:`text-xs font-normal rounded-none border-dashed flex items-center gap-1 w-fit ${W.status==="pending"?"bg-yellow-900/10 border border-yellow-500/30 text-yellow-400/70":W.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:[W.status==="pending"&&s.jsx(v2,{className:"w-3 h-3"}),W.status==="accepted"&&s.jsx(xx,{className:"w-3 h-3"}),W.status==="expired"&&s.jsx(Gt,{className:"w-3 h-3"}),W.status]})}),s.jsxs("td",{className:"py-4 px-4 text-sm text-gray-400",children:[new Date(W.expiresAt).toLocaleDateString(),s.jsx("br",{}),s.jsx("span",{className:"text-xs text-gray-400",children:new Date(W.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsxs(X,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>St(W.id,W.email),children:[s.jsx(Fv,{className:"w-4 h-4 mr-1"}),"Resend"]}),s.jsxs(X,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>ot(W.id),children:[s.jsx(Qc,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})})]},W.id))})]})})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Ir,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Invitations"}),s.jsx("p",{className:"text-gray-400 mb-6",children:"Start inviting users to join this organization."}),s.jsxs(X,{onClick:Ge,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Ir,{className:"w-4 h-4 mr-2"}),"Send First Invitation"]})]})})]}),y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Invite User"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{x(!1),P(""),D("")},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),s.jsx(Re,{id:"invite-email",type:"email",value:_,onChange:W=>P(W.target.value),placeholder:"user@example.com",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),s.jsxs(ua,{value:E,onValueChange:D,children:[s.jsx(ha,{children:s.jsx(gx,{placeholder:"Select an inviter..."})}),s.jsx(fa,{children:$.map(W=>s.jsx(rn,{value:W.id,children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("img",{src:W.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${W.id}`,alt:W.name,className:"w-6 h-6 rounded-none border border-dashed border-white/20"}),s.jsxs("span",{children:[W.name," (",W.email,")"]})]})},W.id))})]})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>{x(!1),P(""),D("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsxs(X,{onClick:nt,disabled:G,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[G?s.jsx(aa,{className:"w-3 h-3 mr-2 animate-spin"}):s.jsx(Fv,{className:"w-4 h-4 mr-2"}),G?"Sending...":"Send Invitation"]})]})]})}),M&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create Team"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{O(!1),U({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),s.jsx(Re,{id:"team-name",value:T.name,onChange:W=>ie(W.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>{O(!1),U({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:ae,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),I&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{B(!1),U({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",C.id]})]})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),s.jsx(Re,{id:"edit-team-name",value:T.name,onChange:W=>ie(W.target.value),placeholder:"e.g. Development Team",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>{B(!1),U({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:me,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),z&&C&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Team"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>L(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:C.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",C.id]})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this team? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>L(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:Te,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),b&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Members"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ze,{className:"w-5 h-5 text-white"}),s.jsx("h4",{className:"text-white font-light",children:"Add Members from Existing Users"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(Ve,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),s.jsx(Re,{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"})]}),s.jsx(X,{onClick:()=>{var te;const W=parseInt(((te=document.getElementById("member-count"))==null?void 0:te.value)||"5");Je(W)},disabled:J,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:J?s.jsxs(s.Fragment,{children:[s.jsx(aa,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ze,{className:"w-3 h-3 mr-2"}),"Seed Members"]})})]})]}),re.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(_a,{title:"Member Seeding Terminal",lines:re,isRunning:J,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsx(X,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),k&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Teams"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Fn,{className:"w-5 h-5 text-white"}),s.jsx("h4",{className:"text-white font-light",children:"Create Teams"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(Ve,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),s.jsx(Re,{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"})]}),s.jsx(X,{onClick:()=>{var te;const W=parseInt(((te=document.getElementById("team-count"))==null?void 0:te.value)||"3");Le(W)},disabled:V,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:V?s.jsxs(s.Fragment,{children:[s.jsx(aa,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Fn,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),ee.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(_a,{title:"Team Seeding Terminal",lines:ee,isRunning:V,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsx(X,{variant:"outline",onClick:()=>S(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx(Cp,{to:"/organizations",children:s.jsxs(X,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[s.jsx(uL,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),s.jsx("br",{}),s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Fn,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Organization Not Found"}),s.jsx("p",{className:"text-gray-400",children:"The organization you're looking for doesn't exist."})]})]})}function kL(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[a,i]=m.useState(""),[o,l]=m.useState("all"),[c,d]=m.useState(!1),[h,u]=m.useState(!1),[f,p]=m.useState(!1),[w,v]=m.useState(!1),[j,g]=m.useState(!1),[y,x]=m.useState(null),[b,N]=m.useState([]),[k,S]=m.useState(!1),M=m.useCallback(async()=>{try{const D=await(await fetch("/api/sessions")).json();t(D.sessions||[])}catch{}finally{r(!1)}},[]);m.useEffect(()=>{M()},[M]);const O=async E=>{N([]),S(!0),N([{id:"start",type:"info",message:`Starting session seeding process for ${E} sessions...`,timestamp:new Date}]);try{const $=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if($.success){const H=$.results.map((U,G)=>U.success?{id:`session-${G}`,type:"progress",message:`Creating session: ${U.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${G}`,type:"error",message:`Failed to create session ${G+1}: ${U.error}`,timestamp:new Date});N(U=>[...U,...H]);const T=$.results.filter(U=>U.success).length;N(U=>[...U,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${T}/${E} sessions successfully`,timestamp:new Date}]),await M()}else N(H=>[...H,{id:"error",type:"error",message:`❌ Seeding failed: ${$.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N($=>[...$,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{S(!1)}},I=async E=>{N([]),S(!0),N([{id:"start",type:"info",message:`Starting account seeding process for ${E} accounts...`,timestamp:new Date}]);try{const $=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:E})})).json();if($.success){const H=$.results.map((U,G)=>U.success?{id:`account-${G}`,type:"progress",message:`Creating account: ${U.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${G}`,type:"error",message:`Failed to create account ${G+1}: ${U.error}`,timestamp:new Date});N(U=>[...U,...H]);const T=$.results.filter(U=>U.success).length;N(U=>[...U,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${T}/${E} accounts successfully`,timestamp:new Date}]),await M()}else N(H=>[...H,{id:"error",type:"error",message:`❌ Seeding failed: ${$.error||"Unknown error"}`,timestamp:new Date}])}catch(D){N($=>[...$,{id:"error",type:"error",message:`❌ Network error: ${D}`,timestamp:new Date}])}finally{S(!1)}},B=E=>{x(E),v(!0)},z=E=>{x(E),u(!0)},L=E=>{x(E),p(!0)},C=async E=>{d(!1)},A=async E=>{u(!1)},_=async()=>{p(!1)},P=e.filter(E=>{const D=E.id.toLowerCase().includes(a.toLowerCase())||E.userId.toLowerCase().includes(a.toLowerCase()),$=o==="all"||o==="active"&&new Date(E.expiresAt)>new Date||o==="expired"&&new Date(E.expiresAt)<=new Date;return D&&$});return n?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(qr,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading sessions..."})]})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Sessions",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-sm",children:e.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Manage user sessions and accounts"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(X,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>g(!0),children:[s.jsx(mt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(X,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>d(!0),children:[s.jsx(Ts,{className:"w-4 h-4 mr-2"}),"Add Session"]})]})]}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"flex-1 relative",children:[s.jsx(Na,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Re,{placeholder:"Search sessions...",value:a,onChange:E=>i(E.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Vp,{className:"w-4 h-4 text-gray-400"}),s.jsxs(ua,{value:o,onValueChange:l,children:[s.jsx(ha,{children:s.jsx(gx,{})}),s.jsxs(fa,{children:[s.jsx(rn,{value:"all",children:"All"}),s.jsx(rn,{value:"active",children:"Active"}),s.jsx(rn,{value:"expired",children:"Expired"})]})]})]})]}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Session"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User ID"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Status"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Expires"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:P.map(E=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(mt,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-white font-light",children:["Session ",E.id.slice(0,8),"..."]}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",E.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:E.userId}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(E.expiresAt)>new Date?s.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}):s.jsx("div",{className:"w-2 h-2 bg-red-400 rounded-full"}),s.jsx("span",{className:"text-sm text-gray-400",children:new Date(E.expiresAt)>new Date?"Active":"Expired"})]})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.expiresAt).toLocaleDateString()}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsx(X,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>B(E),children:s.jsx(Cl,{className:"w-4 h-4"})}),s.jsx(X,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>z(E),children:s.jsx(ja,{className:"w-4 h-4"})}),s.jsx(X,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>L(E),children:s.jsx(Yp,{className:"w-4 h-4"})})]})})]},E.id))})]})})}),j&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Seed Data"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsx("h4",{className:"text-white font-light",children:"Seed Sessions"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(Ve,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),s.jsx(Re,{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"})]}),s.jsx(X,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("session-count"))==null?void 0:D.value)||"5",10);O(E)},disabled:k,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:k?s.jsxs(s.Fragment,{children:[s.jsx(qr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(H0,{className:"w-5 h-5 text-white"}),s.jsx("h4",{className:"text-white font-light",children:"Seed Accounts"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(Ve,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),s.jsx(Re,{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"})]}),s.jsx(X,{onClick:()=>{var D;const E=parseInt(((D=document.getElementById("account-count"))==null?void 0:D.value)||"5",10);I(E)},disabled:k,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:k?s.jsxs(s.Fragment,{children:[s.jsx(qr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(H0,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),b.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(_a,{title:"Session Seeding Terminal",lines:b,isRunning:k,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("div",{className:"flex justify-end mt-6 pt-6 border-t border-dashed border-white/10",children:s.jsx(X,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})}),c&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Create Session"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),s.jsx(Re,{id:"create-user-id",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),s.jsx(Re,{id:"create-expires",type:"datetime-local",className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:()=>C(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),h&&y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Session"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(mt,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),s.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),s.jsx(Re,{id:"edit-user-id",defaultValue:y.userId,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),s.jsx(Re,{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"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:()=>A(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),f&&y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Delete Session"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(mt,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),s.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),s.jsx("p",{className:"text-gray-400",children:"Are you sure you want to delete this session? This action cannot be undone."})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>p(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:_,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),w&&y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Session Details"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Tt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 rounded-none border border-dashed border-white/20 bg-white/10 flex items-center justify-center",children:s.jsx(mt,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-white font-light",children:["Session ",y.id.slice(0,8),"..."]}),s.jsx("div",{className:"text-sm text-gray-400",children:y.userId})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"ID:"}),s.jsx("span",{className:"text-white text-sm",children:y.id})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"User ID:"}),s.jsx("span",{className:"text-white text-sm",children:y.userId})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Status:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt)>new Date?"Active":"Expired"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Expires:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(y.expiresAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Created:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(y.createdAt).toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-400",children:"Updated:"}),s.jsx("span",{className:"text-white text-sm",children:new Date(y.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(X,{onClick:()=>v(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function SL(e){const t=m.useRef(null),n=m.useRef(null),r=m.useRef(0),a=5;m.useEffect(()=>{const i=()=>{try{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;t.current=new WebSocket(l),t.current.onopen=()=>{r.current=0,n.current&&(clearTimeout(n.current),n.current=null)},t.current.onmessage=c=>{try{const d=JSON.parse(c.data);e(d)}catch{}},t.current.onclose=c=>{if(!(c.code===1006||c.code===1001)&&r.current<a){r.current++;const d=Math.min(1e3*2**r.current,1e4);n.current=setTimeout(()=>{i()},d)}},t.current.onerror=c=>{}}catch{}};return i(),()=>{t.current&&t.current.close(),n.current&&clearTimeout(n.current)}},[e])}function CL(){var y,x,b,N,k,S,M,O,I,B,z,L,C,A,_,P,E,D,$,H,T,U,G,Q,re,ne,J,R,ee,F;const[e,t]=m.useState(null),[n,r]=m.useState(null),[a,i]=m.useState(null),[o,l]=m.useState(null),[c,d]=m.useState(!0),[h,u]=m.useState(null);SL(V=>{V.type==="config_changed"?setTimeout(()=>{f(),p(),w(),v()},500):V.type});const f=m.useCallback(async()=>{var V;try{const ie=await(await fetch("/api/config")).json();(V=ie.studio)!=null&&V.version&&u(`v${ie.studio.version}`),t(ie)}catch{}finally{d(!1)}},[]),p=m.useCallback(async()=>{try{const K=await(await fetch("/api/health")).json();r(K.system||{studioVersion:h||"v1.0.0",nodeVersion:process.version,platform:navigator.platform,uptime:"2h 15m"})}catch{r({studioVersion:h||"v1.0.0",nodeVersion:"v18.0.0",platform:"macOS",uptime:"2h 15m"})}},[h]),w=m.useCallback(async()=>{try{const K=await(await fetch("/api/plugins")).json();i(K)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),v=m.useCallback(async()=>{try{const K=await(await fetch("/api/db")).json();l(K)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),j=V=>{switch(V==null?void 0:V.toLowerCase()){case"postgresql":case"postgres":return s.jsxs(He,{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:[s.jsx(Et,{className:"w-3 h-3"}),"Connected"]});case"mysql":return s.jsxs(He,{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:[s.jsx(Et,{className:"w-3 h-3"}),"Connected"]});case"sqlite":return s.jsxs(He,{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:[s.jsx(vc,{className:"w-3 h-3"}),"Local"]});default:return s.jsxs(He,{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:[s.jsx(fr,{className:"w-3 h-3"}),"Unknown"]})}};m.useEffect(()=>{f(),p(),w(),v()},[f,v,w,p]);const g=V=>{switch(V.toLowerCase()){case"google":return s.jsx(Wt,{className:"w-5 h-5 text-white"});case"github":return s.jsx(Dn,{className:"w-5 h-5 text-white"});case"discord":return s.jsx(Wt,{className:"w-5 h-5 text-white"});case"twitter":return s.jsx(Wt,{className:"w-5 h-5 text-white"});default:return s.jsx(Wt,{className:"w-5 h-5 text-white"})}};return c?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):s.jsxs("div",{className:"space-y-8 animate-fade-in",children:[s.jsx("div",{className:"flex items-center justify-between p-5 pt-7",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-normal text-white tracking-tight",children:"Settings"}),s.jsx("p",{className:"text-gray-300 mt-2 uppercase font-mono font-light text-xs",children:"Configure your Better Auth application"})]})}),s.jsx("hr",{className:"w-full border-white/15 h-px"}),s.jsx("hr",{className:"w-full border-white/15 h-px"}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-5",children:[s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Pn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(ra,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Application"})]}),s.jsxs(mr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(On,{className:"space-y-0 px-0 pb-0 border-b-none",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Wt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"App Name"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application display name"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.appName)||"Better Auth"})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(zd,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base URL"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Application base URL"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.baseURL)||"http://localhost:3000"})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Yc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Base Path"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auth API base path"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-mono font-medium text-white",children:(e==null?void 0:e.basePath)||"/api/auth"})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Dn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secret"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Encryption secret"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:(e==null?void 0:e.secret)==="Configured"?"Configured":"Not set"})})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Pn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(mt,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Database"})]}),s.jsxs(mr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(On,{className:"space-y-0 px-0 pb-0 border-b-none",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.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)&&((x=e==null?void 0:e.database)==null?void 0:x.type.charAt(0).toUpperCase())+((b=e==null?void 0:e.database)==null?void 0:b.type.slice(1))||"Unknown"}),s.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)||((k=e==null?void 0:e.database)==null?void 0:k.type)||"")]}),((o==null?void 0:o.dialect)||((S=e==null?void 0:e.database)==null?void 0:S.dialect))&&(o==null?void 0:o.dialect)!=="unknown"&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Dialect"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database dialect"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:(o==null?void 0:o.dialect)||((M=e==null?void 0:e.database)==null?void 0:M.dialect)})})]}),((O=e==null?void 0:e.database)==null?void 0:O.url)&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(zd,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Connection URL"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database connection string"})]})]}),s.jsxs(He,{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:[s.jsx(Et,{className:"w-3 h-3"}),"Configured"]})]}),((I=e==null?void 0:e.database)==null?void 0:I.casing)&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(ra,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Casing"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Table name casing"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white capitalize",children:e.database.casing})})]}),(e==null?void 0:e.database)&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(B0,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Debug Logs"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Database debug logging"})]})]}),s.jsx(He,{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?s.jsxs(s.Fragment,{children:[s.jsx(fr,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Disabled"]})})]}),((B=e==null?void 0:e.database)==null?void 0:B.adapterConfig)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(wc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Adapter ID"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Adapter identifier"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white font-mono",children:e.database.adapterConfig.adapterId||"N/A"})})]}),e.database.adapterConfig.adapterName&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(wc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Adapter Name"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Adapter display name"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:e.database.adapterConfig.adapterName})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(yc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Adapter Features"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Supported capabilities"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 justify-end",children:[e.database.adapterConfig.supportsBooleans&&s.jsx(He,{variant:"secondary",className:"text-xs bg-green-900/20 border border-green-500/30 text-green-400 rounded-none border-dashed",children:"Booleans"}),e.database.adapterConfig.supportsDates&&s.jsx(He,{variant:"secondary",className:"text-xs bg-green-900/20 border border-green-500/30 text-green-400 rounded-none border-dashed",children:"Dates"}),e.database.adapterConfig.supportsJSON&&s.jsx(He,{variant:"secondary",className:"text-xs bg-green-900/20 border border-green-500/30 text-green-400 rounded-none border-dashed",children:"JSON"}),e.database.adapterConfig.supportsNumericIds&&s.jsx(He,{variant:"secondary",className:"text-xs bg-green-900/20 border border-green-500/30 text-green-400 rounded-none border-dashed",children:"Numeric IDs"}),!e.database.adapterConfig.supportsBooleans&&!e.database.adapterConfig.supportsDates&&!e.database.adapterConfig.supportsJSON&&!e.database.adapterConfig.supportsNumericIds&&s.jsx("span",{className:"text-xs text-gray-400",children:"No special features"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(ra,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Adapter Settings"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Configuration options"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 justify-end",children:[e.database.adapterConfig.usePlural!==void 0&&s.jsx(He,{variant:"secondary",className:"text-xs bg-blue-900/20 border border-blue-500/30 text-blue-400 rounded-none border-dashed",children:e.database.adapterConfig.usePlural?"Plural":"Singular"}),e.database.adapterConfig.disableTransformInput&&s.jsx(He,{variant:"secondary",className:"text-xs bg-yellow-900/20 border border-yellow-500/30 text-yellow-400 rounded-none border-dashed",children:"No Input Transform"}),e.database.adapterConfig.disableTransformOutput&&s.jsx(He,{variant:"secondary",className:"text-xs bg-yellow-900/20 border border-yellow-500/30 text-yellow-400 rounded-none border-dashed",children:"No Output Transform"})]})]})]}),!(o!=null&&o.success)&&!(e!=null&&e.database)&&s.jsxs("div",{className:"flex items-center justify-between p-3 px-5",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(fr,{className:"w-5 h-5 text-yellow-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"No Database Detected"}),s.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"})]})]}),s.jsx(He,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"Unknown"})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Pn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(Dn,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Providers"})]}),s.jsxs(mr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsx(On,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((V,K)=>s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[g(V.type),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:V.type}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:V.clientId?"Configured":"Not configured"})]})]}),s.jsx(He,{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:V.clientId?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Active"]}):s.jsxs(s.Fragment,{children:[s.jsx(fr,{className:"w-3 h-3"}),"Setup Required"]})})]},K)):s.jsxs("div",{className:"text-center py-8",children:[s.jsx(Dn,{className:"w-8 h-8 text-white mx-auto mb-2"}),s.jsx("p",{className:"text-sm text-gray-400",children:"No providers configured"})]})})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Pn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx($d,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Email & Password"})]}),s.jsxs(mr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(On,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx($d,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Authentication"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow users to sign up with email"})]})]}),s.jsx(He,{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:(z=e==null?void 0:e.emailAndPassword)!=null&&z.enabled?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Zs,{className:"w-3 h-3"}),"Disabled"]})})]}),((L=e==null?void 0:e.emailAndPassword)==null?void 0:L.enabled)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(ka,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Sign Up"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Allow new user registration"})]})]}),s.jsx(He,{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:(C=e==null?void 0:e.emailAndPassword)!=null&&C.disableSignUp?s.jsxs(s.Fragment,{children:[s.jsx(Zs,{className:"w-3 h-3"}),"Disabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Dn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Email Verification"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Require email verification"})]})]}),s.jsx(He,{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.emailAndPassword)!=null&&A.requireEmailVerification?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Required"]}):s.jsxs(s.Fragment,{children:[s.jsx(fr,{className:"w-3 h-3"}),"Optional"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Yc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Password Length"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Min/Max password length"})]})]}),s.jsx("div",{className:"text-right",children:s.jsxs("p",{className:"text-sm font-medium text-white",children:[((_=e==null?void 0:e.emailAndPassword)==null?void 0:_.minPasswordLength)||8," -"," ",((P=e==null?void 0:e.emailAndPassword)==null?void 0:P.maxPasswordLength)||128]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(yc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Auto Sign In"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto sign in after registration"})]})]}),s.jsx(He,{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=e==null?void 0:e.emailAndPassword)!=null&&E.autoSignIn?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(fr,{className:"w-3 h-3"}),"Disabled"]})})]})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Pn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(gc,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Session"})]}),s.jsxs(mr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(On,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(gc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Duration"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"How long sessions last"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(D=e==null?void 0:e.session)!=null&&D.expiresIn?`${Math.floor(e.session.expiresIn/(60*60*24))} days`:"7 days"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Default"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(B0,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Update Age"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Session refresh interval"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white",children:($=e==null?void 0:e.session)!=null&&$.updateAge?`${Math.floor(e.session.updateAge/(60*60))} hours`:"24 hours"})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(yc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Session Refresh"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Auto refresh sessions"})]})]}),s.jsx(He,{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:(H=e==null?void 0:e.session)!=null&&H.disableSessionRefresh?s.jsxs(s.Fragment,{children:[s.jsx(Zs,{className:"w-3 h-3"}),"Disabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Store in Database"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Store sessions in database"})]})]}),s.jsx(He,{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:(T=e==null?void 0:e.session)!=null&&T.storeSessionInDatabase?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(vc,{className:"w-3 h-3"}),"Secondary Storage"]})})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Pn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(Dn,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Rate Limiting"})]}),s.jsxs(mr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(On,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Dn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limiting"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Enable rate limiting"})]})]}),s.jsx(He,{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:(U=e==null?void 0:e.rateLimit)!=null&&U.enabled?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(fr,{className:"w-3 h-3"}),"Disabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(gc,{className:"w-5 h-5 text-red-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Rate Limit Window"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Time window for rate limiting"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(G=e==null?void 0:e.rateLimit)!=null&&G.window?`${e.rateLimit.window} seconds`:"10 seconds"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Window"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Dn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Max Requests"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Maximum requests per window"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:((Q=e==null?void 0:e.rateLimit)==null?void 0:Q.max)||100}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Requests"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(mt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Storage"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Rate limit storage type"})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"text-sm font-medium text-white capitalize",children:((re=e==null?void 0:e.rateLimit)==null?void 0:re.storage)||"memory"})})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Pn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(ra,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Advanced"})]}),s.jsxs(mr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(On,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Yc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Secure Cookies"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Use secure cookies"})]})]}),s.jsx(He,{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:(ne=e==null?void 0:e.advanced)!=null&&ne.useSecureCookies?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(fr,{className:"w-3 h-3"}),"Disabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Dn,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"CSRF Check"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"CSRF protection"})]})]}),s.jsx(He,{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:(J=e==null?void 0:e.advanced)!=null&&J.disableCSRFCheck?s.jsxs(s.Fragment,{children:[s.jsx(Zs,{className:"w-3 h-3"}),"Disabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Cl,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"IP Tracking"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Track IP addresses"})]})]}),s.jsx(He,{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:(ee=(R=e==null?void 0:e.advanced)==null?void 0:R.ipAddress)!=null&&ee.disableIpTracking?s.jsxs(s.Fragment,{children:[s.jsx(Zs,{className:"w-3 h-3"}),"Disabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(GP,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Telemetry"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Usage analytics"})]})]}),s.jsx(He,{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:(F=e==null?void 0:e.telemetry)!=null&&F.enabled?s.jsxs(s.Fragment,{children:[s.jsx(fr,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Disabled"]})})]})]})]}),s.jsxs(_n,{className:"border-white/15 bg-black/70 px-0 sm:px-0 md:px-0 lg:px-0 xl:px-0 rounded-none",children:[s.jsxs(Pn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(vc,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"System Info"})]}),s.jsxs(mr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsxs(On,{className:"p-0",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(yc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Studio Version"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Better Auth Studio"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:h||"v1.0.0"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Latest"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(vc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Node.js Version"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Runtime environment"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.nodeVersion)||"v18.0.0"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Current"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 px-5 border-b border-white/15",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Wt,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Platform"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Operating system"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.platform)||"macOS"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"System"})]})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 px-5 border-b border-white/15 last:border-b-0",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(gc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:"Uptime"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Service uptime"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(n==null?void 0:n.uptime)||"2h 15m"}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Running"})]})]})]})]}),s.jsxs(_n,{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:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs(Pn,{className:"space-y-0",children:[s.jsxs(Tn,{className:"text-white font-light uppercase text-lg flex items-center space-x-2",children:[s.jsx(wc,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Plugins"})]}),s.jsxs(mr,{className:"uppercase font-mono font-light flex items-center gap-2 text-gray-400 text-xs",children:[s.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:[" ",s.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"]})]}),s.jsxs("div",{className:"pr-6",children:[s.jsx("p",{className:"text-sm font-medium text-white",children:(a==null?void 0:a.totalPlugins)||0}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:"Active"})]})]}),s.jsx("hr",{className:"w-full border-white/15 h-px -mt-3 mb-1"}),s.jsx(On,{className:"space-y-0 px-0 pb-0 border-b-none",children:a!=null&&a.plugins&&a.plugins.length>0?s.jsxs(s.Fragment,{children:[a.plugins.map((V,K)=>s.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${K<a.plugins.length-1?"border-b border-white/15":""}`,children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(wc,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:V.name.slice(0,1).toUpperCase()+V.name.slice(1).replace("-"," ")}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:V.description})]})]}),s.jsx("div",{className:"text-right flex items-center space-x-2",children:s.jsxs(He,{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:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]})})]},V.id)),a.configPath&&s.jsx("div",{className:"p-4 px-5 bg-black/30 border-t border-white/10",children:s.jsxs("p",{className:"text-xs text-gray-400",children:["Config file:"," ",s.jsx("span",{className:"text-white font-mono",children:a.configPath})]})})]}):s.jsxs("div",{className:"flex items-center justify-between p-4 px-5",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(fr,{className:"w-5 h-5 text-yellow-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-white",children:"No Plugins Enabled"}),s.jsx("p",{className:"text-xs text-gray-400",children:(a==null?void 0:a.error)||"No plugins are currently configured in your Better Auth setup"})]})]}),s.jsx(He,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}function Wv(){var _,P;const{orgId:e,teamId:t}=Sp(),n=Dr(),[r,a]=m.useState(null),[i,o]=m.useState([]),[l,c]=m.useState(!0),[d,h]=m.useState("details"),[u,f]=m.useState(!1),[p,w]=m.useState(!1),[v,j]=m.useState(""),[g,y]=m.useState([]),[x,b]=m.useState([]),[N,k]=m.useState({name:""}),S=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}`)).json();D.success&&D.team?(a(D.team),k({name:D.team.name})):D.team?(a(D.team),k({name:D.team.name})):Y.error("Team not found")}catch{Y.error("Failed to load team")}finally{c(!1)}},[t]),M=m.useCallback(async()=>{if(t)try{const D=await(await fetch(`/api/teams/${t}/members`)).json();D.success&&o(D.members||[])}catch{Y.error("Failed to load team members")}},[t]),O=async()=>{try{const D=await(await fetch("/api/users?limit=10000")).json(),$=i.map(T=>T.userId),H=(D.users||[]).filter(T=>!$.includes(T.id));y(H)}catch{Y.error("Failed to load users")}};m.useEffect(()=>{t&&(S(),M())},[t,S,M]);const I=async()=>{if(!N.name){Y.error("Please enter a team name");return}const E=Y.loading("Updating team...");try{const $=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.name})})).json();$.success?(await S(),w(!1),Y.success("Team updated successfully!",{id:E})):Y.error(`Error updating team: ${$.error||"Unknown error"}`,{id:E})}catch{Y.error("Error updating team",{id:E})}},B=async()=>{if(x.length===0){Y.error("Please select at least one user");return}const E=Y.loading(`Adding ${x.length} members...`);try{const $=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:x})})).json();$.success?(await M(),f(!1),b([]),j(""),Y.success(`Successfully added ${x.length} members!`,{id:E})):Y.error(`Error adding members: ${$.error||"Unknown error"}`,{id:E})}catch{Y.error("Error adding members",{id:E})}},z=async(E,D)=>{const $=Y.loading(`Removing ${D}...`);try{const T=await(await fetch(`/api/team-members/${E}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();T.success?(await M(),Y.success(`${D} removed from team!`,{id:$})):Y.error(`Error removing member: ${T.error||"Unknown error"}`,{id:$})}catch{Y.error("Error removing team member",{id:$})}},L=()=>{O(),f(!0)},C=E=>{b(D=>D.includes(E)?D.filter($=>$!==E):[...D,E])},A=g.filter(E=>E.name.toLowerCase().includes(v.toLowerCase())||E.email.toLowerCase().includes(v.toLowerCase()));return l?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[s.jsx(aa,{className:"w-6 h-6 text-white animate-spin"}),s.jsx("div",{className:"text-white text-sm",children:"Loading team details..."})]})}):r?s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:s.jsxs("span",{className:"font-light",children:[s.jsxs("span",{onClick:()=>n(`/organizations/${r.organizationId}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),s.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(X,{onClick:L,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Add Members"]}),s.jsxs(X,{onClick:()=>w(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(ja,{className:"w-4 h-4 mr-2"}),"Edit Team"]})]})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-12 h-12 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl text-white font-light inline-flex items-center",children:[r.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:t}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("div",{className:"flex items-center space-x-2 mt-1",children:r.organization&&s.jsxs(Cp,{to:`/organizations/${r.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[s.jsx(Fn,{className:"w-4 h-4 inline mr-1"}),r.organization.name]})})]})]}),s.jsx("div",{className:"border-b border-white/10",children:s.jsxs("nav",{className:"flex space-x-8",children:[s.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 ${d==="details"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[s.jsx(Ze,{className:"w-4 h-4"}),s.jsx("span",{children:"Details"})]}),s.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 ${d==="members"?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-gray-300"}`,children:[s.jsx(Ze,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Members",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:i.length}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]})]})}),d==="details"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:[s.jsx("h3",{className:"text-lg text-white font-light mb-4",children:"Team Information"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Name"}),s.jsx("p",{className:"text-white font-sans mt-1",children:r.name})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"}),s.jsx("p",{className:"text-white font-sans mt-1",children:((_=r.organization)==null?void 0:_.name)||"Unknown"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Created"}),s.jsx("p",{className:"text-white font-sans mt-1",children:new Date(r.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-gray-400 font-mono uppercase",children:"Last Updated"}),s.jsx("p",{className:"text-white font-sans mt-1",children:new Date(r.updatedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ze,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:i.length}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Members"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(qn,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:Math.ceil((Date.now()-new Date(r.createdAt).getTime())/(1e3*60*60*24))}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Days Active"})]})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-6",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Fn,{className:"w-8 h-8 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl text-white font-sans font-light",children:"1"}),s.jsx("p",{className:"text-sm text-gray-400 font-mono uppercase",children:"Organization"})]})]})})]})]}),d==="members"&&s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg relative text-white font-light inline-flex items-start",children:["Team Members",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:i.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsx("p",{className:"text-gray-400 font-light font-mono text-xs uppercase mt-1",children:"Manage members of this team"})]})}),i.length>0?s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"User"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Email"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Role"}),s.jsx("th",{className:"text-left py-4 px-4 text-white font-light",children:"Joined"}),s.jsx("th",{className:"text-right py-4 px-4 text-white font-light",children:"Actions"})]})}),s.jsx("tbody",{children:i.map(E=>s.jsxs("tr",{className:"border-b border-dashed border-white/5 hover:bg-white/5",children:[s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.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"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.user.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",E.user.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:E.user.email}),s.jsx("td",{className:"py-4 px-4",children:s.jsx(He,{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})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(E.joinedAt).toLocaleDateString()}),s.jsx("td",{className:"py-4 px-4 text-right",children:s.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.jsxs(X,{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:[s.jsx(Qc,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},E.id))})]})})}):s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Ze,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"No Members Yet"}),s.jsx("p",{className:"text-gray-400 mb-6",children:"Add members to this team to get started."}),s.jsxs(X,{onClick:L,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Add First Members"]})]})})]}),u&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Add Team Members"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{f(!1),b([]),j("")},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(g2,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Re,{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"})]}),x.length>0&&s.jsx("div",{className:"bg-blue-900/20 border border-blue-500/30 rounded-none p-3",children:s.jsxs("p",{className:"text-blue-400 text-sm",children:[x.length," user",x.length!==1?"s":""," selected"]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none max-h-96 overflow-y-auto",children:A.length>0?s.jsx("div",{className:"divide-y divide-white/5",children:A.map(E=>s.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${x.includes(E.id)?"bg-blue-900/20":""}`,onClick:()=>C(E.id),children:[s.jsx("input",{type:"checkbox",checked:x.includes(E.id),onChange:()=>C(E.id),className:"rounded border-gray-300"}),s.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"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]},E.id))}):s.jsx("div",{className:"p-8 text-center",children:s.jsx("p",{className:"text-gray-400",children:"No users found matching your search."})})})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>{f(!1),b([]),j("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsxs(X,{onClick:B,disabled:x.length===0,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[s.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Add ",x.length," Member",x.length!==1?"s":""]})]})]})}),p&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-6 w-full max-w-md rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit Team"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>w(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"w-16 h-16 bg-white/10 border border-dashed border-white/20 rounded-none flex items-center justify-center",children:s.jsx(Ze,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:r.name}),s.jsx("div",{className:"text-sm text-gray-400",children:(P=r.organization)==null?void 0:P.name})]})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),s.jsx(Re,{id:"edit-team-name",value:N.name,onChange:E=>k({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"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>w(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:I,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})})]}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:s.jsxs("span",{className:"font-light",children:[s.jsxs("span",{onClick:()=>n(`/organizations/${e}`),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["teams /"," "]}),s.jsx("span",{className:"text-white font-mono text-sm",children:t})]})})}),s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ze,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("h2",{className:"text-xl text-white font-light mb-2",children:"Team Not Found"}),s.jsx("p",{className:"text-gray-400",children:"The team you're looking for doesn't exist."})]})]})}function EL(){const e=Dr(),[t,n]=m.useState([]),[r,a]=m.useState(!0),[i,o]=m.useState(null),[l,c]=m.useState(""),[d,h]=m.useState("all"),[u,f]=m.useState(1),[p]=m.useState(20);m.useEffect(()=>{w()},[]);const w=async()=>{try{const k=await(await fetch("/api/plugins")).json(),S=(k==null?void 0:k.plugins).find(M=>M.id==="teams");o({enabled:!!S,availablePlugins:(k==null?void 0:k.plugins).map(M=>M.id),configPath:k.configPath,teamsPlugin:(k==null?void 0:k.plugins).find(M=>M.id==="teams")}),S?await v():a(!1)}catch(N){console.error("Failed to check teams plugin status:",N),o({enabled:!1,error:"Failed to check plugin status"}),a(!1)}},v=async()=>{try{const k=await(await fetch("/api/teams")).json();k.success&&n(k.teams||[])}catch(N){console.error("Failed to fetch teams:",N),Y.error("Failed to load teams")}finally{a(!1)}},j=t.filter(N=>{var S;const k=N.name.toLowerCase().includes(l.toLowerCase())||((S=N.organization)==null?void 0:S.name.toLowerCase().includes(l.toLowerCase()));if(d==="all")return k;if(d==="recent"){const M=new Date;return M.setDate(M.getDate()-7),k&&new Date(N.createdAt)>M}return k}),g=u*p,y=g-p,x=j.slice(y,g),b=Math.ceil(j.length/p);return r?s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx(qr,{className:"w-8 h-8 animate-spin text-white"})}):i!=null&&i.enabled?s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Teams",s.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white font-mono text-sm",children:j.length}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:[j.length," team",j.length!==1?"s":""," found"]})]}),s.jsx("div",{className:"flex items-center space-x-3",children:s.jsxs(X,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[s.jsx(Ts,{className:"w-4 h-4 mr-2"}),"Create Team"]})})]}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"relative flex-1 max-w-md",children:[s.jsx(Na,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Re,{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"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(X,{variant:d==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),className:d==="all"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"All"}),s.jsx(X,{variant:d==="recent"?"default":"outline",size:"sm",onClick:()=>h("recent"),className:d==="recent"?"bg-white text-black":"border-dashed border-white/20 text-white hover:bg-white/10",children:"Recent"})]})]}),x.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(ka,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-light text-white mb-2",children:"No teams found"}),s.jsx("p",{className:"text-gray-400 mb-6",children:l?"Try adjusting your search terms":"Get started by creating your first team"}),!l&&s.jsxs(X,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[s.jsx(Ts,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):s.jsx("div",{className:"grid gap-4",children:x.map(N=>{var k;return s.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:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-none flex items-center justify-center",children:s.jsx(ka,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium",children:N.name}),s.jsxs("p",{className:"text-gray-400 text-sm",children:[(k=N.organization)==null?void 0:k.name," • ",N.memberCount||0," members"]})]})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(He,{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)})}),b>1&&s.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[s.jsx(X,{variant:"outline",size:"sm",onClick:()=>f(Math.max(1,u-1)),disabled:u===1,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Previous"}),s.jsxs("span",{className:"text-gray-400 text-sm",children:["Page ",u," of ",b]}),s.jsx(X,{variant:"outline",size:"sm",onClick:()=>f(Math.min(b,u+1)),disabled:u===b,className:"border-dashed border-white/20 text-white hover:bg-white/10 disabled:opacity-50",children:"Next"})]})]}):s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl text-white font-light",children:"Teams"}),s.jsx("p",{className:"text-gray-400 mt-1",children:"Manage your application organizations"})]})}),s.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none p-8",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx(gr,{className:"w-12 h-12 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-xl text-white font-light mb-2",children:"Organization Plugin Required"}),s.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."}),s.jsxs("div",{className:"bg-black/50 border border-dashed border-white/20 rounded-none p-4 mb-6",children:[s.jsx("h4",{className:"text-white font-light mb-3",children:"Follow these steps:"}),s.jsx("ol",{className:"text-gray-300 space-y-2 text-sm list-decimal list-inside",children:s.jsxs("li",{children:["Import the plugin in your auth configuration file",(i==null?void 0:i.configPath)&&s.jsxs("span",{className:"text-gray-400",children:[" (",i.configPath,")"]}),":"]})}),s.jsx("div",{className:"mt-4 bg-black/70 border border-dashed border-white/10 rounded-none p-3 overflow-x-auto",children:s.jsxs("pre",{className:"text-sm text-gray-300",children:[s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ betterAuth }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"import"})," ","{ organization }"," ",s.jsx("span",{className:"text-blue-400",children:"from"})," ",s.jsx("span",{className:"text-green-400",children:'"better-auth/plugins/organization"'})," ",s.jsx("br",{}),s.jsx("span",{className:"text-blue-400",children:"export const"})," ",s.jsx("span",{className:"text-yellow-300",children:"auth"})," ="," ",s.jsx("span",{className:"text-yellow-300",children:"betterAuth"}),"(","{"," ",s.jsx("br",{}),s.jsx("span",{className:"text-gray-500 pl-10",children:"// ... your existing configuration"})," ",s.jsx("br",{}),s.jsx("span",{className:"text-red-300 pl-10",children:"plugins"}),": [ ",s.jsx("br",{}),s.jsxs("span",{className:"text-yellow-300 pl-12",children:["organization(",")"]}),s.jsx("br",{}),s.jsx("span",{className:"pl-10",children:"]"})," ",s.jsx("br",{}),"}",") ",s.jsx("br",{})]})}),s.jsx("div",{className:"mt-4",children:s.jsx("p",{className:"text-gray-400 text-sm",children:"2. Do migrations to create the organizations table"})}),s.jsx("div",{className:"mt-2",children:s.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&&s.jsx("div",{className:"mb-4",children:s.jsxs("p",{className:"text-gray-400 text-sm",children:["Currently enabled plugins: ",i.availablePlugins.join(", ")]})}),s.jsx(X,{onClick:()=>window.location.reload(),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Check Again"}),s.jsxs("div",{className:"mt-4 text-xs text-gray-500",children:["Need help? Check the"," ",s.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"})]})]})]})})]})}const Zh=`// Example custom migration script
474
- import { migrateUser } from '@better-auth/migration';
475
-
476
- async function run() {
477
- const legacyUsers = await fetchLegacyUsers();
478
-
479
- for (const user of legacyUsers) {
480
- await migrateUser({
481
- email: user.email,
482
- passwordHash: user.passwordHash,
483
- metadata: user.metadata,
484
- });
485
- }
486
-
487
- return {
488
- migrated: legacyUsers.length,
489
- timestamp: new Date().toISOString(),
490
- };
491
- }
492
-
493
- run().then(console.log).catch(console.error);`,mo=[{id:"clerk",name:"Clerk",description:"Clerk Migration guide",docs:"https://better-auth.com/docs/migrations/clerk",logo:s.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:s.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';
494
- import { generateRandomString, symmetricEncrypt } from "better-auth/crypto";
495
- import { clerkClient } from '@clerk/clerk-sdk-node';
496
- import { auth } from "@/lib/auth";
497
- import * as fs from "node:fs/promises";
498
-
499
- function getCSVData(csv: string) {
500
- const lines = csv.split('\\n').filter(line => line.trim());
501
- const headers = lines[0]?.split(',').map(header => header.trim()) || [];
502
- const jsonData = lines.slice(1).map(line => {
503
- const values = line.split(',').map(value => value.trim());
504
- return headers.reduce((obj, header, index) => {
505
- obj[header] = values[index] || '';
506
- return obj;
507
- }, {} as Record<string, string>);
508
- });
509
- return jsonData as Array<{
510
- id: string;
511
- first_name: string;
512
- last_name: string;
513
- username: string;
514
- primary_email_address: string;
515
- primary_phone_number: string;
516
- verified_email_addresses: string;
517
- unverified_email_addresses: string;
518
- verified_phone_numbers: string;
519
- unverified_phone_numbers: string;
520
- totp_secret: string;
521
- password_digest: string;
522
- password_hasher: string;
523
- }>;
524
- }
525
-
526
- async function getClerkUsers(totalUsers: number) {
527
- const clerkUsers: any[] = [];
528
- for (let i = 0; i < totalUsers; i += 500) {
529
- const response = await fetch(\`https://api.clerk.com/v1/users?offset=\${i}&limit=500\`, {
530
- headers: { Authorization: \`Bearer \${process.env.CLERK_SECRET_KEY}\` },
531
- });
532
- if (!response.ok) throw new Error(\`Failed to fetch users: \${response.statusText}\`);
533
- clerkUsers.push(...((await response.json()) as any));
534
- }
535
- return clerkUsers;
536
- }
537
-
538
- export async function generateBackupCodes(secret: string) {
539
- const backupCodes = Array.from({ length: 10 })
540
- .map(() => generateRandomString(10, "a-z", "0-9", "A-Z"))
541
- .map(code => \`\${code.slice(0,5)}-\${code.slice(5)}\`);
542
- return symmetricEncrypt({ data: JSON.stringify(backupCodes), key: secret });
543
- }
544
-
545
- function safeDateConversion(timestamp?: number): Date {
546
- if (!timestamp) return new Date();
547
- const date = new Date(timestamp);
548
- if (isNaN(date.getTime())) return new Date();
549
- const year = date.getFullYear();
550
- if (year < 2000 || year > 2100) return new Date();
551
- return date;
552
- }
553
-
554
- async function migrateFromClerk() {
555
- const exportedUserCSV = await fs.readFile("exported_users.csv", "utf-8");
556
- const jsonData = getCSVData(exportedUserCSV);
557
- const clerkUsers = await getClerkUsers(jsonData.length);
558
-
559
- const ctx = await auth.$context;
560
- const isAdminEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "admin");
561
- const isTwoFactorEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "two-factor");
562
- const isUsernameEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "username");
563
- const isPhoneNumberEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "phone-number");
564
-
565
- for (const user of jsonData) {
566
- const {
567
- id,
568
- first_name,
569
- last_name,
570
- username,
571
- primary_email_address,
572
- primary_phone_number,
573
- verified_email_addresses,
574
- verified_phone_numbers,
575
- totp_secret,
576
- password_digest,
577
- } = user;
578
-
579
- const clerkUser = clerkUsers.find((item) => item?.id === id);
580
-
581
- const createdUser = await ctx.adapter.create({
582
- model: "user",
583
- data: {
584
- id,
585
- email: primary_email_address,
586
- emailVerified: verified_email_addresses.length > 0,
587
- name: \`\${first_name} \${last_name}\`,
588
- image: clerkUser?.image_url,
589
- createdAt: safeDateConversion(clerkUser?.created_at),
590
- updatedAt: safeDateConversion(clerkUser?.updated_at),
591
- ...(isTwoFactorEnabled ? { twoFactorEnabled: clerkUser?.two_factor_enabled } : {}),
592
- ...(isAdminEnabled ? {
593
- banned: clerkUser?.banned,
594
- banExpiresAt: clerkUser?.lockout_expires_in_seconds,
595
- role: "user",
596
- } : {}),
597
- ...(isUsernameEnabled ? { username } : {}),
598
- ...(isPhoneNumberEnabled ? {
599
- phoneNumber: primary_phone_number,
600
- phoneNumberVerified: verified_phone_numbers.length > 0,
601
- } : {}),
602
- },
603
- forceAllowId: true,
604
- }).catch(async () => {
605
- return await ctx.adapter.findOne({
606
- model: 'user',
607
- where: [{ field: 'id', value: id }],
608
- });
609
- });
610
-
611
- const externalAccounts = clerkUser?.external_accounts ?? [];
612
- for (const externalAccount of externalAccounts) {
613
- const {
614
- id: externalId,
615
- provider,
616
- provider_user_id,
617
- approved_scopes,
618
- created_at,
619
- updated_at,
620
- } = externalAccount;
621
-
622
- if (provider === 'credential') {
623
- await ctx.adapter.create({
624
- model: 'account',
625
- data: {
626
- id: externalId,
627
- providerId: provider,
628
- accountId: provider_user_id,
629
- scope: approved_scopes,
630
- userId: createdUser?.id,
631
- createdAt: safeDateConversion(created_at),
632
- updatedAt: safeDateConversion(updated_at),
633
- password: password_digest,
634
- },
635
- });
636
- } else {
637
- await ctx.adapter.create({
638
- model: 'account',
639
- data: {
640
- id: externalId,
641
- providerId: provider.replace('oauth_', ''),
642
- accountId: provider_user_id,
643
- scope: approved_scopes,
644
- userId: createdUser?.id,
645
- createdAt: safeDateConversion(created_at),
646
- updatedAt: safeDateConversion(updated_at),
647
- },
648
- forceAllowId: true,
649
- });
650
- }
651
- }
652
-
653
- if (isTwoFactorEnabled && totp_secret) {
654
- await ctx.adapter.create({
655
- model: 'twoFactor',
656
- data: {
657
- userId: createdUser?.id,
658
- secret: totp_secret,
659
- backupCodes: await generateBackupCodes(totp_secret),
660
- },
661
- });
662
- }
663
- }
664
- }
665
-
666
- migrateFromClerk()
667
- .then(() => {
668
- console.log('Migration completed');
669
- process.exit(0);
670
- })
671
- .catch((error) => {
672
- console.error('Migration failed:', error);
673
- process.exit(1);
674
- });`},{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 ML(){const[e,t]=Z4(),[n,r]=m.useState(null),[a,i]=m.useState([]),[o,l]=m.useState(!1),[c,d]=m.useState(!1),[h,u]=m.useState([]),[f,p]=m.useState(""),[w,v]=m.useState(!1),[j,g]=m.useState(""),[y,x]=m.useState(Zh),b=(R,ee,F,V)=>{i(K=>[...K,{id:V??`log-${Date.now()}-${Math.random()}`,type:R,message:ee,timestamp:new Date,status:F}])},N=m.useRef(new Set),k=m.useRef(new Set),S=m.useRef(new Map),M=m.useRef(null),O=()=>mo.find(R=>!R.disabled)??mo[0],I=mo.find(R=>R.id===j)??O();m.useEffect(()=>{g(w?R=>{var ee;return R||((ee=O())==null?void 0:ee.id)||""}:"")},[w]);const B=R=>{g(R),R!=="custom"&&x(Zh)},z=async R=>{try{await navigator.clipboard.writeText(R),Y.success("Copied to clipboard")}catch{Y.error("Failed to copy to clipboard")}},L=R=>{switch(R.toLowerCase()){case"github":return s.jsx(tT,{className:"w-5 h-5 text-white"});case"google":return s.jsx(Wt,{className:"w-5 h-5 text-white"});case"discord":return s.jsx(Wt,{className:"w-5 h-5 text-white"});case"twitter":case"x":return s.jsx(Wt,{className:"w-5 h-5 text-white"});case"facebook":return s.jsx(Wt,{className:"w-5 h-5 text-white"});case"apple":return s.jsx(Wt,{className:"w-5 h-5 text-white"});default:return s.jsx(Wt,{className:"w-5 h-5 text-white"})}},C=()=>{M.current&&!M.current.closed&&M.current.close(),M.current=null},A=(R,ee,F,V,K)=>{let ie=S.current.get(R);ie||(ie=new Map,S.current.set(R,ie));const ce=ie.get(F);if(ce){i(ke=>ke.map(Ie=>Ie.id===ce?{...Ie,type:ee,message:V,status:K,timestamp:new Date}:Ie));return}const pe=`session-${R}-${F}-${Date.now()}`;ie.set(F,pe),b(ee,V,K,pe)},_=(R,ee,F=0)=>{N.current.has(R)||N.current.add(R),fetch(`/api/tools/oauth/status?testSessionId=${encodeURIComponent(R)}`).then(K=>K.json()).then(K=>{if(K.hasResult){N.current.delete(R),P(K.result);return}if(F+1>=15){N.current.delete(R),A(R,"error","timeout","⌛ Timed out waiting for account creation. Check Better Auth logs.","failed"),C(),r(null),Y.error("OAuth test timed out waiting for account creation");return}setTimeout(()=>_(R,ee,F+1),2e3)}).catch(K=>{console.error("Failed to check OAuth status",K),F+1<15?setTimeout(()=>_(R,ee,F+1),2e3):(N.current.delete(R),A(R,"error","poll-error",`⚠️ Failed to check OAuth status: ${K}`,"failed"),C(),r(null),Y.error("Failed to check OAuth status"))})},P=R=>{l(!0);const ee=R.testSessionId;if(R.success){if(k.current.has(ee)&&R.userInfo)return;if(A(ee,"success","waiting","✅ Verified with Better Auth.","completed"),R.userInfo){k.current.add(ee);const F=[R.userInfo.name?`👤 ${R.userInfo.name}`:null,R.userInfo.email?`✉️ ${R.userInfo.email}`:null].filter(Boolean).join(" | "),V=F?`✅ ${R.provider} OAuth succeeded — ${F}`:`✅ ${R.provider} OAuth succeeded!`;A(ee,"success","completed",V,"completed"),A(ee,"info","timestamp",`⏰ Completed at ${new Date(R.timestamp).toLocaleTimeString()}`,"completed"),Y.success(`OAuth test for ${R.provider} passed!`),C(),r(null),S.current.delete(ee)}else A(ee,"progress","await-finalize","⌛ OAuth flow finished. Waiting for Better Auth to finalize account...","running"),N.current.has(ee)||(N.current.add(ee),_(ee,R.provider))}else{if(k.current.has(ee))return;A(ee,"error","waiting","❌ Verification failed with Better Auth.","failed");const F=R.error?` — ${R.error}`:"";A(ee,"error","failed",`❌ ${R.provider} OAuth failed${F}`,"failed"),Y.error(`OAuth test for ${R.provider} failed`),C(),r(null),S.current.delete(ee)}R.success||(k.current.add(ee),S.current.delete(ee)),sessionStorage.removeItem("oauth_test_session"),sessionStorage.removeItem(`oauth_test_result_${ee}`)};m.useEffect(()=>{const R=e.get("oauth_test_result");if(R)try{const ee=JSON.parse(decodeURIComponent(R));l(!0),P(ee),t({})}catch(ee){console.error("Failed to parse OAuth result:",ee)}},[e,t]),m.useEffect(()=>{(async()=>{try{const F=await(await fetch("/api/tools/oauth/providers")).json();F.success&&F.providers&&u(F.providers.filter(V=>V.enabled))}catch(ee){console.error("Failed to fetch OAuth providers:",ee)}})()},[]);const E=async()=>{if(h.length===0){Y.error("No OAuth providers configured"),b("error","❌ No OAuth providers found in configuration","failed"),b("info","💡 Please configure at least one OAuth provider in your Better Auth config","failed");return}d(!0)},D=async R=>{d(!1),p(""),r("test-oauth"),l(!0),i([]),b("info",`🔍 Testing ${R} OAuth...`,"running");const ee=new Date().toISOString();try{b("progress","📡 Contacting Better Auth...","running");const V=await(await fetch("/api/tools/oauth/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:R})})).json();if(V.success&&V.startUrl){S.current.delete(V.testSessionId),A(V.testSessionId,"progress","popup-open",`🌐 Opening ${V.provider} OAuth popup...`,"running");const K={testSessionId:V.testSessionId,provider:V.provider,providerId:R,startTime:ee};k.current.delete(V.testSessionId),sessionStorage.setItem("oauth_test_session",JSON.stringify(K));const ie=600,ce=700,pe=(window.screen.width-ie)/2,ke=(window.screen.height-ce)/2,Ie=window.open(V.startUrl,"oauth-test",`width=${ie},height=${ce},left=${pe},top=${ke},scrollbars=yes,resizable=yes`);if(!Ie){b("error","❌ Failed to open OAuth window. Please allow popups for this site.","failed"),b("error","💡 Check your browser popup blocker settings","failed"),Y.error("Failed to open OAuth window. Please allow popups."),r(null);return}M.current=Ie;let Ce=!1;const tt=_e=>{if(_e.origin===window.location.origin){if(_e.data&&_e.data.type==="oauth_test_state"){if(_e.data.status==="redirect")N.current.has(K.testSessionId)||_(K.testSessionId,K.provider);else if(_e.data.status==="error"){Ce=!0;const Ge=sessionStorage.getItem("oauth_test_session");let nt=V.provider;if(Ge)try{nt=JSON.parse(Ge).provider||nt}catch{}P({success:!1,provider:nt,testSessionId:_e.data.testSessionId,error:_e.data.error||"Failed to start OAuth test"}),window.removeEventListener("message",tt),clearInterval(Je),clearTimeout(Le),C()}return}if(_e.data&&_e.data.type==="oauth_test_result"){window.removeEventListener("message",tt),clearInterval(Je),clearTimeout(Le),Ce=!0;const Ge=_e.data.result;P(Ge),N.current.has(Ge.testSessionId)||_(Ge.testSessionId,Ge.provider),C()}}};window.addEventListener("message",tt);const Je=setInterval(()=>{Ie.closed&&(clearInterval(Je),clearTimeout(Le),window.removeEventListener("message",tt),!sessionStorage.getItem(`oauth_test_result_${K.testSessionId}`)&&!Ce&&(Ce=!0,_(K.testSessionId,K.provider)))},500),Le=setTimeout(()=>{Ie.closed||(clearInterval(Je),window.removeEventListener("message",tt),C(),Ce||(Ce=!0),b("error","❌ OAuth test timed out after 5 minutes","failed"),b("error","💡 Possible reasons:","failed"),b("error"," • Authentication took too long","failed"),b("error"," • Provider is not responding","failed"),b("error"," • Network connectivity issues","failed"),Y.error("OAuth test timed out"),r(null))},5*60*1e3)}else b("error",`❌ Failed to initiate OAuth test: ${V.error||"Unknown error"}`,"failed"),V.details&&b("error",`💡 Details: ${JSON.stringify(V.details)}`,"failed"),V.cause&&b("error",`💡 Cause: ${V.cause}`,"failed"),Y.error(V.error||"Failed to start OAuth test"),r(null)}catch(F){b("error",`❌ Network error: ${F}`,"failed"),Y.error("Failed to start OAuth test"),r(null)}},$=()=>{v(!0)},H=async(R,ee)=>{const F=mo.find(K=>K.id===R);if(!F){Y.error("Unknown migration provider");return}if(F.disabled){Y.info(`${F.name} migration is coming soon`);return}v(!1),r("run-migration"),l(!0),i([]);const V=K=>new Promise(ie=>setTimeout(ie,K));try{if(b("info",`🚀 Preparing ${F.name} migration...`,"running"),F.highlights)for(const ce of F.highlights)await V(350),b("progress",ce,"running");b("progress","📡 Sending migration payload to server...","running");const ie=await(await fetch("/api/tools/migrations/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:F.id,script:F.custom?ee:F.script})})).json();if(ie.success)b("progress","🚀 Migration job acknowledged. Follow server logs for live progress.","running"),b("success",`✅ ${F.name} migration request accepted.`,"completed"),ie.message&&b("info",ie.message,"completed"),Y.success(`${F.name} migration flow completed`);else throw new Error(ie.error||"Migration request failed")}catch(K){console.error("Migration execution error:",K),b("error",`❌ Migration failed: ${K}`,"failed"),Y.error("Migration failed")}finally{r(null)}},re=[{id:"test-oauth",name:"Test OAuth",description:"Test OAuth provider connections",icon:Wt,action:E,category:"oauth"},{id:"run-migration",name:"Run Migration",description:"Run database migrations",icon:Vr,action:$,category:"database"},{id:"test-db",name:"Test Database",description:"Test database connection",icon:Vr,action:async()=>{r("test-db"),l(!0),i([]),b("info","Testing database connection...","running");try{const ee=await(await fetch("/api/database/test")).json();await new Promise(F=>setTimeout(F,1e3)),b("progress","Checking on database con!","running"),ee.success?(b("success","✅ Database connection successful!","completed"),ee.result&&Array.isArray(ee.result)&&ee.result.length>0&&(b("info","📄 Sample user record (first row):","completed"),b("info",JSON.stringify(ee.result[0],null,2),"completed")),Y.success("Database connection test successful")):(b("error",`❌ Database connection failed: ${ee.error||"Unknown error"}`,"failed"),Y.error("Database connection test failed"))}catch(R){b("error",`❌ Network error: ${R}`,"failed"),Y.error("Failed to test database connection")}finally{r(null)}},category:"database"},{id:"validate-config",name:"Validate Config",description:"Validate Better Auth configuration",icon:xx,action:async()=>{r("validate-config"),l(!0),i([]),b("info","Validating Better Auth configuration...","running");try{await new Promise(R=>setTimeout(R,500)),b("progress","Checking database connection...","running"),await new Promise(R=>setTimeout(R,500)),b("progress","Validating plugins configuration...","running"),await new Promise(R=>setTimeout(R,500)),b("success","✅ Configuration is valid!","completed"),Y.success("Configuration validated successfully")}catch(R){b("error",`❌ Configuration validation failed: ${R}`,"failed"),Y.error("Configuration validation failed")}finally{r(null)}},category:"utilities"},{id:"generate-api-key",name:"Generate API Key",description:"Generate a new API key",icon:zd,action:async()=>{r("generate-api-key"),l(!0),i([]),b("info","Generating new API key...","running");try{const ee=await(await fetch("/api/tools/generate-api-key",{method:"POST",headers:{"Content-Type":"application/json"}})).json();ee.success&&ee.apiKey?(b("success","✅ API key generated successfully!","completed"),b("info",`API Key: ${ee.apiKey}`,"completed"),Y.success("API key generated successfully")):(b("error",`❌ Failed to generate API key: ${ee.error||"Unknown error"}`,"failed"),Y.error("Failed to generate API key"))}catch(R){b("error",`❌ Network error: ${R}`,"failed"),Y.error("Failed to generate API key")}finally{r(null)}},category:"utilities"},{id:"health-check",name:"Health Check",description:"Run system health check",icon:W0,action:async()=>{r("health-check"),l(!0),i([]),b("info","Running system health check...","running");try{await new Promise(R=>setTimeout(R,500)),b("progress","Checking API endpoints...","running"),await new Promise(R=>setTimeout(R,500)),b("progress","Checking database health...","running"),await new Promise(R=>setTimeout(R,500)),b("progress","Checking plugins status...","running"),await new Promise(R=>setTimeout(R,500)),b("success","✅ System health check passed!","completed"),Y.success("System health check passed")}catch(R){b("error",`❌ Health check failed: ${R}`,"failed"),Y.error("Health check failed")}finally{r(null)}},category:"testing"}],J=[{id:"oauth",name:"OAuth",icon:Wt},{id:"database",name:"Database",icon:Vr},{id:"testing",name:"Testing",icon:W0},{id:"utilities",name:"Utilities",icon:w2}].map(R=>({...R,tools:re.filter(ee=>ee.category===R.id)}));return s.jsxs("div",{className:"space-y-6 p-6 bg-black w-full min-h-screen",children:[s.jsxs("div",{className:"w-full flex flex-col",children:[s.jsxs("div",{className:"mb-8",children:[s.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[s.jsx(oj,{className:"w-8 h-8 text-white"}),s.jsx("h1",{className:"text-3xl font-light text-white",children:"Tools"})]}),s.jsx("p",{className:"text-gray-400 font-mono text-xs uppercase",children:"Utility tools for managing and testing your Better Auth setup"})]}),o&&a.length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 tracking-wider",children:"Tool Output"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsx(_a,{title:"Tool Execution Logs",lines:a,isRunning:n!==null,className:"w-full",defaultCollapsed:!1})]}),s.jsx("div",{className:"space-y-8",children:J.map(R=>s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(R.icon,{className:"w-5 h-5 text-white"}),s.jsx("h2",{className:"text-lg font-light text-white uppercase tracking-wider",children:R.name})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:R.tools.map(ee=>{const F=ee.icon,V=n===ee.id;return s.jsxs("button",{onClick:()=>ee.action(),disabled:ee.id!=="test-oauth"&&ee.id!=="test-db"||V||n!==null,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 ${ee.id!=="test-oauth"&&ee.id!=="test-db"?"opacity-60 cursor-not-allowed":"hover:bg-black/50 disabled:opacity-50 disabled:cursor-not-allowed"}`,children:[s.jsx("div",{className:"p-2 bg-white/10 rounded-none group-hover:bg-white/20 transition-colors",children:V?s.jsx(aa,{className:"w-6 h-6 text-white animate-spin"}):s.jsx(F,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-light mb-1",children:ee.name}),s.jsxs("p",{className:"text-xs uppercase font-mono flex items-center text-gray-400",children:[s.jsx(cL,{className:"w-4 h-4 mr-2"}),ee.description]})]}),ee.id!=="test-oauth"&&ee.id!=="test-db"&&s.jsx("span",{className:"absolute top-2 right-3 text-[10px] font-mono uppercase tracking-[0.2em] text-white/60",children:"Coming Soon"}),s.jsx(xs,{className:"w-4 h-4 text-gray-400 group-hover:text-white transition-colors"})]},ee.id)})})]},R.id))})]}),c&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 p-8 w-full max-w-2xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Wt,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light",children:"Select OAuth Provider"})]}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{d(!1),p("")},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-5 h-5"})})]}),s.jsx("div",{className:"space-y-4",children:h.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Wt,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),s.jsx("p",{className:"text-gray-400 mb-2 text-lg",children:"No OAuth providers configured"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Please configure OAuth providers in your Better Auth configuration"})]}):s.jsx(s.Fragment,{children:s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-4 uppercase font-mono",children:["Available Providers (",h.length,")"]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-h-96 overflow-y-auto",children:h.map(R=>s.jsxs("button",{onClick:()=>{p(R.id),setTimeout(()=>{D(R.id)},100)},className:`w-full flex items-center space-x-4 p-4 border rounded-none transition-all text-left group ${f===R.id?"border-white/50 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/30"}`,children:[s.jsx("div",{className:"flex-shrink-0",children:L(R.id)}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-white uppercase font-mono font-light text-base",children:R.name||R.id})}),s.jsx(xs,{className:`w-5 h-5 transition-colors flex-shrink-0 ${f===R.id?"text-white":"text-gray-400 group-hover:text-white"}`})]},R.id))}),s.jsx("p",{className:"text-xs text-gray-500 mt-4 font-mono uppercase",children:"Click on a provider to start the OAuth test"})]})})}),s.jsx("div",{className:"flex justify-end space-x-3 mt-8 pt-6 border-t border-dashed border-white/10",children:s.jsx(X,{variant:"outline",onClick:()=>{d(!1),p("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"})})]})}),w&&s.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/95 border border-dashed border-white/20 p-8 w-full max-w-5xl rounded-none",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Vr,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light uppercase tracking-wider",children:"Select Migration"})]}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[s.jsx("div",{className:"space-y-3",children:mo.map(R=>{const ee=(I==null?void 0:I.id)===R.id;return s.jsxs("button",{onClick:()=>B(R.id),disabled:R.disabled,className:`w-full flex items-center space-x-3 p-4 border transition-colors rounded-none text-left ${R.disabled?"border-dashed border-white/10 bg-black/30 cursor-not-allowed opacity-60":ee?"border-white/60 bg-white/10":"border-dashed border-white/20 hover:bg-white/5 hover:border-white/40"}`,children:[s.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-white/10 flex items-center justify-center",children:R.logo?R.logo:s.jsx(U0,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-white uppercase font-mono text-sm",children:R.name}),s.jsx("p",{className:"text-xs uppercase text-gray-400 font-mono mt-1 truncate",children:R.description})]}),R.disabled&&s.jsx("span",{className:"text-[10px] font-mono text-gray-400 uppercase",children:"Coming Soon"})]},R.id)})}),s.jsxs("div",{className:"md:col-span-2 space-y-4",children:[s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx("div",{className:"w-12 h-12 bg-white/10 flex items-center justify-center",children:I.logo?I.logo:s.jsx(U0,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-white -mb-2 text-lg font-light uppercase tracking-wider",children:I.name}),s.jsx("p",{className:"text-sm mt-0 text-gray-400 uppercase font-mono leading-relaxed",children:I.description}),s.jsx("div",{className:"flex items-center space-x-2",children:I.docs&&s.jsx(X,{variant:"ghost",size:"sm",asChild:!0,className:"rounded-none border border-dashed",children:s.jsx("a",{href:I.docs,target:"_blank",rel:"noreferrer",children:"View Docs"})})})]})]}),I.highlights&&s.jsx("ul",{className:"space-y-2 text-xs text-gray-300 font-mono bg-black/40 border border-white/10 p-4",children:I.highlights.map(R=>s.jsxs("li",{className:"flex items-start space-x-2",children:[s.jsx("span",{className:"text-white/60 mt-0.5",children:"•"}),s.jsx("span",{children:R})]},R))}),I.disabled?s.jsxs("div",{className:"space-y-4 text-gray-400 font-mono text-xs",children:[s.jsx("p",{children:"This migration provider is coming soon."}),s.jsxs("p",{children:["Subscribe to updates at"," ",s.jsx("a",{href:"https://better-auth.com",target:"_blank",rel:"noreferrer",className:"text-white underline",children:"better-auth.com"}),"."]})]}):I.custom?s.jsxs("div",{className:"space-y-3",children:[s.jsx("label",{className:"text-xs uppercase font-mono text-gray-400",children:"Custom Migration Script"}),s.jsx("textarea",{value:y,onChange:R=>x(R.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"}),s.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[s.jsx(X,{variant:"outline",size:"sm",className:"rounded-none",onClick:()=>x(Zh),children:"Reset"}),s.jsxs(X,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>z(y),children:[s.jsx(Cm,{className:"w-4 h-4"}),"Copy Script"]}),s.jsx(X,{className:"rounded-none",onClick:()=>H("custom",y),children:"Run Custom Script"})]})]}):s.jsxs("div",{className:"space-y-3",children:[I.script&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between text-xs uppercase font-mono text-gray-400",children:[s.jsx("span",{children:"Migration Script Preview"}),s.jsxs(X,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>z(I.script),children:[s.jsx(Cm,{className:"w-4 h-4"}),"Copy Script"]})]}),s.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:s.jsx("code",{children:I.script})})]}),s.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.jsxs(X,{className:"rounded-none",onClick:()=>H(I.id),children:["Run ",I.name," Migration"]})})]})]})]})]})})]})}function DL(){const{userId:e}=Sp(),t=Dr(),[n,r]=m.useState(null),[a,i]=m.useState([]),[o,l]=m.useState([]),[c,d]=m.useState([]),[h,u]=m.useState(!0),[f,p]=m.useState("details"),[w,v]=m.useState(!1),[j,g]=m.useState(!1),[y,x]=m.useState(!1),[b,N]=m.useState(!1),[k,S]=m.useState(""),[M,O]=m.useState(),[I,B]=m.useState(!1),[z,L]=m.useState([]),[C,A]=m.useState(!1),[_,P]=m.useState({}),E=m.useCallback(async()=>{try{const V=await(await fetch("/api/admin/status")).json();B(V.enabled)}catch{B(!1)}},[]),D=async F=>{try{const V=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:F})});if(V.ok){const K=await V.json();if(K.success&&K.location)return K.location}return null}catch{return null}},$=async F=>{const V=F.map(async ce=>{if(!_[ce.id]){const pe=await D(ce.ipAddress);if(pe)return{sessionId:ce.id,location:pe}}return null}),K=await Promise.all(V),ie={};K.forEach(ce=>{ce&&(ie[ce.sessionId]=ce.location)}),Object.keys(ie).length>0&&P(ce=>({...ce,...ie}))},H=F=>{if(!F)return"🌍";const V=F.toUpperCase().split("").map(K=>127397+K.charCodeAt(0));return String.fromCodePoint(...V)},T=m.useCallback(async()=>{try{const F=await fetch(`/api/users/${e}`);if(F.ok){const V=await F.json();r(V.user)}else Y.error("Failed to fetch user details"),t("/users")}catch{Y.error("Failed to fetch user details"),t("/users")}finally{u(!1)}},[e,t]),U=m.useCallback(async()=>{try{const[F,V,K]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(F.ok){const ie=await F.json();i(ie.memberships||[])}if(V.ok){const ie=await V.json();l(ie.memberships||[])}if(K.ok){const ce=(await K.json()).sessions||[];d(ce),$(ce)}}catch{}},[e]),G=async()=>{var ie,ce;if(!n)return;const F=(ie=document.getElementById("edit-name"))==null?void 0:ie.value,V=(ce=document.getElementById("edit-email"))==null?void 0:ce.value;if(!F||!V){Y.error("Please fill in all fields");return}const K=Y.loading("Updating user...");try{const ke=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:F,email:V})})).json();ke.success?(r({...n,name:F,email:V}),v(!1),Y.success("User updated successfully!",{id:K})):Y.error(`Error updating user: ${ke.error||"Unknown error"}`,{id:K})}catch{Y.error("Error updating user",{id:K})}},Q=async()=>{if(!n)return;if(!I){Y.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const F=Y.loading("Banning user...");try{const V=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})}),K=await V.json();V.ok?(Y.success("User banned successfully!",{id:F}),g(!1),S(""),O(void 0),T()):V.status===403?Y.error("You do not have permission to ban users. Admin role required.",{id:F}):K.adminPluginEnabled&&K.instructions?Y.error(`${K.error}`,{id:F,duration:6e3,description:`Use: ${K.instructions.example}`}):Y.error(`Error banning user: ${K.error||K.message||"Unknown error"}`,{id:F})}catch{Y.error("Error banning user",{id:F})}},re=async()=>{if(!n)return;if(!I){Y.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const F=Y.loading("Unbanning user...");try{const V=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),K=await V.json();V.ok?(Y.success("User unbanned successfully!",{id:F}),x(!1),T()):V.status===403?Y.error("You do not have permission to unban users. Admin role required.",{id:F}):K.adminPluginEnabled&&K.instructions?Y.error(`${K.error}`,{id:F,duration:6e3,description:`Use: ${K.instructions.example}`}):Y.error(`Error unbanning user: ${K.error||K.message||"Unknown error"}`,{id:F})}catch{Y.error("Error unbanning user",{id:F})}},ne=async F=>{const V=Y.loading("Removing user from organization...");try{const ie=await(await fetch(`/api/organizations/members/${F}`,{method:"DELETE"})).json();ie.success?(i(ce=>ce.filter(pe=>pe.id!==F)),Y.success("User removed from organization!",{id:V})):Y.error(`Error removing user: ${ie.error||"Unknown error"}`,{id:V})}catch{Y.error("Error removing user from organization",{id:V})}},J=async F=>{const V=Y.loading("Removing user from team...");try{const ie=await(await fetch(`/api/teams/members/${F}`,{method:"DELETE"})).json();ie.success?(l(ce=>ce.filter(pe=>pe.id!==F)),Y.success("User removed from team!",{id:V})):Y.error(`Error removing user: ${ie.error||"Unknown error"}`,{id:V})}catch{Y.error("Error removing user from team",{id:V})}},R=async F=>{const V=Y.loading("Deleting session...");try{const ie=await(await fetch(`/api/sessions/${F}`,{method:"DELETE"})).json();ie.success?(d(ce=>ce.filter(pe=>pe.id!==F)),Y.success("Session deleted successfully!",{id:V})):Y.error(`Error deleting session: ${ie.error||"Unknown error"}`,{id:V})}catch{Y.error("Error deleting session",{id:V})}};m.useEffect(()=>{e&&(T(),U(),E())},[e,E,T,U]);const ee=async(F=3)=>{if(e){L([]),A(!0),L([{id:"start",type:"info",message:`Starting session seeding process for ${F} sessions...`,timestamp:new Date}]);try{const K=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:F})})).json();if(K.success){const ie=K.results.map((pe,ke)=>pe.success?{id:`session-${ke}`,type:"progress",message:`Creating session ${ke+1}: ${pe.session.token.substring(0,20)}... from ${pe.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${ke}`,type:"error",message:`Failed to create session ${ke+1}: ${pe.error}`,timestamp:new Date});L(pe=>[...pe,...ie]);const ce=K.results.filter(pe=>pe.success).length;L(pe=>[...pe,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${ce}/${F} sessions successfully`,timestamp:new Date}]),U()}else L(ie=>[...ie,{id:"error",type:"error",message:`❌ Session seeding failed: ${K.error||"Unknown error"}`,timestamp:new Date}])}catch(V){L(K=>[...K,{id:"error",type:"error",message:`❌ Network error: ${V}`,timestamp:new Date}])}finally{A(!1)}}};return h?s.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:s.jsx("div",{className:"text-white text-lg",children:"Loading user details..."})}):n?s.jsxs("div",{className:"space-y-6 p-6 bg-black w-full",children:[s.jsxs("div",{className:"w-full flex flex-col",children:[s.jsx("span",{className:"mb-4 ml-0 flex justify-start items-start text-left border-none text-white",children:s.jsxs("span",{className:"font-light",children:[s.jsxs("span",{onClick:()=>t("/users"),className:"uppercase cursor-pointer text-white/80 font-mono text-sm",children:["users /"," "]}),s.jsx("span",{className:"text-white font-mono text-sm",children:n.id})]})}),s.jsx("div",{className:"mb-8 mt-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx("div",{className:"w-16 h-16 bg-gray-800 border border-dashed border-white/20 flex items-center justify-center",children:n.image?s.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):s.jsx(Mc,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsxs("h1",{className:"text-3xl font-light text-white inline-flex items-center",children:[n.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2 cursor-pointer hover:text-white transition-colors",onClick:()=>{navigator.clipboard.writeText(n.id),Y.success("User ID copied to clipboard")},title:"Click to copy User ID",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsxs("span",{className:"text-white/80 font-mono text-xs",children:[n.id.slice(0,8),"..."]}),s.jsx("span",{className:"ml-1",children:"]"})]}),n.banned&&s.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"})]}),s.jsx("p",{className:"text-gray-400 font-mono text-sm",children:n.email}),s.jsx("div",{className:"flex items-center space-x-2 mt-2",children:n.role&&s.jsxs("div",{className:"flex items-center space-x-1 px-2 py-1 rounded-sm text-xs font-mono bg-purple-500/20 text-purple-400",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-purple-500"}),s.jsx("span",{children:n.role})]})})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs(X,{variant:"outline",onClick:()=>v(!0),className:"border border-white/20 text-white hover:bg-white/10 rounded-none",children:[s.jsx(ja,{className:"w-4 h-4 mr-2"}),"Edit User"]}),n.banned?s.jsxs(X,{variant:"outline",onClick:()=>x(!0),className:"border border-green-400/20 text-green-400 hover:bg-green-400/10 rounded-none",disabled:!I,children:[s.jsx(Qh,{className:"w-4 h-4 mr-2"}),"Unban User"]}):s.jsxs(X,{variant:"outline",onClick:()=>g(!0),className:"border border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",disabled:!I,children:[s.jsx(Qh,{className:"w-4 h-4 mr-2"}),"Ban User"]})]})]})}),s.jsxs("div",{className:"border border-dashed border-white/10 rounded-none",children:[s.jsx("div",{className:"border-b border-dashed border-white/10",children:s.jsx("nav",{className:"flex space-x-8 px-6",children:[{id:"details",name:"Details",icon:Mc},{id:"organizations",name:"Organizations",icon:Fn,count:a.length},{id:"teams",name:"Teams",icon:Ze,count:o.length},{id:"sessions",name:"Sessions",icon:F0,count:c.length}].map(F=>s.jsxs("button",{onClick:()=>p(F.id),className:`flex items-center space-x-2 py-4 px-2 border-b-2 font-medium text-sm ${f===F.id?"border-white text-white":"border-transparent text-gray-400 hover:text-white hover:border-white/50"}`,children:[s.jsx(F.icon,{className:"w-4 h-4 text-white/90"}),s.jsxs("span",{className:"inline-flex items-start",children:[s.jsx("span",{className:"",children:F.name}),F.count!==void 0&&s.jsxs("sup",{className:"text-xs text-gray-500 ml-1",children:[s.jsx("span",{className:"mr-0.5",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:F.count}),s.jsx("span",{className:"ml-0.5",children:"]"})]})]})]},F.id))})}),s.jsxs("div",{className:"p-6",children:[f==="details"&&s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[s.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"BASIC INFORMATION"}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(Mc,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),s.jsx("div",{className:"text-white font-sans text-sm",children:n.name.toLowerCase().replace(/\s+/g,"")})]})]}),s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(Ir,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Email"}),s.jsx("div",{className:"text-white font-mono text-sm",children:n.email})]})]}),n.username&&s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(pL,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Username"}),s.jsx("div",{className:"text-white font-mono text-sm",children:n.username})]})]}),n.phoneNumber&&s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(mL,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Phone"}),s.jsx("div",{className:"text-white font-mono text-sm",children:"+251 91 234 5678"})]})]}),s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(qn,{className:"w-4 h-4 text-gray-400 mt-1"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500 mb-1",children:"Member Since"}),s.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"})})]})]})]})]}),s.jsxs("div",{className:"overflow-x-hidden bg-white/[3%] border border-white/10 p-6 rounded-none",children:[s.jsx("h3",{className:"text-sm uppercase font-mono text-gray-400 mb-4 tracking-wider",children:"SECURITY"}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed my-4"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ir,{className:"w-4 h-4 text-gray-400"}),s.jsx("div",{children:s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Email Verification"})})]}),s.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"})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 bg-black/30 border border-white/5 rounded-none",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Vr,{className:"w-4 h-4 text-gray-400"}),s.jsx("div",{children:s.jsx("div",{className:"text-xs uppercase font-mono text-gray-500",children:"Two-Factor Authentication"})})]}),s.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"})]})]})]})]}),f==="organizations"&&s.jsx("div",{className:"space-y-4",children:a.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Fn,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Organizations"}),s.jsx("p",{className:"text-gray-400",children:"This user is not a member of any organizations."})]}):s.jsx("div",{className:"grid gap-4",children:a.map(F=>s.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[s.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:F.organization.image?s.jsx("img",{src:F.organization.image,alt:F.organization.name,className:"w-12 h-12 object-cover"}):s.jsx(Fn,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[F.organization.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:F.organization.slug}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in ",F.organization.slug]})]})]}),s.jsx("div",{className:"flex flex-col items-end space-y-2",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),s.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(F.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(F.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(X,{variant:"outline",size:"sm",onClick:()=>ne(F.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[s.jsx(Lv,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},F.id))})}),f==="teams"&&s.jsx("div",{className:"space-y-4",children:o.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ze,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Teams"}),s.jsx("p",{className:"text-gray-400",children:"This user is not a member of any teams."})]}):s.jsx("div",{className:"grid gap-4",children:o.map(F=>s.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[s.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:s.jsx(Ze,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:[F.team.name,s.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:F.team.organizationSlug||F.team.organizationName}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsxs("p",{className:"text-gray-400 text-sm font-sans mt-1",children:["in"," ",F.team.organizationSlug||F.team.organizationName]})]})]}),s.jsx("div",{className:"flex flex-col items-end space-y-2",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Joined:"," "]}),s.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(F.joinedAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(F.joinedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(X,{variant:"outline",size:"sm",onClick:()=>J(F.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[s.jsx(Lv,{className:"w-4 h-4 mr-1"}),"Remove"]})})]},F.id))})}),f==="sessions"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium text-white",children:"Sessions"}),s.jsx("p",{className:"text-gray-400 text-sm",children:"Manage user authentication sessions"})]}),s.jsxs(X,{variant:"outline",onClick:()=>{L([]),A(!1),N(!0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:[s.jsx(Vr,{className:"w-4 h-4 mr-2"}),"Seed Sessions"]})]}),c.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(F0,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Sessions"}),s.jsx("p",{className:"text-gray-400",children:"This user has no active sessions."})]}):s.jsx("div",{className:"grid gap-4",children:c.map(F=>{var V,K,ie,ce;return s.jsxs("div",{className:"border border-dashed border-white/10 rounded-none p-4 hover:bg-white/5 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-3",children:[s.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[s.jsx("div",{className:"w-12 h-12 bg-black/80 border border-dashed border-white/20 flex items-center justify-center rounded-none",children:s.jsx(Iv,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("h3",{className:"text-white font-light inline-flex items-start",children:["Session ",F.id.substring(0,8),"...",s.jsxs("sup",{className:"text-xs text-gray-500 ml-2 mt-0.5",children:[s.jsx("span",{className:"mr-1",children:"["}),s.jsx("span",{className:"text-white/80 font-mono text-xs",children:F.ipAddress}),s.jsx("span",{className:"ml-1",children:"]"})]})]}),s.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[s.jsx(fL,{className:"w-3.5 h-3.5 text-gray-400"}),s.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((V=_[F.id])==null?void 0:V.city)||"...",","," ",((K=_[F.id])==null?void 0:K.country)||"..."]}),((ie=_[F.id])==null?void 0:ie.countryCode)&&s.jsx("span",{className:"text-xs ml-1",children:H((ce=_[F.id])==null?void 0:ce.countryCode)})]})]})]}),s.jsx("div",{className:"flex flex-col items-end space-y-2",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("span",{className:"text-gray-500 font-mono text-xs uppercase",children:["Expires:"," "]}),s.jsxs("span",{className:"text-white font-mono text-xs",children:[new Date(F.expiresAt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),","," ",new Date(F.expiresAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]})]})})]}),s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(X,{variant:"outline",size:"sm",onClick:()=>R(F.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[s.jsx(Qh,{className:"w-4 h-4 mr-1"}),"Revoke"]})})]},F.id)})})]})]})]})]}),w&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black/90 border border-dashed border-white/20 rounded-none p-6 w-full max-w-md",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg text-white font-light",children:"Edit User"}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:"×"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.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?s.jsx("img",{src:n.image,alt:n.name,className:"w-16 h-16 object-cover"}):s.jsx(Mc,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h4",{className:"text-white font-medium",children:n==null?void 0:n.name}),s.jsx("p",{className:"text-gray-400 text-sm",children:n==null?void 0:n.email})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Name"}),s.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"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Email"}),s.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"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-2 mt-6",children:[s.jsx(X,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:G,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),j&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-red-400/20 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Ban User"}),s.jsxs("p",{className:"text-gray-400 mb-4",children:["Ban ",s.jsx("strong",{children:n.name})," from accessing the system."]}),s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),s.jsx(Re,{id:"banReason",value:k,onChange:F=>S(F.target.value),placeholder:"Enter reason for ban (optional)",className:"bg-black border border-dashed border-white/20 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(Ve,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),s.jsx(Re,{id:"banExpires",type:"number",value:M||"",onChange:F=>O(F.target.value?Number(F.target.value):void 0),placeholder:"Leave empty for permanent ban",className:"bg-black border border-dashed border-white/20 text-white rounded-none"}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Examples: 3600 (1 hour), 86400 (1 day), 604800 (1 week)"})]})]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(X,{variant:"outline",onClick:()=>{g(!1),S(""),O(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:Q,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),y&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-black border border-green-400/20 rounded-none p-6 w-full max-w-md",children:[s.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Unban User"}),s.jsxs("p",{className:"text-gray-400 mb-6",children:["Are you sure you want to unban ",s.jsx("strong",{children:n.name}),"? This will restore their access to the system."]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(X,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(X,{onClick:re,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),b&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:s.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:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("h3",{className:"text-sm text-white flex items-center justify-center font-light uppercase",children:[s.jsx("span",{className:"text-white/50 mr-2",children:"["}),s.jsx(Iv,{className:"inline mr-2 w-3 h-3 text-white"}),s.jsx("span",{className:"font-mono text-white/70 uppercase",children:"Seed Sessions"}),s.jsx("span",{className:"text-white/50 ml-2",children:"]"})]}),s.jsx(X,{variant:"ghost",size:"sm",onClick:()=>N(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Gt,{className:"w-4 h-4"})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed -mt-4 mb-4"}),s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(Ve,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),s.jsx(Re,{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"})]}),s.jsx(X,{onClick:()=>{var V;const F=parseInt(((V=document.getElementById("session-count"))==null?void 0:V.value)||"3",10);ee(F)},disabled:C,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:C?s.jsxs(s.Fragment,{children:[s.jsx(aa,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Vr,{className:"w-3 h-3 mr-2"}),"Seed Sessions"]})})]})}),z.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(_a,{title:"Session Seeding Terminal",lines:z,isRunning:C,className:"w-full",defaultCollapsed:!0})})]}),s.jsx("hr",{className:"border-white/10 -mx-10 border-dashed mt-10"}),s.jsx("div",{className:"flex justify-end mt-6 pt-6",children:s.jsx(X,{variant:"outline",onClick:()=>N(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Close"})})]})})]}):s.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:s.jsx("div",{className:"text-white text-lg",children:"User not found"})})}function _L(){return s.jsx(i6,{children:s.jsxs(q4,{children:[s.jsx(Uz,{children:s.jsxs(F4,{children:[s.jsx(tn,{path:"/",element:s.jsx(vL,{})}),s.jsx(tn,{path:"/users",element:s.jsx(N2,{})}),s.jsx(tn,{path:"/users/:userId",element:s.jsx(DL,{})}),s.jsx(tn,{path:"/organizations",element:s.jsx(j2,{})}),s.jsx(tn,{path:"/organizations/:orgId",element:s.jsx(NL,{})}),s.jsx(tn,{path:"/teams",element:s.jsx(EL,{})}),s.jsx(tn,{path:"/teams/:teamId",element:s.jsx(Wv,{})}),s.jsx(tn,{path:"/organizations/:orgId/teams/:teamId",element:s.jsx(Wv,{})}),s.jsx(tn,{path:"/sessions",element:s.jsx(kL,{})}),s.jsx(tn,{path:"/database",element:s.jsx(bL,{})}),s.jsx(tn,{path:"/database/demo",element:s.jsx(a6,{})}),s.jsx(tn,{path:"/tools",element:s.jsx(ML,{})}),s.jsx(tn,{path:"/settings",element:s.jsx(CL,{})})]})}),s.jsx(SC,{theme:"dark",position:"top-right",richColors:!0,closeButton:!0})]})})}Jh.createRoot(document.getElementById("root")).render(s.jsx(Z.StrictMode,{children:s.jsx(_L,{})}));