better-auth-studio 1.0.36 → 1.0.38

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,669 +0,0 @@
1
- function dk(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 Km(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mw={exports:{}},iu={},_w={exports:{}},Re={};/**
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 El=Symbol.for("react.element"),uk=Symbol.for("react.portal"),hk=Symbol.for("react.fragment"),fk=Symbol.for("react.strict_mode"),mk=Symbol.for("react.profiler"),pk=Symbol.for("react.provider"),xk=Symbol.for("react.context"),gk=Symbol.for("react.forward_ref"),vk=Symbol.for("react.suspense"),wk=Symbol.for("react.memo"),yk=Symbol.for("react.lazy"),Xx=Symbol.iterator;function bk(e){return e===null||typeof e!="object"?null:(e=Xx&&e[Xx]||e["@@iterator"],typeof e=="function"?e:null)}var Dw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Tw=Object.assign,Pw={};function Vi(e,t,n){this.props=e,this.context=t,this.refs=Pw,this.updater=n||Dw}Vi.prototype.isReactComponent={};Vi.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")};Vi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Aw(){}Aw.prototype=Vi.prototype;function Qm(e,t,n){this.props=e,this.context=t,this.refs=Pw,this.updater=n||Dw}var Zm=Qm.prototype=new Aw;Zm.constructor=Qm;Tw(Zm,Vi.prototype);Zm.isPureReactComponent=!0;var qx=Array.isArray,Ow=Object.prototype.hasOwnProperty,Jm={current:null},zw={key:!0,ref:!0,__self:!0,__source:!0};function $w(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)Ow.call(t,r)&&!zw.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:El,type:e,key:i,ref:o,props:a,_owner:Jm.current}}function Nk(e,t){return{$$typeof:El,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ep(e){return typeof e=="object"&&e!==null&&e.$$typeof===El}function jk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Gx=/\/+/g;function uh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?jk(""+e.key):t.toString(36)}function Uc(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 El:case uk:o=!0}}if(o)return o=e,a=a(o),e=r===""?"."+uh(o,0):r,qx(a)?(n="",e!=null&&(n=e.replace(Gx,"$&/")+"/"),Uc(a,t,n,"",function(d){return d})):a!=null&&(ep(a)&&(a=Nk(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(Gx,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",qx(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+uh(i,l);o+=Uc(i,t,n,c,a)}else if(c=bk(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+uh(i,l++),o+=Uc(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 tc(e,t,n){if(e==null)return e;var r=[],a=0;return Uc(e,r,"","",function(i){return t.call(n,i,a++)}),r}function kk(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 Zt={current:null},Bc={transition:null},Sk={ReactCurrentDispatcher:Zt,ReactCurrentBatchConfig:Bc,ReactCurrentOwner:Jm};function Rw(){throw Error("act(...) is not supported in production builds of React.")}Re.Children={map:tc,forEach:function(e,t,n){tc(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return tc(e,function(){t++}),t},toArray:function(e){return tc(e,function(t){return t})||[]},only:function(e){if(!ep(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Re.Component=Vi;Re.Fragment=hk;Re.Profiler=mk;Re.PureComponent=Qm;Re.StrictMode=fk;Re.Suspense=vk;Re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Sk;Re.act=Rw;Re.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=Tw({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Jm.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Ow.call(t,c)&&!zw.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:El,type:e.type,key:a,ref:i,props:r,_owner:o}};Re.createContext=function(e){return e={$$typeof:xk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:pk,_context:e},e.Consumer=e};Re.createElement=$w;Re.createFactory=function(e){var t=$w.bind(null,e);return t.type=e,t};Re.createRef=function(){return{current:null}};Re.forwardRef=function(e){return{$$typeof:gk,render:e}};Re.isValidElement=ep;Re.lazy=function(e){return{$$typeof:yk,_payload:{_status:-1,_result:e},_init:kk}};Re.memo=function(e,t){return{$$typeof:wk,type:e,compare:t===void 0?null:t}};Re.startTransition=function(e){var t=Bc.transition;Bc.transition={};try{e()}finally{Bc.transition=t}};Re.unstable_act=Rw;Re.useCallback=function(e,t){return Zt.current.useCallback(e,t)};Re.useContext=function(e){return Zt.current.useContext(e)};Re.useDebugValue=function(){};Re.useDeferredValue=function(e){return Zt.current.useDeferredValue(e)};Re.useEffect=function(e,t){return Zt.current.useEffect(e,t)};Re.useId=function(){return Zt.current.useId()};Re.useImperativeHandle=function(e,t,n){return Zt.current.useImperativeHandle(e,t,n)};Re.useInsertionEffect=function(e,t){return Zt.current.useInsertionEffect(e,t)};Re.useLayoutEffect=function(e,t){return Zt.current.useLayoutEffect(e,t)};Re.useMemo=function(e,t){return Zt.current.useMemo(e,t)};Re.useReducer=function(e,t,n){return Zt.current.useReducer(e,t,n)};Re.useRef=function(e){return Zt.current.useRef(e)};Re.useState=function(e){return Zt.current.useState(e)};Re.useSyncExternalStore=function(e,t,n){return Zt.current.useSyncExternalStore(e,t,n)};Re.useTransition=function(){return Zt.current.useTransition()};Re.version="18.3.1";_w.exports=Re;var m=_w.exports;const Q=Km(m),tp=dk({__proto__:null,default:Q},[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 Ck=m,Ek=Symbol.for("react.element"),Mk=Symbol.for("react.fragment"),_k=Object.prototype.hasOwnProperty,Dk=Ck.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Tk={key:!0,ref:!0,__self:!0,__source:!0};function Iw(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)_k.call(t,r)&&!Tk.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:Ek,type:e,key:i,ref:o,props:a,_owner:Dk.current}}iu.Fragment=Mk;iu.jsx=Iw;iu.jsxs=Iw;Mw.exports=iu;var s=Mw.exports,bf={},Lw={exports:{}},kn={},Fw={exports:{}},Uw={};/**
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(C,_){var z=C.length;C.push(_);e:for(;0<z;){var H=z-1>>>1,P=C[H];if(0<a(P,_))C[H]=_,C[z]=P,z=H;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var _=C[0],z=C.pop();if(z!==_){C[0]=z;e:for(var H=0,P=C.length,B=P>>>1;H<B;){var q=2*(H+1)-1,G=C[q],se=q+1,re=C[se];if(0>a(G,z))se<P&&0>a(re,G)?(C[H]=re,C[se]=z,H=se):(C[H]=G,C[q]=z,H=q);else if(se<P&&0>a(re,z))C[H]=re,C[se]=z,H=se;else break e}}return _}function a(C,_){var z=C.sortIndex-_.sortIndex;return z!==0?z:C.id-_.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,b=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(C){for(var _=n(d);_!==null;){if(_.callback===null)r(d);else if(_.startTime<=C)r(d),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(d)}}function N(C){if(v=!1,x(C),!w)if(n(c)!==null)w=!0,D(j);else{var _=n(d);_!==null&&T(N,_.startTime-C)}}function j(C,_){w=!1,v&&(v=!1,g(M),M=-1),p=!0;var z=f;try{for(x(_),u=n(c);u!==null&&(!(u.expirationTime>_)||C&&!U());){var H=u.callback;if(typeof H=="function"){u.callback=null,f=u.priorityLevel;var P=H(u.expirationTime<=_);_=e.unstable_now(),typeof P=="function"?u.callback=P:u===n(c)&&r(c),x(_)}else r(c);u=n(c)}if(u!==null)var B=!0;else{var q=n(d);q!==null&&T(N,q.startTime-_),B=!1}return B}finally{u=null,f=z,p=!1}}var k=!1,S=null,M=-1,A=5,I=-1;function U(){return!(e.unstable_now()-I<A)}function $(){if(S!==null){var C=e.unstable_now();I=C;var _=!0;try{_=S(!0,C)}finally{_?L():(k=!1,S=null)}}else k=!1}var L;if(typeof y=="function")L=function(){y($)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,O=E.port2;E.port1.onmessage=$,L=function(){O.postMessage(null)}}else L=function(){b($,0)};function D(C){S=C,k||(k=!0,L())}function T(C,_){M=b(function(){C(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){w||p||(w=!0,D(j))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(C){switch(f){case 1:case 2:case 3:var _=3;break;default:_=f}var z=f;f=_;try{return C()}finally{f=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,_){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var z=f;f=C;try{return _()}finally{f=z}},e.unstable_scheduleCallback=function(C,_,z){var H=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?H+z:H):z=H,C){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=z+P,C={id:h++,callback:_,priorityLevel:C,startTime:z,expirationTime:P,sortIndex:-1},z>H?(C.sortIndex=z,t(d,C),n(c)===null&&C===n(d)&&(v?(g(M),M=-1):v=!0,T(N,z-H))):(C.sortIndex=P,t(c,C),w||p||(w=!0,D(j))),C},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(C){var _=f;return function(){var z=f;f=_;try{return C.apply(this,arguments)}finally{f=z}}}})(Uw);Fw.exports=Uw;var Pk=Fw.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 Ak=m,bn=Pk;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 Bw=new Set,Xo={};function za(e,t){Si(e,t),Si(e+"Capture",t)}function Si(e,t){for(Xo[e]=t,e=0;e<t.length;e++)Bw.add(t[e])}var qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nf=Object.prototype.hasOwnProperty,Ok=/^[: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]*$/,Kx={},Qx={};function zk(e){return Nf.call(Qx,e)?!0:Nf.call(Kx,e)?!1:Ok.test(e)?Qx[e]=!0:(Kx[e]=!0,!1)}function $k(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 Rk(e,t,n,r){if(t===null||typeof t>"u"||$k(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 Jt(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 Ft={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ft[e]=new Jt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ft[t]=new Jt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ft[e]=new Jt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ft[e]=new Jt(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){Ft[e]=new Jt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ft[e]=new Jt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ft[e]=new Jt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ft[e]=new Jt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ft[e]=new Jt(e,5,!1,e.toLowerCase(),null,!1,!1)});var np=/[\-:]([a-z])/g;function rp(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(np,rp);Ft[t]=new Jt(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(np,rp);Ft[t]=new Jt(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(np,rp);Ft[t]=new Jt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ft[e]=new Jt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ft.xlinkHref=new Jt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ft[e]=new Jt(e,1,!1,e.toLowerCase(),null,!0,!0)});function sp(e,t,n,r){var a=Ft.hasOwnProperty(t)?Ft[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Rk(t,n,a,r)&&(n=null),r||a===null?zk(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 ts=Ak.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nc=Symbol.for("react.element"),Ja=Symbol.for("react.portal"),ei=Symbol.for("react.fragment"),ap=Symbol.for("react.strict_mode"),jf=Symbol.for("react.profiler"),Ww=Symbol.for("react.provider"),Hw=Symbol.for("react.context"),ip=Symbol.for("react.forward_ref"),kf=Symbol.for("react.suspense"),Sf=Symbol.for("react.suspense_list"),op=Symbol.for("react.memo"),gs=Symbol.for("react.lazy"),Vw=Symbol.for("react.offscreen"),Zx=Symbol.iterator;function oo(e){return e===null||typeof e!="object"?null:(e=Zx&&e[Zx]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Object.assign,hh;function Mo(e){if(hh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);hh=t&&t[1]||""}return`
34
- `+hh+e}var fh=!1;function mh(e,t){if(!e||fh)return"";fh=!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{fh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Mo(e):""}function Ik(e){switch(e.tag){case 5:return Mo(e.type);case 16:return Mo("Lazy");case 13:return Mo("Suspense");case 19:return Mo("SuspenseList");case 0:case 2:case 15:return e=mh(e.type,!1),e;case 11:return e=mh(e.type.render,!1),e;case 1:return e=mh(e.type,!0),e;default:return""}}function Cf(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 ei:return"Fragment";case Ja:return"Portal";case jf:return"Profiler";case ap:return"StrictMode";case kf:return"Suspense";case Sf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Hw:return(e.displayName||"Context")+".Consumer";case Ww:return(e._context.displayName||"Context")+".Provider";case ip:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case op:return t=e.displayName||null,t!==null?t:Cf(e.type)||"Memo";case gs:t=e._payload,e=e._init;try{return Cf(e(t))}catch{}}return null}function Lk(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 Cf(t);case 8:return t===ap?"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 Rs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fk(e){var t=Yw(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 rc(e){e._valueTracker||(e._valueTracker=Fk(e))}function Xw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Yw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function dd(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 Ef(e,t){var n=t.checked;return xt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Jx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Rs(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 qw(e,t){t=t.checked,t!=null&&sp(e,"checked",t,!1)}function Mf(e,t){qw(e,t);var n=Rs(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")?_f(e,t.type,n):t.hasOwnProperty("defaultValue")&&_f(e,t.type,Rs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function eg(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 _f(e,t,n){(t!=="number"||dd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var _o=Array.isArray;function fi(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=""+Rs(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 Df(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(oe(91));return xt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function tg(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(_o(n)){if(1<n.length)throw Error(oe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Rs(n)}}function Gw(e,t){var n=Rs(t.value),r=Rs(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 ng(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Kw(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 Tf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Kw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var sc,Qw=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(sc=sc||document.createElement("div"),sc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=sc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function qo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zo={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},Uk=["Webkit","ms","Moz","O"];Object.keys(zo).forEach(function(e){Uk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zo[t]=zo[e]})});function Zw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zo.hasOwnProperty(e)&&zo[e]?(""+t).trim():t+"px"}function Jw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=Zw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var Bk=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 Pf(e,t){if(t){if(Bk[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 Af(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 Of=null;function lp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zf=null,mi=null,pi=null;function rg(e){if(e=Dl(e)){if(typeof zf!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=uu(t),zf(e.stateNode,e.type,t))}}function ey(e){mi?pi?pi.push(e):pi=[e]:mi=e}function ty(){if(mi){var e=mi,t=pi;if(pi=mi=null,rg(e),t)for(e=0;e<t.length;e++)rg(t[e])}}function ny(e,t){return e(t)}function ry(){}var ph=!1;function sy(e,t,n){if(ph)return e(t,n);ph=!0;try{return ny(e,t,n)}finally{ph=!1,(mi!==null||pi!==null)&&(ry(),ty())}}function Go(e,t){var n=e.stateNode;if(n===null)return null;var r=uu(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 $f=!1;if(qr)try{var lo={};Object.defineProperty(lo,"passive",{get:function(){$f=!0}}),window.addEventListener("test",lo,lo),window.removeEventListener("test",lo,lo)}catch{$f=!1}function Wk(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 $o=!1,ud=null,hd=!1,Rf=null,Hk={onError:function(e){$o=!0,ud=e}};function Vk(e,t,n,r,a,i,o,l,c){$o=!1,ud=null,Wk.apply(Hk,arguments)}function Yk(e,t,n,r,a,i,o,l,c){if(Vk.apply(this,arguments),$o){if($o){var d=ud;$o=!1,ud=null}else throw Error(oe(198));hd||(hd=!0,Rf=d)}}function $a(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 ay(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 sg(e){if($a(e)!==e)throw Error(oe(188))}function Xk(e){var t=e.alternate;if(!t){if(t=$a(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 sg(a),e;if(i===r)return sg(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 iy(e){return e=Xk(e),e!==null?oy(e):null}function oy(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=oy(e);if(t!==null)return t;e=e.sibling}return null}var ly=bn.unstable_scheduleCallback,ag=bn.unstable_cancelCallback,qk=bn.unstable_shouldYield,Gk=bn.unstable_requestPaint,yt=bn.unstable_now,Kk=bn.unstable_getCurrentPriorityLevel,cp=bn.unstable_ImmediatePriority,cy=bn.unstable_UserBlockingPriority,fd=bn.unstable_NormalPriority,Qk=bn.unstable_LowPriority,dy=bn.unstable_IdlePriority,ou=null,jr=null;function Zk(e){if(jr&&typeof jr.onCommitFiberRoot=="function")try{jr.onCommitFiberRoot(ou,e,void 0,(e.current.flags&128)===128)}catch{}}var er=Math.clz32?Math.clz32:tS,Jk=Math.log,eS=Math.LN2;function tS(e){return e>>>=0,e===0?32:31-(Jk(e)/eS|0)|0}var ac=64,ic=4194304;function Do(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 md(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=Do(l):(i&=o,i!==0&&(r=Do(i)))}else o=n&~a,o!==0?r=Do(o):i!==0&&(r=Do(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-er(t),a=1<<n,r|=e[n],t&=~a;return r}function nS(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 rS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-er(i),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=nS(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function If(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function uy(){var e=ac;return ac<<=1,!(ac&4194240)&&(ac=64),e}function xh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ml(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-er(t),e[t]=n}function sS(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-er(n),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~i}}function dp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-er(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var qe=0;function hy(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var fy,up,my,py,xy,Lf=!1,oc=[],Cs=null,Es=null,Ms=null,Ko=new Map,Qo=new Map,ys=[],aS="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 ig(e,t){switch(e){case"focusin":case"focusout":Cs=null;break;case"dragenter":case"dragleave":Es=null;break;case"mouseover":case"mouseout":Ms=null;break;case"pointerover":case"pointerout":Ko.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qo.delete(t.pointerId)}}function co(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=Dl(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function iS(e,t,n,r,a){switch(t){case"focusin":return Cs=co(Cs,e,t,n,r,a),!0;case"dragenter":return Es=co(Es,e,t,n,r,a),!0;case"mouseover":return Ms=co(Ms,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return Ko.set(i,co(Ko.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Qo.set(i,co(Qo.get(i)||null,e,t,n,r,a)),!0}return!1}function gy(e){var t=sa(e.target);if(t!==null){var n=$a(t);if(n!==null){if(t=n.tag,t===13){if(t=ay(n),t!==null){e.blockedOn=t,xy(e.priority,function(){my(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 Wc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ff(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Of=r,n.target.dispatchEvent(r),Of=null}else return t=Dl(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function og(e,t,n){Wc(e)&&n.delete(t)}function oS(){Lf=!1,Cs!==null&&Wc(Cs)&&(Cs=null),Es!==null&&Wc(Es)&&(Es=null),Ms!==null&&Wc(Ms)&&(Ms=null),Ko.forEach(og),Qo.forEach(og)}function uo(e,t){e.blockedOn===t&&(e.blockedOn=null,Lf||(Lf=!0,bn.unstable_scheduleCallback(bn.unstable_NormalPriority,oS)))}function Zo(e){function t(a){return uo(a,e)}if(0<oc.length){uo(oc[0],e);for(var n=1;n<oc.length;n++){var r=oc[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Cs!==null&&uo(Cs,e),Es!==null&&uo(Es,e),Ms!==null&&uo(Ms,e),Ko.forEach(t),Qo.forEach(t),n=0;n<ys.length;n++)r=ys[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ys.length&&(n=ys[0],n.blockedOn===null);)gy(n),n.blockedOn===null&&ys.shift()}var xi=ts.ReactCurrentBatchConfig,pd=!0;function lS(e,t,n,r){var a=qe,i=xi.transition;xi.transition=null;try{qe=1,hp(e,t,n,r)}finally{qe=a,xi.transition=i}}function cS(e,t,n,r){var a=qe,i=xi.transition;xi.transition=null;try{qe=4,hp(e,t,n,r)}finally{qe=a,xi.transition=i}}function hp(e,t,n,r){if(pd){var a=Ff(e,t,n,r);if(a===null)Ch(e,t,r,xd,n),ig(e,r);else if(iS(a,e,t,n,r))r.stopPropagation();else if(ig(e,r),t&4&&-1<aS.indexOf(e)){for(;a!==null;){var i=Dl(a);if(i!==null&&fy(i),i=Ff(e,t,n,r),i===null&&Ch(e,t,r,xd,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else Ch(e,t,r,null,n)}}var xd=null;function Ff(e,t,n,r){if(xd=null,e=lp(r),e=sa(e),e!==null)if(t=$a(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ay(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 xd=e,null}function vy(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(Kk()){case cp:return 1;case cy:return 4;case fd:case Qk:return 16;case dy:return 536870912;default:return 16}default:return 16}}var js=null,fp=null,Hc=null;function wy(){if(Hc)return Hc;var e,t=fp,n=t.length,r,a="value"in js?js.value:js.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 Hc=a.slice(e,1<r?1-r:void 0)}function Vc(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 lc(){return!0}function lg(){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)?lc:lg,this.isPropagationStopped=lg,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=lc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=lc)},persist:function(){},isPersistent:lc}),t}var Yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mp=Sn(Yi),_l=xt({},Yi,{view:0,detail:0}),dS=Sn(_l),gh,vh,ho,lu=xt({},_l,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pp,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!==ho&&(ho&&e.type==="mousemove"?(gh=e.screenX-ho.screenX,vh=e.screenY-ho.screenY):vh=gh=0,ho=e),gh)},movementY:function(e){return"movementY"in e?e.movementY:vh}}),cg=Sn(lu),uS=xt({},lu,{dataTransfer:0}),hS=Sn(uS),fS=xt({},_l,{relatedTarget:0}),wh=Sn(fS),mS=xt({},Yi,{animationName:0,elapsedTime:0,pseudoElement:0}),pS=Sn(mS),xS=xt({},Yi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),gS=Sn(xS),vS=xt({},Yi,{data:0}),dg=Sn(vS),wS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yS={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"},bS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bS[e])?!!t[e]:!1}function pp(){return NS}var jS=xt({},_l,{key:function(e){if(e.key){var t=wS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pp,charCode:function(e){return e.type==="keypress"?Vc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kS=Sn(jS),SS=xt({},lu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ug=Sn(SS),CS=xt({},_l,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pp}),ES=Sn(CS),MS=xt({},Yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),_S=Sn(MS),DS=xt({},lu,{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}),TS=Sn(DS),PS=[9,13,27,32],xp=qr&&"CompositionEvent"in window,Ro=null;qr&&"documentMode"in document&&(Ro=document.documentMode);var AS=qr&&"TextEvent"in window&&!Ro,yy=qr&&(!xp||Ro&&8<Ro&&11>=Ro),hg=" ",fg=!1;function by(e,t){switch(e){case"keyup":return PS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ny(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ti=!1;function OS(e,t){switch(e){case"compositionend":return Ny(t);case"keypress":return t.which!==32?null:(fg=!0,hg);case"textInput":return e=t.data,e===hg&&fg?null:e;default:return null}}function zS(e,t){if(ti)return e==="compositionend"||!xp&&by(e,t)?(e=wy(),Hc=fp=js=null,ti=!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 yy&&t.locale!=="ko"?null:t.data;default:return null}}var $S={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 mg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$S[e.type]:t==="textarea"}function jy(e,t,n,r){ey(r),t=gd(t,"onChange"),0<t.length&&(n=new mp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Io=null,Jo=null;function RS(e){Oy(e,0)}function cu(e){var t=si(e);if(Xw(t))return e}function IS(e,t){if(e==="change")return t}var ky=!1;if(qr){var yh;if(qr){var bh="oninput"in document;if(!bh){var pg=document.createElement("div");pg.setAttribute("oninput","return;"),bh=typeof pg.oninput=="function"}yh=bh}else yh=!1;ky=yh&&(!document.documentMode||9<document.documentMode)}function xg(){Io&&(Io.detachEvent("onpropertychange",Sy),Jo=Io=null)}function Sy(e){if(e.propertyName==="value"&&cu(Jo)){var t=[];jy(t,Jo,e,lp(e)),sy(RS,t)}}function LS(e,t,n){e==="focusin"?(xg(),Io=t,Jo=n,Io.attachEvent("onpropertychange",Sy)):e==="focusout"&&xg()}function FS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return cu(Jo)}function US(e,t){if(e==="click")return cu(t)}function BS(e,t){if(e==="input"||e==="change")return cu(t)}function WS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rr=typeof Object.is=="function"?Object.is:WS;function el(e,t){if(rr(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(!Nf.call(t,a)||!rr(e[a],t[a]))return!1}return!0}function gg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vg(e,t){var n=gg(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=gg(n)}}function Cy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ey(){for(var e=window,t=dd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=dd(e.document)}return t}function gp(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 HS(e){var t=Ey(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cy(n.ownerDocument.documentElement,n)){if(r!==null&&gp(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=vg(n,i);var o=vg(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 VS=qr&&"documentMode"in document&&11>=document.documentMode,ni=null,Uf=null,Lo=null,Bf=!1;function wg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bf||ni==null||ni!==dd(r)||(r=ni,"selectionStart"in r&&gp(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}),Lo&&el(Lo,r)||(Lo=r,r=gd(Uf,"onSelect"),0<r.length&&(t=new mp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ni)))}function cc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ri={animationend:cc("Animation","AnimationEnd"),animationiteration:cc("Animation","AnimationIteration"),animationstart:cc("Animation","AnimationStart"),transitionend:cc("Transition","TransitionEnd")},Nh={},My={};qr&&(My=document.createElement("div").style,"AnimationEvent"in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),"TransitionEvent"in window||delete ri.transitionend.transition);function du(e){if(Nh[e])return Nh[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in My)return Nh[e]=t[n];return e}var _y=du("animationend"),Dy=du("animationiteration"),Ty=du("animationstart"),Py=du("transitionend"),Ay=new Map,yg="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 Ws(e,t){Ay.set(e,t),za(t,[e])}for(var jh=0;jh<yg.length;jh++){var kh=yg[jh],YS=kh.toLowerCase(),XS=kh[0].toUpperCase()+kh.slice(1);Ws(YS,"on"+XS)}Ws(_y,"onAnimationEnd");Ws(Dy,"onAnimationIteration");Ws(Ty,"onAnimationStart");Ws("dblclick","onDoubleClick");Ws("focusin","onFocus");Ws("focusout","onBlur");Ws(Py,"onTransitionEnd");Si("onMouseEnter",["mouseout","mouseover"]);Si("onMouseLeave",["mouseout","mouseover"]);Si("onPointerEnter",["pointerout","pointerover"]);Si("onPointerLeave",["pointerout","pointerover"]);za("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));za("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));za("onBeforeInput",["compositionend","keypress","textInput","paste"]);za("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));za("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));za("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var To="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(" "),qS=new Set("cancel close invalid load scroll toggle".split(" ").concat(To));function bg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Yk(r,t,void 0,e),e.currentTarget=null}function Oy(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;bg(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;bg(a,l,d),i=c}}}if(hd)throw e=Rf,hd=!1,Rf=null,e}function st(e,t){var n=t[Xf];n===void 0&&(n=t[Xf]=new Set);var r=e+"__bubble";n.has(r)||(zy(t,e,2,!1),n.add(r))}function Sh(e,t,n){var r=0;t&&(r|=4),zy(n,e,r,t)}var dc="_reactListening"+Math.random().toString(36).slice(2);function tl(e){if(!e[dc]){e[dc]=!0,Bw.forEach(function(n){n!=="selectionchange"&&(qS.has(n)||Sh(n,!1,e),Sh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[dc]||(t[dc]=!0,Sh("selectionchange",!1,t))}}function zy(e,t,n,r){switch(vy(t)){case 1:var a=lS;break;case 4:a=cS;break;default:a=hp}n=a.bind(null,t,n,e),a=void 0,!$f||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 Ch(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=sa(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}sy(function(){var d=i,h=lp(n),u=[];e:{var f=Ay.get(e);if(f!==void 0){var p=mp,w=e;switch(e){case"keypress":if(Vc(n)===0)break e;case"keydown":case"keyup":p=kS;break;case"focusin":w="focus",p=wh;break;case"focusout":w="blur",p=wh;break;case"beforeblur":case"afterblur":p=wh;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=cg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=hS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=ES;break;case _y:case Dy:case Ty:p=pS;break;case Py:p=_S;break;case"scroll":p=dS;break;case"wheel":p=TS;break;case"copy":case"cut":case"paste":p=gS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=ug}var v=(t&4)!==0,b=!v&&e==="scroll",g=v?f!==null?f+"Capture":null:f;v=[];for(var y=d,x;y!==null;){x=y;var N=x.stateNode;if(x.tag===5&&N!==null&&(x=N,g!==null&&(N=Go(y,g),N!=null&&v.push(nl(y,N,x)))),b)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!==Of&&(w=n.relatedTarget||n.fromElement)&&(sa(w)||w[Gr]))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?sa(w):null,w!==null&&(b=$a(w),w!==b||w.tag!==5&&w.tag!==6)&&(w=null)):(p=null,w=d),p!==w)){if(v=cg,N="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(v=ug,N="onPointerLeave",g="onPointerEnter",y="pointer"),b=p==null?f:si(p),x=w==null?f:si(w),f=new v(N,y+"leave",p,n,h),f.target=b,f.relatedTarget=x,N=null,sa(h)===d&&(v=new v(g,y+"enter",w,n,h),v.target=x,v.relatedTarget=b,N=v),b=N,p&&w)t:{for(v=p,g=w,y=0,x=v;x;x=Ha(x))y++;for(x=0,N=g;N;N=Ha(N))x++;for(;0<y-x;)v=Ha(v),y--;for(;0<x-y;)g=Ha(g),x--;for(;y--;){if(v===g||g!==null&&v===g.alternate)break t;v=Ha(v),g=Ha(g)}v=null}else v=null;p!==null&&Ng(u,f,p,v,!1),w!==null&&b!==null&&Ng(u,b,w,v,!0)}}e:{if(f=d?si(d):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var j=IS;else if(mg(f))if(ky)j=BS;else{j=FS;var k=LS}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(j=US);if(j&&(j=j(e,d))){jy(u,j,n,h);break e}k&&k(e,f,d),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&_f(f,"number",f.value)}switch(k=d?si(d):window,e){case"focusin":(mg(k)||k.contentEditable==="true")&&(ni=k,Uf=d,Lo=null);break;case"focusout":Lo=Uf=ni=null;break;case"mousedown":Bf=!0;break;case"contextmenu":case"mouseup":case"dragend":Bf=!1,wg(u,n,h);break;case"selectionchange":if(VS)break;case"keydown":case"keyup":wg(u,n,h)}var S;if(xp)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 ti?by(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(yy&&n.locale!=="ko"&&(ti||M!=="onCompositionStart"?M==="onCompositionEnd"&&ti&&(S=wy()):(js=h,fp="value"in js?js.value:js.textContent,ti=!0)),k=gd(d,M),0<k.length&&(M=new dg(M,e,null,n,h),u.push({event:M,listeners:k}),S?M.data=S:(S=Ny(n),S!==null&&(M.data=S)))),(S=AS?OS(e,n):zS(e,n))&&(d=gd(d,"onBeforeInput"),0<d.length&&(h=new dg("onBeforeInput","beforeinput",null,n,h),u.push({event:h,listeners:d}),h.data=S))}Oy(u,t)})}function nl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function gd(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Go(e,n),i!=null&&r.unshift(nl(e,i,a)),i=Go(e,t),i!=null&&r.push(nl(e,i,a))),e=e.return}return r}function Ha(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ng(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=Go(n,i),c!=null&&o.unshift(nl(n,c,l))):a||(c=Go(n,i),c!=null&&o.push(nl(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var GS=/\r\n?/g,KS=/\u0000|\uFFFD/g;function jg(e){return(typeof e=="string"?e:""+e).replace(GS,`
38
- `).replace(KS,"")}function uc(e,t,n){if(t=jg(t),jg(e)!==t&&n)throw Error(oe(425))}function vd(){}var Wf=null,Hf=null;function Vf(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 Yf=typeof setTimeout=="function"?setTimeout:void 0,QS=typeof clearTimeout=="function"?clearTimeout:void 0,kg=typeof Promise=="function"?Promise:void 0,ZS=typeof queueMicrotask=="function"?queueMicrotask:typeof kg<"u"?function(e){return kg.resolve(null).then(e).catch(JS)}:Yf;function JS(e){setTimeout(function(){throw e})}function Eh(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),Zo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Zo(t)}function _s(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 Sg(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 Xi=Math.random().toString(36).slice(2),vr="__reactFiber$"+Xi,rl="__reactProps$"+Xi,Gr="__reactContainer$"+Xi,Xf="__reactEvents$"+Xi,eC="__reactListeners$"+Xi,tC="__reactHandles$"+Xi;function sa(e){var t=e[vr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Gr]||n[vr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sg(e);e!==null;){if(n=e[vr])return n;e=Sg(e)}return t}e=n,n=e.parentNode}return null}function Dl(e){return e=e[vr]||e[Gr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function si(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(oe(33))}function uu(e){return e[rl]||null}var qf=[],ai=-1;function Hs(e){return{current:e}}function it(e){0>ai||(e.current=qf[ai],qf[ai]=null,ai--)}function et(e,t){ai++,qf[ai]=e.current,e.current=t}var Is={},Xt=Hs(Is),cn=Hs(!1),va=Is;function Ci(e,t){var n=e.type.contextTypes;if(!n)return Is;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 dn(e){return e=e.childContextTypes,e!=null}function wd(){it(cn),it(Xt)}function Cg(e,t,n){if(Xt.current!==Is)throw Error(oe(168));et(Xt,t),et(cn,n)}function $y(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,Lk(e)||"Unknown",a));return xt({},n,r)}function yd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Is,va=Xt.current,et(Xt,e),et(cn,cn.current),!0}function Eg(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=$y(e,t,va),r.__reactInternalMemoizedMergedChildContext=e,it(cn),it(Xt),et(Xt,e)):it(cn),et(cn,n)}var Lr=null,hu=!1,Mh=!1;function Ry(e){Lr===null?Lr=[e]:Lr.push(e)}function nC(e){hu=!0,Ry(e)}function Vs(){if(!Mh&&Lr!==null){Mh=!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,hu=!1}catch(a){throw Lr!==null&&(Lr=Lr.slice(e+1)),ly(cp,Vs),a}finally{qe=t,Mh=!1}}return null}var ii=[],oi=0,bd=null,Nd=0,Rn=[],In=0,wa=null,Fr=1,Ur="";function Zs(e,t){ii[oi++]=Nd,ii[oi++]=bd,bd=e,Nd=t}function Iy(e,t,n){Rn[In++]=Fr,Rn[In++]=Ur,Rn[In++]=wa,wa=e;var r=Fr;e=Ur;var a=32-er(r)-1;r&=~(1<<a),n+=1;var i=32-er(t)+a;if(30<i){var o=a-a%5;i=(r&(1<<o)-1).toString(32),r>>=o,a-=o,Fr=1<<32-er(t)+a|n<<a|r,Ur=i+e}else Fr=1<<i|n<<a|r,Ur=e}function vp(e){e.return!==null&&(Zs(e,1),Iy(e,1,0))}function wp(e){for(;e===bd;)bd=ii[--oi],ii[oi]=null,Nd=ii[--oi],ii[oi]=null;for(;e===wa;)wa=Rn[--In],Rn[In]=null,Ur=Rn[--In],Rn[In]=null,Fr=Rn[--In],Rn[In]=null}var wn=null,vn=null,ct=!1,Gn=null;function Ly(e,t){var n=Fn(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 Mg(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=_s(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=wa!==null?{id:Fr,overflow:Ur}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Fn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,wn=e,vn=null,!0):!1;default:return!1}}function Gf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Kf(e){if(ct){var t=vn;if(t){var n=t;if(!Mg(e,t)){if(Gf(e))throw Error(oe(418));t=_s(n.nextSibling);var r=wn;t&&Mg(e,t)?Ly(r,n):(e.flags=e.flags&-4097|2,ct=!1,wn=e)}}else{if(Gf(e))throw Error(oe(418));e.flags=e.flags&-4097|2,ct=!1,wn=e}}}function _g(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;wn=e}function hc(e){if(e!==wn)return!1;if(!ct)return _g(e),ct=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vf(e.type,e.memoizedProps)),t&&(t=vn)){if(Gf(e))throw Fy(),Error(oe(418));for(;t;)Ly(e,t),t=_s(t.nextSibling)}if(_g(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=_s(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}vn=null}}else vn=wn?_s(e.stateNode.nextSibling):null;return!0}function Fy(){for(var e=vn;e;)e=_s(e.nextSibling)}function Ei(){vn=wn=null,ct=!1}function yp(e){Gn===null?Gn=[e]:Gn.push(e)}var rC=ts.ReactCurrentBatchConfig;function fo(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 fc(e,t){throw e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Dg(e){var t=e._init;return t(e._payload)}function Uy(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=As(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,N){return y===null||y.tag!==6?(y=zh(x,g.mode,N),y.return=g,y):(y=a(y,x),y.return=g,y)}function c(g,y,x,N){var j=x.type;return j===ei?h(g,y,x.props.children,N,x.key):y!==null&&(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===gs&&Dg(j)===y.type)?(N=a(y,x.props),N.ref=fo(g,y,x),N.return=g,N):(N=Zc(x.type,x.key,x.props,null,g.mode,N),N.ref=fo(g,y,x),N.return=g,N)}function d(g,y,x,N){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=$h(x,g.mode,N),y.return=g,y):(y=a(y,x.children||[]),y.return=g,y)}function h(g,y,x,N,j){return y===null||y.tag!==7?(y=ua(x,g.mode,N,j),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=zh(""+y,g.mode,x),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case nc:return x=Zc(y.type,y.key,y.props,null,g.mode,x),x.ref=fo(g,null,y),x.return=g,x;case Ja:return y=$h(y,g.mode,x),y.return=g,y;case gs:var N=y._init;return u(g,N(y._payload),x)}if(_o(y)||oo(y))return y=ua(y,g.mode,x,null),y.return=g,y;fc(g,y)}return null}function f(g,y,x,N){var j=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return j!==null?null:l(g,y,""+x,N);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case nc:return x.key===j?c(g,y,x,N):null;case Ja:return x.key===j?d(g,y,x,N):null;case gs:return j=x._init,f(g,y,j(x._payload),N)}if(_o(x)||oo(x))return j!==null?null:h(g,y,x,N,null);fc(g,x)}return null}function p(g,y,x,N,j){if(typeof N=="string"&&N!==""||typeof N=="number")return g=g.get(x)||null,l(y,g,""+N,j);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case nc:return g=g.get(N.key===null?x:N.key)||null,c(y,g,N,j);case Ja:return g=g.get(N.key===null?x:N.key)||null,d(y,g,N,j);case gs:var k=N._init;return p(g,y,x,k(N._payload),j)}if(_o(N)||oo(N))return g=g.get(x)||null,h(y,g,N,j,null);fc(y,N)}return null}function w(g,y,x,N){for(var j=null,k=null,S=y,M=y=0,A=null;S!==null&&M<x.length;M++){S.index>M?(A=S,S=null):A=S.sibling;var I=f(g,S,x[M],N);if(I===null){S===null&&(S=A);break}e&&S&&I.alternate===null&&t(g,S),y=i(I,y,M),k===null?j=I:k.sibling=I,k=I,S=A}if(M===x.length)return n(g,S),ct&&Zs(g,M),j;if(S===null){for(;M<x.length;M++)S=u(g,x[M],N),S!==null&&(y=i(S,y,M),k===null?j=S:k.sibling=S,k=S);return ct&&Zs(g,M),j}for(S=r(g,S);M<x.length;M++)A=p(S,g,M,x[M],N),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?M:A.key),y=i(A,y,M),k===null?j=A:k.sibling=A,k=A);return e&&S.forEach(function(U){return t(g,U)}),ct&&Zs(g,M),j}function v(g,y,x,N){var j=oo(x);if(typeof j!="function")throw Error(oe(150));if(x=j.call(x),x==null)throw Error(oe(151));for(var k=j=null,S=y,M=y=0,A=null,I=x.next();S!==null&&!I.done;M++,I=x.next()){S.index>M?(A=S,S=null):A=S.sibling;var U=f(g,S,I.value,N);if(U===null){S===null&&(S=A);break}e&&S&&U.alternate===null&&t(g,S),y=i(U,y,M),k===null?j=U:k.sibling=U,k=U,S=A}if(I.done)return n(g,S),ct&&Zs(g,M),j;if(S===null){for(;!I.done;M++,I=x.next())I=u(g,I.value,N),I!==null&&(y=i(I,y,M),k===null?j=I:k.sibling=I,k=I);return ct&&Zs(g,M),j}for(S=r(g,S);!I.done;M++,I=x.next())I=p(S,g,M,I.value,N),I!==null&&(e&&I.alternate!==null&&S.delete(I.key===null?M:I.key),y=i(I,y,M),k===null?j=I:k.sibling=I,k=I);return e&&S.forEach(function($){return t(g,$)}),ct&&Zs(g,M),j}function b(g,y,x,N){if(typeof x=="object"&&x!==null&&x.type===ei&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case nc:e:{for(var j=x.key,k=y;k!==null;){if(k.key===j){if(j=x.type,j===ei){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===j||typeof j=="object"&&j!==null&&j.$$typeof===gs&&Dg(j)===k.type){n(g,k.sibling),y=a(k,x.props),y.ref=fo(g,k,x),y.return=g,g=y;break e}n(g,k);break}else t(g,k);k=k.sibling}x.type===ei?(y=ua(x.props.children,g.mode,N,x.key),y.return=g,g=y):(N=Zc(x.type,x.key,x.props,null,g.mode,N),N.ref=fo(g,y,x),N.return=g,g=N)}return o(g);case Ja: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=$h(x,g.mode,N),y.return=g,g=y}return o(g);case gs:return k=x._init,b(g,y,k(x._payload),N)}if(_o(x))return w(g,y,x,N);if(oo(x))return v(g,y,x,N);fc(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=zh(x,g.mode,N),y.return=g,g=y),o(g)):n(g,y)}return b}var Mi=Uy(!0),By=Uy(!1),jd=Hs(null),kd=null,li=null,bp=null;function Np(){bp=li=kd=null}function jp(e){var t=jd.current;it(jd),e._currentValue=t}function Qf(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 gi(e,t){kd=e,bp=li=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(on=!0),e.firstContext=null)}function Bn(e){var t=e._currentValue;if(bp!==e)if(e={context:e,memoizedValue:t,next:null},li===null){if(kd===null)throw Error(oe(308));li=e,kd.dependencies={lanes:0,firstContext:e}}else li=li.next=e;return t}var aa=null;function kp(e){aa===null?aa=[e]:aa.push(e)}function Wy(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,kp(t)):(n.next=a.next,a.next=n),t.interleaved=n,Kr(e,r)}function Kr(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 vs=!1;function Sp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hy(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 Ds(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,We&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Kr(e,n)}return a=r.interleaved,a===null?(t.next=t,kp(r)):(t.next=a.next,a.next=t),r.interleaved=t,Kr(e,n)}function Yc(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,dp(e,n)}}function Tg(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 Sd(e,t,n,r){var a=e.updateQueue;vs=!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:vs=!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);ba|=o,e.lanes=o,e.memoizedState=u}}function Pg(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 Tl={},kr=Hs(Tl),sl=Hs(Tl),al=Hs(Tl);function ia(e){if(e===Tl)throw Error(oe(174));return e}function Cp(e,t){switch(et(al,t),et(sl,e),et(kr,Tl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tf(t,e)}it(kr),et(kr,t)}function _i(){it(kr),it(sl),it(al)}function Vy(e){ia(al.current);var t=ia(kr.current),n=Tf(t,e.type);t!==n&&(et(sl,e),et(kr,n))}function Ep(e){sl.current===e&&(it(kr),it(sl))}var mt=Hs(0);function Cd(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 _h=[];function Mp(){for(var e=0;e<_h.length;e++)_h[e]._workInProgressVersionPrimary=null;_h.length=0}var Xc=ts.ReactCurrentDispatcher,Dh=ts.ReactCurrentBatchConfig,ya=0,pt=null,Mt=null,Tt=null,Ed=!1,Fo=!1,il=0,sC=0;function Bt(){throw Error(oe(321))}function _p(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!rr(e[n],t[n]))return!1;return!0}function Dp(e,t,n,r,a,i){if(ya=i,pt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xc.current=e===null||e.memoizedState===null?lC:cC,e=n(r,a),Fo){i=0;do{if(Fo=!1,il=0,25<=i)throw Error(oe(301));i+=1,Tt=Mt=null,t.updateQueue=null,Xc.current=dC,e=n(r,a)}while(Fo)}if(Xc.current=Md,t=Mt!==null&&Mt.next!==null,ya=0,Tt=Mt=pt=null,Ed=!1,t)throw Error(oe(300));return e}function Tp(){var e=il!==0;return il=0,e}function mr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?pt.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function Wn(){if(Mt===null){var e=pt.alternate;e=e!==null?e.memoizedState:null}else e=Mt.next;var t=Tt===null?pt.memoizedState:Tt.next;if(t!==null)Tt=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},Tt===null?pt.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function ol(e,t){return typeof t=="function"?t(e):t}function Th(e){var t=Wn(),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((ya&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,ba|=h}d=d.next}while(d!==null&&d!==i);c===null?o=r:c.next=l,rr(r,t.memoizedState)||(on=!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,ba|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ph(e){var t=Wn(),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);rr(i,t.memoizedState)||(on=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Yy(){}function Xy(e,t){var n=pt,r=Wn(),a=t(),i=!rr(r.memoizedState,a);if(i&&(r.memoizedState=a,on=!0),r=r.queue,Pp(Ky.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Tt!==null&&Tt.memoizedState.tag&1){if(n.flags|=2048,ll(9,Gy.bind(null,n,r,a,t),void 0,null),At===null)throw Error(oe(349));ya&30||qy(n,t,a)}return a}function qy(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 Gy(e,t,n,r){t.value=n,t.getSnapshot=r,Qy(t)&&Zy(e)}function Ky(e,t,n){return n(function(){Qy(t)&&Zy(e)})}function Qy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rr(e,n)}catch{return!0}}function Zy(e){var t=Kr(e,1);t!==null&&tr(t,e,1,-1)}function Ag(e){var t=mr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:e},t.queue=e,e=e.dispatch=oC.bind(null,pt,e),[t.memoizedState,e]}function ll(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 Jy(){return Wn().memoizedState}function qc(e,t,n,r){var a=mr();pt.flags|=e,a.memoizedState=ll(1|t,n,void 0,r===void 0?null:r)}function fu(e,t,n,r){var a=Wn();r=r===void 0?null:r;var i=void 0;if(Mt!==null){var o=Mt.memoizedState;if(i=o.destroy,r!==null&&_p(r,o.deps)){a.memoizedState=ll(t,n,i,r);return}}pt.flags|=e,a.memoizedState=ll(1|t,n,i,r)}function Og(e,t){return qc(8390656,8,e,t)}function Pp(e,t){return fu(2048,8,e,t)}function eb(e,t){return fu(4,2,e,t)}function tb(e,t){return fu(4,4,e,t)}function nb(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 rb(e,t,n){return n=n!=null?n.concat([e]):null,fu(4,4,nb.bind(null,t,e),n)}function Ap(){}function sb(e,t){var n=Wn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&_p(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ab(e,t){var n=Wn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&_p(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ib(e,t,n){return ya&21?(rr(n,t)||(n=uy(),pt.lanes|=n,ba|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,on=!0),e.memoizedState=n)}function aC(e,t){var n=qe;qe=n!==0&&4>n?n:4,e(!0);var r=Dh.transition;Dh.transition={};try{e(!1),t()}finally{qe=n,Dh.transition=r}}function ob(){return Wn().memoizedState}function iC(e,t,n){var r=Ps(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lb(e))cb(t,n);else if(n=Wy(e,t,n,r),n!==null){var a=Qt();tr(n,e,r,a),db(n,t,r)}}function oC(e,t,n){var r=Ps(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lb(e))cb(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,rr(l,o)){var c=t.interleaved;c===null?(a.next=a,kp(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=Wy(e,t,a,r),n!==null&&(a=Qt(),tr(n,e,r,a),db(n,t,r))}}function lb(e){var t=e.alternate;return e===pt||t!==null&&t===pt}function cb(e,t){Fo=Ed=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function db(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,dp(e,n)}}var Md={readContext:Bn,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useInsertionEffect:Bt,useLayoutEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useMutableSource:Bt,useSyncExternalStore:Bt,useId:Bt,unstable_isNewReconciler:!1},lC={readContext:Bn,useCallback:function(e,t){return mr().memoizedState=[e,t===void 0?null:t],e},useContext:Bn,useEffect:Og,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,qc(4194308,4,nb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qc(4194308,4,e,t)},useInsertionEffect:function(e,t){return qc(4,2,e,t)},useMemo:function(e,t){var n=mr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mr();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=iC.bind(null,pt,e),[r.memoizedState,e]},useRef:function(e){var t=mr();return e={current:e},t.memoizedState=e},useState:Ag,useDebugValue:Ap,useDeferredValue:function(e){return mr().memoizedState=e},useTransition:function(){var e=Ag(!1),t=e[0];return e=aC.bind(null,e[1]),mr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pt,a=mr();if(ct){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),At===null)throw Error(oe(349));ya&30||qy(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Og(Ky.bind(null,r,i,e),[e]),r.flags|=2048,ll(9,Gy.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=mr(),t=At.identifierPrefix;if(ct){var n=Ur,r=Fr;n=(r&~(1<<32-er(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=il++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=sC++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},cC={readContext:Bn,useCallback:sb,useContext:Bn,useEffect:Pp,useImperativeHandle:rb,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:ab,useReducer:Th,useRef:Jy,useState:function(){return Th(ol)},useDebugValue:Ap,useDeferredValue:function(e){var t=Wn();return ib(t,Mt.memoizedState,e)},useTransition:function(){var e=Th(ol)[0],t=Wn().memoizedState;return[e,t]},useMutableSource:Yy,useSyncExternalStore:Xy,useId:ob,unstable_isNewReconciler:!1},dC={readContext:Bn,useCallback:sb,useContext:Bn,useEffect:Pp,useImperativeHandle:rb,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:ab,useReducer:Ph,useRef:Jy,useState:function(){return Ph(ol)},useDebugValue:Ap,useDeferredValue:function(e){var t=Wn();return Mt===null?t.memoizedState=e:ib(t,Mt.memoizedState,e)},useTransition:function(){var e=Ph(ol)[0],t=Wn().memoizedState;return[e,t]},useMutableSource:Yy,useSyncExternalStore:Xy,useId:ob,unstable_isNewReconciler:!1};function Vn(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 Zf(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 mu={isMounted:function(e){return(e=e._reactInternals)?$a(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qt(),a=Ps(e),i=Yr(r,a);i.payload=t,n!=null&&(i.callback=n),t=Ds(e,i,a),t!==null&&(tr(t,e,a,r),Yc(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qt(),a=Ps(e),i=Yr(r,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ds(e,i,a),t!==null&&(tr(t,e,a,r),Yc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qt(),r=Ps(e),a=Yr(n,r);a.tag=2,t!=null&&(a.callback=t),t=Ds(e,a,r),t!==null&&(tr(t,e,r,n),Yc(t,e,r))}};function zg(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?!el(n,r)||!el(a,i):!0}function ub(e,t,n){var r=!1,a=Is,i=t.contextType;return typeof i=="object"&&i!==null?i=Bn(i):(a=dn(t)?va:Xt.current,r=t.contextTypes,i=(r=r!=null)?Ci(e,a):Is),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=mu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function $g(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&&mu.enqueueReplaceState(t,t.state,null)}function Jf(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Sp(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Bn(i):(i=dn(t)?va:Xt.current,a.context=Ci(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Zf(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&&mu.enqueueReplaceState(a,a.state,null),Sd(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Di(e,t){try{var n="",r=t;do n+=Ik(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 Ah(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function em(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var uC=typeof WeakMap=="function"?WeakMap:Map;function hb(e,t,n){n=Yr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Dd||(Dd=!0,dm=r),em(e,t)},n}function fb(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(){em(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){em(e,t),typeof r!="function"&&(Ts===null?Ts=new Set([this]):Ts.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Rg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new uC;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=SC.bind(null,e,t,n),t.then(e,e))}function Ig(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 Lg(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,Ds(n,t,1))),n.lanes|=1),e)}var hC=ts.ReactCurrentOwner,on=!1;function Gt(e,t,n,r){t.child=e===null?By(t,null,n,r):Mi(t,e.child,n,r)}function Fg(e,t,n,r,a){n=n.render;var i=t.ref;return gi(t,a),r=Dp(e,t,n,r,i,a),n=Tp(),e!==null&&!on?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Qr(e,t,a)):(ct&&n&&vp(t),t.flags|=1,Gt(e,t,r,a),t.child)}function Ug(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!Up(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,mb(e,t,i,r,a)):(e=Zc(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:el,n(o,r)&&e.ref===t.ref)return Qr(e,t,a)}return t.flags|=1,e=As(i,r),e.ref=t.ref,e.return=t,t.child=e}function mb(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(el(i,r)&&e.ref===t.ref)if(on=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(on=!0);else return t.lanes=e.lanes,Qr(e,t,a)}return tm(e,t,n,r,a)}function pb(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(di,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(di,fn),fn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,et(di,fn),fn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,et(di,fn),fn|=r;return Gt(e,t,a,n),t.child}function xb(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function tm(e,t,n,r,a){var i=dn(n)?va:Xt.current;return i=Ci(t,i),gi(t,a),n=Dp(e,t,n,r,i,a),r=Tp(),e!==null&&!on?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Qr(e,t,a)):(ct&&r&&vp(t),t.flags|=1,Gt(e,t,n,a),t.child)}function Bg(e,t,n,r,a){if(dn(n)){var i=!0;yd(t)}else i=!1;if(gi(t,a),t.stateNode===null)Gc(e,t),ub(t,n,r),Jf(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=Bn(d):(d=dn(n)?va:Xt.current,d=Ci(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)&&$g(t,o,r,d),vs=!1;var f=t.memoizedState;o.state=f,Sd(t,r,o,a),c=t.memoizedState,l!==r||f!==c||cn.current||vs?(typeof h=="function"&&(Zf(t,n,h,r),c=t.memoizedState),(l=vs||zg(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,Hy(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Vn(t.type,l),o.props=d,u=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Bn(c):(c=dn(n)?va:Xt.current,c=Ci(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)&&$g(t,o,r,c),vs=!1,f=t.memoizedState,o.state=f,Sd(t,r,o,a);var w=t.memoizedState;l!==u||f!==w||cn.current||vs?(typeof p=="function"&&(Zf(t,n,p,r),w=t.memoizedState),(d=vs||zg(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 nm(e,t,n,r,i,a)}function nm(e,t,n,r,a,i){xb(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&Eg(t,n,!1),Qr(e,t,i);r=t.stateNode,hC.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Mi(t,e.child,null,i),t.child=Mi(t,null,l,i)):Gt(e,t,l,i),t.memoizedState=r.state,a&&Eg(t,n,!0),t.child}function gb(e){var t=e.stateNode;t.pendingContext?Cg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Cg(e,t.context,!1),Cp(e,t.containerInfo)}function Wg(e,t,n,r,a){return Ei(),yp(a),t.flags|=256,Gt(e,t,n,r),t.child}var rm={dehydrated:null,treeContext:null,retryLane:0};function sm(e){return{baseLanes:e,cachePool:null,transitions:null}}function vb(e,t,n){var r=t.pendingProps,a=mt.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(mt,a&1),e===null)return Kf(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=gu(o,r,0,null),e=ua(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=sm(n),t.memoizedState=rm,e):Op(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return fC(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=As(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=As(l,i):(i=ua(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?sm(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=rm,r}return i=e.child,e=i.sibling,r=As(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 Op(e,t){return t=gu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function mc(e,t,n,r){return r!==null&&yp(r),Mi(t,e.child,null,n),e=Op(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fC(e,t,n,r,a,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Ah(Error(oe(422))),mc(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=gu({mode:"visible",children:r.children},a,0,null),i=ua(i,a,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Mi(t,e.child,null,o),t.child.memoizedState=sm(o),t.memoizedState=rm,i);if(!(t.mode&1))return mc(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=Ah(i,r,void 0),mc(e,t,o,r)}if(l=(o&e.childLanes)!==0,on||l){if(r=At,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,Kr(e,a),tr(r,e,a,-1))}return Fp(),r=Ah(Error(oe(421))),mc(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=CC.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,vn=_s(a.nextSibling),wn=t,ct=!0,Gn=null,e!==null&&(Rn[In++]=Fr,Rn[In++]=Ur,Rn[In++]=wa,Fr=e.id,Ur=e.overflow,wa=t),t=Op(t,r.children),t.flags|=4096,t)}function Hg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qf(e.return,t,n)}function Oh(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 wb(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(Gt(e,t,r.children,n),r=mt.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&&Hg(e,n,t);else if(e.tag===19)Hg(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(mt,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&&Cd(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Oh(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&&Cd(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Oh(t,!0,n,null,i);break;case"together":Oh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Gc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Qr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ba|=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=As(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=As(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mC(e,t,n){switch(t.tag){case 3:gb(t),Ei();break;case 5:Vy(t);break;case 1:dn(t.type)&&yd(t);break;case 4:Cp(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;et(jd,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(et(mt,mt.current&1),t.flags|=128,null):n&t.child.childLanes?vb(e,t,n):(et(mt,mt.current&1),e=Qr(e,t,n),e!==null?e.sibling:null);et(mt,mt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return wb(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),et(mt,mt.current),r)break;return null;case 22:case 23:return t.lanes=0,pb(e,t,n)}return Qr(e,t,n)}var yb,am,bb,Nb;yb=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}};am=function(){};bb=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,ia(kr.current);var i=null;switch(n){case"input":a=Ef(e,a),r=Ef(e,r),i=[];break;case"select":a=xt({},a,{value:void 0}),r=xt({},r,{value:void 0}),i=[];break;case"textarea":a=Df(e,a),r=Df(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vd)}Pf(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"&&(Xo.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"&&(Xo.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&st("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)}};Nb=function(e,t,n,r){n!==r&&(t.flags|=4)};function mo(e,t){if(!ct)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 Wt(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 pC(e,t,n){var r=t.pendingProps;switch(wp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(t),null;case 1:return dn(t.type)&&wd(),Wt(t),null;case 3:return r=t.stateNode,_i(),it(cn),it(Xt),Mp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(hc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Gn!==null&&(fm(Gn),Gn=null))),am(e,t),Wt(t),null;case 5:Ep(t);var a=ia(al.current);if(n=t.type,e!==null&&t.stateNode!=null)bb(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 Wt(t),null}if(e=ia(kr.current),hc(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[vr]=t,r[rl]=i,e=(t.mode&1)!==0,n){case"dialog":st("cancel",r),st("close",r);break;case"iframe":case"object":case"embed":st("load",r);break;case"video":case"audio":for(a=0;a<To.length;a++)st(To[a],r);break;case"source":st("error",r);break;case"img":case"image":case"link":st("error",r),st("load",r);break;case"details":st("toggle",r);break;case"input":Jx(r,i),st("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},st("invalid",r);break;case"textarea":tg(r,i),st("invalid",r)}Pf(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&&uc(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&uc(r.textContent,l,e),a=["children",""+l]):Xo.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&st("scroll",r)}switch(n){case"input":rc(r),eg(r,i,!0);break;case"textarea":rc(r),ng(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=vd)}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=Kw(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[vr]=t,e[rl]=r,yb(e,t,!1,!1),t.stateNode=e;e:{switch(o=Af(n,r),n){case"dialog":st("cancel",e),st("close",e),a=r;break;case"iframe":case"object":case"embed":st("load",e),a=r;break;case"video":case"audio":for(a=0;a<To.length;a++)st(To[a],e);a=r;break;case"source":st("error",e),a=r;break;case"img":case"image":case"link":st("error",e),st("load",e),a=r;break;case"details":st("toggle",e),a=r;break;case"input":Jx(e,r),a=Ef(e,r),st("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=xt({},r,{value:void 0}),st("invalid",e);break;case"textarea":tg(e,r),a=Df(e,r),st("invalid",e);break;default:a=r}Pf(n,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Jw(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Qw(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&qo(e,c):typeof c=="number"&&qo(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Xo.hasOwnProperty(i)?c!=null&&i==="onScroll"&&st("scroll",e):c!=null&&sp(e,i,c,o))}switch(n){case"input":rc(e),eg(e,r,!1);break;case"textarea":rc(e),ng(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Rs(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?fi(e,!!r.multiple,i,!1):r.defaultValue!=null&&fi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=vd)}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 Wt(t),null;case 6:if(e&&t.stateNode!=null)Nb(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(oe(166));if(n=ia(al.current),ia(kr.current),hc(t)){if(r=t.stateNode,n=t.memoizedProps,r[vr]=t,(i=r.nodeValue!==n)&&(e=wn,e!==null))switch(e.tag){case 3:uc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&uc(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[vr]=t,t.stateNode=r}return Wt(t),null;case 13:if(it(mt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ct&&vn!==null&&t.mode&1&&!(t.flags&128))Fy(),Ei(),t.flags|=98560,i=!1;else if(i=hc(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[vr]=t}else Ei(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wt(t),i=!1}else Gn!==null&&(fm(Gn),Gn=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||mt.current&1?Dt===0&&(Dt=3):Fp())),t.updateQueue!==null&&(t.flags|=4),Wt(t),null);case 4:return _i(),am(e,t),e===null&&tl(t.stateNode.containerInfo),Wt(t),null;case 10:return jp(t.type._context),Wt(t),null;case 17:return dn(t.type)&&wd(),Wt(t),null;case 19:if(it(mt),i=t.memoizedState,i===null)return Wt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)mo(i,!1);else{if(Dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Cd(e),o!==null){for(t.flags|=128,mo(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(mt,mt.current&1|2),t.child}e=e.sibling}i.tail!==null&&yt()>Ti&&(t.flags|=128,r=!0,mo(i,!1),t.lanes=4194304)}else{if(!r)if(e=Cd(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!ct)return Wt(t),null}else 2*yt()-i.renderingStartTime>Ti&&n!==1073741824&&(t.flags|=128,r=!0,mo(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=yt(),t.sibling=null,n=mt.current,et(mt,r?n&1|2:n&1),t):(Wt(t),null);case 22:case 23:return Lp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fn&1073741824&&(Wt(t),t.subtreeFlags&6&&(t.flags|=8192)):Wt(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function xC(e,t){switch(wp(t),t.tag){case 1:return dn(t.type)&&wd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _i(),it(cn),it(Xt),Mp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ep(t),null;case 13:if(it(mt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Ei()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return it(mt),null;case 4:return _i(),null;case 10:return jp(t.type._context),null;case 22:case 23:return Lp(),null;case 24:return null;default:return null}}var pc=!1,Yt=!1,gC=typeof WeakSet=="function"?WeakSet:Set,ye=null;function ci(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){wt(e,t,r)}else n.current=null}function im(e,t,n){try{n()}catch(r){wt(e,t,r)}}var Vg=!1;function vC(e,t){if(Wf=pd,e=Ey(),gp(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(Hf={focusedElem:e,selectionRange:n},pd=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;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,b=w.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Vn(t.type,v),b);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(N){wt(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return w=Vg,Vg=!1,w}function Uo(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&&im(t,n,i)}a=a.next}while(a!==r)}}function pu(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 om(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 jb(e){var t=e.alternate;t!==null&&(e.alternate=null,jb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vr],delete t[rl],delete t[Xf],delete t[eC],delete t[tC])),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 kb(e){return e.tag===5||e.tag===3||e.tag===4}function Yg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kb(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 lm(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=vd));else if(r!==4&&(e=e.child,e!==null))for(lm(e,t,n),e=e.sibling;e!==null;)lm(e,t,n),e=e.sibling}function cm(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(cm(e,t,n),e=e.sibling;e!==null;)cm(e,t,n),e=e.sibling}var It=null,Xn=!1;function ls(e,t,n){for(n=n.child;n!==null;)Sb(e,t,n),n=n.sibling}function Sb(e,t,n){if(jr&&typeof jr.onCommitFiberUnmount=="function")try{jr.onCommitFiberUnmount(ou,n)}catch{}switch(n.tag){case 5:Yt||ci(n,t);case 6:var r=It,a=Xn;It=null,ls(e,t,n),It=r,Xn=a,It!==null&&(Xn?(e=It,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):It.removeChild(n.stateNode));break;case 18:It!==null&&(Xn?(e=It,n=n.stateNode,e.nodeType===8?Eh(e.parentNode,n):e.nodeType===1&&Eh(e,n),Zo(e)):Eh(It,n.stateNode));break;case 4:r=It,a=Xn,It=n.stateNode.containerInfo,Xn=!0,ls(e,t,n),It=r,Xn=a;break;case 0:case 11:case 14:case 15:if(!Yt&&(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)&&im(n,t,o),a=a.next}while(a!==r)}ls(e,t,n);break;case 1:if(!Yt&&(ci(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){wt(n,t,l)}ls(e,t,n);break;case 21:ls(e,t,n);break;case 22:n.mode&1?(Yt=(r=Yt)||n.memoizedState!==null,ls(e,t,n),Yt=r):ls(e,t,n);break;default:ls(e,t,n)}}function Xg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gC),t.forEach(function(r){var a=EC.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Hn(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:It=l.stateNode,Xn=!1;break e;case 3:It=l.stateNode.containerInfo,Xn=!0;break e;case 4:It=l.stateNode.containerInfo,Xn=!0;break e}l=l.return}if(It===null)throw Error(oe(160));Sb(i,o,a),It=null,Xn=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){wt(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Cb(t,e),t=t.sibling}function Cb(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Hn(t,e),dr(e),r&4){try{Uo(3,e,e.return),pu(3,e)}catch(v){wt(e,e.return,v)}try{Uo(5,e,e.return)}catch(v){wt(e,e.return,v)}}break;case 1:Hn(t,e),dr(e),r&512&&n!==null&&ci(n,n.return);break;case 5:if(Hn(t,e),dr(e),r&512&&n!==null&&ci(n,n.return),e.flags&32){var a=e.stateNode;try{qo(a,"")}catch(v){wt(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&&qw(a,i),Af(l,o);var d=Af(l,i);for(o=0;o<c.length;o+=2){var h=c[o],u=c[o+1];h==="style"?Jw(a,u):h==="dangerouslySetInnerHTML"?Qw(a,u):h==="children"?qo(a,u):sp(a,h,u,d)}switch(l){case"input":Mf(a,i);break;case"textarea":Gw(a,i);break;case"select":var f=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?fi(a,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?fi(a,!!i.multiple,i.defaultValue,!0):fi(a,!!i.multiple,i.multiple?[]:"",!1))}a[rl]=i}catch(v){wt(e,e.return,v)}}break;case 6:if(Hn(t,e),dr(e),r&4){if(e.stateNode===null)throw Error(oe(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(v){wt(e,e.return,v)}}break;case 3:if(Hn(t,e),dr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Zo(t.containerInfo)}catch(v){wt(e,e.return,v)}break;case 4:Hn(t,e),dr(e);break;case 13:Hn(t,e),dr(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(Rp=yt())),r&4&&Xg(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Yt=(d=Yt)||h,Hn(t,e),Yt=d):Hn(t,e),dr(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!h&&e.mode&1)for(ye=e,h=e.child;h!==null;){for(u=ye=h;ye!==null;){switch(f=ye,p=f.child,f.tag){case 0:case 11:case 14:case 15:Uo(4,f,f.return);break;case 1:ci(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){wt(r,n,v)}}break;case 5:ci(f,f.return);break;case 22:if(f.memoizedState!==null){Gg(u);continue}}p!==null?(p.return=f,ye=p):Gg(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=Zw("display",o))}catch(v){wt(e,e.return,v)}}}else if(u.tag===6){if(h===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(v){wt(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:Hn(t,e),dr(e),r&4&&Xg(e);break;case 21:break;default:Hn(t,e),dr(e)}}function dr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(kb(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&&(qo(a,""),r.flags&=-33);var i=Yg(e);cm(e,i,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Yg(e);lm(e,l,o);break;default:throw Error(oe(161))}}catch(c){wt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wC(e,t,n){ye=e,Eb(e)}function Eb(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var a=ye,i=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||pc;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Yt;l=pc;var d=Yt;if(pc=o,(Yt=c)&&!d)for(ye=a;ye!==null;)o=ye,c=o.child,o.tag===22&&o.memoizedState!==null?Kg(a):c!==null?(c.return=o,ye=c):Kg(a);for(;i!==null;)ye=i,Eb(i),i=i.sibling;ye=a,pc=l,Yt=d}qg(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,ye=i):qg(e)}}function qg(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Yt||pu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Yt)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Vn(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Pg(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}Pg(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&&Zo(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(oe(163))}Yt||t.flags&512&&om(t)}catch(f){wt(t,t.return,f)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function Gg(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function Kg(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pu(4,t)}catch(c){wt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){wt(t,a,c)}}var i=t.return;try{om(t)}catch(c){wt(t,i,c)}break;case 5:var o=t.return;try{om(t)}catch(c){wt(t,o,c)}}}catch(c){wt(t,t.return,c)}if(t===e){ye=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ye=l;break}ye=t.return}}var yC=Math.ceil,_d=ts.ReactCurrentDispatcher,zp=ts.ReactCurrentOwner,Un=ts.ReactCurrentBatchConfig,We=0,At=null,jt=null,Lt=0,fn=0,di=Hs(0),Dt=0,cl=null,ba=0,xu=0,$p=0,Bo=null,an=null,Rp=0,Ti=1/0,Rr=null,Dd=!1,dm=null,Ts=null,xc=!1,ks=null,Td=0,Wo=0,um=null,Kc=-1,Qc=0;function Qt(){return We&6?yt():Kc!==-1?Kc:Kc=yt()}function Ps(e){return e.mode&1?We&2&&Lt!==0?Lt&-Lt:rC.transition!==null?(Qc===0&&(Qc=uy()),Qc):(e=qe,e!==0||(e=window.event,e=e===void 0?16:vy(e.type)),e):1}function tr(e,t,n,r){if(50<Wo)throw Wo=0,um=null,Error(oe(185));Ml(e,n,r),(!(We&2)||e!==At)&&(e===At&&(!(We&2)&&(xu|=n),Dt===4&&bs(e,Lt)),un(e,r),n===1&&We===0&&!(t.mode&1)&&(Ti=yt()+500,hu&&Vs()))}function un(e,t){var n=e.callbackNode;rS(e,t);var r=md(e,e===At?Lt:0);if(r===0)n!==null&&ag(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ag(n),t===1)e.tag===0?nC(Qg.bind(null,e)):Ry(Qg.bind(null,e)),ZS(function(){!(We&6)&&Vs()}),n=null;else{switch(hy(r)){case 1:n=cp;break;case 4:n=cy;break;case 16:n=fd;break;case 536870912:n=dy;break;default:n=fd}n=zb(n,Mb.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Mb(e,t){if(Kc=-1,Qc=0,We&6)throw Error(oe(327));var n=e.callbackNode;if(vi()&&e.callbackNode!==n)return null;var r=md(e,e===At?Lt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Pd(e,r);else{t=r;var a=We;We|=2;var i=Db();(At!==e||Lt!==t)&&(Rr=null,Ti=yt()+500,da(e,t));do try{jC();break}catch(l){_b(e,l)}while(!0);Np(),_d.current=i,We=a,jt!==null?t=0:(At=null,Lt=0,t=Dt)}if(t!==0){if(t===2&&(a=If(e),a!==0&&(r=a,t=hm(e,a))),t===1)throw n=cl,da(e,0),bs(e,r),un(e,yt()),n;if(t===6)bs(e,r);else{if(a=e.current.alternate,!(r&30)&&!bC(a)&&(t=Pd(e,r),t===2&&(i=If(e),i!==0&&(r=i,t=hm(e,i))),t===1))throw n=cl,da(e,0),bs(e,r),un(e,yt()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(oe(345));case 2:Js(e,an,Rr);break;case 3:if(bs(e,r),(r&130023424)===r&&(t=Rp+500-yt(),10<t)){if(md(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Qt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Yf(Js.bind(null,e,an,Rr),t);break}Js(e,an,Rr);break;case 4:if(bs(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-er(r);i=1<<o,o=t[o],o>a&&(a=o),r&=~i}if(r=a,r=yt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yC(r/1960))-r,10<r){e.timeoutHandle=Yf(Js.bind(null,e,an,Rr),r);break}Js(e,an,Rr);break;case 5:Js(e,an,Rr);break;default:throw Error(oe(329))}}}return un(e,yt()),e.callbackNode===n?Mb.bind(null,e):null}function hm(e,t){var n=Bo;return e.current.memoizedState.isDehydrated&&(da(e,t).flags|=256),e=Pd(e,t),e!==2&&(t=an,an=n,t!==null&&fm(t)),e}function fm(e){an===null?an=e:an.push.apply(an,e)}function bC(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(!rr(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 bs(e,t){for(t&=~$p,t&=~xu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-er(t),r=1<<n;e[n]=-1,t&=~r}}function Qg(e){if(We&6)throw Error(oe(327));vi();var t=md(e,0);if(!(t&1))return un(e,yt()),null;var n=Pd(e,t);if(e.tag!==0&&n===2){var r=If(e);r!==0&&(t=r,n=hm(e,r))}if(n===1)throw n=cl,da(e,0),bs(e,t),un(e,yt()),n;if(n===6)throw Error(oe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Js(e,an,Rr),un(e,yt()),null}function Ip(e,t){var n=We;We|=1;try{return e(t)}finally{We=n,We===0&&(Ti=yt()+500,hu&&Vs())}}function Na(e){ks!==null&&ks.tag===0&&!(We&6)&&vi();var t=We;We|=1;var n=Un.transition,r=qe;try{if(Un.transition=null,qe=1,e)return e()}finally{qe=r,Un.transition=n,We=t,!(We&6)&&Vs()}}function Lp(){fn=di.current,it(di)}function da(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,QS(n)),jt!==null)for(n=jt.return;n!==null;){var r=n;switch(wp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&wd();break;case 3:_i(),it(cn),it(Xt),Mp();break;case 5:Ep(r);break;case 4:_i();break;case 13:it(mt);break;case 19:it(mt);break;case 10:jp(r.type._context);break;case 22:case 23:Lp()}n=n.return}if(At=e,jt=e=As(e.current,null),Lt=fn=t,Dt=0,cl=null,$p=xu=ba=0,an=Bo=null,aa!==null){for(t=0;t<aa.length;t++)if(n=aa[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}aa=null}return e}function _b(e,t){do{var n=jt;try{if(Np(),Xc.current=Md,Ed){for(var r=pt.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Ed=!1}if(ya=0,Tt=Mt=pt=null,Fo=!1,il=0,zp.current=null,n===null||n.return===null){Dt=1,cl=t,jt=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=Lt,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=Ig(o);if(p!==null){p.flags&=-257,Lg(p,o,l,i,t),p.mode&1&&Rg(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)){Rg(i,d,t),Fp();break e}c=Error(oe(426))}}else if(ct&&l.mode&1){var b=Ig(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Lg(b,o,l,i,t),yp(Di(c,l));break e}}i=c=Di(c,l),Dt!==4&&(Dt=2),Bo===null?Bo=[i]:Bo.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=hb(i,c,t);Tg(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"&&(Ts===null||!Ts.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var N=fb(i,l,t);Tg(i,N);break e}}i=i.return}while(i!==null)}Pb(n)}catch(j){t=j,jt===n&&n!==null&&(jt=n=n.return);continue}break}while(!0)}function Db(){var e=_d.current;return _d.current=Md,e===null?Md:e}function Fp(){(Dt===0||Dt===3||Dt===2)&&(Dt=4),At===null||!(ba&268435455)&&!(xu&268435455)||bs(At,Lt)}function Pd(e,t){var n=We;We|=2;var r=Db();(At!==e||Lt!==t)&&(Rr=null,da(e,t));do try{NC();break}catch(a){_b(e,a)}while(!0);if(Np(),We=n,_d.current=r,jt!==null)throw Error(oe(261));return At=null,Lt=0,Dt}function NC(){for(;jt!==null;)Tb(jt)}function jC(){for(;jt!==null&&!qk();)Tb(jt)}function Tb(e){var t=Ob(e.alternate,e,fn);e.memoizedProps=e.pendingProps,t===null?Pb(e):jt=t,zp.current=null}function Pb(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=xC(n,t),n!==null){n.flags&=32767,jt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Dt=6,jt=null;return}}else if(n=pC(n,t,fn),n!==null){jt=n;return}if(t=t.sibling,t!==null){jt=t;return}jt=t=e}while(t!==null);Dt===0&&(Dt=5)}function Js(e,t,n){var r=qe,a=Un.transition;try{Un.transition=null,qe=1,kC(e,t,n,r)}finally{Un.transition=a,qe=r}return null}function kC(e,t,n,r){do vi();while(ks!==null);if(We&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(sS(e,i),e===At&&(jt=At=null,Lt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||xc||(xc=!0,zb(fd,function(){return vi(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Un.transition,Un.transition=null;var o=qe;qe=1;var l=We;We|=4,zp.current=null,vC(e,n),Cb(n,e),HS(Hf),pd=!!Wf,Hf=Wf=null,e.current=n,wC(n),Gk(),We=l,qe=o,Un.transition=i}else e.current=n;if(xc&&(xc=!1,ks=e,Td=a),i=e.pendingLanes,i===0&&(Ts=null),Zk(n.stateNode),un(e,yt()),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(Dd)throw Dd=!1,e=dm,dm=null,e;return Td&1&&e.tag!==0&&vi(),i=e.pendingLanes,i&1?e===um?Wo++:(Wo=0,um=e):Wo=0,Vs(),null}function vi(){if(ks!==null){var e=hy(Td),t=Un.transition,n=qe;try{if(Un.transition=null,qe=16>e?16:e,ks===null)var r=!1;else{if(e=ks,ks=null,Td=0,We&6)throw Error(oe(331));var a=We;for(We|=4,ye=e.current;ye!==null;){var i=ye,o=i.child;if(ye.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(ye=d;ye!==null;){var h=ye;switch(h.tag){case 0:case 11:case 15:Uo(8,h,i)}var u=h.child;if(u!==null)u.return=h,ye=u;else for(;ye!==null;){h=ye;var f=h.sibling,p=h.return;if(jb(h),h===d){ye=null;break}if(f!==null){f.return=p,ye=f;break}ye=p}}}var w=i.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}ye=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,ye=o;else e:for(;ye!==null;){if(i=ye,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Uo(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,ye=g;break e}ye=i.return}}var y=e.current;for(ye=y;ye!==null;){o=ye;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,ye=x;else e:for(o=y;ye!==null;){if(l=ye,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:pu(9,l)}}catch(j){wt(l,l.return,j)}if(l===o){ye=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,ye=N;break e}ye=l.return}}if(We=a,Vs(),jr&&typeof jr.onPostCommitFiberRoot=="function")try{jr.onPostCommitFiberRoot(ou,e)}catch{}r=!0}return r}finally{qe=n,Un.transition=t}}return!1}function Zg(e,t,n){t=Di(n,t),t=hb(e,t,1),e=Ds(e,t,1),t=Qt(),e!==null&&(Ml(e,1,t),un(e,t))}function wt(e,t,n){if(e.tag===3)Zg(e,e,n);else for(;t!==null;){if(t.tag===3){Zg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ts===null||!Ts.has(r))){e=Di(n,e),e=fb(t,e,1),t=Ds(t,e,1),e=Qt(),t!==null&&(Ml(t,1,e),un(t,e));break}}t=t.return}}function SC(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qt(),e.pingedLanes|=e.suspendedLanes&n,At===e&&(Lt&n)===n&&(Dt===4||Dt===3&&(Lt&130023424)===Lt&&500>yt()-Rp?da(e,0):$p|=n),un(e,t)}function Ab(e,t){t===0&&(e.mode&1?(t=ic,ic<<=1,!(ic&130023424)&&(ic=4194304)):t=1);var n=Qt();e=Kr(e,t),e!==null&&(Ml(e,t,n),un(e,n))}function CC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ab(e,n)}function EC(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),Ab(e,n)}var Ob;Ob=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||cn.current)on=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return on=!1,mC(e,t,n);on=!!(e.flags&131072)}else on=!1,ct&&t.flags&1048576&&Iy(t,Nd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Gc(e,t),e=t.pendingProps;var a=Ci(t,Xt.current);gi(t,n),a=Dp(null,t,r,e,a,n);var i=Tp();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,dn(r)?(i=!0,yd(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Sp(t),a.updater=mu,t.stateNode=a,a._reactInternals=t,Jf(t,r,e,n),t=nm(null,t,r,!0,i,n)):(t.tag=0,ct&&i&&vp(t),Gt(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Gc(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=_C(r),e=Vn(r,e),a){case 0:t=tm(null,t,r,e,n);break e;case 1:t=Bg(null,t,r,e,n);break e;case 11:t=Fg(null,t,r,e,n);break e;case 14:t=Ug(null,t,r,Vn(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:Vn(r,a),tm(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Bg(e,t,r,a,n);case 3:e:{if(gb(t),e===null)throw Error(oe(387));r=t.pendingProps,i=t.memoizedState,a=i.element,Hy(e,t),Sd(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=Di(Error(oe(423)),t),t=Wg(e,t,r,n,a);break e}else if(r!==a){a=Di(Error(oe(424)),t),t=Wg(e,t,r,n,a);break e}else for(vn=_s(t.stateNode.containerInfo.firstChild),wn=t,ct=!0,Gn=null,n=By(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ei(),r===a){t=Qr(e,t,n);break e}Gt(e,t,r,n)}t=t.child}return t;case 5:return Vy(t),e===null&&Kf(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Vf(r,a)?o=null:i!==null&&Vf(r,i)&&(t.flags|=32),xb(e,t),Gt(e,t,o,n),t.child;case 6:return e===null&&Kf(t),null;case 13:return vb(e,t,n);case 4:return Cp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Mi(t,null,r,n):Gt(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Fg(e,t,r,a,n);case 7:return Gt(e,t,t.pendingProps,n),t.child;case 8:return Gt(e,t,t.pendingProps.children,n),t.child;case 12:return Gt(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(jd,r._currentValue),r._currentValue=o,i!==null)if(rr(i.value,o)){if(i.children===a.children&&!cn.current){t=Qr(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),Qf(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),Qf(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}Gt(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,gi(t,n),a=Bn(a),r=r(a),t.flags|=1,Gt(e,t,r,n),t.child;case 14:return r=t.type,a=Vn(r,t.pendingProps),a=Vn(r.type,a),Ug(e,t,r,a,n);case 15:return mb(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Vn(r,a),Gc(e,t),t.tag=1,dn(r)?(e=!0,yd(t)):e=!1,gi(t,n),ub(t,r,a),Jf(t,r,a,n),nm(null,t,r,!0,e,n);case 19:return wb(e,t,n);case 22:return pb(e,t,n)}throw Error(oe(156,t.tag))};function zb(e,t){return ly(e,t)}function MC(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 Fn(e,t,n,r){return new MC(e,t,n,r)}function Up(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _C(e){if(typeof e=="function")return Up(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ip)return 11;if(e===op)return 14}return 2}function As(e,t){var n=e.alternate;return n===null?(n=Fn(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 Zc(e,t,n,r,a,i){var o=2;if(r=e,typeof e=="function")Up(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ei:return ua(n.children,a,i,t);case ap:o=8,a|=8;break;case jf:return e=Fn(12,n,t,a|2),e.elementType=jf,e.lanes=i,e;case kf:return e=Fn(13,n,t,a),e.elementType=kf,e.lanes=i,e;case Sf:return e=Fn(19,n,t,a),e.elementType=Sf,e.lanes=i,e;case Vw:return gu(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ww:o=10;break e;case Hw:o=9;break e;case ip:o=11;break e;case op:o=14;break e;case gs:o=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Fn(o,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function ua(e,t,n,r){return e=Fn(7,e,r,t),e.lanes=n,e}function gu(e,t,n,r){return e=Fn(22,e,r,t),e.elementType=Vw,e.lanes=n,e.stateNode={isHidden:!1},e}function zh(e,t,n){return e=Fn(6,e,null,t),e.lanes=n,e}function $h(e,t,n){return t=Fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function DC(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=xh(0),this.expirationTimes=xh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xh(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Bp(e,t,n,r,a,i,o,l,c){return e=new DC(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Fn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sp(i),e}function TC(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ja,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $b(e){if(!e)return Is;e=e._reactInternals;e:{if($a(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(dn(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(dn(n))return $y(e,n,t)}return t}function Rb(e,t,n,r,a,i,o,l,c){return e=Bp(n,r,!0,e,a,i,o,l,c),e.context=$b(null),n=e.current,r=Qt(),a=Ps(n),i=Yr(r,a),i.callback=t??null,Ds(n,i,a),e.current.lanes=a,Ml(e,a,r),un(e,r),e}function vu(e,t,n,r){var a=t.current,i=Qt(),o=Ps(a);return n=$b(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=Ds(a,t,o),e!==null&&(tr(e,a,o,i),Yc(e,a,o)),o}function Ad(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 Jg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Wp(e,t){Jg(e,t),(e=e.alternate)&&Jg(e,t)}function PC(){return null}var Ib=typeof reportError=="function"?reportError:function(e){console.error(e)};function Hp(e){this._internalRoot=e}wu.prototype.render=Hp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));vu(e,t,null,null)};wu.prototype.unmount=Hp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Na(function(){vu(null,e,null,null)}),t[Gr]=null}};function wu(e){this._internalRoot=e}wu.prototype.unstable_scheduleHydration=function(e){if(e){var t=py();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ys.length&&t!==0&&t<ys[n].priority;n++);ys.splice(n,0,e),n===0&&gy(e)}};function Vp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function e0(){}function AC(e,t,n,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var d=Ad(o);i.call(d)}}var o=Rb(t,r,e,0,null,!1,!1,"",e0);return e._reactRootContainer=o,e[Gr]=o.current,tl(e.nodeType===8?e.parentNode:e),Na(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var d=Ad(c);l.call(d)}}var c=Bp(e,0,!1,null,null,!1,!1,"",e0);return e._reactRootContainer=c,e[Gr]=c.current,tl(e.nodeType===8?e.parentNode:e),Na(function(){vu(t,c,n,r)}),c}function bu(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=Ad(o);l.call(c)}}vu(t,o,e,a)}else o=AC(n,t,e,a,r);return Ad(o)}fy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Do(t.pendingLanes);n!==0&&(dp(t,n|1),un(t,yt()),!(We&6)&&(Ti=yt()+500,Vs()))}break;case 13:Na(function(){var r=Kr(e,1);if(r!==null){var a=Qt();tr(r,e,1,a)}}),Wp(e,1)}};up=function(e){if(e.tag===13){var t=Kr(e,134217728);if(t!==null){var n=Qt();tr(t,e,134217728,n)}Wp(e,134217728)}};my=function(e){if(e.tag===13){var t=Ps(e),n=Kr(e,t);if(n!==null){var r=Qt();tr(n,e,t,r)}Wp(e,t)}};py=function(){return qe};xy=function(e,t){var n=qe;try{return qe=e,t()}finally{qe=n}};zf=function(e,t,n){switch(t){case"input":if(Mf(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=uu(r);if(!a)throw Error(oe(90));Xw(r),Mf(r,a)}}}break;case"textarea":Gw(e,n);break;case"select":t=n.value,t!=null&&fi(e,!!n.multiple,t,!1)}};ny=Ip;ry=Na;var OC={usingClientEntryPoint:!1,Events:[Dl,si,uu,ey,ty,Ip]},po={findFiberByHostInstance:sa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zC={bundleType:po.bundleType,version:po.version,rendererPackageName:po.rendererPackageName,rendererConfig:po.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ts.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=iy(e),e===null?null:e.stateNode},findFiberByHostInstance:po.findFiberByHostInstance||PC,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 gc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gc.isDisabled&&gc.supportsFiber)try{ou=gc.inject(zC),jr=gc}catch{}}kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=OC;kn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vp(t))throw Error(oe(200));return TC(e,t,null,n)};kn.createRoot=function(e,t){if(!Vp(e))throw Error(oe(299));var n=!1,r="",a=Ib;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Bp(e,1,!1,null,null,n,!1,r,a),e[Gr]=t.current,tl(e.nodeType===8?e.parentNode:e),new Hp(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=iy(t),e=e===null?null:e.stateNode,e};kn.flushSync=function(e){return Na(e)};kn.hydrate=function(e,t,n){if(!yu(t))throw Error(oe(200));return bu(null,e,t,!0,n)};kn.hydrateRoot=function(e,t,n){if(!Vp(e))throw Error(oe(405));var r=n!=null&&n.hydratedSources||null,a=!1,i="",o=Ib;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Rb(t,null,e,1,n??null,a,!1,i,o),e[Gr]=t.current,tl(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 wu(t)};kn.render=function(e,t,n){if(!yu(t))throw Error(oe(200));return bu(null,e,t,!1,n)};kn.unmountComponentAtNode=function(e){if(!yu(e))throw Error(oe(40));return e._reactRootContainer?(Na(function(){bu(null,null,e,!1,function(){e._reactRootContainer=null,e[Gr]=null})}),!0):!1};kn.unstable_batchedUpdates=Ip;kn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!yu(n))throw Error(oe(200));if(e==null||e._reactInternals===void 0)throw Error(oe(38));return bu(e,t,n,!1,r)};kn.version="18.3.1-next-f1338f8080-20240426";function Lb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Lb)}catch(e){console.error(e)}}Lb(),Lw.exports=kn;var Nu=Lw.exports;const Fb=Km(Nu);var t0=Nu;bf.createRoot=t0.createRoot,bf.hydrateRoot=t0.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 dl(){return dl=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},dl.apply(this,arguments)}var Ss;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ss||(Ss={}));const n0="popstate";function $C(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:l}=r.location;return mm("",{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:Od(a)}return IC(t,n,null,e)}function kt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ub(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function RC(){return Math.random().toString(36).substr(2,8)}function r0(e,t){return{usr:e.state,key:e.key,idx:t}}function mm(e,t,n,r){return n===void 0&&(n=null),dl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?qi(t):t,{state:n,key:t&&t.key||r||RC()})}function Od(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 qi(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 IC(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,l=Ss.Pop,c=null,d=h();d==null&&(d=0,o.replaceState(dl({},o.state,{idx:d}),""));function h(){return(o.state||{idx:null}).idx}function u(){l=Ss.Pop;let b=h(),g=b==null?null:b-d;d=b,c&&c({action:l,location:v.location,delta:g})}function f(b,g){l=Ss.Push;let y=mm(v.location,b,g);d=h()+1;let x=r0(y,d),N=v.createHref(y);try{o.pushState(x,"",N)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(N)}i&&c&&c({action:l,location:v.location,delta:1})}function p(b,g){l=Ss.Replace;let y=mm(v.location,b,g);d=h();let x=r0(y,d),N=v.createHref(y);o.replaceState(x,"",N),i&&c&&c({action:l,location:v.location,delta:0})}function w(b){let g=a.location.origin!=="null"?a.location.origin:a.location.href,y=typeof b=="string"?b:Od(b);return y=y.replace(/ $/,"%20"),kt(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(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(n0,u),c=b,()=>{a.removeEventListener(n0,u),c=null}},createHref(b){return t(a,b)},createURL:w,encodeLocation(b){let g=w(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:p,go(b){return o.go(b)}};return v}var s0;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(s0||(s0={}));function LC(e,t,n){return n===void 0&&(n="/"),FC(e,t,n)}function FC(e,t,n,r){let a=typeof t=="string"?qi(t):t,i=Yp(a.pathname||"/",n);if(i==null)return null;let o=Bb(e);UC(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=JC(i);l=KC(o[c],d)}return l}function Bb(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("/")&&(kt(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=Os([r,c.relativePath]),h=n.concat(c);i.children&&i.children.length>0&&(kt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Bb(i.children,t,h,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:qC(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 Wb(i.path))a(i,o,c)}),t}function Wb(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=Wb(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 UC(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GC(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const BC=/^:[\w-]+$/,WC=3,HC=2,VC=1,YC=10,XC=-2,a0=e=>e==="*";function qC(e,t){let n=e.split("/"),r=n.length;return n.some(a0)&&(r+=XC),t&&(r+=HC),n.filter(a=>!a0(a)).reduce((a,i)=>a+(BC.test(i)?WC:i===""?VC:YC),r)}function GC(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 KC(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=QC({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:Os([i,u.pathname]),pathnameBase:r4(Os([i,u.pathnameBase])),route:f}),u.pathnameBase!=="/"&&(i=Os([i,u.pathnameBase]))}return o}function QC(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ZC(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 ZC(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ub(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 JC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ub(!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 Yp(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 e4(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?qi(e):e;return{pathname:n?n.startsWith("/")?n:t4(n,t):t,search:s4(r),hash:a4(a)}}function t4(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 Rh(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 n4(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Hb(e,t){let n=n4(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Vb(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=qi(e):(a=dl({},e),kt(!a.pathname||!a.pathname.includes("?"),Rh("?","pathname","search",a)),kt(!a.pathname||!a.pathname.includes("#"),Rh("#","pathname","hash",a)),kt(!a.search||!a.search.includes("#"),Rh("#","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=e4(a,l),d=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||h)&&(c.pathname+="/"),c}const Os=e=>e.join("/").replace(/\/\/+/g,"/"),r4=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),s4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,a4=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function i4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Yb=["post","put","patch","delete"];new Set(Yb);const o4=["get",...Yb];new Set(o4);/**
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 ul(){return ul=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},ul.apply(this,arguments)}const Xp=m.createContext(null),l4=m.createContext(null),Ra=m.createContext(null),ju=m.createContext(null),Ys=m.createContext({outlet:null,matches:[],isDataRoute:!1}),Xb=m.createContext(null);function c4(e,t){let{relative:n}=t===void 0?{}:t;Pl()||kt(!1);let{basename:r,navigator:a}=m.useContext(Ra),{hash:i,pathname:o,search:l}=Gb(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Os([r,o])),a.createHref({pathname:c,search:l,hash:i})}function Pl(){return m.useContext(ju)!=null}function Gi(){return Pl()||kt(!1),m.useContext(ju).location}function qb(e){m.useContext(Ra).static||m.useLayoutEffect(e)}function Dr(){let{isDataRoute:e}=m.useContext(Ys);return e?N4():d4()}function d4(){Pl()||kt(!1);let e=m.useContext(Xp),{basename:t,future:n,navigator:r}=m.useContext(Ra),{matches:a}=m.useContext(Ys),{pathname:i}=Gi(),o=JSON.stringify(Hb(a,n.v7_relativeSplatPath)),l=m.useRef(!1);return qb(()=>{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=Vb(d,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Os([t,u.pathname])),(h.replace?r.replace:r.push)(u,h.state,h)},[t,r,o,i,e])}function qp(){let{matches:e}=m.useContext(Ys),t=e[e.length-1];return t?t.params:{}}function Gb(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Ra),{matches:a}=m.useContext(Ys),{pathname:i}=Gi(),o=JSON.stringify(Hb(a,r.v7_relativeSplatPath));return m.useMemo(()=>Vb(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function u4(e,t){return h4(e,t)}function h4(e,t,n,r){Pl()||kt(!1);let{navigator:a}=m.useContext(Ra),{matches:i}=m.useContext(Ys),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=Gi(),h;if(t){var u;let b=typeof t=="string"?qi(t):t;c==="/"||(u=b.pathname)!=null&&u.startsWith(c)||kt(!1),h=b}else h=d;let f=h.pathname||"/",p=f;if(c!=="/"){let b=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(b.length).join("/")}let w=LC(e,{pathname:p}),v=g4(w&&w.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Os([c,a.encodeLocation?a.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Os([c,a.encodeLocation?a.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n,r);return t&&v?m.createElement(ju.Provider,{value:{location:ul({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Ss.Pop}},v):v}function f4(){let e=b4(),t=i4(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(f4,null);class p4 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(Ys.Provider,{value:this.props.routeContext},m.createElement(Xb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function x4(e){let{routeContext:t,match:n,children:r}=e,a=m.useContext(Xp);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Ys.Provider,{value:t},r)}function g4(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||kt(!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,b=null;n&&(p=l&&u.route.id?l[u.route.id]:void 0,v=u.route.errorElement||m4,c&&(d<0&&f===0?(j4("route-fallback"),w=!0,b=null):d===f&&(w=!0,b=u.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),y=()=>{let x;return p?x=v:w?x=b:u.route.Component?x=m.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=h,m.createElement(x4,{match:u,routeContext:{outlet:h,matches:g,isDataRoute:n!=null},children:x})};return n&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?m.createElement(p4,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:y(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):y()},null)}var Kb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Kb||{}),Qb=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}(Qb||{});function v4(e){let t=m.useContext(Xp);return t||kt(!1),t}function w4(e){let t=m.useContext(l4);return t||kt(!1),t}function y4(e){let t=m.useContext(Ys);return t||kt(!1),t}function Zb(e){let t=y4(),n=t.matches[t.matches.length-1];return n.route.id||kt(!1),n.route.id}function b4(){var e;let t=m.useContext(Xb),n=w4(),r=Zb();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function N4(){let{router:e}=v4(Kb.UseNavigateStable),t=Zb(Qb.UseNavigateStable),n=m.useRef(!1);return qb(()=>{n.current=!0}),m.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,ul({fromRouteId:t},i)))},[e,t])}const i0={};function j4(e,t,n){i0[e]||(i0[e]=!0)}function k4(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function nn(e){kt(!1)}function S4(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Ss.Pop,navigator:i,static:o=!1,future:l}=e;Pl()&&kt(!1);let c=t.replace(/^\/*/,"/"),d=m.useMemo(()=>({basename:c,navigator:i,static:o,future:ul({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=qi(r));let{pathname:h="/",search:u="",hash:f="",state:p=null,key:w="default"}=r,v=m.useMemo(()=>{let b=Yp(h,c);return b==null?null:{location:{pathname:b,search:u,hash:f,state:p,key:w},navigationType:a}},[c,h,u,f,p,w,a]);return v==null?null:m.createElement(Ra.Provider,{value:d},m.createElement(ju.Provider,{children:n,value:v}))}function C4(e){let{children:t,location:n}=e;return u4(pm(t),n)}new Promise(()=>{});function pm(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,pm(r.props.children,i));return}r.type!==nn&&kt(!1),!r.props.index||!r.props.children||kt(!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=pm(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 xm(){return xm=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},xm.apply(this,arguments)}function E4(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 M4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _4(e,t){return e.button===0&&(!t||t==="_self")&&!M4(e)}function gm(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 D4(e,t){let n=gm(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const T4=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],P4="6";try{window.__reactRouterVersion=P4}catch{}const A4="startTransition",o0=tp[A4];function O4(e){let{basename:t,children:n,future:r,window:a}=e,i=m.useRef();i.current==null&&(i.current=$C({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&&o0?o0(()=>c(u)):c(u)},[c,d]);return m.useLayoutEffect(()=>o.listen(h),[o,h]),m.useEffect(()=>k4(r),[r]),m.createElement(S4,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const z4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gp=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=E4(t,T4),{basename:p}=m.useContext(Ra),w,v=!1;if(typeof d=="string"&&$4.test(d)&&(w=d,z4))try{let x=new URL(window.location.href),N=d.startsWith("//")?new URL(x.protocol+d):new URL(d),j=Yp(N.pathname,p);N.origin===x.origin&&j!=null?d=j+N.search+N.hash:v=!0}catch{}let b=c4(d,{relative:a}),g=R4(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",xm({},f,{href:w||b,onClick:v||i?r:y,ref:n,target:c}))});var l0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(l0||(l0={}));var c0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(c0||(c0={}));function R4(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=Dr(),d=Gi(),h=Gb(e,{relative:o});return m.useCallback(u=>{if(_4(u,n)){u.preventDefault();let f=r!==void 0?r:Od(d)===Od(h);c(e,{replace:f,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[d,c,h,r,a,n,e,i,o,l])}function I4(e){let t=m.useRef(gm(e)),n=m.useRef(!1),r=Gi(),a=m.useMemo(()=>D4(r.search,n.current?null:t.current),[r.search]),i=Dr(),o=m.useCallback((l,c)=>{const d=gm(typeof l=="function"?l(a):l);n.current=!0,i("?"+d,c)},[i,a]);return[a,o]}function L4(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 F4=e=>{switch(e){case"success":return W4;case"info":return V4;case"warning":return H4;case"error":return Y4;default:return null}},U4=Array(12).fill(0),B4=({visible:e,className:t})=>Q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Q.createElement("div",{className:"sonner-spinner"},U4.map((n,r)=>Q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),W4=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),H4=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Q.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"})),V4=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),Y4=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),X4=Q.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"},Q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),q4=()=>{const[e,t]=Q.useState(document.hidden);return Q.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let vm=1;class G4{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:vm++,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],Q.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(Q4(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"&&!Q.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"&&!Q.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"&&!Q.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"&&!Q.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)||vm++;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 rn=new G4,K4=(e,t)=>{const n=(t==null?void 0:t.id)||vm++;return rn.addToast({title:e,...t,id:n}),n},Q4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Z4=K4,J4=()=>rn.toasts,eE=()=>rn.getActiveToasts(),V=Object.assign(Z4,{success:rn.success,info:rn.info,warning:rn.warning,error:rn.error,custom:rn.custom,message:rn.message,promise:rn.promise,dismiss:rn.dismiss,loading:rn.loading},{getHistory:J4,getToasts:eE});L4("[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 vc(e){return e.label!==void 0}const tE=3,nE="24px",rE="16px",d0=4e3,sE=356,aE=14,iE=45,oE=200;function ur(...e){return e.filter(Boolean).join(" ")}function lE(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const cE=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:b,index:g,toasts:y,expanded:x,removeToast:N,defaultRichColors:j,closeButton:k,style:S,cancelButtonStyle:M,actionButtonStyle:A,className:I="",descriptionClassName:U="",duration:$,position:L,gap:E,expandByDefault:O,classNames:D,icons:T,closeButtonAriaLabel:C="Close toast"}=e,[_,z]=Q.useState(null),[H,P]=Q.useState(null),[B,q]=Q.useState(!1),[G,se]=Q.useState(!1),[re,Z]=Q.useState(!1),[R,ee]=Q.useState(!1),[J,F]=Q.useState(!1),[K,ne]=Q.useState(0),[ce,ge]=Q.useState(0),ve=Q.useRef(u.duration||$||d0),Ae=Q.useRef(null),Te=Q.useRef(null),tt=g===0,ht=g+1<=v,Le=u.type,Oe=u.dismissible!==!1,Ge=u.className||"",Je=u.descriptionClassName||"",ot=Q.useMemo(()=>b.findIndex(fe=>fe.toastId===u.id)||0,[b,u.id]),Ot=Q.useMemo(()=>{var fe;return(fe=u.closeButton)!=null?fe:k},[u.closeButton,k]),zt=Q.useMemo(()=>u.duration||$||d0,[u.duration,$]),ae=Q.useRef(0),me=Q.useRef(0),ze=Q.useRef(0),X=Q.useRef(null),[le,W]=L.split("-"),te=Q.useMemo(()=>b.reduce((fe,Ve,vt)=>vt>=ot?fe:fe+Ve.height,0),[b,ot]),ue=q4(),Ne=u.invert||h,Se=Le==="loading";me.current=Q.useMemo(()=>ot*E+te,[ot,te]),Q.useEffect(()=>{ve.current=zt},[zt]),Q.useEffect(()=>{q(!0)},[]),Q.useEffect(()=>{const fe=Te.current;if(fe){const Ve=fe.getBoundingClientRect().height;return ge(Ve),w(vt=>[{toastId:u.id,height:Ve,position:u.position},...vt]),()=>w(vt=>vt.filter(Nt=>Nt.toastId!==u.id))}},[w,u.id]),Q.useLayoutEffect(()=>{if(!B)return;const fe=Te.current,Ve=fe.style.height;fe.style.height="auto";const vt=fe.getBoundingClientRect().height;fe.style.height=Ve,ge(vt),w(Nt=>Nt.find(Qe=>Qe.toastId===u.id)?Nt.map(Qe=>Qe.toastId===u.id?{...Qe,height:vt}:Qe):[{toastId:u.id,height:vt,position:u.position},...Nt])},[B,u.title,u.description,w,u.id,u.jsx,u.action,u.cancel]);const he=Q.useCallback(()=>{se(!0),ne(me.current),w(fe=>fe.filter(Ve=>Ve.toastId!==u.id)),setTimeout(()=>{N(u)},oE)},[u,N,w,me]);Q.useEffect(()=>{if(u.promise&&Le==="loading"||u.duration===1/0||u.type==="loading")return;let fe;return x||p||ue?(()=>{if(ze.current<ae.current){const Nt=new Date().getTime()-ae.current;ve.current=ve.current-Nt}ze.current=new Date().getTime()})():(()=>{ve.current!==1/0&&(ae.current=new Date().getTime(),fe=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),he()},ve.current))})(),()=>clearTimeout(fe)},[x,p,u,Le,ue,he]),Q.useEffect(()=>{u.delete&&(he(),u.onDismiss==null||u.onDismiss.call(u,u))},[he,u.delete]);function Pe(){var fe;if(T!=null&&T.loading){var Ve;return Q.createElement("div",{className:ur(D==null?void 0:D.loader,u==null||(Ve=u.classNames)==null?void 0:Ve.loader,"sonner-loader"),"data-visible":Le==="loading"},T.loading)}return Q.createElement(B4,{className:ur(D==null?void 0:D.loader,u==null||(fe=u.classNames)==null?void 0:fe.loader),visible:Le==="loading"})}const Me=u.icon||(T==null?void 0:T[Le])||F4(Le);var Fe,bt;return Q.createElement("li",{tabIndex:0,ref:Te,className:ur(I,Ge,D==null?void 0:D.toast,u==null||(t=u.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[Le],u==null||(n=u.classNames)==null?void 0:n[Le]),"data-sonner-toast":"","data-rich-colors":(Fe=u.richColors)!=null?Fe:j,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":B,"data-promise":!!u.promise,"data-swiped":J,"data-removed":G,"data-visible":ht,"data-y-position":le,"data-x-position":W,"data-index":g,"data-front":tt,"data-swiping":re,"data-dismissible":Oe,"data-type":Le,"data-invert":Ne,"data-swipe-out":R,"data-swipe-direction":H,"data-expanded":!!(x||O&&B),"data-testid":u.testId,style:{"--index":g,"--toasts-before":g,"--z-index":y.length-g,"--offset":`${G?K:me.current}px`,"--initial-height":O?"auto":`${ce}px`,...S,...u.style},onDragEnd:()=>{Z(!1),z(null),X.current=null},onPointerDown:fe=>{fe.button!==2&&(Se||!Oe||(Ae.current=new Date,ne(me.current),fe.target.setPointerCapture(fe.pointerId),fe.target.tagName!=="BUTTON"&&(Z(!0),X.current={x:fe.clientX,y:fe.clientY})))},onPointerUp:()=>{var fe,Ve,vt;if(R||!Oe)return;X.current=null;const Nt=Number(((fe=Te.current)==null?void 0:fe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),En=Number(((Ve=Te.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qe=new Date().getTime()-((vt=Ae.current)==null?void 0:vt.getTime()),$t=_==="x"?Nt:En,lr=Math.abs($t)/Qe;if(Math.abs($t)>=iE||lr>.11){ne(me.current),u.onDismiss==null||u.onDismiss.call(u,u),P(_==="x"?Nt>0?"right":"left":En>0?"down":"up"),he(),ee(!0);return}else{var qt,Rt;(qt=Te.current)==null||qt.style.setProperty("--swipe-amount-x","0px"),(Rt=Te.current)==null||Rt.style.setProperty("--swipe-amount-y","0px")}F(!1),Z(!1),z(null)},onPointerMove:fe=>{var Ve,vt,Nt;if(!X.current||!Oe||((Ve=window.getSelection())==null?void 0:Ve.toString().length)>0)return;const Qe=fe.clientY-X.current.y,$t=fe.clientX-X.current.x;var lr;const qt=(lr=e.swipeDirections)!=null?lr:lE(L);!_&&(Math.abs($t)>1||Math.abs(Qe)>1)&&z(Math.abs($t)>Math.abs(Qe)?"x":"y");let Rt={x:0,y:0};const La=hn=>1/(1.5+Math.abs(hn)/20);if(_==="y"){if(qt.includes("top")||qt.includes("bottom"))if(qt.includes("top")&&Qe<0||qt.includes("bottom")&&Qe>0)Rt.y=Qe;else{const hn=Qe*La(Qe);Rt.y=Math.abs(hn)<Math.abs(Qe)?hn:Qe}}else if(_==="x"&&(qt.includes("left")||qt.includes("right")))if(qt.includes("left")&&$t<0||qt.includes("right")&&$t>0)Rt.x=$t;else{const hn=$t*La($t);Rt.x=Math.abs(hn)<Math.abs($t)?hn:$t}(Math.abs(Rt.x)>0||Math.abs(Rt.y)>0)&&F(!0),(vt=Te.current)==null||vt.style.setProperty("--swipe-amount-x",`${Rt.x}px`),(Nt=Te.current)==null||Nt.style.setProperty("--swipe-amount-y",`${Rt.y}px`)}},Ot&&!u.jsx&&Le!=="loading"?Q.createElement("button",{"aria-label":C,"data-disabled":Se,"data-close-button":!0,onClick:Se||!Oe?()=>{}:()=>{he(),u.onDismiss==null||u.onDismiss.call(u,u)},className:ur(D==null?void 0:D.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(bt=T==null?void 0:T.close)!=null?bt:X4):null,(Le||u.icon||u.promise)&&u.icon!==null&&((T==null?void 0:T[Le])!==null||u.icon)?Q.createElement("div",{"data-icon":"",className:ur(D==null?void 0:D.icon,u==null||(a=u.classNames)==null?void 0:a.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||Pe():null,u.type!=="loading"?Me:null):null,Q.createElement("div",{"data-content":"",className:ur(D==null?void 0:D.content,u==null||(i=u.classNames)==null?void 0:i.content)},Q.createElement("div",{"data-title":"",className:ur(D==null?void 0:D.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?Q.createElement("div",{"data-description":"",className:ur(U,Je,D==null?void 0:D.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),Q.isValidElement(u.cancel)?u.cancel:u.cancel&&vc(u.cancel)?Q.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||M,onClick:fe=>{vc(u.cancel)&&Oe&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,fe),he())},className:ur(D==null?void 0:D.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,Q.isValidElement(u.action)?u.action:u.action&&vc(u.action)?Q.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||A,onClick:fe=>{vc(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,fe),!fe.defaultPrevented&&he())},className:ur(D==null?void 0:D.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function u0(){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 dE(e,t){const n={};return[e,t].forEach((r,a)=>{const i=a===1,o=i?"--mobile-offset":"--offset",l=i?rE:nE;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 uE=Q.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:b=tE,toastOptions:g,dir:y=u0(),gap:x=aE,icons:N,containerAriaLabel:j="Notifications"}=t,[k,S]=Q.useState([]),M=Q.useMemo(()=>r?k.filter(B=>B.toasterId===r):k.filter(B=>!B.toasterId),[k,r]),A=Q.useMemo(()=>Array.from(new Set([i].concat(M.filter(B=>B.position).map(B=>B.position)))),[M,i]),[I,U]=Q.useState([]),[$,L]=Q.useState(!1),[E,O]=Q.useState(!1),[D,T]=Q.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),C=Q.useRef(null),_=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=Q.useRef(null),H=Q.useRef(!1),P=Q.useCallback(B=>{S(q=>{var G;return(G=q.find(se=>se.id===B.id))!=null&&G.delete||rn.dismiss(B.id),q.filter(({id:se})=>se!==B.id)})},[]);return Q.useEffect(()=>rn.subscribe(B=>{if(B.dismiss){requestAnimationFrame(()=>{S(q=>q.map(G=>G.id===B.id?{...G,delete:!0}:G))});return}setTimeout(()=>{Fb.flushSync(()=>{S(q=>{const G=q.findIndex(se=>se.id===B.id);return G!==-1?[...q.slice(0,G),{...q[G],...B},...q.slice(G+1)]:[B,...q]})})})}),[k]),Q.useEffect(()=>{if(f!=="system"){T(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?T("dark"):T("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:q})=>{T(q?"dark":"light")})}catch{B.addListener(({matches:G})=>{try{T(G?"dark":"light")}catch(se){console.error(se)}})}},[f]),Q.useEffect(()=>{k.length<=1&&L(!1)},[k]),Q.useEffect(()=>{const B=q=>{var G;if(o.every(Z=>q[Z]||q.code===Z)){var re;L(!0),(re=C.current)==null||re.focus()}q.code==="Escape"&&(document.activeElement===C.current||(G=C.current)!=null&&G.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[o]),Q.useEffect(()=>{if(C.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,H.current=!1)}},[C.current]),Q.createElement("section",{ref:n,"aria-label":`${j} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((B,q)=>{var G;const[se,re]=B.split("-");return M.length?Q.createElement("ol",{key:B,dir:y==="auto"?u0():y,tabIndex:-1,ref:C,className:d,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":se,"data-x-position":re,style:{"--front-toast-height":`${((G=I[0])==null?void 0:G.height)||0}px`,"--width":`${sE}px`,"--gap":`${x}px`,...v,...dE(h,u)},onBlur:Z=>{H.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(H.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||H.current||(H.current=!0,z.current=Z.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{E||L(!1)},onDragEnd:()=>L(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},M.filter(Z=>!Z.position&&q===0||Z.position===B).map((Z,R)=>{var ee,J;return Q.createElement(cE,{key:Z.id,icons:N,index:R,toast:Z,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:b,closeButton:(J=g==null?void 0:g.closeButton)!=null?J:c,interacting:E,position:B,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:P,toasts:M.filter(F=>F.position==Z.position),heights:I.filter(F=>F.position==Z.position),setHeights:U,expandByDefault:l,gap:x,expanded:$,swipeDirections:t.swipeDirections})})):null}))});function Ct(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=Ct(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var hE={value:()=>{}};function ku(){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 Jc(n)}function Jc(e){this._=e}function fE(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}})}Jc.prototype=ku.prototype={constructor:Jc,on:function(e,t){var n=this._,r=fE(e+"",n),a,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((a=(e=r[i]).type)&&(a=mE(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]=h0(n[a],e.name,t);else if(t==null)for(a in n)n[a]=h0(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 Jc(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 mE(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function h0(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=hE,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var wm="http://www.w3.org/1999/xhtml";const f0={svg:"http://www.w3.org/2000/svg",xhtml:wm,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Su(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),f0.hasOwnProperty(t)?{space:f0[t],local:e}:e}function pE(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===wm&&t.documentElement.namespaceURI===wm?t.createElement(e):t.createElementNS(n,e)}}function xE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jb(e){var t=Su(e);return(t.local?xE:pE)(t)}function gE(){}function Kp(e){return e==null?gE:function(){return this.querySelector(e)}}function vE(e){typeof e!="function"&&(e=Kp(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 Nn(r,this._parents)}function wE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yE(){return[]}function e1(e){return e==null?yE:function(){return this.querySelectorAll(e)}}function bE(e){return function(){return wE(e.apply(this,arguments))}}function NE(e){typeof e=="function"?e=bE(e):e=e1(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 Nn(r,a)}function t1(e){return function(){return this.matches(e)}}function n1(e){return function(t){return t.matches(e)}}var jE=Array.prototype.find;function kE(e){return function(){return jE.call(this.children,e)}}function SE(){return this.firstElementChild}function CE(e){return this.select(e==null?SE:kE(typeof e=="function"?e:n1(e)))}var EE=Array.prototype.filter;function ME(){return Array.from(this.children)}function _E(e){return function(){return EE.call(this.children,e)}}function DE(e){return this.selectAll(e==null?ME:_E(typeof e=="function"?e:n1(e)))}function TE(e){typeof e!="function"&&(e=t1(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 Nn(r,this._parents)}function r1(e){return new Array(e.length)}function PE(){return new Nn(this._enter||this._groups.map(r1),this._parents)}function zd(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}zd.prototype={constructor:zd,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 AE(e){return function(){return e}}function OE(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 zd(e,i[o]);for(;o<c;++o)(l=t[o])&&(a[o]=l)}function zE(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 zd(e,i[l]);for(l=0;l<h;++l)(c=t[l])&&d.get(f[l])===c&&(a[l]=c)}function $E(e){return e.__data__}function RE(e,t){if(!arguments.length)return Array.from(this,$E);var n=t?zE:OE,r=this._parents,a=this._groups;typeof e!="function"&&(e=AE(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=IE(e.call(h,h&&h.__data__,d,r)),w=p.length,v=l[d]=new Array(w),b=o[d]=new Array(w),g=c[d]=new Array(f);n(h,u,v,b,g,p,t);for(var y=0,x=0,N,j;y<w;++y)if(N=v[y]){for(y>=x&&(x=y+1);!(j=b[x])&&++x<w;);N._next=j||null}}return o=new Nn(o,r),o._enter=l,o._exit=c,o}function IE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function LE(){return new Nn(this._exit||this._groups.map(r1),this._parents)}function FE(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 UE(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 Nn(l,this._parents)}function BE(){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 WE(e){e||(e=HE);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 Nn(a,this._parents).order()}function HE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function VE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function YE(){return Array.from(this)}function XE(){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 qE(){let e=0;for(const t of this)++e;return e}function GE(){return!this.node()}function KE(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 QE(e){return function(){this.removeAttribute(e)}}function ZE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function JE(e,t){return function(){this.setAttribute(e,t)}}function e3(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function t3(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function n3(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 r3(e,t){var n=Su(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?ZE:QE:typeof t=="function"?n.local?n3:t3:n.local?e3:JE)(n,t))}function s1(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function s3(e){return function(){this.style.removeProperty(e)}}function a3(e,t,n){return function(){this.style.setProperty(e,t,n)}}function i3(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function o3(e,t,n){return arguments.length>1?this.each((t==null?s3:typeof t=="function"?i3:a3)(e,t,n??"")):Pi(this.node(),e)}function Pi(e,t){return e.style.getPropertyValue(t)||s1(e).getComputedStyle(e,null).getPropertyValue(t)}function l3(e){return function(){delete this[e]}}function c3(e,t){return function(){this[e]=t}}function d3(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function u3(e,t){return arguments.length>1?this.each((t==null?l3:typeof t=="function"?d3:c3)(e,t)):this.node()[e]}function a1(e){return e.trim().split(/^|\s+/)}function Qp(e){return e.classList||new i1(e)}function i1(e){this._node=e,this._names=a1(e.getAttribute("class")||"")}i1.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 o1(e,t){for(var n=Qp(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function l1(e,t){for(var n=Qp(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function h3(e){return function(){o1(this,e)}}function f3(e){return function(){l1(this,e)}}function m3(e,t){return function(){(t.apply(this,arguments)?o1:l1)(this,e)}}function p3(e,t){var n=a1(e+"");if(arguments.length<2){for(var r=Qp(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?m3:t?h3:f3)(n,t))}function x3(){this.textContent=""}function g3(e){return function(){this.textContent=e}}function v3(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function w3(e){return arguments.length?this.each(e==null?x3:(typeof e=="function"?v3:g3)(e)):this.node().textContent}function y3(){this.innerHTML=""}function b3(e){return function(){this.innerHTML=e}}function N3(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function j3(e){return arguments.length?this.each(e==null?y3:(typeof e=="function"?N3:b3)(e)):this.node().innerHTML}function k3(){this.nextSibling&&this.parentNode.appendChild(this)}function S3(){return this.each(k3)}function C3(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function E3(){return this.each(C3)}function M3(e){var t=typeof e=="function"?e:Jb(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _3(){return null}function D3(e,t){var n=typeof e=="function"?e:Jb(e),r=t==null?_3:typeof t=="function"?t:Kp(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function T3(){var e=this.parentNode;e&&e.removeChild(this)}function P3(){return this.each(T3)}function A3(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function O3(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z3(e){return this.select(e?O3:A3)}function $3(e){return arguments.length?this.property("__data__",e):this.node().__data__}function R3(e){return function(t){e.call(this,t,this.__data__)}}function I3(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 L3(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 F3(e,t,n){return function(){var r=this.__on,a,i=R3(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 U3(e,t,n){var r=I3(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?F3:L3,a=0;a<i;++a)this.each(l(r[a],t,n));return this}function c1(e,t,n){var r=s1(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 B3(e,t){return function(){return c1(this,e,t)}}function W3(e,t){return function(){return c1(this,e,t.apply(this,arguments))}}function H3(e,t){return this.each((typeof t=="function"?W3:B3)(e,t))}function*V3(){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 d1=[null];function Nn(e,t){this._groups=e,this._parents=t}function Al(){return new Nn([[document.documentElement]],d1)}function Y3(){return this}Nn.prototype=Al.prototype={constructor:Nn,select:vE,selectAll:NE,selectChild:CE,selectChildren:DE,filter:TE,data:RE,enter:PE,exit:LE,join:FE,merge:UE,selection:Y3,order:BE,sort:WE,call:VE,nodes:YE,node:XE,size:qE,empty:GE,each:KE,attr:r3,style:o3,property:u3,classed:p3,text:w3,html:j3,raise:S3,lower:E3,append:M3,insert:D3,remove:P3,clone:z3,datum:$3,on:U3,dispatch:H3,[Symbol.iterator]:V3};function gn(e){return typeof e=="string"?new Nn([[document.querySelector(e)]],[document.documentElement]):new Nn([[e]],d1)}function X3(e){let t;for(;t=e.sourceEvent;)e=t;return e}function qn(e,t){if(e=X3(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 q3={passive:!1},hl={capture:!0,passive:!1};function Ih(e){e.stopImmediatePropagation()}function wi(e){e.preventDefault(),e.stopImmediatePropagation()}function u1(e){var t=e.document.documentElement,n=gn(e).on("dragstart.drag",wi,hl);"onselectstart"in t?n.on("selectstart.drag",wi,hl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function h1(e,t){var n=e.document.documentElement,r=gn(e).on("dragstart.drag",null);t&&(r.on("click.drag",wi,hl),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 wc=e=>()=>e;function ym(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}})}ym.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function G3(e){return!e.ctrlKey&&!e.button}function K3(){return this.parentNode}function Q3(e,t){return t??{x:e.x,y:e.y}}function Z3(){return navigator.maxTouchPoints||"ontouchstart"in this}function f1(){var e=G3,t=K3,n=Q3,r=Z3,a={},i=ku("start","drag","end"),o=0,l,c,d,h,u=0;function f(N){N.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",g,q3).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(N,j){if(!(h||!e.call(this,N,j))){var k=x(this,t.call(this,N,j),N,j,"mouse");k&&(gn(N.view).on("mousemove.drag",w,hl).on("mouseup.drag",v,hl),u1(N.view),Ih(N),d=!1,l=N.clientX,c=N.clientY,k("start",N))}}function w(N){if(wi(N),!d){var j=N.clientX-l,k=N.clientY-c;d=j*j+k*k>u}a.mouse("drag",N)}function v(N){gn(N.view).on("mousemove.drag mouseup.drag",null),h1(N.view,d),wi(N),a.mouse("end",N)}function b(N,j){if(e.call(this,N,j)){var k=N.changedTouches,S=t.call(this,N,j),M=k.length,A,I;for(A=0;A<M;++A)(I=x(this,S,N,j,k[A].identifier,k[A]))&&(Ih(N),I("start",N,k[A]))}}function g(N){var j=N.changedTouches,k=j.length,S,M;for(S=0;S<k;++S)(M=a[j[S].identifier])&&(wi(N),M("drag",N,j[S]))}function y(N){var j=N.changedTouches,k=j.length,S,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),S=0;S<k;++S)(M=a[j[S].identifier])&&(Ih(N),M("end",N,j[S]))}function x(N,j,k,S,M,A){var I=i.copy(),U=qn(A||k,j),$,L,E;if((E=n.call(N,new ym("beforestart",{sourceEvent:k,target:f,identifier:M,active:o,x:U[0],y:U[1],dx:0,dy:0,dispatch:I}),S))!=null)return $=E.x-U[0]||0,L=E.y-U[1]||0,function O(D,T,C){var _=U,z;switch(D){case"start":a[M]=O,z=o++;break;case"end":delete a[M],--o;case"drag":U=qn(C||T,j),z=o;break}I.call(D,N,new ym(D,{sourceEvent:T,subject:E,target:f,identifier:M,active:z,x:U[0]+$,y:U[1]+L,dx:U[0]-_[0],dy:U[1]-_[1],dispatch:I}),S)}}return f.filter=function(N){return arguments.length?(e=typeof N=="function"?N:wc(!!N),f):e},f.container=function(N){return arguments.length?(t=typeof N=="function"?N:wc(N),f):t},f.subject=function(N){return arguments.length?(n=typeof N=="function"?N:wc(N),f):n},f.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:wc(!!N),f):r},f.on=function(){var N=i.on.apply(i,arguments);return N===i?f:N},f.clickDistance=function(N){return arguments.length?(u=(N=+N)*N,f):Math.sqrt(u)},f}function Zp(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function m1(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ol(){}var fl=.7,$d=1/fl,yi="\\s*([+-]?\\d+)\\s*",ml="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J3=/^#([0-9a-f]{3,8})$/,e5=new RegExp(`^rgb\\(${yi},${yi},${yi}\\)$`),t5=new RegExp(`^rgb\\(${Sr},${Sr},${Sr}\\)$`),n5=new RegExp(`^rgba\\(${yi},${yi},${yi},${ml}\\)$`),r5=new RegExp(`^rgba\\(${Sr},${Sr},${Sr},${ml}\\)$`),s5=new RegExp(`^hsl\\(${ml},${Sr},${Sr}\\)$`),a5=new RegExp(`^hsla\\(${ml},${Sr},${Sr},${ml}\\)$`),m0={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};Zp(Ol,ja,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:p0,formatHex:p0,formatHex8:i5,formatHsl:o5,formatRgb:x0,toString:x0});function p0(){return this.rgb().formatHex()}function i5(){return this.rgb().formatHex8()}function o5(){return p1(this).formatHsl()}function x0(){return this.rgb().formatRgb()}function ja(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=J3.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?g0(t):n===3?new ln(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?yc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?yc(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=e5.exec(e))?new ln(t[1],t[2],t[3],1):(t=t5.exec(e))?new ln(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=n5.exec(e))?yc(t[1],t[2],t[3],t[4]):(t=r5.exec(e))?yc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=s5.exec(e))?y0(t[1],t[2]/100,t[3]/100,1):(t=a5.exec(e))?y0(t[1],t[2]/100,t[3]/100,t[4]):m0.hasOwnProperty(e)?g0(m0[e]):e==="transparent"?new ln(NaN,NaN,NaN,0):null}function g0(e){return new ln(e>>16&255,e>>8&255,e&255,1)}function yc(e,t,n,r){return r<=0&&(e=t=n=NaN),new ln(e,t,n,r)}function l5(e){return e instanceof Ol||(e=ja(e)),e?(e=e.rgb(),new ln(e.r,e.g,e.b,e.opacity)):new ln}function bm(e,t,n,r){return arguments.length===1?l5(e):new ln(e,t,n,r??1)}function ln(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Zp(ln,bm,m1(Ol,{brighter(e){return e=e==null?$d:Math.pow($d,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fl:Math.pow(fl,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ln(ha(this.r),ha(this.g),ha(this.b),Rd(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:v0,formatHex:v0,formatHex8:c5,formatRgb:w0,toString:w0}));function v0(){return`#${oa(this.r)}${oa(this.g)}${oa(this.b)}`}function c5(){return`#${oa(this.r)}${oa(this.g)}${oa(this.b)}${oa((isNaN(this.opacity)?1:this.opacity)*255)}`}function w0(){const e=Rd(this.opacity);return`${e===1?"rgb(":"rgba("}${ha(this.r)}, ${ha(this.g)}, ${ha(this.b)}${e===1?")":`, ${e})`}`}function Rd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ha(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function oa(e){return e=ha(e),(e<16?"0":"")+e.toString(16)}function y0(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function p1(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof Ol||(e=ja(e)),!e)return new Kn;if(e instanceof Kn)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 Kn(o,l,c,e.opacity)}function d5(e,t,n,r){return arguments.length===1?p1(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Zp(Kn,d5,m1(Ol,{brighter(e){return e=e==null?$d:Math.pow($d,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fl:Math.pow(fl,e),new Kn(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 ln(Lh(e>=240?e-240:e+120,a,r),Lh(e,a,r),Lh(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(b0(this.h),bc(this.s),bc(this.l),Rd(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=Rd(this.opacity);return`${e===1?"hsl(":"hsla("}${b0(this.h)}, ${bc(this.s)*100}%, ${bc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function b0(e){return e=(e||0)%360,e<0?e+360:e}function bc(e){return Math.max(0,Math.min(1,e||0))}function Lh(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 Jp=e=>()=>e;function u5(e,t){return function(n){return e+n*t}}function h5(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 f5(e){return(e=+e)==1?x1:function(t,n){return n-t?h5(t,n,e):Jp(isNaN(t)?n:t)}}function x1(e,t){var n=t-e;return n?u5(e,n):Jp(isNaN(e)?t:e)}const Id=function e(t){var n=f5(t);function r(a,i){var o=n((a=bm(a)).r,(i=bm(i)).r),l=n(a.g,i.g),c=n(a.b,i.b),d=x1(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 m5(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 p5(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function x5(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]=Ho(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 g5(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function gr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function v5(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]=Ho(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var Nm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fh=new RegExp(Nm.source,"g");function w5(e){return function(){return e}}function y5(e){return function(t){return e(t)+""}}function g1(e,t){var n=Nm.lastIndex=Fh.lastIndex=0,r,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Nm.exec(e))&&(a=Fh.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:gr(r,a)})),n=Fh.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?y5(c[0].x):w5(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 Ho(e,t){var n=typeof t,r;return t==null||n==="boolean"?Jp(t):(n==="number"?gr:n==="string"?(r=ja(t))?(t=r,Id):g1:t instanceof ja?Id:t instanceof Date?g5:p5(t)?m5:Array.isArray(t)?x5:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?v5:gr)(e,t)}var N0=180/Math.PI,jm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function v1(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)*N0,skewX:Math.atan(c)*N0,scaleX:o,scaleY:l}}var Nc;function b5(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jm:v1(t.a,t.b,t.c,t.d,t.e,t.f)}function N5(e){return e==null||(Nc||(Nc=document.createElementNS("http://www.w3.org/2000/svg","g")),Nc.setAttribute("transform",e),!(e=Nc.transform.baseVal.consolidate()))?jm:(e=e.matrix,v1(e.a,e.b,e.c,e.d,e.e,e.f))}function w1(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:gr(d,u)},{i:v-2,x:gr(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:gr(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:gr(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:gr(d,u)},{i:v-2,x:gr(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,b;++w<v;)u[(b=f[w]).i]=b.x(p);return u.join("")}}}var j5=w1(b5,"px, ","px)","deg)"),k5=w1(N5,", ",")",")"),S5=1e-12;function j0(e){return((e=Math.exp(e))+1/e)/2}function C5(e){return((e=Math.exp(e))-1/e)/2}function E5(e){return((e=Math.exp(2*e))-1)/(e+1)}const ed=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,b,g;if(v<S5)g=Math.log(f/d)/t,b=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),N=(f*f-d*d-r*v)/(2*f*n*y),j=Math.log(Math.sqrt(x*x+1)-x),k=Math.log(Math.sqrt(N*N+1)-N);g=(k-j)/t,b=function(S){var M=S*g,A=j0(j),I=d/(n*y)*(A*E5(t*M+j)-C5(j));return[l+I*p,c+I*w,d*A/j0(t*M+j)]}}return b.duration=g*1e3*t/Math.SQRT2,b}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 Ai=0,Po=0,xo=0,y1=1e3,Ld,Ao,Fd=0,ka=0,Cu=0,pl=typeof performance=="object"&&performance.now?performance:Date,b1=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ex(){return ka||(b1(M5),ka=pl.now()+Cu)}function M5(){ka=0}function Ud(){this._call=this._time=this._next=null}Ud.prototype=N1.prototype={constructor:Ud,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ex():+n)+(t==null?0:+t),!this._next&&Ao!==this&&(Ao?Ao._next=this:Ld=this,Ao=this),this._call=e,this._time=n,km()},stop:function(){this._call&&(this._call=null,this._time=1/0,km())}};function N1(e,t,n){var r=new Ud;return r.restart(e,t,n),r}function _5(){ex(),++Ai;for(var e=Ld,t;e;)(t=ka-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ai}function k0(){ka=(Fd=pl.now())+Cu,Ai=Po=0;try{_5()}finally{Ai=0,T5(),ka=0}}function D5(){var e=pl.now(),t=e-Fd;t>y1&&(Cu-=t,Fd=e)}function T5(){for(var e,t=Ld,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:Ld=n);Ao=e,km(r)}function km(e){if(!Ai){Po&&(Po=clearTimeout(Po));var t=e-ka;t>24?(e<1/0&&(Po=setTimeout(k0,e-pl.now()-Cu)),xo&&(xo=clearInterval(xo))):(xo||(Fd=pl.now(),xo=setInterval(D5,y1)),Ai=1,b1(k0))}}function S0(e,t,n){var r=new Ud;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var P5=ku("start","end","cancel","interrupt"),A5=[],j1=0,C0=1,Sm=2,td=3,E0=4,Cm=5,nd=6;function Eu(e,t,n,r,a,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;O5(e,n,{name:t,index:r,group:a,on:P5,tween:A5,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:j1})}function tx(e,t){var n=ir(e,t);if(n.state>j1)throw new Error("too late; already scheduled");return n}function Tr(e,t){var n=ir(e,t);if(n.state>td)throw new Error("too late; already running");return n}function ir(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function O5(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=N1(i,0,n.time);function i(d){n.state=C0,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!==C0)return c();for(h in r)if(p=r[h],p.name===n.name){if(p.state===td)return S0(o);p.state===E0?(p.state=nd,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[h]):+h<t&&(p.state=nd,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[h])}if(S0(function(){n.state===td&&(n.state=E0,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=td,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=Cm,1),u=-1,f=a.length;++u<f;)a[u].call(e,h);n.state===Cm&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=nd,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function rd(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<Cm,r.state=nd,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function z5(e){return this.each(function(){rd(this,e)})}function $5(e,t){var n,r;return function(){var a=Tr(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 R5(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=Tr(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 I5(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ir(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?$5:R5)(n,e,t))}function nx(e,t,n){var r=e._id;return e.each(function(){var a=Tr(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return ir(a,r).value[t]}}function k1(e,t){var n;return(typeof t=="number"?gr:t instanceof ja?Id:(n=ja(t))?(t=n,Id):g1)(e,t)}function L5(e){return function(){this.removeAttribute(e)}}function F5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function U5(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 B5(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 W5(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 H5(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 V5(e,t){var n=Su(e),r=n==="transform"?k5:k1;return this.attrTween(e,typeof t=="function"?(n.local?H5:W5)(n,r,nx(this,"attr."+e,t)):t==null?(n.local?F5:L5)(n):(n.local?B5:U5)(n,r,t))}function Y5(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function X5(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function q5(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&X5(e,i)),n}return a._value=t,a}function G5(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Y5(e,i)),n}return a._value=t,a}function K5(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=Su(e);return this.tween(n,(r.local?q5:G5)(r,t))}function Q5(e,t){return function(){tx(this,e).delay=+t.apply(this,arguments)}}function Z5(e,t){return t=+t,function(){tx(this,e).delay=t}}function J5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Q5:Z5)(t,e)):ir(this.node(),t).delay}function eM(e,t){return function(){Tr(this,e).duration=+t.apply(this,arguments)}}function tM(e,t){return t=+t,function(){Tr(this,e).duration=t}}function nM(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?eM:tM)(t,e)):ir(this.node(),t).duration}function rM(e,t){if(typeof t!="function")throw new Error;return function(){Tr(this,e).ease=t}}function sM(e){var t=this._id;return arguments.length?this.each(rM(t,e)):ir(this.node(),t).ease}function aM(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Tr(this,e).ease=n}}function iM(e){if(typeof e!="function")throw new Error;return this.each(aM(this._id,e))}function oM(e){typeof e!="function"&&(e=t1(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 Zr(r,this._parents,this._name,this._id)}function lM(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 Zr(o,this._parents,this._name,this._id)}function cM(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 dM(e,t,n){var r,a,i=cM(t)?tx:Tr;return function(){var o=i(this,e),l=o.on;l!==r&&(a=(r=l).copy()).on(t,n),o.on=a}}function uM(e,t){var n=this._id;return arguments.length<2?ir(this.node(),n).on.on(e):this.each(dM(n,e,t))}function hM(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function fM(){return this.on("end.remove",hM(this._id))}function mM(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Kp(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,Eu(d[f],t,n,f,d,ir(h,n)));return new Zr(i,this._parents,t,n)}function pM(e){var t=this._name,n=this._id;typeof e!="function"&&(e=e1(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=ir(h,n),v=0,b=f.length;v<b;++v)(p=f[v])&&Eu(p,t,n,v,f,w);i.push(f),o.push(h)}return new Zr(i,o,t,n)}var xM=Al.prototype.constructor;function gM(){return new xM(this._groups,this._parents)}function vM(e,t){var n,r,a;return function(){var i=Pi(this,e),o=(this.style.removeProperty(e),Pi(this,e));return i===o?null:i===n&&o===r?a:a=t(n=i,r=o)}}function S1(e){return function(){this.style.removeProperty(e)}}function wM(e,t,n){var r,a=n+"",i;return function(){var o=Pi(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}function yM(e,t,n){var r,a,i;return function(){var o=Pi(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Pi(this,e))),o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,l))}}function bM(e,t){var n,r,a,i="style."+t,o="end."+i,l;return function(){var c=Tr(this,e),d=c.on,h=c.value[i]==null?l||(l=S1(t)):void 0;(d!==n||a!==h)&&(r=(n=d).copy()).on(o,a=h),c.on=r}}function NM(e,t,n){var r=(e+="")=="transform"?j5:k1;return t==null?this.styleTween(e,vM(e,r)).on("end.style."+e,S1(e)):typeof t=="function"?this.styleTween(e,yM(e,r,nx(this,"style."+e,t))).each(bM(this._id,e)):this.styleTween(e,wM(e,r,t),n).on("end.style."+e,null)}function jM(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function kM(e,t,n){var r,a;function i(){var o=t.apply(this,arguments);return o!==a&&(r=(a=o)&&jM(e,o,n)),r}return i._value=t,i}function SM(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,kM(e,t,n??""))}function CM(e){return function(){this.textContent=e}}function EM(e){return function(){var t=e(this);this.textContent=t??""}}function MM(e){return this.tween("text",typeof e=="function"?EM(nx(this,"text",e)):CM(e==null?"":e+""))}function _M(e){return function(t){this.textContent=e.call(this,t)}}function DM(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&_M(a)),t}return r._value=e,r}function TM(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,DM(e))}function PM(){for(var e=this._name,t=this._id,n=C1(),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=ir(c,t);Eu(c,e,n,d,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Zr(r,this._parents,e,n)}function AM(){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=Tr(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 OM=0;function Zr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function C1(){return++OM}var zr=Al.prototype;Zr.prototype={constructor:Zr,select:mM,selectAll:pM,selectChild:zr.selectChild,selectChildren:zr.selectChildren,filter:oM,merge:lM,selection:gM,transition:PM,call:zr.call,nodes:zr.nodes,node:zr.node,size:zr.size,empty:zr.empty,each:zr.each,on:uM,attr:V5,attrTween:K5,style:NM,styleTween:SM,text:MM,textTween:TM,remove:fM,tween:I5,delay:J5,duration:nM,ease:sM,easeVarying:iM,end:AM,[Symbol.iterator]:zr[Symbol.iterator]};function zM(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $M={time:null,delay:0,duration:250,ease:zM};function RM(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 IM(e){var t,n;e instanceof Zr?(t=e._id,e=e._name):(t=C1(),(n=$M).time=ex(),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])&&Eu(c,e,t,d,o,n||RM(c,t));return new Zr(r,this._parents,e,t)}Al.prototype.interrupt=z5;Al.prototype.transition=IM;const jc=e=>()=>e;function LM(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 Mu=new Br(1,0,0);E1.prototype=Br.prototype;function E1(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Mu;return e.__zoom}function Uh(e){e.stopImmediatePropagation()}function go(e){e.preventDefault(),e.stopImmediatePropagation()}function FM(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function UM(){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 M0(){return this.__zoom||Mu}function BM(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function WM(){return navigator.maxTouchPoints||"ontouchstart"in this}function HM(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 M1(){var e=FM,t=UM,n=HM,r=BM,a=WM,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=ed,d=ku("start","zoom","end"),h,u,f,p=500,w=150,v=0,b=10;function g(E){E.property("__zoom",M0).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",I).filter(a).on("touchstart.zoom",U).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(E,O,D,T){var C=E.selection?E.selection():E;C.property("__zoom",M0),E!==C?j(E,O,D,T):C.interrupt().each(function(){k(this,arguments).event(T).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},g.scaleBy=function(E,O,D,T){g.scaleTo(E,function(){var C=this.__zoom.k,_=typeof O=="function"?O.apply(this,arguments):O;return C*_},D,T)},g.scaleTo=function(E,O,D,T){g.transform(E,function(){var C=t.apply(this,arguments),_=this.__zoom,z=D==null?N(C):typeof D=="function"?D.apply(this,arguments):D,H=_.invert(z),P=typeof O=="function"?O.apply(this,arguments):O;return n(x(y(_,P),z,H),C,o)},D,T)},g.translateBy=function(E,O,D,T){g.transform(E,function(){return n(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,T)},g.translateTo=function(E,O,D,T,C){g.transform(E,function(){var _=t.apply(this,arguments),z=this.__zoom,H=T==null?N(_):typeof T=="function"?T.apply(this,arguments):T;return n(Mu.translate(H[0],H[1]).scale(z.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof D=="function"?-D.apply(this,arguments):-D),_,o)},T,C)};function y(E,O){return O=Math.max(i[0],Math.min(i[1],O)),O===E.k?E:new Br(O,E.x,E.y)}function x(E,O,D){var T=O[0]-D[0]*E.k,C=O[1]-D[1]*E.k;return T===E.x&&C===E.y?E:new Br(E.k,T,C)}function N(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function j(E,O,D,T){E.on("start.zoom",function(){k(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(T).end()}).tween("zoom",function(){var C=this,_=arguments,z=k(C,_).event(T),H=t.apply(C,_),P=D==null?N(H):typeof D=="function"?D.apply(C,_):D,B=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),q=C.__zoom,G=typeof O=="function"?O.apply(C,_):O,se=c(q.invert(P).concat(B/q.k),G.invert(P).concat(B/G.k));return function(re){if(re===1)re=G;else{var Z=se(re),R=B/Z[2];re=new Br(R,P[0]-Z[0]*R,P[1]-Z[1]*R)}z.zoom(null,re)}})}function k(E,O,D){return!D&&E.__zooming||new S(E,O)}function S(E,O){this.that=E,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,O),this.taps=0}S.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,O){return this.mouse&&E!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var O=gn(this.that).datum();d.call(E,this.that,new LM(E,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),O)}};function M(E,...O){if(!e.apply(this,arguments))return;var D=k(this,O).event(E),T=this.__zoom,C=Math.max(i[0],Math.min(i[1],T.k*Math.pow(2,r.apply(this,arguments)))),_=qn(E);if(D.wheel)(D.mouse[0][0]!==_[0]||D.mouse[0][1]!==_[1])&&(D.mouse[1]=T.invert(D.mouse[0]=_)),clearTimeout(D.wheel);else{if(T.k===C)return;D.mouse=[_,T.invert(_)],rd(this),D.start()}go(E),D.wheel=setTimeout(z,w),D.zoom("mouse",n(x(y(T,C),D.mouse[0],D.mouse[1]),D.extent,o));function z(){D.wheel=null,D.end()}}function A(E,...O){if(f||!e.apply(this,arguments))return;var D=E.currentTarget,T=k(this,O,!0).event(E),C=gn(E.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",B,!0),_=qn(E,D),z=E.clientX,H=E.clientY;u1(E.view),Uh(E),T.mouse=[_,this.__zoom.invert(_)],rd(this),T.start();function P(q){if(go(q),!T.moved){var G=q.clientX-z,se=q.clientY-H;T.moved=G*G+se*se>v}T.event(q).zoom("mouse",n(x(T.that.__zoom,T.mouse[0]=qn(q,D),T.mouse[1]),T.extent,o))}function B(q){C.on("mousemove.zoom mouseup.zoom",null),h1(q.view,T.moved),go(q),T.event(q).end()}}function I(E,...O){if(e.apply(this,arguments)){var D=this.__zoom,T=qn(E.changedTouches?E.changedTouches[0]:E,this),C=D.invert(T),_=D.k*(E.shiftKey?.5:2),z=n(x(y(D,_),T,C),t.apply(this,O),o);go(E),l>0?gn(this).transition().duration(l).call(j,z,T,E):gn(this).call(g.transform,z,T,E)}}function U(E,...O){if(e.apply(this,arguments)){var D=E.touches,T=D.length,C=k(this,O,E.changedTouches.length===T).event(E),_,z,H,P;for(Uh(E),z=0;z<T;++z)H=D[z],P=qn(H,this),P=[P,this.__zoom.invert(P),H.identifier],C.touch0?!C.touch1&&C.touch0[2]!==P[2]&&(C.touch1=P,C.taps=0):(C.touch0=P,_=!0,C.taps=1+!!h);h&&(h=clearTimeout(h)),_&&(C.taps<2&&(u=P[0],h=setTimeout(function(){h=null},p)),rd(this),C.start())}}function $(E,...O){if(this.__zooming){var D=k(this,O).event(E),T=E.changedTouches,C=T.length,_,z,H,P;for(go(E),_=0;_<C;++_)z=T[_],H=qn(z,this),D.touch0&&D.touch0[2]===z.identifier?D.touch0[0]=H:D.touch1&&D.touch1[2]===z.identifier&&(D.touch1[0]=H);if(z=D.that.__zoom,D.touch1){var B=D.touch0[0],q=D.touch0[1],G=D.touch1[0],se=D.touch1[1],re=(re=G[0]-B[0])*re+(re=G[1]-B[1])*re,Z=(Z=se[0]-q[0])*Z+(Z=se[1]-q[1])*Z;z=y(z,Math.sqrt(re/Z)),H=[(B[0]+G[0])/2,(B[1]+G[1])/2],P=[(q[0]+se[0])/2,(q[1]+se[1])/2]}else if(D.touch0)H=D.touch0[0],P=D.touch0[1];else return;D.zoom("touch",n(x(z,H,P),D.extent,o))}}function L(E,...O){if(this.__zooming){var D=k(this,O).event(E),T=E.changedTouches,C=T.length,_,z;for(Uh(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),_=0;_<C;++_)z=T[_],D.touch0&&D.touch0[2]===z.identifier?delete D.touch0:D.touch1&&D.touch1[2]===z.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(z=qn(z,this),Math.hypot(u[0]-z[0],u[1]-z[1])<b)){var H=gn(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return g.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:jc(+E),g):r},g.filter=function(E){return arguments.length?(e=typeof E=="function"?E:jc(!!E),g):e},g.touchable=function(E){return arguments.length?(a=typeof E=="function"?E:jc(!!E),g):a},g.extent=function(E){return arguments.length?(t=typeof E=="function"?E:jc([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),g):t},g.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],g):[i[0],i[1]]},g.translateExtent=function(E){return arguments.length?(o[0][0]=+E[0][0],o[1][0]=+E[1][0],o[0][1]=+E[0][1],o[1][1]=+E[1][1],g):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},g.constrain=function(E){return arguments.length?(n=E,g):n},g.duration=function(E){return arguments.length?(l=+E,g):l},g.interpolate=function(E){return arguments.length?(c=E,g):c},g.on=function(){var E=d.on.apply(d,arguments);return E===d?g:E},g.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,g):Math.sqrt(v)},g.tapDistance=function(E){return arguments.length?(b=+E,g):b},g}const Mr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003: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."},xl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_1=["Enter"," ","Escape"],D1={"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 Oi;(function(e){e.Strict="strict",e.Loose="loose"})(Oi||(Oi={}));var fa;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(fa||(fa={}));var gl;(function(e){e.Partial="partial",e.Full="full"})(gl||(gl={}));const T1={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Ns;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ns||(Ns={}));var Bd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bd||(Bd={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));const _0={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top};function P1(e){return e===null?null:e?"valid":"invalid"}const A1=e=>"id"in e&&"source"in e&&"target"in e,VM=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),rx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),zl=(e,t=[0,0])=>{const{width:n,height:r}=ns(e),a=e.origin??t,i=n*a[0],o=r*a[1];return{x:e.position.x-i,y:e.position.y-o}},YM=(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):rx(a)?a:t.nodeLookup.get(a.id));const l=o?Wd(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return _u(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Du(n)},$l=(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=Wd(r);n=_u(n,a)}}),Du(n)},sx=(e,t,[n,r,a]=[0,0,1],i=!1,o=!1)=>{const l={...Il(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=vl(l,$i(d)),b=(p??0)*(w??0),g=i&&v>0;(!d.internals.handleBounds||g||v>=b||d.dragging)&&c.push(d)}return c},XM=(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 qM(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 GM({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:i},o){if(e.size===0)return Promise.resolve(!0);const l=qM(e,o),c=$l(l),d=ax(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 O1({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",Mr.error005());else{const p=l.measured.width,w=l.measured.height;p&&w&&(u=[[c,d],[c+p,d+w]])}else l&&Ri(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=Ri(u)?Sa(t,u,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(i==null||i("015",Mr.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 KM({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=XM(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 zi=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Sa=(e={x:0,y:0},t,n)=>({x:zi(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:zi(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function z1(e,t,n){const{width:r,height:a}=ns(n),{x:i,y:o}=n.internals.positionAbsolute;return Sa(e,[[i,o],[i+r,o+a]],t)}const D0=(e,t,n)=>e<t?zi(Math.abs(e-t),1,t)/t:e>n?-zi(Math.abs(e-n),1,t)/t:0,$1=(e,t,n=15,r=40)=>{const a=D0(e.x,r,t.width-r)*n,i=D0(e.y,r,t.height-r)*n;return[a,i]},_u=(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)}),Em=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Du=({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}=rx(e)?e.internals.positionAbsolute:zl(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}},Wd=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=rx(e)?e.internals.positionAbsolute:zl(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)}},R1=(e,t)=>Du(_u(Em(e),Em(t))),vl=(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)},T0=e=>Qn(e.width)&&Qn(e.height)&&Qn(e.x)&&Qn(e.y),Qn=e=>!isNaN(e)&&isFinite(e),QM=(e,t)=>{},Rl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Il=({x:e,y:t},[n,r,a],i=!1,o=[1,1])=>{const l={x:(e-n)/a,y:(t-r)/a};return i?Rl(l,o):l},Hd=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function Va(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 ZM(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Va(e,n),a=Va(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=Va(e.top??e.y??0,n),a=Va(e.bottom??e.y??0,n),i=Va(e.left??e.x??0,t),o=Va(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 JM(e,t,n,r,a,i){const{x:o,y:l}=Hd(e,[t,n,r]),{x:c,y:d}=Hd({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 ax=(e,t,n,r,a,i)=>{const o=ZM(i,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,d=Math.min(l,c),h=zi(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=JM(e,p,w,h,t,n),b={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-b.left+b.right,y:w-b.top+b.bottom,zoom:h}},wl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ri(e){return e!=null&&e!=="parent"}function ns(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 I1(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 L1(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 P0(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function e_(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function t_(e){return{...D1,...e||{}}}function Vo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:i,y:o}=Zn(e),l=Il({x:i-((a==null?void 0:a.left)??0),y:o-((a==null?void 0:a.top)??0)},r),{x:c,y:d}=n?Rl(l,t):l;return{xSnapped:c,ySnapped:d,...l}}const ix=e=>({width:e.offsetWidth,height:e.offsetHeight}),F1=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},n_=["INPUT","SELECT","TEXTAREA"];function U1(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:n_.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const B1=e=>"clientX"in e,Zn=(e,t)=>{var i,o;const n=B1(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,...ix(o)}})};function W1({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 kc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function O0({pos:e,x1:t,y1:n,x2:r,y2:a,c:i}){switch(e){case Ce.Left:return[t-kc(t-r,i),n];case Ce.Right:return[t+kc(r-t,i),n];case Ce.Top:return[t,n-kc(n-a,i)];case Ce.Bottom:return[t,n+kc(a-n,i)]}}function H1({sourceX:e,sourceY:t,sourcePosition:n=Ce.Bottom,targetX:r,targetY:a,targetPosition:i=Ce.Top,curvature:o=.25}){const[l,c]=O0({pos:n,x1:e,y1:t,x2:r,y2:a,c:o}),[d,h]=O0({pos:i,x1:r,y1:a,x2:e,y2:t,c:o}),[u,f,p,w]=W1({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 V1({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 r_({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 s_({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const i=_u(Wd(e),Wd(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 vl(o,Du(i))>0}const a_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,i_=(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)),Y1=(e,t)=>{if(!e.source||!e.target)return t;let n;return A1(e)?n={...e}:n={...e,id:a_(e)},i_(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function X1({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,i,o,l]=V1({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,i,o,l]}const z0={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},o_=({source:e,sourcePosition:t=Ce.Bottom,target:n})=>t===Ce.Left||t===Ce.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},$0=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function l_({source:e,sourcePosition:t=Ce.Bottom,target:n,targetPosition:r=Ce.Top,center:a,offset:i,stepPosition:o}){const l=z0[t],c=z0[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=o_({source:d,sourcePosition:t,target:h}),f=u.x!==0?"x":"y",p=u[f];let w=[],v,b;const g={x:0,y:0},y={x:0,y:0},[,,x,N]=V1({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,b=a.y??(d.y+h.y)/2):(v=a.x??(d.x+h.x)/2,b=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:b},{x:h.x,y:b}];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 $=Math.abs(e[f]-n[f]);if($<=i){const L=Math.min(i-1,i-$);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 $=f==="x"?"y":"x",L=l[f]===c[$],E=d[$]>h[$],O=d[$]<h[$];(l[f]===1&&(!L&&E||L&&O)||l[f]!==1&&(!L&&O||L&&E))&&(w=f==="x"?k:S)}const M={x:d.x+g.x,y:d.y+g.y},A={x:h.x+y.x,y:h.y+y.y},I=Math.max(Math.abs(M.x-w[0].x),Math.abs(A.x-w[0].x)),U=Math.max(Math.abs(M.y-w[0].y),Math.abs(A.y-w[0].y));I>=U?(v=(M.x+A.x)/2,b=w[0].y):(v=w[0].x,b=(M.y+A.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,b,x,N]}function c_(e,t,n,r){const a=Math.min($0(e,t)/2,$0(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 Mm({sourceX:e,sourceY:t,sourcePosition:n=Ce.Bottom,targetX:r,targetY:a,targetPosition:i=Ce.Top,borderRadius:o=5,centerX:l,centerY:c,offset:d=20,stepPosition:h=.5}){const[u,f,p,w,v]=l_({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 N="";return x>0&&x<u.length-1?N=c_(u[x-1],y,u[x+1],o):N=`${x===0?"M":"L"}${y.x} ${y.y}`,g+=N,g},""),f,p,w,v]}function R0(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function d_(e){var u;const{sourceNode:t,targetNode:n}=e;if(!R0(t)||!R0(n))return null;const r=t.internals.handleBounds||I0(t.handles),a=n.internals.handleBounds||I0(n.handles),i=L0((r==null?void 0:r.source)??[],e.sourceHandle),o=L0(e.connectionMode===Oi.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",Mr.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Ce.Bottom,c=(o==null?void 0:o.position)||Ce.Top,d=yl(t,i,l),h=yl(n,o,c);return{sourceX:d.x,sourceY:d.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function I0(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 yl(e,t,n=Ce.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??ns(e);if(r)return{x:a+o/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Ce.Top:return{x:a+o/2,y:i};case Ce.Right:return{x:a+o,y:i+l/2};case Ce.Bottom:return{x:a+o/2,y:i+l};case Ce.Left:return{x:a,y:i+l/2}}}function L0(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function _m(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function u_(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=_m(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 ox={nodeOrigin:[0,0],nodeExtent:xl,elevateNodesOnSelect:!0,defaults:{}},h_={...ox,checkEquality:!0};function lx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function f_(e,t,n){const r=lx(ox,n);for(const a of e.values())if(a.parentId)cx(a,e,t,r);else{const i=zl(a,r.nodeOrigin),o=Ri(a.extent)?a.extent:r.nodeExtent,l=Sa(i,o,ns(a));a.internals.positionAbsolute=l}}function m_(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 Dm(e,t,n,r){var c,d;const a=lx(h_,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=zl(h,a.nodeOrigin),p=Ri(h.extent)?h.extent:a.nodeExtent,w=Sa(f,p,ns(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:m_(h,u),z:q1(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&&cx(u,t,n,r)}return i}function p_(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 cx(e,t,n,r){const{elevateNodesOnSelect:a,nodeOrigin:i,nodeExtent:o}=lx(ox,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}p_(e,n);const d=a?1e3:0,{x:h,y:u,z:f}=x_(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 q1(e,t){return(Qn(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function x_(e,t,n,r,a){const{x:i,y:o}=t.internals.positionAbsolute,l=ns(e),c=zl(e,n),d=Ri(e.extent)?Sa(c,e.extent,l):c;let h=Sa({x:i+d.x,y:o+d.y},r,l);e.extent==="parent"&&(h=z1(h,l,t));const u=q1(e,a),f=t.internals.z??0;return{x:h.x,y:h.y,z:f>=u?f+1:u}}function dx(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=R1(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=ns(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)),b=Math.max(u.height,Math.round(l.height)),g=(v-u.width)*f[0],y=(b-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(N=>{e.some(j=>j.id===N.id)||a.push({id:N.id,type:"position",position:{x:N.position.x+p,y:N.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:b+(w?f[1]*w-y:0)}})}),a}function g_(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=ix(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=Ri(p.extent)?p.extent:i;let{positionAbsolute:x}=p.internals;p.parentId&&p.extent==="parent"?x=z1(x,w,t.get(p.parentId)):y&&(x=Sa(x,y,w));const N={...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,N),p.parentId&&cx(N,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(N,a)}))}}if(u.length>0){const f=dx(u,t,n,a);c.push(...f)}return{changes:c,updatedInternals:l}}async function v_({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 F0(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 G1(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}`;F0("source",c,h,e,a,o),F0("target",c,d,e,i,l),t.set(r.id,r)}}function K1(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:K1(n,t):!1}function U0(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 w_(e,t,n,r){const a=new Map;for(const[i,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!K1(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 Bh({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 y_({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=Rl(i,t);return{x:o.x-i.x,y:o.y-i.y}}function b_({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 b({noDragClassName:y,handleSelector:x,domNode:N,isSelectable:j,nodeId:k,nodeClickDistance:S=0}){f=gn(N);function M({x:$,y:L}){const{nodeLookup:E,nodeExtent:O,snapGrid:D,snapToGrid:T,nodeOrigin:C,onNodeDrag:_,onSelectionDrag:z,onError:H,updateNodePositions:P}=t();i={x:$,y:L};let B=!1;const q=l.size>1,G=q&&O?Em($l(l)):null,se=q&&T?y_({dragItems:l,snapGrid:D,x:$,y:L}):null;for(const[re,Z]of l){if(!E.has(re))continue;let R={x:$-Z.distance.x,y:L-Z.distance.y};T&&(R=se?{x:Math.round(R.x+se.x),y:Math.round(R.y+se.y)}:Rl(R,D));let ee=null;if(q&&O&&!Z.extent&&G){const{positionAbsolute:K}=Z.internals,ne=K.x-G.x+O[0][0],ce=K.x+Z.measured.width-G.x2+O[1][0],ge=K.y-G.y+O[0][1],ve=K.y+Z.measured.height-G.y2+O[1][1];ee=[[ne,ge],[ce,ve]]}const{position:J,positionAbsolute:F}=O1({nodeId:re,nextPosition:R,nodeLookup:E,nodeExtent:ee||O,nodeOrigin:C,onError:H});B=B||Z.position.x!==J.x||Z.position.y!==J.y,Z.position=J,Z.internals.positionAbsolute=F}if(w=w||B,!!B&&(P(l,!0),v&&(r||_||!k&&z))){const[re,Z]=Bh({nodeId:k,dragItems:l,nodeLookup:E});r==null||r(v,l,re,Z),_==null||_(v,re,Z),k||z==null||z(v,Z)}}async function A(){if(!h)return;const{transform:$,panBy:L,autoPanSpeed:E,autoPanOnNodeDrag:O}=t();if(!O){c=!1,cancelAnimationFrame(o);return}const[D,T]=$1(d,h,E);(D!==0||T!==0)&&(i.x=(i.x??0)-D/$[2],i.y=(i.y??0)-T/$[2],await L({x:D,y:T})&&M(i)),o=requestAnimationFrame(A)}function I($){var q;const{nodeLookup:L,multiSelectionActive:E,nodesDraggable:O,transform:D,snapGrid:T,snapToGrid:C,selectNodesOnDrag:_,onNodeDragStart:z,onSelectionDragStart:H,unselectNodesAndEdges:P}=t();u=!0,(!_||!j)&&!E&&k&&((q=L.get(k))!=null&&q.selected||P()),j&&_&&k&&(e==null||e(k));const B=Vo($.sourceEvent,{transform:D,snapGrid:T,snapToGrid:C,containerBounds:h});if(i=B,l=w_(L,O,B,k),l.size>0&&(n||z||!k&&H)){const[G,se]=Bh({nodeId:k,dragItems:l,nodeLookup:L});n==null||n($.sourceEvent,l,G,se),z==null||z($.sourceEvent,G,se),k||H==null||H($.sourceEvent,se)}}const U=f1().clickDistance(S).on("start",$=>{const{domNode:L,nodeDragThreshold:E,transform:O,snapGrid:D,snapToGrid:T}=t();h=(L==null?void 0:L.getBoundingClientRect())||null,p=!1,w=!1,v=$.sourceEvent,E===0&&I($),i=Vo($.sourceEvent,{transform:O,snapGrid:D,snapToGrid:T,containerBounds:h}),d=Zn($.sourceEvent,h)}).on("drag",$=>{const{autoPanOnNodeDrag:L,transform:E,snapGrid:O,snapToGrid:D,nodeDragThreshold:T,nodeLookup:C}=t(),_=Vo($.sourceEvent,{transform:E,snapGrid:O,snapToGrid:D,containerBounds:h});if(v=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||k&&!C.has(k))&&(p=!0),!p){if(!c&&L&&u&&(c=!0,A()),!u){const z=Zn($.sourceEvent,h),H=z.x-d.x,P=z.y-d.y;Math.sqrt(H*H+P*P)>T&&I($)}(i.x!==_.xSnapped||i.y!==_.ySnapped)&&l&&u&&(d=Zn($.sourceEvent,h),M(_))}}).on("end",$=>{if(!(!u||p)&&(c=!1,u=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:L,updateNodePositions:E,onNodeDragStop:O,onSelectionDragStop:D}=t();if(w&&(E(l,!1),w=!1),a||O||!k&&D){const[T,C]=Bh({nodeId:k,dragItems:l,nodeLookup:L,dragging:!1});a==null||a($.sourceEvent,l,T,C),O==null||O($.sourceEvent,T,C),k||D==null||D($.sourceEvent,C)}}}).filter($=>{const L=$.target;return!$.button&&(!y||!U0(L,`.${y}`,N))&&(!x||U0(L,x,N))});f.call(U)}function g(){f==null||f.on(".drag",null)}return{update:b,destroy:g}}function N_(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())vl(a,$i(i))>0&&r.push(i);return r}const j_=250;function k_(e,t,n,r){var l,c;let a=[],i=1/0;const o=N_(e,n,t+j_);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}=yl(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 Q1(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,...yl(o,c,c.position,!0)}:c}function Z1(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function S_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const J1=()=>!0;function C_(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:b,isValidConnection:g=J1,onReconnectEnd:y,updateConnection:x,getTransform:N,getFromHandle:j,autoPanSpeed:k,dragThreshold:S=1,handleDomNode:M}){const A=F1(e.target);let I=0,U;const{x:$,y:L}=Zn(e),E=Z1(i,M),O=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!O||!E)return;const T=Q1(a,E,r,c,t);if(!T)return;let C=Zn(e,O),_=!1,z=null,H=!1,P=null;function B(){if(!h||!O)return;const[J,F]=$1(C,O,k);f({x:J,y:F}),I=requestAnimationFrame(B)}const q={...T,nodeId:a,type:E,position:T.position},G=c.get(a);let re={inProgress:!0,isValid:null,from:yl(G,q,Ce.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:G,to:C,toHandle:null,toPosition:_0[q.position],toNode:null};function Z(){D=!0,x(re),w==null||w(e,{nodeId:a,handleId:r,handleType:E})}S===0&&Z();function R(J){if(!D){const{x:ce,y:ge}=Zn(J),ve=ce-$,Ae=ge-L;if(!(ve*ve+Ae*Ae>S*S))return;Z()}if(!j()||!q){ee(J);return}const F=N();C=Zn(J,O),U=k_(Il(C,F,!1,[1,1]),n,c,q),_||(B(),_=!0);const K=eN(J,{handle:U,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:o?"target":"source",isValidConnection:g,doc:A,lib:d,flowId:u,nodeLookup:c});P=K.handleDomNode,z=K.connection,H=S_(!!U,K.isValid);const ne={...re,isValid:H,to:K.toHandle&&H?Hd({x:K.toHandle.x,y:K.toHandle.y},F):C,toHandle:K.toHandle,toPosition:H&&K.toHandle?K.toHandle.position:_0[q.position],toNode:K.toHandle?c.get(K.toHandle.nodeId):null};H&&U&&re.toHandle&&ne.toHandle&&re.toHandle.type===ne.toHandle.type&&re.toHandle.nodeId===ne.toHandle.nodeId&&re.toHandle.id===ne.toHandle.id&&re.to.x===ne.to.x&&re.to.y===ne.to.y||(x(ne),re=ne)}function ee(J){if(!("touches"in J&&J.touches.length>0)){if(D){(U||P)&&z&&H&&(v==null||v(z));const{inProgress:F,...K}=re,ne={...K,toPosition:re.toHandle?re.toPosition:null};b==null||b(J,ne),i&&(y==null||y(J,ne))}p(),cancelAnimationFrame(I),_=!1,H=!1,z=null,P=null,A.removeEventListener("mousemove",R),A.removeEventListener("mouseup",ee),A.removeEventListener("touchmove",R),A.removeEventListener("touchend",ee)}}A.addEventListener("mousemove",R),A.addEventListener("mouseup",ee),A.addEventListener("touchmove",R),A.addEventListener("touchend",ee)}function eN(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:i,doc:o,lib:l,flowId:c,isValidConnection:d=J1,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}=Zn(e),v=o.elementFromPoint(p,w),b=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,g={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const y=Z1(void 0,b),x=b.getAttribute("data-nodeid"),N=b.getAttribute("data-handleid"),j=b.classList.contains("connectable"),k=b.classList.contains("connectableend");if(!x||!y)return g;const S={source:u?x:r,sourceHandle:u?N:a,target:u?r:x,targetHandle:u?a:N};g.connection=S;const A=j&&k&&(n===Oi.Strict?u&&y==="source"||!u&&y==="target":x!==r||N!==a);g.isValid=A&&d(S),g.toHandle=Q1(x,y,N,h,n,!0)}return g}const Tm={onPointerDown:C_,isValid:eN};function E_({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 N=n(),j=x.sourceEvent.ctrlKey&&wl()?10:1,k=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*h,S=N[2]*Math.pow(2,k*j);t.scaleTo(S)};let v=[0,0];const b=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 N=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const j=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],k=[j[0]-v[0],j[1]-v[1]];v=j;const S=r()*Math.max(N[2],Math.log(N[2]))*(p?-1:1),M={x:N[0]-k[0]*S,y:N[1]-k[1]*S},A=[[0,0],[c,d]];t.setViewportConstrained({x:M.x,y:M.y,zoom:N[2]},A,l)},y=M1().on("start",b).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:qn}}const M_=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Tu=e=>({x:e.x,y:e.y,zoom:e.k}),Wh=({x:e,y:t,zoom:n})=>Mu.translate(e,t).scale(n),ui=(e,t)=>e.target.closest(`.${t}`),tN=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),__=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Hh=(e,t=0,n=__,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},nN=e=>{const t=e.ctrlKey&&wl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function D_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:d}){return h=>{if(ui(h,t))return!1;h.preventDefault(),h.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(h.ctrlKey&&o){const b=qn(h),g=nN(h),y=u*Math.pow(2,g);r.scaleTo(n,y,b,h);return}const f=h.deltaMode===1?20:1;let p=a===fa.Vertical?0:h.deltaX*f,w=a===fa.Horizontal?0:h.deltaY*f;!wl()&&h.shiftKey&&a!==fa.Vertical&&(p=h.deltaY*f,w=0),r.translateBy(n,-(p/u)*i,-(w/u)*i,{internal:!0});const v=Tu(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 T_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const i=r.type==="wheel",o=!t&&i&&!r.ctrlKey,l=ui(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,a)}}function P_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,o,l;if((i=r.sourceEvent)!=null&&i.internal)return;const a=Tu(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 A_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return i=>{var o,l;e.usedRightMouseButton=!!(n&&tN(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,Tu(i.transform)))}}function O_({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&&tN(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&i(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),a&&M_(e.prevViewport,o.transform))){const c=Tu(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(o.sourceEvent,c)},n?150:0)}}}function z_({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 b;const f=e||t,p=n&&u.ctrlKey,w=u.type==="wheel";if(u.button===1&&u.type==="mousedown"&&(ui(u,`${d}-flow__node`)||ui(u,`${d}-flow__edge`)))return!0;if(!r&&!f&&!a&&!i&&!n||o||h&&!w||ui(u,l)&&w||ui(u,c)&&(!w||a&&w&&!e)||!n&&u.ctrlKey&&w)return!1;if(!n&&u.type==="touchstart"&&((b=u.touches)==null?void 0:b.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 $_({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=M1().clickDistance(!Qn(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(a),p=gn(e).call(f);x({x:i.x,y:i.y,zoom:zi(i.zoom,t,n)},[[0,0],[u.width,u.height]],a);const w=p.on("wheel.zoom"),v=p.on("dblclick.zoom");f.wheelDelta(nN);function b($,L){return p?new Promise(E=>{f==null||f.interpolate((L==null?void 0:L.interpolate)==="linear"?Ho:ed).transform(Hh(p,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),$)}):Promise.resolve(!1)}function g({noWheelClassName:$,noPanClassName:L,onPaneContextMenu:E,userSelectionActive:O,panOnScroll:D,panOnDrag:T,panOnScrollMode:C,panOnScrollSpeed:_,preventScrolling:z,zoomOnPinch:H,zoomOnScroll:P,zoomOnDoubleClick:B,zoomActivationKeyPressed:q,lib:G,onTransformChange:se,connectionInProgress:re}){O&&!h.isZoomingOrPanning&&y();const R=D&&!q&&!O?D_({zoomPanValues:h,noWheelClassName:$,d3Selection:p,d3Zoom:f,panOnScrollMode:C,panOnScrollSpeed:_,zoomOnPinch:H,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:c}):T_({noWheelClassName:$,preventScrolling:z,d3ZoomHandler:w});if(p.on("wheel.zoom",R,{passive:!1}),!O){const J=P_({zoomPanValues:h,onDraggingChange:d,onPanZoomStart:l});f.on("start",J);const F=A_({zoomPanValues:h,panOnDrag:T,onPaneContextMenu:!!E,onPanZoom:o,onTransformChange:se});f.on("zoom",F);const K=O_({zoomPanValues:h,panOnDrag:T,panOnScroll:D,onPaneContextMenu:E,onPanZoomEnd:c,onDraggingChange:d});f.on("end",K)}const ee=z_({zoomActivationKeyPressed:q,panOnDrag:T,zoomOnScroll:P,panOnScroll:D,zoomOnDoubleClick:B,zoomOnPinch:H,userSelectionActive:O,noPanClassName:L,noWheelClassName:$,lib:G,connectionInProgress:re});f.filter(ee),B?p.on("dblclick.zoom",v):p.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function x($,L,E){const O=Wh($),D=f==null?void 0:f.constrain()(O,L,E);return D&&await b(D),new Promise(T=>T(D))}async function N($,L){const E=Wh($);return await b(E,L),new Promise(O=>O(E))}function j($){if(p){const L=Wh($),E=p.property("__zoom");(E.k!==$.zoom||E.x!==$.x||E.y!==$.y)&&(f==null||f.transform(p,L,null,{sync:!0}))}}function k(){const $=p?E1(p.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function S($,L){return p?new Promise(E=>{f==null||f.interpolate((L==null?void 0:L.interpolate)==="linear"?Ho:ed).scaleTo(Hh(p,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),$)}):Promise.resolve(!1)}function M($,L){return p?new Promise(E=>{f==null||f.interpolate((L==null?void 0:L.interpolate)==="linear"?Ho:ed).scaleBy(Hh(p,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>E(!0)),$)}):Promise.resolve(!1)}function A($){f==null||f.scaleExtent($)}function I($){f==null||f.translateExtent($)}function U($){const L=!Qn($)||$<0?0:$;f==null||f.clickDistance(L)}return{update:g,destroy:y,setViewport:N,setViewportConstrained:x,getViewport:k,scaleTo:S,scaleBy:M,setScaleExtent:A,setTranslateExtent:I,syncViewport:j,setClickDistance:U}}var Ii;(function(e){e.Line="line",e.Handle="handle"})(Ii||(Ii={}));function R_({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 I_(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 cs(e,t){return Math.max(0,t-e)}function ds(e,t){return Math.max(0,e-t)}function Sc(e,t,n){return Math.max(0,t-e,e-n)}function B0(e,t){return e?!t:t}function L_(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:b,minHeight:g,maxHeight:y}=r,{x,y:N,width:j,height:k,aspectRatio:S}=e;let M=Math.floor(h?p-e.pointerX:0),A=Math.floor(u?w-e.pointerY:0);const I=j+(c?-M:M),U=k+(d?-A:A),$=-i[0]*j,L=-i[1]*k;let E=Sc(I,v,b),O=Sc(U,g,y);if(o){let C=0,_=0;c&&M<0?C=cs(x+M+$,o[0][0]):!c&&M>0&&(C=ds(x+I+$,o[1][0])),d&&A<0?_=cs(N+A+L,o[0][1]):!d&&A>0&&(_=ds(N+U+L,o[1][1])),E=Math.max(E,C),O=Math.max(O,_)}if(l){let C=0,_=0;c&&M>0?C=ds(x+M,l[0][0]):!c&&M<0&&(C=cs(x+I,l[1][0])),d&&A>0?_=ds(N+A,l[0][1]):!d&&A<0&&(_=cs(N+U,l[1][1])),E=Math.max(E,C),O=Math.max(O,_)}if(a){if(h){const C=Sc(I/S,g,y)*S;if(E=Math.max(E,C),o){let _=0;!c&&!d||c&&!d&&f?_=ds(N+L+I/S,o[1][1])*S:_=cs(N+L+(c?M:-M)/S,o[0][1])*S,E=Math.max(E,_)}if(l){let _=0;!c&&!d||c&&!d&&f?_=cs(N+I/S,l[1][1])*S:_=ds(N+(c?M:-M)/S,l[0][1])*S,E=Math.max(E,_)}}if(u){const C=Sc(U*S,v,b)/S;if(O=Math.max(O,C),o){let _=0;!c&&!d||d&&!c&&f?_=ds(x+U*S+$,o[1][0])/S:_=cs(x+(d?A:-A)*S+$,o[0][0])/S,O=Math.max(O,_)}if(l){let _=0;!c&&!d||d&&!c&&f?_=cs(x+U*S,l[1][0])/S:_=ds(x+(d?A:-A)*S,l[0][0])/S,O=Math.max(O,_)}}}A=A+(A<0?O:-O),M=M+(M<0?E:-E),a&&(f?I>U*S?A=(B0(c,d)?-M:M)/S:M=(B0(c,d)?-A:A)*S:h?(A=M/S,d=c):(M=A*S,c=d));const D=c?x+M:x,T=d?N+A:N;return{width:j+(c?-M:M),height:k+(d?-A:A),x:i[0]*M*(c?-1:1)+D,y:i[1]*A*(d?-1:1)+T}}const rN={width:0,height:0,x:0,y:0},F_={...rN,pointerX:0,pointerY:0,aspectRatio:1};function U_(e){return[[0,0],[e.measured.width,e.measured.height]]}function B_(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 W_({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 b={...rN},g={...F_};const y=I_(c);let x,N=null,j=[],k,S,M,A=!1;const I=f1().on("start",U=>{const{nodeLookup:$,transform:L,snapGrid:E,snapToGrid:O,nodeOrigin:D,paneDomNode:T}=n();if(x=$.get(t),!x)return;N=(T==null?void 0:T.getBoundingClientRect())??null;const{xSnapped:C,ySnapped:_}=Vo(U.sourceEvent,{transform:L,snapGrid:E,snapToGrid:O,containerBounds:N});b={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},g={...b,pointerX:C,pointerY:_,aspectRatio:b.width/b.height},k=void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(k=$.get(x.parentId),S=k&&x.extent==="parent"?U_(k):void 0),j=[],M=void 0;for(const[z,H]of $)if(H.parentId===t&&(j.push({id:z,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const P=B_(H,x,H.origin??D);M?M=[[Math.min(P[0][0],M[0][0]),Math.min(P[0][1],M[0][1])],[Math.max(P[1][0],M[1][0]),Math.max(P[1][1],M[1][1])]]:M=P}f==null||f(U,{...b})}).on("drag",U=>{const{transform:$,snapGrid:L,snapToGrid:E,nodeOrigin:O}=n(),D=Vo(U.sourceEvent,{transform:$,snapGrid:L,snapToGrid:E,containerBounds:N}),T=[];if(!x)return;const{x:C,y:_,width:z,height:H}=b,P={},B=x.origin??O,{width:q,height:G,x:se,y:re}=L_(g,y,D,d,h,B,S,M),Z=q!==z,R=G!==H,ee=se!==C&&Z,J=re!==_&&R;if(!ee&&!J&&!Z&&!R)return;if((ee||J||B[0]===1||B[1]===1)&&(P.x=ee?se:b.x,P.y=J?re:b.y,b.x=P.x,b.y=P.y,j.length>0)){const ce=se-C,ge=re-_;for(const ve of j)ve.position={x:ve.position.x-ce+B[0]*(q-z),y:ve.position.y-ge+B[1]*(G-H)},T.push(ve)}if((Z||R)&&(P.width=Z&&(!u||u==="horizontal")?q:b.width,P.height=R&&(!u||u==="vertical")?G:b.height,b.width=P.width,b.height=P.height),k&&x.expandParent){const ce=B[0]*(P.width??0);P.x&&P.x<ce&&(b.x=ce,g.x=g.x-(P.x-ce));const ge=B[1]*(P.height??0);P.y&&P.y<ge&&(b.y=ge,g.y=g.y-(P.y-ge))}const F=R_({width:b.width,prevWidth:z,height:b.height,prevHeight:H,affectsX:y.affectsX,affectsY:y.affectsY}),K={...b,direction:F};(v==null?void 0:v(U,K))!==!1&&(A=!0,p==null||p(U,K),r(P,T))}).on("end",U=>{A&&(w==null||w(U,{...b}),a==null||a({...b}),A=!1)});i.call(I)}function l(){i.on(".drag",null)}return{update:o,destroy:l}}var sN={exports:{}},aN={},iN={exports:{}},oN={};/**
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 Li=m;function H_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var V_=typeof Object.is=="function"?Object.is:H_,Y_=Li.useState,X_=Li.useEffect,q_=Li.useLayoutEffect,G_=Li.useDebugValue;function K_(e,t){var n=t(),r=Y_({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return q_(function(){a.value=n,a.getSnapshot=t,Vh(a)&&i({inst:a})},[e,n,t]),X_(function(){return Vh(a)&&i({inst:a}),e(function(){Vh(a)&&i({inst:a})})},[e]),G_(n),n}function Vh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!V_(e,n)}catch{return!0}}function Q_(e,t){return t()}var Z_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Q_:K_;oN.useSyncExternalStore=Li.useSyncExternalStore!==void 0?Li.useSyncExternalStore:Z_;iN.exports=oN;var J_=iN.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 Pu=m,eD=J_;function tD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nD=typeof Object.is=="function"?Object.is:tD,rD=eD.useSyncExternalStore,sD=Pu.useRef,aD=Pu.useEffect,iD=Pu.useMemo,oD=Pu.useDebugValue;aN.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var i=sD(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=iD(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,nD(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=rD(e,i[0],i[1]);return aD(function(){o.hasValue=!0,o.value=l},[l]),oD(l),l};sN.exports=aN;var lD=sN.exports;const cD=Km(lD),dD={},W0=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:()=>{(dD?"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},uD=e=>e?W0(e):W0,{useDebugValue:hD}=Q,{useSyncExternalStoreWithSelector:fD}=cD,mD=e=>e;function lN(e,t=mD,n){const r=fD(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return hD(r),r}const H0=(e,t)=>{const n=uD(e),r=(a,i=t)=>lN(n,a,i);return Object.assign(r,n),r},pD=(e,t)=>e?H0(e,t):H0;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 Au=m.createContext(null),xD=Au.Provider,cN=Mr.error001();function Be(e,t){const n=m.useContext(Au);if(n===null)throw new Error(cN);return lN(n,e,t)}function dt(){const e=m.useContext(Au);if(e===null)throw new Error(cN);return m.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const V0={display:"none"},gD={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},dN="react-flow__node-desc",uN="react-flow__edge-desc",vD="react-flow__aria-live",wD=e=>e.ariaLiveMessage,yD=e=>e.ariaLabelConfig;function bD({rfId:e}){const t=Be(wD);return s.jsx("div",{id:`${vD}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:gD,children:t})}function ND({rfId:e,disableKeyboardA11y:t}){const n=Be(yD);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:`${dN}-${e}`,style:V0,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),s.jsx("div",{id:`${uN}-${e}`,style:V0,children:n["edge.a11yDescription.default"]}),!t&&s.jsx(bD,{rfId:e})]})}const Ou=m.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},i)=>{const o=`${e}`.split("-");return s.jsx("div",{className:Ct(["react-flow__panel",n,...o]),style:r,ref:i,...a,children:t})});Ou.displayName="Panel";function jD({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:s.jsx(Ou,{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 kD=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}},Cc=e=>e.id;function SD(e,t){return gt(e.selectedNodes.map(Cc),t.selectedNodes.map(Cc))&&gt(e.selectedEdges.map(Cc),t.selectedEdges.map(Cc))}function CD({onSelectionChange:e}){const t=dt(),{selectedNodes:n,selectedEdges:r}=Be(kD,SD);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 ED=e=>!!e.onSelectionChangeHandlers;function MD({onSelectionChange:e}){const t=Be(ED);return e||t?s.jsx(CD,{onSelectionChange:e}):null}const hN=[0,0],_D={x:0,y:0,zoom:1},DD=["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"],Y0=[...DD,"rfId"],TD=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}),X0={translateExtent:xl,nodeOrigin:hN,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function PD(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:i,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=Be(TD,gt),h=dt();m.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=X0,l()}),[]);const u=m.useRef(X0);return m.useEffect(()=>{for(const f of Y0){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:t_(p)}):f==="fitView"?h.setState({fitViewQueued:p}):f==="fitViewOptions"?h.setState({fitViewOptions:p}):h.setState({[f]:p})))}u.current=e},Y0.map(f=>e[f])),null}function q0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function AD(e){var r;const[t,n]=m.useState(e==="system"?null:e);return m.useEffect(()=>{if(e!=="system"){n(e);return}const a=q0(),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=q0())!=null&&r.matches?"dark":"light"}const G0=typeof document<"u"?document:null;function bl(e=null,t={target:G0,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)??G0,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=p=>{var b,g;if(a.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!a.current||a.current&&!d)&&U1(p))return!1;const v=Q0(p.code,l);if(i.current.add(p[v]),K0(o,i.current,!1)){const y=((g=(b=p.composedPath)==null?void 0:b.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=Q0(p.code,l);K0(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 K0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function Q0(e,t){return t.includes(e)?"code":"key"}const OD=()=>{const e=dt();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=ax(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 Il(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=Hd(t,n);return{x:o.x+a,y:o.y+i}}}),[])};function fN(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)zD(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 zD(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 mN(e,t){return fN(e,t)}function pN(e,t){return fN(e,t)}function ea(e,t){return{id:e,type:"select",selected:t}}function hi(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(ea(i.id,o)))}return r}function Z0({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 J0(e){return{id:e.id,type:"remove"}}const ev=e=>VM(e),$D=e=>A1(e);function xN(e){return m.forwardRef(e)}const RD=typeof window<"u"?m.useLayoutEffect:m.useEffect;function tv(e){const[t,n]=m.useState(BigInt(0)),[r]=m.useState(()=>ID(()=>n(a=>a+BigInt(1))));return RD(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function ID(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const gN=m.createContext(null);function LD({children:e}){const t=dt(),n=m.useCallback(l=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:h,onNodesChange:u,nodeLookup:f,fitViewQueued:p}=t.getState();let w=c;for(const b of l)w=typeof b=="function"?b(w):b;const v=Z0({items:w,lookup:f});h&&d(w),v.length>0?u==null||u(v):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:g,setNodes:y}=t.getState();b&&y(g)})},[]),r=tv(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(Z0({items:p,lookup:f}))},[]),i=tv(a),o=m.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return s.jsx(gN.Provider,{value:o,children:e})}function FD(){const e=m.useContext(gN);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const UD=e=>!!e.panZoom;function ux(){const e=OD(),t=dt(),n=FD(),r=Be(UD),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=ev(u)?u:f.get(u.id),v=w.parentId?L1(w.position,w.measured,w.parentId,f,p):w.position,b={...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(b)},d=(u,f,p={replace:!1})=>{o(w=>w.map(v=>{if(v.id===u){const b=typeof f=="function"?f(v):f;return p.replace&&ev(b)?b:{...v,...b}}return v}))},h=(u,f,p={replace:!1})=>{l(w=>w.map(v=>{if(v.id===u){const b=typeof f=="function"?f(v):f;return p.replace&&$D(b)?b:{...v,...b}}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,b]=p;return{nodes:u.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:w,y:v,zoom:b}}},deleteElements:async({nodes:u=[],edges:f=[]})=>{const{nodes:p,edges:w,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:g,triggerEdgeChanges:y,onDelete:x,onBeforeDelete:N}=t.getState(),{nodes:j,edges:k}=await KM({nodesToRemove:u,edgesToRemove:f,nodes:p,edges:w,onBeforeDelete:N}),S=k.length>0,M=j.length>0;if(S){const A=k.map(J0);b==null||b(k),y(A)}if(M){const A=j.map(J0);v==null||v(j),g(A)}return(M||S)&&(x==null||x({nodes:j,edges:k})),{deletedNodes:j,deletedEdges:k}},getIntersectingNodes:(u,f=!0,p)=>{const w=T0(u),v=w?u:c(u),b=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(b?g:y),N=vl(x,v);return f&&N>0||N>=x.width*x.height||N>=v.width*v.height}):[]},isNodeIntersecting:(u,f,p=!0)=>{const v=T0(u)?u:c(u);if(!v)return!1;const b=vl(v,f);return p&&b>0||b>=f.width*f.height||b>=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 YM(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??e_();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 nv=e=>e.selected,BD=typeof window<"u"?window:void 0;function WD({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=dt(),{deleteElements:r}=ux(),a=bl(e,{actInsideInputWithModifier:!1}),i=bl(t,{target:BD});m.useEffect(()=>{if(a){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(nv),edges:o.filter(nv)}),n.setState({nodesSelectionActive:!1})}},[a]),m.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function HD(e){const t=dt();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=ix(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Mr.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 zu={position:"absolute",width:"100%",height:"100%",top:0,left:0},VD=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function YD({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:i=fa.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:b,onViewportChange:g,isControlledViewport:y,paneClickDistance:x}){const N=dt(),j=m.useRef(null),{userSelectionActive:k,lib:S,connectionInProgress:M}=Be(VD,gt),A=bl(f),I=m.useRef();HD(j);const U=m.useCallback($=>{g==null||g({x:$[0],y:$[1],zoom:$[2]}),y||N.setState({transform:$})},[g,y]);return m.useEffect(()=>{if(j.current){I.current=$_({domNode:j.current,minZoom:h,maxZoom:u,translateExtent:d,viewport:c,paneClickDistance:x,onDraggingChange:O=>N.setState({paneDragging:O}),onPanZoomStart:(O,D)=>{const{onViewportChangeStart:T,onMoveStart:C}=N.getState();C==null||C(O,D),T==null||T(D)},onPanZoom:(O,D)=>{const{onViewportChange:T,onMove:C}=N.getState();C==null||C(O,D),T==null||T(D)},onPanZoomEnd:(O,D)=>{const{onViewportChangeEnd:T,onMoveEnd:C}=N.getState();C==null||C(O,D),T==null||T(D)}});const{x:$,y:L,zoom:E}=I.current.getViewport();return N.setState({panZoom:I.current,transform:[$,L,E],domNode:j.current.closest(".react-flow")}),()=>{var O;(O=I.current)==null||O.destroy()}}},[]),m.useEffect(()=>{var $;($=I.current)==null||$.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:A,preventScrolling:p,noPanClassName:b,userSelectionActive:k,noWheelClassName:v,lib:S,onTransformChange:U,connectionInProgress:M})},[e,t,n,r,a,i,o,l,A,p,b,k,v,S,U,M]),s.jsx("div",{className:"react-flow__renderer",ref:j,style:zu,children:w})}const XD=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qD(){const{userSelectionActive:e,userSelectionRect:t}=Be(XD,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 Yh=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},GD=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function KD({isSelecting:e,selectionKeyPressed:t,selectionMode:n=gl.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=dt(),{userSelectionActive:v,elementsSelectable:b,dragging:g,connectionInProgress:y}=Be(GD,gt),x=b&&(e||v),N=m.useRef(null),j=m.useRef(),k=m.useRef(new Set),S=m.useRef(new Set),M=m.useRef(!1),A=m.useRef(!1),I=T=>{if(M.current||y){M.current=!1;return}l==null||l(T),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},U=T=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){T.preventDefault();return}c==null||c(T)},$=d?T=>d(T):void 0,L=T=>{var P,B;const{resetSelectedElements:C,domNode:_}=w.getState();if(j.current=_==null?void 0:_.getBoundingClientRect(),!b||!e||T.button!==0||T.target!==N.current||!j.current)return;(B=(P=T.target)==null?void 0:P.setPointerCapture)==null||B.call(P,T.pointerId),A.current=!0,M.current=!1;const{x:z,y:H}=Zn(T.nativeEvent,j.current);C(),w.setState({userSelectionRect:{width:0,height:0,startX:z,startY:H,x:z,y:H}}),i==null||i(T)},E=T=>{const{userSelectionRect:C,transform:_,nodeLookup:z,edgeLookup:H,connectionLookup:P,triggerNodeChanges:B,triggerEdgeChanges:q,defaultEdgeOptions:G}=w.getState();if(!j.current||!C)return;M.current=!0;const{x:se,y:re}=Zn(T.nativeEvent,j.current),{startX:Z,startY:R}=C,ee={startX:Z,startY:R,x:se<Z?se:Z,y:re<R?re:R,width:Math.abs(se-Z),height:Math.abs(re-R)},J=k.current,F=S.current;k.current=new Set(sx(z,ee,_,n===gl.Partial,!0).map(ne=>ne.id)),S.current=new Set;const K=(G==null?void 0:G.selectable)??!0;for(const ne of k.current){const ce=P.get(ne);if(ce)for(const{edgeId:ge}of ce.values()){const ve=H.get(ge);ve&&(ve.selectable??K)&&S.current.add(ge)}}if(!P0(J,k.current)){const ne=hi(z,k.current,!0);B(ne)}if(!P0(F,S.current)){const ne=hi(H,S.current);q(ne)}w.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},O=T=>{var _,z;if(T.button!==0||!A.current)return;(z=(_=T.target)==null?void 0:_.releasePointerCapture)==null||z.call(_,T.pointerId);const{userSelectionRect:C}=w.getState();!v&&C&&T.target===N.current&&(I==null||I(T)),w.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),o==null||o(T),(t||a)&&(M.current=!1),A.current=!1},D=r===!0||Array.isArray(r)&&r.includes(0);return s.jsxs("div",{className:Ct(["react-flow__pane",{draggable:D,dragging:g,selection:e}]),onClick:x?void 0:Yh(I,N),onContextMenu:Yh(U,N),onWheel:Yh($,N),onPointerEnter:x?void 0:h,onPointerDown:x?L:u,onPointerMove:x?E:u,onPointerUp:x?O:void 0,onPointerLeave:f,ref:N,style:zu,children:[p,s.jsx(qD,{})]})}function Pm({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",Mr.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 vN({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:i,nodeClickDistance:o}){const l=dt(),[c,d]=m.useState(!1),h=m.useRef();return m.useEffect(()=>{h.current=b_({getStoreItems:()=>l.getState(),onNodeMouseDown:u=>{Pm({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 QD=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function wN(){const e=dt();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=QD(o),p=a?i[0]:5,w=a?i[1]:5,v=n.direction.x*p*n.factor,b=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+b};a&&(y=Rl(y,i));const{position:x,positionAbsolute:N}=O1({nodeId:g.id,nextPosition:y,nodeLookup:d,nodeExtent:r,nodeOrigin:h,onError:l});g.position=x,g.internals.positionAbsolute=N,u.set(g.id,g)}c(u)},[])}const hx=m.createContext(null),ZD=hx.Provider;hx.Consumer;const yN=()=>m.useContext(hx),JD=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),eT=(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===Oi.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 tT({type:e="source",position:t=Ce.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 O,D;const w=o||null,v=e==="target",b=dt(),g=yN(),{connectOnClick:y,noPanClassName:x,rfId:N}=Be(JD,gt),{connectingFrom:j,connectingTo:k,clickConnecting:S,isPossibleEndHandle:M,connectionInProcess:A,clickConnectionInProcess:I,valid:U}=Be(eT(g,w,e),gt);g||(D=(O=b.getState()).onError)==null||D.call(O,"010",Mr.error010());const $=T=>{const{defaultEdgeOptions:C,onConnect:_,hasDefaultEdges:z}=b.getState(),H={...C,...T};if(z){const{edges:P,setEdges:B}=b.getState();B(Y1(H,P))}_==null||_(H),l==null||l(H)},L=T=>{if(!g)return;const C=B1(T.nativeEvent);if(a&&(C&&T.button===0||!C)){const _=b.getState();Tm.onPointerDown(T.nativeEvent,{handleDomNode:T.currentTarget,autoPanOnConnect:_.autoPanOnConnect,connectionMode:_.connectionMode,connectionRadius:_.connectionRadius,domNode:_.domNode,nodeLookup:_.nodeLookup,lib:_.lib,isTarget:v,handleId:w,nodeId:g,flowId:_.rfId,panBy:_.panBy,cancelConnection:_.cancelConnection,onConnectStart:_.onConnectStart,onConnectEnd:_.onConnectEnd,updateConnection:_.updateConnection,onConnect:$,isValidConnection:n||_.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:_.autoPanSpeed,dragThreshold:_.connectionDragThreshold})}C?h==null||h(T):u==null||u(T)},E=T=>{const{onClickConnectStart:C,onClickConnectEnd:_,connectionClickStartHandle:z,connectionMode:H,isValidConnection:P,lib:B,rfId:q,nodeLookup:G,connection:se}=b.getState();if(!g||!z&&!a)return;if(!z){C==null||C(T.nativeEvent,{nodeId:g,handleId:w,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:g,type:e,id:w}});return}const re=F1(T.target),Z=n||P,{connection:R,isValid:ee}=Tm.isValid(T.nativeEvent,{handle:{nodeId:g,id:w,type:e},connectionMode:H,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:Z,flowId:q,doc:re,lib:B,nodeLookup:G});ee&&R&&$(R);const J=structuredClone(se);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,_==null||_(T,J),b.setState({connectionClickStartHandle:null})};return s.jsx("div",{"data-handleid":w,"data-nodeid":g,"data-handlepos":t,"data-id":`${N}-${g}-${w}-${e}`,className:Ct(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,d,{source:!v,target:v,connectable:r,connectablestart:a,connectableend:i,clickconnecting:S,connectingfrom:j,connectingto:k,valid:U,connectionindicator:r&&(!A||M)&&(A||I?i:a)}]),onMouseDown:L,onTouchStart:L,onClick:y?E:void 0,ref:p,...f,children:c})}const ma=m.memo(xN(tT));function nT({data:e,isConnectable:t,sourcePosition:n=Ce.Bottom}){return s.jsxs(s.Fragment,{children:[e==null?void 0:e.label,s.jsx(ma,{type:"source",position:n,isConnectable:t})]})}function rT({data:e,isConnectable:t,targetPosition:n=Ce.Top,sourcePosition:r=Ce.Bottom}){return s.jsxs(s.Fragment,{children:[s.jsx(ma,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,s.jsx(ma,{type:"source",position:r,isConnectable:t})]})}function sT(){return null}function aT({data:e,isConnectable:t,targetPosition:n=Ce.Top}){return s.jsxs(s.Fragment,{children:[s.jsx(ma,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Vd={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},rv={input:nT,default:rT,output:aT,group:sT};function iT(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 oT=e=>{const{width:t,height:n,x:r,y:a}=$l(e.nodeLookup,{filter:i=>!!i.selected});return{width:Qn(t)?t:null,height:Qn(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 lT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=dt(),{width:a,height:i,transformString:o,userSelectionActive:l}=Be(oT,gt),c=wN(),d=m.useRef(null);if(m.useEffect(()=>{var f;n||(f=d.current)==null||f.focus({preventScroll:!0})},[n]),vN({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(Vd,f.key)&&(f.preventDefault(),c({direction:Vd[f.key],factor:f.shiftKey?4:1}))};return s.jsx("div",{className:Ct(["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 sv=typeof window<"u"?window:void 0,cT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function bN({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:b,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:x,panOnScroll:N,panOnScrollSpeed:j,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:M,defaultViewport:A,translateExtent:I,minZoom:U,maxZoom:$,preventScrolling:L,onSelectionContextMenu:E,noWheelClassName:O,noPanClassName:D,disableKeyboardA11y:T,onViewportChange:C,isControlledViewport:_}){const{nodesSelectionActive:z,userSelectionActive:H}=Be(cT),P=bl(d,{target:sv}),B=bl(v,{target:sv}),q=B||M,G=B||N,se=h&&q!==!0,re=P||H||se;return WD({deleteKeyCode:c,multiSelectionKeyCode:w}),s.jsx(YD,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:x,panOnScroll:G,panOnScrollSpeed:j,panOnScrollMode:k,zoomOnDoubleClick:S,panOnDrag:!P&&q,defaultViewport:A,translateExtent:I,minZoom:U,maxZoom:$,zoomActivationKeyCode:b,preventScrolling:L,noWheelClassName:O,noPanClassName:D,onViewportChange:C,isControlledViewport:_,paneClickDistance:l,children:s.jsxs(KD,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:o,panOnDrag:q,isSelecting:!!re,selectionMode:u,selectionKeyPressed:P,selectionOnDrag:se,children:[e,z&&s.jsx(lT,{onSelectionContextMenu:E,noPanClassName:D,disableKeyboardA11y:T})]})})}bN.displayName="FlowRenderer";const dT=m.memo(bN),uT=e=>t=>e?sx(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 hT(e){return Be(m.useCallback(uT(e),[e]),gt)}const fT=e=>e.updateNodeInternals;function mT(){const e=Be(fT),[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 pT({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=dt(),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 xT({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:b,nodeClickDistance:g,onError:y}){const{node:x,internals:N,isParent:j}=Be(Z=>{const R=Z.nodeLookup.get(e),ee=Z.parentLookup.has(e);return{node:R,internals:R.internals,isParent:ee}},gt);let k=x.type||"default",S=(b==null?void 0:b[k])||rv[k];S===void 0&&(y==null||y("003",Mr.error003(k)),k="default",S=(b==null?void 0:b.default)||rv.default);const M=!!(x.draggable||l&&typeof x.draggable>"u"),A=!!(x.selectable||c&&typeof x.selectable>"u"),I=!!(x.connectable||d&&typeof x.connectable>"u"),U=!!(x.focusable||h&&typeof x.focusable>"u"),$=dt(),L=I1(x),E=pT({node:x,nodeType:k,hasDimensions:L,resizeObserver:u}),O=vN({nodeRef:E,disabled:x.hidden||!M,noDragClassName:f,handleSelector:x.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:g}),D=wN();if(x.hidden)return null;const T=ns(x),C=iT(x),_=A||M||t||n||r||a,z=n?Z=>n(Z,{...N.userNode}):void 0,H=r?Z=>r(Z,{...N.userNode}):void 0,P=a?Z=>a(Z,{...N.userNode}):void 0,B=i?Z=>i(Z,{...N.userNode}):void 0,q=o?Z=>o(Z,{...N.userNode}):void 0,G=Z=>{const{selectNodesOnDrag:R,nodeDragThreshold:ee}=$.getState();A&&(!R||!M||ee>0)&&Pm({id:e,store:$,nodeRef:E}),t&&t(Z,{...N.userNode})},se=Z=>{if(!(U1(Z.nativeEvent)||w)){if(_1.includes(Z.key)&&A){const R=Z.key==="Escape";Pm({id:e,store:$,unselect:R,nodeRef:E})}else if(M&&x.selected&&Object.prototype.hasOwnProperty.call(Vd,Z.key)){Z.preventDefault();const{ariaLabelConfig:R}=$.getState();$.setState({ariaLiveMessage:R["node.a11yDescription.ariaLiveMessage"]({direction:Z.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),D({direction:Vd[Z.key],factor:Z.shiftKey?4:1})}}},re=()=>{var ne;if(w||!((ne=E.current)!=null&&ne.matches(":focus-visible")))return;const{transform:Z,width:R,height:ee,autoPanOnNodeFocus:J,setCenter:F}=$.getState();if(!J)return;sx(new Map([[e,x]]),{x:0,y:0,width:R,height:ee},Z,!0).length>0||F(x.position.x+T.width/2,x.position.y+T.height/2,{zoom:Z[2]})};return s.jsx("div",{className:Ct(["react-flow__node",`react-flow__node-${k}`,{[p]:M},x.className,{selected:x.selected,selectable:A,parent:j,draggable:M,dragging:O}]),ref:E,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:_?"all":"none",visibility:L?"visible":"hidden",...x.style,...C},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:H,onMouseLeave:P,onContextMenu:B,onClick:G,onDoubleClick:q,onKeyDown:U?se:void 0,tabIndex:U?0:void 0,onFocus:U?re:void 0,role:x.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${dN}-${v}`,"aria-label":x.ariaLabel,...x.domAttributes,children:s.jsx(ZD,{value:e,children:s.jsx(S,{id:e,data:x.data,type:k,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:x.selected??!1,selectable:A,draggable:M,deletable:x.deletable??!0,isConnectable:I,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:O,dragHandle:x.dragHandle,zIndex:N.z,parentId:x.parentId,...T})})})}const gT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function NN(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:i}=Be(gT,gt),o=hT(e.onlyRenderVisibleElements),l=mT();return s.jsx("div",{className:"react-flow__nodes",style:zu,children:o.map(c=>s.jsx(xT,{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))})}NN.displayName="NodeRenderer";const vT=m.memo(NN);function wT(e){return Be(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&&s_({sourceNode:i,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),gt)}const yT=({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"})},bT=({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"})},av={[Bd.Arrow]:yT,[Bd.ArrowClosed]:bT};function NT(e){const t=dt();return m.useMemo(()=>{var a,i;return Object.prototype.hasOwnProperty.call(av,e)?av[e]:((i=(a=t.getState()).onError)==null||i.call(a,"009",Mr.error009(e)),null)},[e])}const jT=({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=NT(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},jN=({defaultColor:e,rfId:t})=>{const n=Be(i=>i.edges),r=Be(i=>i.defaultEdgeOptions),a=m.useMemo(()=>u_(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(jT,{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};jN.displayName="MarkerDefinitions";var kT=m.memo(jN);function kN({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=Ct(["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}kN.displayName="EdgeText";const ST=m.memo(kN);function $u({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:Ct(["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&&Qn(t)&&Qn(n)?s.jsx(ST,{x:t,y:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function iv({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Ce.Left||e===Ce.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function SN({sourceX:e,sourceY:t,sourcePosition:n=Ce.Bottom,targetX:r,targetY:a,targetPosition:i=Ce.Top}){const[o,l]=iv({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,d]=iv({pos:i,x1:r,y1:a,x2:e,y2:t}),[h,u,f,p]=W1({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 CN(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:b,interactionWidth:g})=>{const[y,x,N]=SN({sourceX:n,sourceY:r,sourcePosition:o,targetX:a,targetY:i,targetPosition:l}),j=e.isInternal?void 0:t;return s.jsx($u,{id:j,path:y,labelX:x,labelY:N,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:b,interactionWidth:g})})}const CT=CN({isInternal:!1}),EN=CN({isInternal:!0});CT.displayName="SimpleBezierEdge";EN.displayName="SimpleBezierEdgeInternal";function MN(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=Ce.Bottom,targetPosition:w=Ce.Top,markerEnd:v,markerStart:b,pathOptions:g,interactionWidth:y})=>{const[x,N,j]=Mm({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($u,{id:k,path:x,labelX:N,labelY:j,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:u,style:f,markerEnd:v,markerStart:b,interactionWidth:y})})}const _N=MN({isInternal:!1}),DN=MN({isInternal:!0});_N.displayName="SmoothStepEdge";DN.displayName="SmoothStepEdgeInternal";function TN(e){return m.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return s.jsx(_N,{...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 ET=TN({isInternal:!1}),PN=TN({isInternal:!0});ET.displayName="StepEdge";PN.displayName="StepEdgeInternal";function AN(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[b,g,y]=X1({sourceX:n,sourceY:r,targetX:a,targetY:i}),x=e.isInternal?void 0:t;return s.jsx($u,{id:x,path:b,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 MT=AN({isInternal:!1}),ON=AN({isInternal:!0});MT.displayName="StraightEdge";ON.displayName="StraightEdgeInternal";function zN(e){return m.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:o=Ce.Bottom,targetPosition:l=Ce.Top,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:b,pathOptions:g,interactionWidth:y})=>{const[x,N,j]=H1({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($u,{id:k,path:x,labelX:N,labelY:j,label:c,labelStyle:d,labelShowBg:h,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:p,style:w,markerEnd:v,markerStart:b,interactionWidth:y})})}const _T=zN({isInternal:!1}),$N=zN({isInternal:!0});_T.displayName="BezierEdge";$N.displayName="BezierEdgeInternal";const ov={default:$N,straight:ON,step:PN,smoothstep:DN,simplebezier:EN},lv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},DT=(e,t,n)=>n===Ce.Left?e-t:n===Ce.Right?e+t:e,TT=(e,t,n)=>n===Ce.Top?e-t:n===Ce.Bottom?e+t:e,cv="react-flow__edgeupdater";function dv({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:Ct([cv,`${cv}-${l}`]),cx:DT(t,r,e),cy:TT(n,r,e),r,stroke:"transparent",fill:"transparent"})}function PT({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=dt(),v=(N,j)=>{if(N.button!==0)return;const{autoPanOnConnect:k,domNode:S,isValidConnection:M,connectionMode:A,connectionRadius:I,lib:U,onConnectStart:$,onConnectEnd:L,cancelConnection:E,nodeLookup:O,rfId:D,panBy:T,updateConnection:C}=w.getState(),_=j.type==="target",z=(B,q)=>{f(!1),u==null||u(B,n,j.type,q)},H=B=>d==null?void 0:d(n,B),P=(B,q)=>{f(!0),h==null||h(N,n,j.type),$==null||$(B,q)};Tm.onPointerDown(N.nativeEvent,{autoPanOnConnect:k,connectionMode:A,connectionRadius:I,domNode:S,handleId:j.id,nodeId:j.nodeId,nodeLookup:O,isTarget:_,edgeUpdaterType:j.type,lib:U,flowId:D,cancelConnection:E,panBy:T,isValidConnection:M,onConnect:H,onConnectStart:P,onConnectEnd:L,onReconnectEnd:z,updateConnection:C,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},b=N=>v(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=N=>v(N,{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(dv,{position:l,centerX:r,centerY:a,radius:t,onMouseDown:b,onMouseEnter:y,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&s.jsx(dv,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:g,onMouseEnter:y,onMouseOut:x,type:"target"})]})}function AT({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:b,onError:g,disableKeyboardA11y:y}){let x=Be(F=>F.edgeLookup.get(e));const N=Be(F=>F.defaultEdgeOptions);x=N?{...N,...x}:x;let j=x.type||"default",k=(v==null?void 0:v[j])||ov[j];k===void 0&&(g==null||g("011",Mr.error011(j)),j="default",k=(v==null?void 0:v.default)||ov.default);const S=!!(x.focusable||t&&typeof x.focusable>"u"),M=typeof u<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),A=!!(x.selectable||r&&typeof x.selectable>"u"),I=m.useRef(null),[U,$]=m.useState(!1),[L,E]=m.useState(!1),O=dt(),{zIndex:D,sourceX:T,sourceY:C,targetX:_,targetY:z,sourcePosition:H,targetPosition:P}=Be(m.useCallback(F=>{const K=F.nodeLookup.get(x.source),ne=F.nodeLookup.get(x.target);if(!K||!ne)return{zIndex:x.zIndex,...lv};const ce=d_({id:e,sourceNode:K,targetNode:ne,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:F.connectionMode,onError:g});return{zIndex:r_({selected:x.selected,zIndex:x.zIndex,sourceNode:K,targetNode:ne,elevateOnSelect:F.elevateEdgesOnSelect}),...ce||lv}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),gt),B=m.useMemo(()=>x.markerStart?`url('#${_m(x.markerStart,w)}')`:void 0,[x.markerStart,w]),q=m.useMemo(()=>x.markerEnd?`url('#${_m(x.markerEnd,w)}')`:void 0,[x.markerEnd,w]);if(x.hidden||T===null||C===null||_===null||z===null)return null;const G=F=>{var ge;const{addSelectedEdges:K,unselectNodesAndEdges:ne,multiSelectionActive:ce}=O.getState();A&&(O.setState({nodesSelectionActive:!1}),x.selected&&ce?(ne({nodes:[],edges:[x]}),(ge=I.current)==null||ge.blur()):K([e])),a&&a(F,x)},se=i?F=>{i(F,{...x})}:void 0,re=o?F=>{o(F,{...x})}:void 0,Z=l?F=>{l(F,{...x})}:void 0,R=c?F=>{c(F,{...x})}:void 0,ee=d?F=>{d(F,{...x})}:void 0,J=F=>{var K;if(!y&&_1.includes(F.key)&&A){const{unselectNodesAndEdges:ne,addSelectedEdges:ce}=O.getState();F.key==="Escape"?((K=I.current)==null||K.blur(),ne({edges:[x]})):ce([e])}};return s.jsx("svg",{style:{zIndex:D},children:s.jsxs("g",{className:Ct(["react-flow__edge",`react-flow__edge-${j}`,x.className,b,{selected:x.selected,animated:x.animated,inactive:!A&&!a,updating:U,selectable:A}]),onClick:G,onDoubleClick:se,onContextMenu:re,onMouseEnter:Z,onMouseMove:R,onMouseLeave:ee,onKeyDown:S?J: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?`${uN}-${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:A,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:T,sourceY:C,targetX:_,targetY:z,sourcePosition:H,targetPosition:P,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:B,markerEnd:q,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),M&&s.jsx(PT,{edge:x,isReconnectable:M,reconnectRadius:h,onReconnect:u,onReconnectStart:f,onReconnectEnd:p,sourceX:T,sourceY:C,targetX:_,targetY:z,sourcePosition:H,targetPosition:P,setUpdateHover:$,setReconnecting:E})]})})}const OT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function RN({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:b,edgesReconnectable:g,elementsSelectable:y,onError:x}=Be(OT,gt),N=wT(t);return s.jsxs("div",{className:"react-flow__edges",children:[s.jsx(kT,{defaultColor:e,rfId:n}),N.map(j=>s.jsx(AT,{id:j,edgesFocusable:b,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},j))]})}RN.displayName="EdgeRenderer";const zT=m.memo(RN),$T=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function RT({children:e}){const t=Be($T);return s.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function IT(e){const t=ux(),n=m.useRef(!1);m.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const LT=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function FT(e){const t=Be(LT),n=dt();return m.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function UT(e){return e.connection.inProgress?{...e.connection,to:Il(e.connection.to,e.transform)}:{...e.connection}}function BT(e){return UT}function WT(e){const t=BT();return Be(t,gt)}const HT=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function VT({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:i,height:o,isValid:l,inProgress:c}=Be(HT,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:Ct(["react-flow__connection",P1(l)]),children:s.jsx(IN,{style:t,type:n,CustomComponent:r,isValid:l})})})}const IN=({style:e,type:t=Ns.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:i,fromNode:o,fromHandle:l,fromPosition:c,to:d,toNode:h,toHandle:u,toPosition:f}=WT();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:P1(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 Ns.Bezier:[p]=H1(w);break;case Ns.SimpleBezier:[p]=SN(w);break;case Ns.Step:[p]=Mm({...w,borderRadius:0});break;case Ns.SmoothStep:[p]=Mm(w);break;default:[p]=X1(w)}return s.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};IN.displayName="ConnectionLine";const YT={};function uv(e=YT){m.useRef(e),dt(),m.useEffect(()=>{},[e])}function XT(){dt(),m.useRef(!1),m.useEffect(()=>{},[])}function LN({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:b,connectionLineContainerStyle:g,selectionKeyCode:y,selectionOnDrag:x,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:k,zoomActivationKeyCode:S,deleteKeyCode:M,onlyRenderVisibleElements:A,elementsSelectable:I,defaultViewport:U,translateExtent:$,minZoom:L,maxZoom:E,preventScrolling:O,defaultMarkerColor:D,zoomOnScroll:T,zoomOnPinch:C,panOnScroll:_,panOnScrollSpeed:z,panOnScrollMode:H,zoomOnDoubleClick:P,panOnDrag:B,onPaneClick:q,onPaneMouseEnter:G,onPaneMouseMove:se,onPaneMouseLeave:re,onPaneScroll:Z,onPaneContextMenu:R,paneClickDistance:ee,nodeClickDistance:J,onEdgeContextMenu:F,onEdgeMouseEnter:K,onEdgeMouseMove:ne,onEdgeMouseLeave:ce,reconnectRadius:ge,onReconnect:ve,onReconnectStart:Ae,onReconnectEnd:Te,noDragClassName:tt,noWheelClassName:ht,noPanClassName:Le,disableKeyboardA11y:Oe,nodeExtent:Ge,rfId:Je,viewport:ot,onViewportChange:Ot}){return uv(e),uv(t),XT(),IT(n),FT(ot),s.jsx(dT,{onPaneClick:q,onPaneMouseEnter:G,onPaneMouseMove:se,onPaneMouseLeave:re,onPaneContextMenu:R,onPaneScroll:Z,paneClickDistance:ee,deleteKeyCode:M,selectionKeyCode:y,selectionOnDrag:x,selectionMode:N,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:j,panActivationKeyCode:k,zoomActivationKeyCode:S,elementsSelectable:I,zoomOnScroll:T,zoomOnPinch:C,zoomOnDoubleClick:P,panOnScroll:_,panOnScrollSpeed:z,panOnScrollMode:H,panOnDrag:B,defaultViewport:U,translateExtent:$,minZoom:L,maxZoom:E,onSelectionContextMenu:u,preventScrolling:O,noDragClassName:tt,noWheelClassName:ht,noPanClassName:Le,disableKeyboardA11y:Oe,onViewportChange:Ot,isControlledViewport:!!ot,children:s.jsxs(RT,{children:[s.jsx(zT,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:o,onReconnect:ve,onReconnectStart:Ae,onReconnectEnd:Te,onlyRenderVisibleElements:A,onEdgeContextMenu:F,onEdgeMouseEnter:K,onEdgeMouseMove:ne,onEdgeMouseLeave:ce,reconnectRadius:ge,defaultMarkerColor:D,noPanClassName:Le,disableKeyboardA11y:Oe,rfId:Je}),s.jsx(VT,{style:v,type:w,component:b,containerStyle:g}),s.jsx("div",{className:"react-flow__edgelabel-renderer"}),s.jsx(vT,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:h,nodeClickDistance:J,onlyRenderVisibleElements:A,noPanClassName:Le,noDragClassName:tt,disableKeyboardA11y:Oe,nodeExtent:Ge,rfId:Je}),s.jsx("div",{className:"react-flow__viewport-portal"})]})})}LN.displayName="GraphView";const qT=m.memo(LN),hv=({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,b=r??t??[],g=n??e??[],y=h??[0,0],x=u??xl;G1(w,v,b);const N=Dm(g,f,p,{nodeOrigin:y,nodeExtent:x,elevateNodesOnSelect:!1});let j=[0,0,1];if(o&&a&&i){const k=$l(f,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:S,y:M,zoom:A}=ax(k,a,i,c,d,(l==null?void 0:l.padding)??.1);j=[S,M,A]}return{rfId:"1",width:a??0,height:i??0,transform:j,nodes:g,nodesInitialized:N,nodeLookup:f,parentLookup:p,edges:b,edgeLookup:v,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:xl,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Oi.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:{...T1},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:QM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:D1}},GT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:h,nodeExtent:u})=>pD((f,p)=>{async function w(){const{nodeLookup:v,panZoom:b,fitViewOptions:g,fitViewResolver:y,width:x,height:N,minZoom:j,maxZoom:k}=p();b&&(await GM({nodes:v,width:x,height:N,panZoom:b,minZoom:j,maxZoom:k},g),y==null||y.resolve(!0),f({fitViewResolver:null}))}return{...hv({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:b,parentLookup:g,nodeOrigin:y,elevateNodesOnSelect:x,fitViewQueued:N}=p(),j=Dm(v,b,g,{nodeOrigin:y,nodeExtent:u,elevateNodesOnSelect:x,checkEquality:!0});N&&j?(w(),f({nodes:v,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:v,nodesInitialized:j})},setEdges:v=>{const{connectionLookup:b,edgeLookup:g}=p();G1(b,g,v),f({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:g}=p();g(v),f({hasDefaultNodes:!0})}if(b){const{setEdges:g}=p();g(b),f({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:g,parentLookup:y,domNode:x,nodeOrigin:N,nodeExtent:j,debug:k,fitViewQueued:S}=p(),{changes:M,updatedInternals:A}=g_(v,g,y,x,N,j);A&&(f_(g,y,{nodeOrigin:N,nodeExtent:j}),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),b==null||b(M)))},updateNodePositions:(v,b=!1)=>{const g=[],y=[],{nodeLookup:x,triggerNodeChanges:N}=p();for(const[j,k]of v){const S=x.get(j),M=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(k!=null&&k.position)),A={id:j,type:"position",position:M?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:b};M&&S.parentId&&g.push({id:j,parentId:S.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),y.push(A)}if(g.length>0){const{parentLookup:j,nodeOrigin:k}=p(),S=dx(g,x,j,k);y.push(...S)}N(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:g,nodes:y,hasDefaultNodes:x,debug:N}=p();if(v!=null&&v.length){if(x){const j=mN(v,y);g(j)}N&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:g,edges:y,hasDefaultEdges:x,debug:N}=p();if(v!=null&&v.length){if(x){const j=pN(v,y);g(j)}N&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:g,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:N}=p();if(b){const j=v.map(k=>ea(k,!0));x(j);return}x(hi(y,new Set([...v]),!0)),N(hi(g))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:g,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:N}=p();if(b){const j=v.map(k=>ea(k,!0));N(j);return}N(hi(g,new Set([...v]))),x(hi(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:g,nodes:y,nodeLookup:x,triggerNodeChanges:N,triggerEdgeChanges:j}=p(),k=v||y,S=b||g,M=k.map(I=>{const U=x.get(I.id);return U&&(U.selected=!1),ea(I.id,!1)}),A=S.map(I=>ea(I.id,!1));N(M),j(A)},setMinZoom:v=>{const{panZoom:b,maxZoom:g}=p();b==null||b.setScaleExtent([v,g]),f({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:g}=p();b==null||b.setScaleExtent([g,v]),f({maxZoom:v})},setTranslateExtent:v=>{var b;(b=p().panZoom)==null||b.setTranslateExtent(v),f({translateExtent:v})},setPaneClickDistance:v=>{var b;(b=p().panZoom)==null||b.setClickDistance(v)},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:g,triggerEdgeChanges:y,elementsSelectable:x}=p();if(!x)return;const N=b.reduce((k,S)=>S.selected?[...k,ea(S.id,!1)]:k,[]),j=v.reduce((k,S)=>S.selected?[...k,ea(S.id,!1)]:k,[]);g(N),y(j)},setNodeExtent:v=>{const{nodes:b,nodeLookup:g,parentLookup:y,nodeOrigin:x,elevateNodesOnSelect:N,nodeExtent:j}=p();v[0][0]===j[0][0]&&v[0][1]===j[0][1]&&v[1][0]===j[1][0]&&v[1][1]===j[1][1]||(Dm(b,g,y,{nodeOrigin:x,nodeExtent:v,elevateNodesOnSelect:N,checkEquality:!1}),f({nodeExtent:v}))},panBy:v=>{const{transform:b,width:g,height:y,panZoom:x,translateExtent:N}=p();return v_({delta:v,panZoom:x,transform:b,translateExtent:N,width:g,height:y})},setCenter:async(v,b,g)=>{const{width:y,height:x,maxZoom:N,panZoom:j}=p();if(!j)return Promise.resolve(!1);const k=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:N;return await j.setViewport({x:y/2-v*k,y:x/2-b*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:{...T1}})},updateConnection:v=>{f({connection:v})},reset:()=>f({...hv()})}},Object.is);function KT({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(()=>GT({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(xD,{value:p,children:s.jsx(LD,{children:f})})}function QT({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(Au)?s.jsx(s.Fragment,{children:e}):s.jsx(KT,{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 ZT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function JT({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:b,onClickConnectEnd:g,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:k,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:A,onNodesDelete:I,onEdgesDelete:U,onDelete:$,onSelectionChange:L,onSelectionDragStart:E,onSelectionDrag:O,onSelectionDragStop:D,onSelectionContextMenu:T,onSelectionStart:C,onSelectionEnd:_,onBeforeDelete:z,connectionMode:H,connectionLineType:P=Ns.Bezier,connectionLineStyle:B,connectionLineComponent:q,connectionLineContainerStyle:G,deleteKeyCode:se="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:Z=!1,selectionMode:R=gl.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:J=wl()?"Meta":"Control",zoomActivationKeyCode:F=wl()?"Meta":"Control",snapToGrid:K,snapGrid:ne,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:ge,nodesDraggable:ve,autoPanOnNodeFocus:Ae,nodesConnectable:Te,nodesFocusable:tt,nodeOrigin:ht=hN,edgesFocusable:Le,edgesReconnectable:Oe,elementsSelectable:Ge=!0,defaultViewport:Je=_D,minZoom:ot=.5,maxZoom:Ot=2,translateExtent:zt=xl,preventScrolling:ae=!0,nodeExtent:me,defaultMarkerColor:ze="#b1b1b7",zoomOnScroll:X=!0,zoomOnPinch:le=!0,panOnScroll:W=!1,panOnScrollSpeed:te=.5,panOnScrollMode:ue=fa.Free,zoomOnDoubleClick:Ne=!0,panOnDrag:Se=!0,onPaneClick:he,onPaneMouseEnter:Pe,onPaneMouseMove:Me,onPaneMouseLeave:Fe,onPaneScroll:bt,onPaneContextMenu:fe,paneClickDistance:Ve=0,nodeClickDistance:vt=0,children:Nt,onReconnect:En,onReconnectStart:Qe,onReconnectEnd:$t,onEdgeContextMenu:lr,onEdgeDoubleClick:qt,onEdgeMouseEnter:Rt,onEdgeMouseMove:La,onEdgeMouseLeave:hn,reconnectRadius:Xl=10,onNodesChange:eo,onEdgesChange:to,noDragClassName:nh="nodrag",noWheelClassName:rh="nowheel",noPanClassName:qs="nopan",fitView:no,fitViewOptions:ql,connectOnClick:Fa,attributionPosition:Ua,proOptions:Ba,defaultEdgeOptions:ro,elevateNodesOnSelect:Gl,elevateEdgesOnSelect:rs,disableKeyboardA11y:cr=!1,autoPanOnConnect:ss,autoPanOnNodeDrag:Wa,autoPanSpeed:Kl,connectionRadius:sh,isValidConnection:as,onError:is,style:so,id:Ql,nodeDragThreshold:ah,connectionDragThreshold:Yx,viewport:ih,onViewportChange:nt,width:Zl,height:Jl,colorMode:oh="light",debug:ao,onScroll:Gs,ariaLabelConfig:lh,...ch},ec){const de=Ql||"1",pe=AD(oh),xe=m.useCallback(ie=>{ie.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Gs==null||Gs(ie)},[Gs]);return s.jsx("div",{"data-testid":"rf__wrapper",...ch,onScroll:xe,style:{...so,...ZT},ref:ec,className:Ct(["react-flow",a,pe]),id:Ql,role:"application",children:s.jsxs(QT,{nodes:e,edges:t,width:Zl,height:Jl,fitView:no,fitViewOptions:ql,minZoom:ot,maxZoom:Ot,nodeOrigin:ht,nodeExtent:me,children:[s.jsx(qT,{onInit:d,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:x,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:o,connectionLineType:P,connectionLineStyle:B,connectionLineComponent:q,connectionLineContainerStyle:G,selectionKeyCode:re,selectionOnDrag:Z,selectionMode:R,deleteKeyCode:se,multiSelectionKeyCode:J,panActivationKeyCode:ee,zoomActivationKeyCode:F,onlyRenderVisibleElements:ce,defaultViewport:Je,translateExtent:zt,minZoom:ot,maxZoom:Ot,preventScrolling:ae,zoomOnScroll:X,zoomOnPinch:le,zoomOnDoubleClick:Ne,panOnScroll:W,panOnScrollSpeed:te,panOnScrollMode:ue,panOnDrag:Se,onPaneClick:he,onPaneMouseEnter:Pe,onPaneMouseMove:Me,onPaneMouseLeave:Fe,onPaneScroll:bt,onPaneContextMenu:fe,paneClickDistance:Ve,nodeClickDistance:vt,onSelectionContextMenu:T,onSelectionStart:C,onSelectionEnd:_,onReconnect:En,onReconnectStart:Qe,onReconnectEnd:$t,onEdgeContextMenu:lr,onEdgeDoubleClick:qt,onEdgeMouseEnter:Rt,onEdgeMouseMove:La,onEdgeMouseLeave:hn,reconnectRadius:Xl,defaultMarkerColor:ze,noDragClassName:nh,noWheelClassName:rh,noPanClassName:qs,rfId:de,disableKeyboardA11y:cr,nodeExtent:me,viewport:ih,onViewportChange:nt}),s.jsx(PD,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:w,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:g,nodesDraggable:ve,autoPanOnNodeFocus:Ae,nodesConnectable:Te,nodesFocusable:tt,edgesFocusable:Le,edgesReconnectable:Oe,elementsSelectable:Ge,elevateNodesOnSelect:Gl,elevateEdgesOnSelect:rs,minZoom:ot,maxZoom:Ot,nodeExtent:me,onNodesChange:eo,onEdgesChange:to,snapToGrid:K,snapGrid:ne,connectionMode:H,translateExtent:zt,connectOnClick:Fa,defaultEdgeOptions:ro,fitView:no,fitViewOptions:ql,onNodesDelete:I,onEdgesDelete:U,onDelete:$,onNodeDragStart:S,onNodeDrag:M,onNodeDragStop:A,onSelectionDrag:O,onSelectionDragStart:E,onSelectionDragStop:D,onMove:h,onMoveStart:u,onMoveEnd:f,noPanClassName:qs,nodeOrigin:ht,rfId:de,autoPanOnConnect:ss,autoPanOnNodeDrag:Wa,autoPanSpeed:Kl,onError:is,connectionRadius:sh,isValidConnection:as,selectNodesOnDrag:ge,nodeDragThreshold:ah,connectionDragThreshold:Yx,onBeforeDelete:z,paneClickDistance:Ve,debug:ao,ariaLabelConfig:lh}),s.jsx(MD,{onSelectionChange:L}),Nt,s.jsx(jD,{proOptions:Ba,position:Ua}),s.jsx(ND,{rfId:de,disableKeyboardA11y:cr})]})})}var eP=xN(JT);function tP(e){const[t,n]=m.useState(e),r=m.useCallback(a=>n(i=>mN(a,i)),[]);return[t,n,r]}function nP(e){const[t,n]=m.useState(e),r=m.useCallback(a=>n(i=>pN(a,i)),[]);return[t,n,r]}function rP({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:Ct(["react-flow__background-pattern",n,r])})}function sP({radius:e,className:t}){return s.jsx("circle",{cx:e,cy:e,r:e,className:Ct(["react-flow__background-pattern","dots",t])})}var Xr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Xr||(Xr={}));const aP={[Xr.Dots]:1,[Xr.Lines]:1,[Xr.Cross]:6},iP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function FN({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}=Be(iP,gt),w=r||aP[t],v=t===Xr.Dots,b=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],N=Array.isArray(i)?i:[i,i],j=b?[x,x]:y,k=[N[0]*f[2]||1+j[0]/2,N[1]*f[2]||1+j[1]/2],S=`${p}${e||""}`;return s.jsxs("svg",{className:Ct(["react-flow__background",d]),style:{...c,...zu,"--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(sP,{radius:x/2,className:h}):s.jsx(rP,{dimensions:j,lineWidth:a,variant:t,className:h})}),s.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${S})`})]})}FN.displayName="Background";const oP=m.memo(FN);function lP(){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 cP(){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 dP(){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 uP(){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 hP(){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 Ec({children:e,className:t,...n}){return s.jsx("button",{type:"button",className:Ct(["react-flow__controls-button",t]),...n,children:e})}const fP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function UN({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=dt(),{isInteractive:v,minZoomReached:b,maxZoomReached:g,ariaLabelConfig:y}=Be(fP,gt),{zoomIn:x,zoomOut:N,fitView:j}=ux(),k=()=>{x(),i==null||i()},S=()=>{N(),o==null||o()},M=()=>{j(a),l==null||l()},A=()=>{w.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),c==null||c(!v)},I=f==="horizontal"?"horizontal":"vertical";return s.jsxs(Ou,{className:Ct(["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(Ec,{onClick:k,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:g,children:s.jsx(lP,{})}),s.jsx(Ec,{onClick:S,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:b,children:s.jsx(cP,{})})]}),n&&s.jsx(Ec,{className:"react-flow__controls-fitview",onClick:M,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:s.jsx(dP,{})}),r&&s.jsx(Ec,{className:"react-flow__controls-interactive",onClick:A,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:v?s.jsx(hP,{}):s.jsx(uP,{})}),h]})}UN.displayName="Controls";const mP=m.memo(UN);function pP({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||{},b=o||w||v;return s.jsx("rect",{className:Ct(["react-flow__minimap-node",{selected:f},d]),x:t,y:n,rx:h,ry:h,width:r,height:a,style:{fill:b,stroke:l,strokeWidth:c},shapeRendering:u,onClick:p?g=>p(g,e):void 0})}const xP=m.memo(pP),gP=e=>e.nodes.map(t=>t.id),Xh=e=>e instanceof Function?e:()=>e;function vP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:i=xP,onClick:o}){const l=Be(gP,gt),c=Xh(t),d=Xh(e),h=Xh(n),u=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return s.jsx(s.Fragment,{children:l.map(f=>s.jsx(yP,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:i,onClick:o,shapeRendering:u},f))})}function wP({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}=Be(w=>{const{internals:v}=w.nodeLookup.get(e),b=v.userNode,{x:g,y}=v.positionAbsolute,{width:x,height:N}=ns(b);return{node:b,x:g,y,width:x,height:N}},gt);return!d||d.hidden||!I1(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 yP=m.memo(wP);var bP=m.memo(vP);const NP=200,jP=150,kP=e=>!e.hidden,SP=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?R1($l(e.nodeLookup,{filter:kP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},CP="react-flow__minimap-desc";function BN({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:b=!1,ariaLabel:g,inversePan:y,zoomStep:x=1,offsetScale:N=5}){const j=dt(),k=m.useRef(null),{boundingRect:S,viewBB:M,rfId:A,panZoom:I,translateExtent:U,flowWidth:$,flowHeight:L,ariaLabelConfig:E}=Be(SP,gt),O=(e==null?void 0:e.width)??NP,D=(e==null?void 0:e.height)??jP,T=S.width/O,C=S.height/D,_=Math.max(T,C),z=_*O,H=_*D,P=N*_,B=S.x-(z-S.width)/2-P,q=S.y-(H-S.height)/2-P,G=z+P*2,se=H+P*2,re=`${CP}-${A}`,Z=m.useRef(0),R=m.useRef();Z.current=_,m.useEffect(()=>{if(k.current&&I)return R.current=E_({domNode:k.current,panZoom:I,getTransform:()=>j.getState().transform,getViewScale:()=>Z.current}),()=>{var K;(K=R.current)==null||K.destroy()}},[I]),m.useEffect(()=>{var K;(K=R.current)==null||K.update({translateExtent:U,width:$,height:L,inversePan:y,pannable:v,zoomStep:x,zoomable:b})},[v,b,y,x,U,$,L]);const ee=p?K=>{var ge;const[ne,ce]=((ge=R.current)==null?void 0:ge.pointer(K))||[0,0];p(K,{x:ne,y:ce})}:void 0,J=w?m.useCallback((K,ne)=>{const ce=j.getState().nodeLookup.get(ne).internals.userNode;w(K,ce)},[]):void 0,F=g??E["minimap.ariaLabel"];return s.jsx(Ou,{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*_: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:Ct(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:s.jsxs("svg",{width:O,height:D,viewBox:`${B} ${q} ${G} ${se}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:k,onClick:ee,children:[F&&s.jsx("title",{id:re,children:F}),s.jsx(bP,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:o,nodeComponent:l}),s.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-P},${q-P}h${G+P*2}v${se+P*2}h${-G-P*2}z
89
- M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}BN.displayName="MiniMap";const EP=m.memo(BN),MP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,_P={[Ii.Line]:"right",[Ii.Handle]:"bottom-right"};function DP({nodeId:e,position:t,variant:n=Ii.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:b,onResizeEnd:g}){const y=yN(),x=typeof e=="string"?e:y,N=dt(),j=m.useRef(null),k=n===Ii.Handle,S=Be(m.useCallback(MP(k&&p),[k,p]),gt),M=m.useRef(null),A=t??_P[n];m.useEffect(()=>{if(!(!j.current||!x))return M.current||(M.current=W_({domNode:j.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:U,transform:$,snapGrid:L,snapToGrid:E,nodeOrigin:O,domNode:D}=N.getState();return{nodeLookup:U,transform:$,snapGrid:L,snapToGrid:E,nodeOrigin:O,paneDomNode:D}},onChange:(U,$)=>{const{triggerNodeChanges:L,nodeLookup:E,parentLookup:O,nodeOrigin:D}=N.getState(),T=[],C={x:U.x,y:U.y},_=E.get(x);if(_&&_.expandParent&&_.parentId){const z=_.origin??D,H=U.width??_.measured.width??0,P=U.height??_.measured.height??0,B={id:_.id,parentId:_.parentId,rect:{width:H,height:P,...L1({x:U.x??_.position.x,y:U.y??_.position.y},{width:H,height:P},_.parentId,E,z)}},q=dx([B],E,O,D);T.push(...q),C.x=U.x?Math.max(z[0]*H,U.x):void 0,C.y=U.y?Math.max(z[1]*P,U.y):void 0}if(C.x!==void 0&&C.y!==void 0){const z={id:x,type:"position",position:{...C}};T.push(z)}if(U.width!==void 0&&U.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};T.push(H)}for(const z of $){const H={...z,type:"position"};T.push(H)}L(T)},onEnd:({width:U,height:$})=>{const L={id:x,type:"dimensions",resizing:!1,dimensions:{width:U,height:$}};N.getState().triggerNodeChanges([L])}})),M.current.update({controlPosition:A,boundaries:{minWidth:l,minHeight:c,maxWidth:d,maxHeight:h},keepAspectRatio:u,resizeDirection:f,onResizeStart:v,onResize:b,onResizeEnd:g,shouldResize:w}),()=>{var U;(U=M.current)==null||U.destroy()}},[A,l,c,d,h,u,v,b,g,w]);const I=A.split("-");return s.jsx("div",{className:Ct(["react-flow__resize-control","nodrag",...I,n,r]),ref:j,style:{...a,scale:S,...o&&{[k?"backgroundColor":"borderColor"]:o}},children:i})}m.memo(DP);/**
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 TP={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 PP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ee=(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,...TP,width:a,height:a,stroke:r,strokeWidth:o?Number(i)*24/Number(a):i,className:["lucide",`lucide-${PP(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 hr=Ee("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 AP=Ee("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 OP=Ee("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 Mc=Ee("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 fv=Ee("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 zP=Ee("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 xr=Ee("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 Yd=Ee("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=Ee("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 $P=Ee("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 Ru=Ee("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 WN=Ee("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 fx=Ee("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 RP=Ee("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 mv=Ee("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 _c=Ee("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 pv=Ee("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 lt=Ee("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 HN=Ee("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"}]]);/**
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 IP=Ee("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"}]]);/**
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 Ll=Ee("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"}]]);/**
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 mx=Ee("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
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 LP=Ee("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"}]]);/**
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 FP=Ee("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"}]]);/**
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 Ht=Ee("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"}]]);/**
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 UP=Ee("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"}]]);/**
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 Dc=Ee("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 Xd=Ee("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"}]]);/**
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 BP=Ee("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"}]]);/**
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 Cr=Ee("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"}]]);/**
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 sd=Ee("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"}]]);/**
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 qd=Ee("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"}]]);/**
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 WP=Ee("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"}]]);/**
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 HP=Ee("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"}]]);/**
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 Ca=Ee("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"}]]);/**
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 zs=Ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 xv=Ee("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"}]]);/**
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 gv=Ee("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"}]]);/**
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 Ea=Ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 bi=Ee("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"}]]);/**
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 Mn=Ee("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
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 VP=Ee("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"}]]);/**
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 YP=Ee("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
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 vv=Ee("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"}]]);/**
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 px=Ee("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"}]]);/**
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 Am=Ee("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"}]]);/**
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 wv=Ee("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"}]]);/**
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 Ma=Ee("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"}]]);/**
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 xx=Ee("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"}]]);/**
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 ra=Ee("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"}]]);/**
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 Pt=Ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
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 qh=Ee("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function VN(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=VN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Gd(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=VN(e))&&(r&&(r+=" "),r+=t);return r}const gx="-",XP=e=>{const t=GP(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(gx);return l[0]===""&&l.length!==1&&l.shift(),YN(l,t)||qP(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},YN=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?YN(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(gx);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},yv=/^\[(.+)\]$/,qP=e=>{if(yv.test(e)){const t=yv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},GP=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return QP(Object.entries(e.classGroups),n).forEach(([i,o])=>{Om(o,r,i,t)}),r},Om=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:bv(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(KP(a)){Om(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{Om(o,bv(t,i),n,r)})})},bv=(e,t)=>{let n=e;return t.split(gx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},KP=e=>e.isThemeGetter,QP=(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,ZP=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)}}},XN="!",JP=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 b=0;b<l.length;b++){let g=l[b];if(d===0){if(g===a&&(r||l.slice(b,b+i)===t)){c.push(l.slice(h,b)),h=b+i;continue}if(g==="/"){u=b;continue}}g==="["?d++:g==="]"&&d--}const f=c.length===0?l:l.substring(h),p=f.startsWith(XN),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},eA=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},tA=e=>({cache:ZP(e.cacheSize),parseClassName:JP(e),...XP(e)}),nA=/\s+/,rA=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(nA);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 b=eA(h).join(":"),g=u?b+XN:b,y=g+v;if(i.includes(y))continue;i.push(y);const x=a(v,w);for(let N=0;N<x.length;++N){const j=x[N];i.push(g+j)}l=d+(l.length>0?" "+l:l)}return l};function sA(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=qN(t))&&(r&&(r+=" "),r+=n);return r}const qN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=qN(e[r]))&&(n&&(n+=" "),n+=t);return n};function aA(e,...t){let n,r,a,i=o;function o(c){const d=t.reduce((h,u)=>u(h),e());return n=tA(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=rA(c,n);return a(c,h),h}return function(){return i(sA.apply(null,arguments))}}const rt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},GN=/^\[(?:([a-z-]+):)?(.+)\]$/i,iA=/^\d+\/\d+$/,oA=new Set(["px","full","screen"]),lA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cA=/\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$/,dA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,uA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$r=e=>Ni(e)||oA.has(e)||iA.test(e),us=e=>Ki(e,"length",yA),Ni=e=>!!e&&!Number.isNaN(Number(e)),Gh=e=>Ki(e,"number",Ni),vo=e=>!!e&&Number.isInteger(Number(e)),fA=e=>e.endsWith("%")&&Ni(e.slice(0,-1)),$e=e=>GN.test(e),hs=e=>lA.test(e),mA=new Set(["length","size","percentage"]),pA=e=>Ki(e,mA,KN),xA=e=>Ki(e,"position",KN),gA=new Set(["image","url"]),vA=e=>Ki(e,gA,NA),wA=e=>Ki(e,"",bA),wo=()=>!0,Ki=(e,t,n)=>{const r=GN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},yA=e=>cA.test(e)&&!dA.test(e),KN=()=>!1,bA=e=>uA.test(e),NA=e=>hA.test(e),jA=()=>{const e=rt("colors"),t=rt("spacing"),n=rt("blur"),r=rt("brightness"),a=rt("borderColor"),i=rt("borderRadius"),o=rt("borderSpacing"),l=rt("borderWidth"),c=rt("contrast"),d=rt("grayscale"),h=rt("hueRotate"),u=rt("invert"),f=rt("gap"),p=rt("gradientColorStops"),w=rt("gradientColorStopPositions"),v=rt("inset"),b=rt("margin"),g=rt("opacity"),y=rt("padding"),x=rt("saturate"),N=rt("scale"),j=rt("sepia"),k=rt("skew"),S=rt("space"),M=rt("translate"),A=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",$e,t],$=()=>[$e,t],L=()=>["",$r,us],E=()=>["auto",Ni,$e],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],T=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],_=()=>["","0",$e],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Ni,$e];return{cacheSize:500,separator:":",theme:{colors:[wo],spacing:[$r,us],blur:["none","",hs,$e],brightness:H(),borderColor:[e],borderRadius:["none","","full",hs,$e],borderSpacing:$(),borderWidth:L(),contrast:H(),grayscale:_(),hueRotate:H(),invert:_(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[fA,us],inset:U(),margin:U(),opacity:H(),padding:$(),saturate:H(),scale:H(),sepia:_(),skew:H(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[hs]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:[...O(),$e]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],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",vo,$e]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",vo,$e]}],"grid-cols":[{"grid-cols":[wo]}],"col-start-end":[{col:["auto",{span:["full",vo,$e]},$e]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[wo]}],"row-start-end":[{row:["auto",{span:[vo,$e]},$e]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"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:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"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",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[hs]},hs]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",hs,us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Gh]}],"font-family":[{font:[wo]}],"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",$e]}],"line-clamp":[{"line-clamp":["none",Ni,Gh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$r,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"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:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$r,us]}],"underline-offset":[{"underline-offset":["auto",$r,$e]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],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",$e]}],"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:[...O(),xA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vA]}],"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:[...D(),"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:D()}],"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:["",...D()]}],"outline-offset":[{"outline-offset":[$r,$e]}],"outline-w":[{outline:[$r,us]}],"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,us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",hs,wA]}],"shadow-color":[{shadow:[wo]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...T(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":T()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",hs,$e]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[j]}],"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":[j]}],"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",$e]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[vo,$e]}],"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",$e]}],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",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$r,us,Gh]}],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"]}}},kA=aA(jA);function De(...e){return kA(Gd(e))}function _t(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 Nv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _a(...e){return t=>{let n=!1;const r=e.map(a=>{const i=Nv(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():Nv(e[a],null)}}}}function Cn(...e){return m.useCallback(_a(...e),e)}function SA(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 Iu(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,b=m.useMemo(()=>w,Object.values(w));return s.jsx(v.Provider,{value:b,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,CA(a,...t)]}function CA(...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 Lu(e){const t=MA(e),n=m.forwardRef((r,a)=>{const{children:i,...o}=r,l=m.Children.toArray(i),c=l.find(DA);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 EA=Lu("Slot");function MA(e){const t=m.forwardRef((n,r)=>{const{children:a,...i}=n;if(m.isValidElement(a)){const o=PA(a),l=TA(i,a.props);return a.type!==m.Fragment&&(l.ref=r?_a(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 QN=Symbol("radix.slottable");function _A(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=QN,t}function DA(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===QN}function TA(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 PA(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 AA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=AA.reduce((e,t)=>{const n=Lu(`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 OA(e,t){e&&Nu.flushSync(()=>e.dispatchEvent(t))}function Fi(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 zA(e,t=globalThis==null?void 0:globalThis.document){const n=Fi(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 $A="DismissableLayer",zm="dismissableLayer.update",RA="dismissableLayer.pointerDownOutside",IA="dismissableLayer.focusOutside",jv,ZN=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fu=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=m.useContext(ZN),[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),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(b),y=h?v.indexOf(h):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,N=y>=g,j=UA(S=>{const M=S.target,A=[...d.branches].some(I=>I.contains(M));!N||A||(a==null||a(S),o==null||o(S),S.defaultPrevented||l==null||l())},f),k=BA(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 zA(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&&(jv=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),kv(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=jv)}},[h,f,n,d]),m.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),kv())},[h,d]),m.useEffect(()=>{const S=()=>p({});return document.addEventListener(zm,S),()=>document.removeEventListener(zm,S)},[]),s.jsx(ut.div,{...c,ref:w,style:{pointerEvents:x?N?"auto":"none":void 0,...e.style},onFocusCapture:_t(e.onFocusCapture,k.onFocusCapture),onBlurCapture:_t(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:_t(e.onPointerDownCapture,j.onPointerDownCapture)})});Fu.displayName=$A;var LA="DismissableLayerBranch",FA=m.forwardRef((e,t)=>{const n=m.useContext(ZN),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(ut.div,{...e,ref:a})});FA.displayName=LA;function UA(e,t=globalThis==null?void 0:globalThis.document){const n=Fi(e),r=m.useRef(!1),a=m.useRef(()=>{});return m.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){JN(RA,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 BA(e,t=globalThis==null?void 0:globalThis.document){const n=Fi(e),r=m.useRef(!1);return m.useEffect(()=>{const a=i=>{i.target&&!r.current&&JN(IA,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 kv(){const e=new CustomEvent(zm);document.dispatchEvent(e)}function JN(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?OA(a,i):a.dispatchEvent(i)}var Ls=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},WA=tp[" useId ".trim().toString()]||(()=>{}),HA=0;function nr(e){const[t,n]=m.useState(WA());return Ls(()=>{n(r=>r??String(HA++))},[e]),e||(t?`radix-${t}`:"")}const VA=["top","right","bottom","left"],Fs=Math.min,xn=Math.max,Kd=Math.round,Tc=Math.floor,Er=e=>({x:e,y:e}),YA={left:"right",right:"left",bottom:"top",top:"bottom"},XA={start:"end",end:"start"};function $m(e,t,n){return xn(e,Fs(t,n))}function Jr(e,t){return typeof e=="function"?e(t):e}function es(e){return e.split("-")[0]}function Qi(e){return e.split("-")[1]}function vx(e){return e==="x"?"y":"x"}function wx(e){return e==="y"?"height":"width"}const qA=new Set(["top","bottom"]);function yr(e){return qA.has(es(e))?"y":"x"}function yx(e){return vx(yr(e))}function GA(e,t,n){n===void 0&&(n=!1);const r=Qi(e),a=yx(e),i=wx(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Qd(o)),[o,Qd(o)]}function KA(e){const t=Qd(e);return[Rm(e),t,Rm(t)]}function Rm(e){return e.replace(/start|end/g,t=>XA[t])}const Sv=["left","right"],Cv=["right","left"],QA=["top","bottom"],ZA=["bottom","top"];function JA(e,t,n){switch(e){case"top":case"bottom":return n?t?Cv:Sv:t?Sv:Cv;case"left":case"right":return t?QA:ZA;default:return[]}}function eO(e,t,n,r){const a=Qi(e);let i=JA(es(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Rm)))),i}function Qd(e){return e.replace(/left|right|bottom|top/g,t=>YA[t])}function tO(e){return{top:0,right:0,bottom:0,left:0,...e}}function ej(e){return typeof e!="number"?tO(e):{top:e,right:e,bottom:e,left:e}}function Zd(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 Ev(e,t,n){let{reference:r,floating:a}=e;const i=yr(t),o=yx(t),l=wx(o),c=es(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(Qi(t)){case"start":p[o]-=f*(n&&d?-1:1);break;case"end":p[o]+=f*(n&&d?-1:1);break}return p}const nO=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}=Ev(d,r,c),f=r,p={},w=0;for(let v=0;v<l.length;v++){const{name:b,fn:g}=l[v],{x:y,y:x,data:N,reset:j}=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,[b]:{...p[b],...N}},j&&w<=50&&(w++,typeof j=="object"&&(j.placement&&(f=j.placement),j.rects&&(d=j.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):j.rects),{x:h,y:u}=Ev(d,f,c)),v=-1)}return{x:h,y:u,placement:f,strategy:a,middlewareData:p}};async function Nl(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}=Jr(t,e),w=ej(p),b=l[f?u==="floating"?"reference":"floating":u],g=Zd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.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)),N=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},j=Zd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:c}):y);return{top:(g.top-j.top+w.top)/N.y,bottom:(j.bottom-g.bottom+w.bottom)/N.y,left:(g.left-j.left+w.left)/N.x,right:(j.right-g.right+w.right)/N.x}}const rO=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}=Jr(e,t)||{};if(d==null)return{};const u=ej(h),f={x:n,y:r},p=yx(a),w=wx(p),v=await o.getDimensions(d),b=p==="y",g=b?"top":"left",y=b?"bottom":"right",x=b?"clientHeight":"clientWidth",N=i.reference[w]+i.reference[p]-f[p]-i.floating[w],j=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=N/2-j/2,A=S/2-v[w]/2-1,I=Fs(u[g],A),U=Fs(u[y],A),$=I,L=S-v[w]-U,E=S/2-v[w]/2+M,O=$m($,E,L),D=!c.arrow&&Qi(a)!=null&&E!==O&&i.reference[w]/2-(E<$?I:U)-v[w]/2<0,T=D?E<$?E-$:E-L:0;return{[p]:f[p]+T,data:{[p]:O,centerOffset:E-O-T,...D&&{alignmentOffset:T}},reset:D}}}),sO=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,...b}=Jr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=es(a),y=yr(l),x=es(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),j=f||(x||!v?[Qd(l)]:KA(l)),k=w!=="none";!f&&k&&j.push(...eO(l,v,w,N));const S=[l,...j],M=await Nl(t,b),A=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&A.push(M[g]),u){const E=GA(a,o,N);A.push(M[E[0]],M[E[1]])}if(I=[...I,{placement:a,overflows:A}],!A.every(E=>E<=0)){var U,$;const E=(((U=i.flip)==null?void 0:U.index)||0)+1,O=S[E];if(O&&(!(u==="alignment"?y!==yr(O):!1)||I.every(C=>yr(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:E,overflows:I},reset:{placement:O}};let D=($=I.filter(T=>T.overflows[0]<=0).sort((T,C)=>T.overflows[1]-C.overflows[1])[0])==null?void 0:$.placement;if(!D)switch(p){case"bestFit":{var L;const T=(L=I.filter(C=>{if(k){const _=yr(C.placement);return _===y||_==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(_=>_>0).reduce((_,z)=>_+z,0)]).sort((C,_)=>C[1]-_[1])[0])==null?void 0:L[0];T&&(D=T);break}case"initialPlacement":D=l;break}if(a!==D)return{reset:{placement:D}}}return{}}}};function Mv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _v(e){return VA.some(t=>e[t]>=0)}const aO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Jr(e,t);switch(r){case"referenceHidden":{const i=await Nl(t,{...a,elementContext:"reference"}),o=Mv(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:_v(o)}}}case"escaped":{const i=await Nl(t,{...a,altBoundary:!0}),o=Mv(i,n.floating);return{data:{escapedOffsets:o,escaped:_v(o)}}}default:return{}}}}},tj=new Set(["left","top"]);async function iO(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=es(n),l=Qi(n),c=yr(n)==="y",d=tj.has(o)?-1:1,h=i&&c?-1:1,u=Jr(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 oO=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 iO(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}}}}},lO=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:b=>{let{x:g,y}=b;return{x:g,y}}},...c}=Jr(e,t),d={x:n,y:r},h=await Nl(t,c),u=yr(es(a)),f=vx(u);let p=d[f],w=d[u];if(i){const b=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=p+h[b],x=p-h[g];p=$m(y,p,x)}if(o){const b=u==="y"?"top":"left",g=u==="y"?"bottom":"right",y=w+h[b],x=w-h[g];w=$m(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}}}}}},cO=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}=Jr(e,t),h={x:n,y:r},u=yr(a),f=vx(u);let p=h[f],w=h[u];const v=Jr(l,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const x=f==="y"?"height":"width",N=i.reference[f]-i.floating[x]+b.mainAxis,j=i.reference[f]+i.reference[x]-b.mainAxis;p<N?p=N:p>j&&(p=j)}if(d){var g,y;const x=f==="y"?"width":"height",N=tj.has(es(a)),j=i.reference[u]-i.floating[x]+(N&&((g=o.offset)==null?void 0:g[u])||0)+(N?0:b.crossAxis),k=i.reference[u]+i.reference[x]+(N?0:((y=o.offset)==null?void 0:y[u])||0)-(N?b.crossAxis:0);w<j?w=j:w>k&&(w=k)}return{[f]:p,[u]:w}}}},dO=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}=Jr(e,t),h=await Nl(t,d),u=es(a),f=Qi(a),p=yr(a)==="y",{width:w,height:v}=i.floating;let b,g;u==="top"||u==="bottom"?(b=u,g=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=u,b=f==="end"?"top":"bottom");const y=v-h.top-h.bottom,x=w-h.left-h.right,N=Fs(v-h[b],y),j=Fs(w-h[g],x),k=!t.middlewareData.shift;let S=N,M=j;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),U=xn(h.right,0),$=xn(h.top,0),L=xn(h.bottom,0);p?M=w-2*(I!==0||U!==0?I+U:xn(h.left,h.right)):S=v-2*($!==0||L!==0?$+L:xn(h.top,h.bottom))}await c({...t,availableWidth:M,availableHeight:S});const A=await o.getDimensions(l.floating);return w!==A.width||v!==A.height?{reset:{rects:!0}}:{}}}};function Uu(){return typeof window<"u"}function Zi(e){return nj(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=(nj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function nj(e){return Uu()?e instanceof Node||e instanceof yn(e).Node:!1}function sr(e){return Uu()?e instanceof Element||e instanceof yn(e).Element:!1}function _r(e){return Uu()?e instanceof HTMLElement||e instanceof yn(e).HTMLElement:!1}function Dv(e){return!Uu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yn(e).ShadowRoot}const uO=new Set(["inline","contents"]);function Fl(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ar(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!uO.has(a)}const hO=new Set(["table","td","th"]);function fO(e){return hO.has(Zi(e))}const mO=[":popover-open",":modal"];function Bu(e){return mO.some(t=>{try{return e.matches(t)}catch{return!1}})}const pO=["transform","translate","scale","rotate","perspective"],xO=["transform","translate","scale","rotate","perspective","filter"],gO=["paint","layout","strict","content"];function bx(e){const t=Nx(),n=sr(e)?ar(e):e;return pO.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)||xO.some(r=>(n.willChange||"").includes(r))||gO.some(r=>(n.contain||"").includes(r))}function vO(e){let t=Us(e);for(;_r(t)&&!Ui(t);){if(bx(t))return t;if(Bu(t))return null;t=Us(t)}return null}function Nx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wO=new Set(["html","body","#document"]);function Ui(e){return wO.has(Zi(e))}function ar(e){return yn(e).getComputedStyle(e)}function Wu(e){return sr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Us(e){if(Zi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dv(e)&&e.host||Pr(e);return Dv(t)?t.host:t}function rj(e){const t=Us(e);return Ui(t)?e.ownerDocument?e.ownerDocument.body:e.body:_r(t)&&Fl(t)?t:rj(t)}function jl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=rj(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=yn(a);if(i){const l=Im(o);return t.concat(o,o.visualViewport||[],Fl(a)?a:[],l&&n?jl(l):[])}return t.concat(a,jl(a,[],n))}function Im(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sj(e){const t=ar(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=_r(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,l=Kd(n)!==i||Kd(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function jx(e){return sr(e)?e:e.contextElement}function ji(e){const t=jx(e);if(!_r(t))return Er(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=sj(t);let o=(i?Kd(n.width):n.width)/r,l=(i?Kd(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const yO=Er(0);function aj(e){const t=yn(e);return!Nx()||!t.visualViewport?yO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yn(e)?!1:t}function Da(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=jx(e);let o=Er(1);t&&(r?sr(r)&&(o=ji(r)):o=ji(e));const l=bO(i,n,r)?aj(i):Er(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&&sr(r)?yn(r):r;let w=f,v=Im(w);for(;v&&r&&p!==w;){const b=ji(v),g=v.getBoundingClientRect(),y=ar(v),x=g.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,N=g.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;c*=b.x,d*=b.y,h*=b.x,u*=b.y,c+=x,d+=N,w=yn(v),v=Im(w)}}return Zd({width:h,height:u,x:c,y:d})}function Hu(e,t){const n=Wu(e).scrollLeft;return t?t.left+n:Da(Pr(e)).left+n}function ij(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Hu(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function NO(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Pr(r),l=t?Bu(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=Er(1);const h=Er(0),u=_r(r);if((u||!u&&!i)&&((Zi(r)!=="body"||Fl(o))&&(c=Wu(r)),_r(r))){const p=Da(r);d=ji(r),h.x=p.x+r.clientLeft,h.y=p.y+r.clientTop}const f=o&&!u&&!i?ij(o,c):Er(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 jO(e){return Array.from(e.getClientRects())}function kO(e){const t=Pr(e),n=Wu(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+Hu(e);const l=-n.scrollTop;return ar(r).direction==="rtl"&&(o+=xn(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:l}}const Tv=25;function SO(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=Nx();(!h||h&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=Hu(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<=Tv&&(i-=w)}else d<=Tv&&(i+=d);return{width:i,height:o,x:l,y:c}}const CO=new Set(["absolute","fixed"]);function EO(e,t){const n=Da(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=_r(e)?ji(e):Er(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 Pv(e,t,n){let r;if(t==="viewport")r=SO(e,n);else if(t==="document")r=kO(Pr(e));else if(sr(t))r=EO(t,n);else{const a=aj(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Zd(r)}function oj(e,t){const n=Us(e);return n===t||!sr(n)||Ui(n)?!1:ar(n).position==="fixed"||oj(n,t)}function MO(e,t){const n=t.get(e);if(n)return n;let r=jl(e,[],!1).filter(l=>sr(l)&&Zi(l)!=="body"),a=null;const i=ar(e).position==="fixed";let o=i?Us(e):e;for(;sr(o)&&!Ui(o);){const l=ar(o),c=bx(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&CO.has(a.position)||Fl(o)&&!c&&oj(e,o))?r=r.filter(h=>h!==o):a=l,o=Us(o)}return t.set(e,r),r}function _O(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Bu(t)?[]:MO(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((d,h)=>{const u=Pv(t,h,a);return d.top=xn(u.top,d.top),d.right=Fs(u.right,d.right),d.bottom=Fs(u.bottom,d.bottom),d.left=xn(u.left,d.left),d},Pv(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function DO(e){const{width:t,height:n}=sj(e);return{width:t,height:n}}function TO(e,t,n){const r=_r(t),a=Pr(t),i=n==="fixed",o=Da(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Er(0);function d(){c.x=Hu(a)}if(r||!r&&!i)if((Zi(t)!=="body"||Fl(a))&&(l=Wu(t)),r){const p=Da(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?ij(a,l):Er(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 Kh(e){return ar(e).position==="static"}function Av(e,t){if(!_r(e)||ar(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pr(e)===n&&(n=n.ownerDocument.body),n}function lj(e,t){const n=yn(e);if(Bu(e))return n;if(!_r(e)){let a=Us(e);for(;a&&!Ui(a);){if(sr(a)&&!Kh(a))return a;a=Us(a)}return n}let r=Av(e,t);for(;r&&fO(r)&&Kh(r);)r=Av(r,t);return r&&Ui(r)&&Kh(r)&&!bx(r)?n:r||vO(e)||n}const PO=async function(e){const t=this.getOffsetParent||lj,n=this.getDimensions,r=await n(e.floating);return{reference:TO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function AO(e){return ar(e).direction==="rtl"}const OO={convertOffsetParentRelativeRectToViewportRelativeRect:NO,getDocumentElement:Pr,getClippingRect:_O,getOffsetParent:lj,getElementRects:PO,getClientRects:jO,getDimensions:DO,getScale:ji,isElement:sr,isRTL:AO};function cj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zO(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=Tc(u),v=Tc(a.clientWidth-(h+f)),b=Tc(a.clientHeight-(u+p)),g=Tc(h),x={rootMargin:-w+"px "+-v+"px "+-b+"px "+-g+"px",threshold:xn(0,Fs(1,c))||1};let N=!0;function j(k){const S=k[0].intersectionRatio;if(S!==c){if(!N)return o();S?o(!1,S):r=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!cj(d,e.getBoundingClientRect())&&o(),N=!1}try{n=new IntersectionObserver(j,{...x,root:a.ownerDocument})}catch{n=new IntersectionObserver(j,x)}n.observe(e)}return o(!0),i}function $O(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=jx(e),h=a||i?[...d?jl(d):[],...jl(t)]:[];h.forEach(g=>{a&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const u=d&&l?zO(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?Da(e):null;c&&b();function b(){const g=Da(e);v&&!cj(v,g)&&n(),v=g,w=requestAnimationFrame(b)}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 RO=oO,IO=lO,LO=sO,FO=dO,UO=aO,Ov=rO,BO=cO,WO=(e,t,n)=>{const r=new Map,a={platform:OO,...n},i={...a.platform,_c:r};return nO(e,t,{...a,platform:i})};var HO=typeof document<"u",VO=function(){},ad=HO?m.useLayoutEffect:VO;function Jd(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(!Jd(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)&&!Jd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function dj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zv(e,t){const n=dj(e);return Math.round(t*n)/n}function Qh(e){const t=m.useRef(e);return ad(()=>{t.current=e}),t}function YO(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);Jd(f,r)||p(r);const[w,v]=m.useState(null),[b,g]=m.useState(null),y=m.useCallback(C=>{C!==k.current&&(k.current=C,v(C))},[]),x=m.useCallback(C=>{C!==S.current&&(S.current=C,g(C))},[]),N=i||w,j=o||b,k=m.useRef(null),S=m.useRef(null),M=m.useRef(h),A=c!=null,I=Qh(c),U=Qh(a),$=Qh(d),L=m.useCallback(()=>{if(!k.current||!S.current)return;const C={placement:t,strategy:n,middleware:f};U.current&&(C.platform=U.current),WO(k.current,S.current,C).then(_=>{const z={..._,isPositioned:$.current!==!1};E.current&&!Jd(M.current,z)&&(M.current=z,Nu.flushSync(()=>{u(z)}))})},[f,t,n,U,$]);ad(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,u(C=>({...C,isPositioned:!1})))},[d]);const E=m.useRef(!1);ad(()=>(E.current=!0,()=>{E.current=!1}),[]),ad(()=>{if(N&&(k.current=N),j&&(S.current=j),N&&j){if(I.current)return I.current(N,j,L);L()}},[N,j,L,I,A]);const O=m.useMemo(()=>({reference:k,floating:S,setReference:y,setFloating:x}),[y,x]),D=m.useMemo(()=>({reference:N,floating:j}),[N,j]),T=m.useMemo(()=>{const C={position:n,left:0,top:0};if(!D.floating)return C;const _=zv(D.floating,h.x),z=zv(D.floating,h.y);return l?{...C,transform:"translate("+_+"px, "+z+"px)",...dj(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:z}},[n,l,D.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:L,refs:O,elements:D,floatingStyles:T}),[h,L,O,D,T])}const XO=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?Ov({element:r.current,padding:a}).fn(n):{}:r?Ov({element:r,padding:a}).fn(n):{}}}},qO=(e,t)=>({...RO(e),options:[e,t]}),GO=(e,t)=>({...IO(e),options:[e,t]}),KO=(e,t)=>({...BO(e),options:[e,t]}),QO=(e,t)=>({...LO(e),options:[e,t]}),ZO=(e,t)=>({...FO(e),options:[e,t]}),JO=(e,t)=>({...UO(e),options:[e,t]}),e6=(e,t)=>({...XO(e),options:[e,t]});var t6="Arrow",uj=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(ut.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"})})});uj.displayName=t6;var n6=uj;function r6(e){const[t,n]=m.useState(void 0);return Ls(()=>{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 kx="Popper",[hj,Vu]=Iu(kx),[s6,fj]=hj(kx),mj=e=>{const{__scopePopper:t,children:n}=e,[r,a]=m.useState(null);return s.jsx(s6,{scope:t,anchor:r,onAnchorChange:a,children:n})};mj.displayName=kx;var pj="PopperAnchor",xj=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=fj(pj,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(ut.div,{...a,ref:l})});xj.displayName=pj;var Sx="PopperContent",[a6,i6]=hj(Sx),gj=m.forwardRef((e,t)=>{var re,Z,R,ee,J,F;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,b=fj(Sx,n),[g,y]=m.useState(null),x=Cn(t,K=>y(K)),[N,j]=m.useState(null),k=r6(N),S=(k==null?void 0:k.width)??0,M=(k==null?void 0:k.height)??0,A=r+(i!=="center"?"-"+i:""),I=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},U=Array.isArray(d)?d:[d],$=U.length>0,L={padding:I,boundary:U.filter(l6),altBoundary:$},{refs:E,floatingStyles:O,placement:D,isPositioned:T,middlewareData:C}=YO({strategy:"fixed",placement:A,whileElementsMounted:(...K)=>$O(...K,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[qO({mainAxis:a+M,alignmentAxis:o}),c&&GO({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?KO():void 0,...L}),c&&QO({...L}),ZO({...L,apply:({elements:K,rects:ne,availableWidth:ce,availableHeight:ge})=>{const{width:ve,height:Ae}=ne.reference,Te=K.floating.style;Te.setProperty("--radix-popper-available-width",`${ce}px`),Te.setProperty("--radix-popper-available-height",`${ge}px`),Te.setProperty("--radix-popper-anchor-width",`${ve}px`),Te.setProperty("--radix-popper-anchor-height",`${Ae}px`)}}),N&&e6({element:N,padding:l}),c6({arrowWidth:S,arrowHeight:M}),f&&JO({strategy:"referenceHidden",...L})]}),[_,z]=yj(D),H=Fi(w);Ls(()=>{T&&(H==null||H())},[T,H]);const P=(re=C.arrow)==null?void 0:re.x,B=(Z=C.arrow)==null?void 0:Z.y,q=((R=C.arrow)==null?void 0:R.centerOffset)!==0,[G,se]=m.useState();return Ls(()=>{g&&se(window.getComputedStyle(g).zIndex)},[g]),s.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:T?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(ee=C.transformOrigin)==null?void 0:ee.x,(J=C.transformOrigin)==null?void 0:J.y].join(" "),...((F=C.hide)==null?void 0:F.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(a6,{scope:n,placedSide:_,onArrowChange:j,arrowX:P,arrowY:B,shouldHideArrow:q,children:s.jsx(ut.div,{"data-side":_,"data-align":z,...v,ref:x,style:{...v.style,animation:T?void 0:"none"}})})})});gj.displayName=Sx;var vj="PopperArrow",o6={top:"bottom",right:"left",bottom:"top",left:"right"},wj=m.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=i6(vj,r),o=o6[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(n6,{...a,ref:n,style:{...a.style,display:"block"}})})});wj.displayName=vj;function l6(e){return e!==null}var c6=e=>({name:"transformOrigin",options:e,fn(t){var b,g,y;const{placement:n,rects:r,middlewareData:a}=t,o=((b=a.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,h]=yj(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 yj(e){const[t,n="center"]=e.split("-");return[t,n]}var bj=mj,Cx=xj,Nj=gj,jj=wj,d6="Portal",Ex=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,i]=m.useState(!1);Ls(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Fb.createPortal(s.jsx(ut.div,{...r,ref:t}),o):null});Ex.displayName=d6;function u6(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Ia=e=>{const{present:t,children:n}=e,r=h6(t),a=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Cn(r.ref,f6(a));return typeof n=="function"||r.isPresent?m.cloneElement(a,{ref:i}):null};Ia.displayName="Presence";function h6(e){const[t,n]=m.useState(),r=m.useRef(null),a=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=u6(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const d=Pc(r.current);i.current=l==="mounted"?d:"none"},[l]),Ls(()=>{const d=r.current,h=a.current;if(h!==e){const f=i.current,p=Pc(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]),Ls(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,u=p=>{const v=Pc(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&v&&(c("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=p=>{p.target===t&&(i.current=Pc(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 Pc(e){return(e==null?void 0:e.animationName)||"none"}function f6(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 m6=tp[" useInsertionEffect ".trim().toString()]||Ls;function Mx({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=p6({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=x6(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 p6({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),a=m.useRef(n),i=m.useRef(t);return m6(()=>{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 x6(e){return typeof e=="function"}var g6=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"}),v6="VisuallyHidden",kj=m.forwardRef((e,t)=>s.jsx(ut.span,{...e,ref:t,style:{...g6,...e.style}}));kj.displayName=v6;var w6=kj,[Yu]=Iu("Tooltip",[Vu]),Xu=Vu(),Sj="TooltipProvider",y6=700,Lm="tooltip.open",[b6,_x]=Yu(Sj),Cj=e=>{const{__scopeTooltip:t,delayDuration:n=y6,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(b6,{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})};Cj.displayName=Sj;var kl="Tooltip",[N6,qu]=Yu(kl),Ej=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=_x(kl,e.__scopeTooltip),d=Xu(t),[h,u]=m.useState(null),f=nr(),p=m.useRef(0),w=o??c.disableHoverableContent,v=l??c.delayDuration,b=m.useRef(!1),[g,y]=Mx({prop:r,defaultProp:a??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(Lm))):c.onClose(),i==null||i(S)},caller:kl}),x=m.useMemo(()=>g?b.current?"delayed-open":"instant-open":"closed",[g]),N=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,y(!0)},[y]),j=m.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,y(!0),p.current=0},v)},[v,y]);return m.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),s.jsx(bj,{...d,children:s.jsx(N6,{scope:t,contentId:f,open:g,stateAttribute:x,trigger:h,onTriggerChange:u,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?k():N()},[c.isOpenDelayedRef,k,N]),onTriggerLeave:m.useCallback(()=>{w?j():(window.clearTimeout(p.current),p.current=0)},[j,w]),onOpen:N,onClose:j,disableHoverableContent:w,children:n})})};Ej.displayName=kl;var Fm="TooltipTrigger",Mj=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=qu(Fm,n),i=_x(Fm,n),o=Xu(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(Cx,{asChild:!0,...o,children:s.jsx(ut.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:_t(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:_t(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:_t(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:_t(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:_t(e.onBlur,a.onClose),onClick:_t(e.onClick,a.onClose)})})});Mj.displayName=Fm;var j6="TooltipPortal",[zF,k6]=Yu(j6,{forceMount:void 0}),Bi="TooltipContent",_j=m.forwardRef((e,t)=>{const n=k6(Bi,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=qu(Bi,e.__scopeTooltip);return s.jsx(Ia,{present:r||o.open,children:o.disableHoverableContent?s.jsx(Dj,{side:a,...i,ref:t}):s.jsx(S6,{side:a,...i,ref:t})})}),S6=m.forwardRef((e,t)=>{const n=qu(Bi,e.__scopeTooltip),r=_x(Bi,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 b=w.currentTarget,g={x:w.clientX,y:w.clientY},y=D6(g,b.getBoundingClientRect()),x=T6(g,y),N=P6(v.getBoundingClientRect()),j=O6([...x,...N]);l(j),u(!0)},[u]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&h){const w=b=>p(b,h),v=b=>p(b,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 b=v.target,g={x:v.clientX,y:v.clientY},y=(c==null?void 0:c.contains(b))||(h==null?void 0:h.contains(b)),x=!A6(g,o);y?f():x&&(f(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,h,o,d,f]),s.jsx(Dj,{...e,ref:i})}),[C6,E6]=Yu(kl,{isInside:!1}),M6=_A("TooltipContent"),Dj=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=qu(Bi,n),d=Xu(n),{onClose:h}=c;return m.useEffect(()=>(document.addEventListener(Lm,h),()=>document.removeEventListener(Lm,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(Fu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:h,children:s.jsxs(Nj,{"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(M6,{children:r}),s.jsx(C6,{scope:n,isInside:!0,children:s.jsx(w6,{id:c.contentId,role:"tooltip",children:a||r})})]})})});_j.displayName=Bi;var Tj="TooltipArrow",_6=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Xu(n);return E6(Tj,n).isInside?null:s.jsx(jj,{...a,...r,ref:t})});_6.displayName=Tj;function D6(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 T6(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 P6(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 A6(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 O6(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),z6(t)}function z6(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 $6=Cj,R6=Ej,I6=Mj,Pj=_j;const Zh=$6,Jh=R6,ef=I6,id=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Pj,{ref:r,sideOffset:t,className:De("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}));id.displayName=Pj.displayName;const L6=320,F6=32,U6=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",Um=({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=U6(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(lt,{size:12,className:"text-gray-400"}),s.jsx("span",{className:"font-medium",children:r.displayName||r.name}),t&&s.jsx(ma,{type:"target",id:r.name,position:t,className:De(c)})]})}):s.jsx("div",{className:"relative",children:s.jsxs("div",{className:De("border border-gray-700 overflow-hidden shadow-xl bg-gray-900 rounded-lg","hover:border-gray-600 transition-colors duration-200"),style:{width:L6},id:`${r.name}-schema-node`,children:[s.jsxs("div",{className:De("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(lt,{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(IP,{size:12,className:"text-gray-400"}):s.jsx(Ll,{size:12,className:"text-gray-400"})}),a?s.jsx(fx,{size:14,className:"text-gray-400"}):s.jsx(Ru,{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:De("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:F6},children:[s.jsxs("div",{className:"flex items-center gap-1 mr-3 min-w-[40px]",children:[h.isPrimary&&s.jsx(Zh,{delayDuration:100,children:s.jsxs(Jh,{children:[s.jsx(ef,{asChild:!0,children:s.jsx(Xd,{size:10,className:"text-yellow-400 flex-shrink-0"})}),s.jsx(id,{className:"bg-black border-gray-600 text-white text-xs",children:"Primary Key"})]})}),h.isUnique&&!h.isPrimary&&s.jsx(Zh,{delayDuration:100,children:s.jsxs(Jh,{children:[s.jsx(ef,{asChild:!0,children:s.jsx(LP,{size:10,className:"text-green-400 flex-shrink-0"})}),s.jsx(id,{className:"bg-black border-gray-600 text-white text-xs",children:"Unique"})]})}),h.isIdentity&&s.jsx(Zh,{delayDuration:100,children:s.jsxs(Jh,{children:[s.jsx(ef,{asChild:!0,children:s.jsx(UP,{size:10,className:"text-blue-400 flex-shrink-0"})}),s.jsx(id,{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:De("px-2 py-1 rounded text-xs font-medium",d),children:h.plugin})}),s.jsx(ma,{type:"target",id:h.id,position:t||"left",className:De(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(ma,{type:"source",id:h.id,position:n||"right",className:De(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":""]})})]})})},B6={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"}]},W6={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 H6(){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(Um,{data:B6,targetPosition:"left",sourcePosition:"right"})]}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl text-white mb-4",children:"Organization Plugin Table"}),s.jsx(Um,{data:W6,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 Aj=m.createContext(void 0);function V6({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(Aj.Provider,{value:{counts:t,loading:r,refetchCounts:o},children:e})}function Gu(){const e=m.useContext(Aj);if(e===void 0)throw new Error("useCounts must be used within a CountsProvider");return e}var $v=1,Y6=.9,X6=.8,q6=.17,tf=.1,nf=.999,G6=.9999,K6=.99,Q6=/[\\\/_+.#"@\[\(\{&]/,Z6=/[\\\/_+.#"@\[\(\{&]/g,J6=/[\s-]/,Oj=/[\s-]/g;function Bm(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?$v:K6;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*=$v:Q6.test(e.charAt(d-1))?(u*=X6,p=e.slice(a,d-1).match(Z6),p&&a>0&&(u*=Math.pow(nf,p.length))):J6.test(e.charAt(d-1))?(u*=Y6,w=e.slice(a,d-1).match(Oj),w&&a>0&&(u*=Math.pow(nf,w.length))):(u*=q6,a>0&&(u*=Math.pow(nf,d-a))),e.charAt(d)!==t.charAt(i)&&(u*=G6)),(u<tf&&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*tf>u&&(u=f*tf)),u>h&&(h=u),d=n.indexOf(c,d+1);return o[l]=h,h}function Rv(e){return e.toLowerCase().replace(Oj," ")}function ez(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Bm(e,t,Rv(e),Rv(t),0,0,{})}var rf="focusScope.autoFocusOnMount",sf="focusScope.autoFocusOnUnmount",Iv={bubbles:!1,cancelable:!0},tz="FocusScope",Dx=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=m.useState(null),d=Fi(a),h=Fi(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 N=x.target;l.contains(N)?u.current=N:ps(u.current,{select:!0})},b=function(x){if(p.paused||!l)return;const N=x.relatedTarget;N!==null&&(l.contains(N)||ps(u.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const j of x)j.removedNodes.length>0&&ps(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const y=new MutationObserver(g);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),y.disconnect()}}},[r,l,p.paused]),m.useEffect(()=>{if(l){Fv.add(p);const v=document.activeElement;if(!l.contains(v)){const g=new CustomEvent(rf,Iv);l.addEventListener(rf,d),l.dispatchEvent(g),g.defaultPrevented||(nz(oz(zj(l)),{select:!0}),document.activeElement===v&&ps(l))}return()=>{l.removeEventListener(rf,d),setTimeout(()=>{const g=new CustomEvent(sf,Iv);l.addEventListener(sf,h),l.dispatchEvent(g),g.defaultPrevented||ps(v??document.body,{select:!0}),l.removeEventListener(sf,h),Fv.remove(p)},0)}}},[l,d,h,p]);const w=m.useCallback(v=>{if(!n&&!r||p.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(b&&g){const y=v.currentTarget,[x,N]=rz(y);x&&N?!v.shiftKey&&g===N?(v.preventDefault(),n&&ps(x,{select:!0})):v.shiftKey&&g===x&&(v.preventDefault(),n&&ps(N,{select:!0})):g===y&&v.preventDefault()}},[n,r,p.paused]);return s.jsx(ut.div,{tabIndex:-1,...o,ref:f,onKeyDown:w})});Dx.displayName=tz;function nz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ps(r,{select:t}),document.activeElement!==n)return}function rz(e){const t=zj(e),n=Lv(t,e),r=Lv(t.reverse(),e);return[n,r]}function zj(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 Lv(e,t){for(const n of e)if(!sz(n,{upTo:t}))return n}function sz(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 az(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&az(e)&&t&&e.select()}}var Fv=iz();function iz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Uv(e,t),e.unshift(t)},remove(t){var n;e=Uv(e,t),(n=e[0])==null||n.resume()}}}function Uv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function oz(e){return e.filter(t=>t.tagName!=="A")}var af=0;function $j(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bv()),document.body.insertAdjacentElement("beforeend",e[1]??Bv()),af++,()=>{af===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),af--}},[])}function Bv(){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 wr=function(){return wr=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},wr.apply(this,arguments)};function Rj(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 lz(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 od="right-scroll-bar-position",ld="width-before-scroll-bar",cz="with-scroll-bars-hidden",dz="--removed-body-scroll-bar-size";function of(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function uz(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 hz=typeof window<"u"?m.useLayoutEffect:m.useEffect,Wv=new WeakMap;function fz(e,t){var n=uz(null,function(r){return e.forEach(function(a){return of(a,r)})});return hz(function(){var r=Wv.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||of(l,null)}),i.forEach(function(l){a.has(l)||of(l,o)})}Wv.set(n,e)},[e]),n}function mz(e){return e}function pz(e,t){t===void 0&&(t=mz);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 xz(e){e===void 0&&(e={});var t=pz(null);return t.options=wr({async:!0,ssr:!1},e),t}var Ij=function(e){var t=e.sideCar,n=Rj(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,wr({},n))};Ij.isSideCarExport=!0;function gz(e,t){return e.useMedium(t),Ij}var Lj=xz(),lf=function(){},Ku=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:lf,onWheelCapture:lf,onTouchMoveCapture:lf}),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,b=e.allowPinchZoom,g=e.as,y=g===void 0?"div":g,x=e.gapMode,N=Rj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,k=fz([n,t]),S=wr(wr({},N),a);return m.createElement(m.Fragment,null,h&&m.createElement(j,{sideCar:Lj,removeScrollBar:d,shards:u,noRelative:p,noIsolation:w,inert:v,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:x}),o?m.cloneElement(m.Children.only(l),wr(wr({},S),{ref:k})):m.createElement(y,wr({},S,{className:c,ref:k}),l))});Ku.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ku.classNames={fullWidth:ld,zeroRight:od};var vz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=vz();return t&&e.setAttribute("nonce",t),e}function yz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Nz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wz())&&(yz(t,n),bz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jz=function(){var e=Nz();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Fj=function(){var e=jz(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},kz={left:0,top:0,right:0,gap:0},cf=function(e){return parseInt(e||"",10)||0},Sz=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[cf(n),cf(r),cf(a)]},Cz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kz;var t=Sz(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])}},Ez=Fj(),ki="data-scroll-locked",Mz=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
360
- .`.concat(cz,` {
361
- overflow: hidden `).concat(r,`;
362
- padding-right: `).concat(l,"px ").concat(r,`;
363
- }
364
- body[`).concat(ki,`] {
365
- overflow: hidden `).concat(r,`;
366
- overscroll-behavior: contain;
367
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
368
- padding-left: `.concat(a,`px;
369
- padding-top: `).concat(i,`px;
370
- padding-right: `).concat(o,`px;
371
- margin-left:0;
372
- margin-top:0;
373
- margin-right: `).concat(l,"px ").concat(r,`;
374
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
375
- }
376
-
377
- .`).concat(od,` {
378
- right: `).concat(l,"px ").concat(r,`;
379
- }
380
-
381
- .`).concat(ld,` {
382
- margin-right: `).concat(l,"px ").concat(r,`;
383
- }
384
-
385
- .`).concat(od," .").concat(od,` {
386
- right: 0 `).concat(r,`;
387
- }
388
-
389
- .`).concat(ld," .").concat(ld,` {
390
- margin-right: 0 `).concat(r,`;
391
- }
392
-
393
- body[`).concat(ki,`] {
394
- `).concat(dz,": ").concat(l,`px;
395
- }
396
- `)},Hv=function(){var e=parseInt(document.body.getAttribute(ki)||"0",10);return isFinite(e)?e:0},_z=function(){m.useEffect(function(){return document.body.setAttribute(ki,(Hv()+1).toString()),function(){var e=Hv()-1;e<=0?document.body.removeAttribute(ki):document.body.setAttribute(ki,e.toString())}},[])},Dz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;_z();var i=m.useMemo(function(){return Cz(a)},[a]);return m.createElement(Ez,{styles:Mz(i,!t,a,n?"":"!important")})},Wm=!1;if(typeof window<"u")try{var Ac=Object.defineProperty({},"passive",{get:function(){return Wm=!0,!0}});window.addEventListener("test",Ac,Ac),window.removeEventListener("test",Ac,Ac)}catch{Wm=!1}var Ya=Wm?{passive:!1}:!1,Tz=function(e){return e.tagName==="TEXTAREA"},Uj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Tz(e)&&n[t]==="visible")},Pz=function(e){return Uj(e,"overflowY")},Az=function(e){return Uj(e,"overflowX")},Vv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=Bj(e,r);if(a){var i=Wj(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Oz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Bj=function(e,t){return e==="v"?Pz(t):Az(t)},Wj=function(e,t){return e==="v"?Oz(t):zz(t)},$z=function(e,t){return e==="h"&&t==="rtl"?-1:1},Rz=function(e,t,n,r,a){var i=$z(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=Wj(e,l),w=p[0],v=p[1],b=p[2],g=v-b-i*w;(w||g)&&Bj(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},Oc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yv=function(e){return[e.deltaX,e.deltaY]},Xv=function(e){return e&&"current"in e?e.current:e},Iz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Lz=function(e){return`
397
- .block-interactivity-`.concat(e,` {pointer-events: none;}
398
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
399
- `)},Fz=0,Xa=[];function Uz(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),a=m.useState(Fz++)[0],i=m.useState(Fj)[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=lz([e.lockRef.current],(e.shards||[]).map(Xv),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var g=Oc(v),y=n.current,x="deltaX"in v?v.deltaX:y[0]-g[0],N="deltaY"in v?v.deltaY:y[1]-g[1],j,k=v.target,S=Math.abs(x)>Math.abs(N)?"h":"v";if("touches"in v&&S==="h"&&k.type==="range")return!1;var M=Vv(S,k);if(!M)return!0;if(M?j=S:(j=S==="v"?"h":"v",M=Vv(S,k)),!M)return!1;if(!r.current&&"changedTouches"in v&&(x||N)&&(r.current=j),!j)return!0;var A=r.current||j;return Rz(A,b,v,A==="h"?x:N)},[]),c=m.useCallback(function(v){var b=v;if(!(!Xa.length||Xa[Xa.length-1]!==i)){var g="deltaY"in b?Yv(b):Oc(b),y=t.current.filter(function(j){return j.name===b.type&&(j.target===b.target||b.target===j.shadowParent)&&Iz(j.delta,g)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var x=(o.current.shards||[]).map(Xv).filter(Boolean).filter(function(j){return j.contains(b.target)}),N=x.length>0?l(b,x[0]):!o.current.noIsolation;N&&b.cancelable&&b.preventDefault()}}},[]),d=m.useCallback(function(v,b,g,y){var x={name:v,delta:b,target:g,should:y,shadowParent:Bz(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(N){return N!==x})},1)},[]),h=m.useCallback(function(v){n.current=Oc(v),r.current=void 0},[]),u=m.useCallback(function(v){d(v.type,Yv(v),v.target,l(v,e.lockRef.current))},[]),f=m.useCallback(function(v){d(v.type,Oc(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Xa.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Ya),document.addEventListener("touchmove",c,Ya),document.addEventListener("touchstart",h,Ya),function(){Xa=Xa.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ya),document.removeEventListener("touchmove",c,Ya),document.removeEventListener("touchstart",h,Ya)}},[]);var p=e.removeScrollBar,w=e.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:Lz(a)}):null,p?m.createElement(Dz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Bz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Wz=gz(Lj,Uz);var Tx=m.forwardRef(function(e,t){return m.createElement(Ku,wr({},e,{ref:t,sideCar:Wz}))});Tx.classNames=Ku.classNames;var Hz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qa=new WeakMap,zc=new WeakMap,$c={},df=0,Hj=function(e){return e&&(e.host||Hj(e.parentNode))},Vz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Hj(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})},Yz=function(e,t,n,r){var a=Vz(t,Array.isArray(e)?e:[e]);$c[n]||($c[n]=new WeakMap);var i=$c[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=(qa.get(f)||0)+1,b=(i.get(f)||0)+1;qa.set(f,v),i.set(f,b),o.push(f),v===1&&w&&zc.set(f,!0),b===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(),df++,function(){o.forEach(function(u){var f=qa.get(u)-1,p=i.get(u)-1;qa.set(u,f),i.set(u,p),f||(zc.has(u)||u.removeAttribute(r),zc.delete(u)),p||u.removeAttribute(n)}),df--,df||(qa=new WeakMap,qa=new WeakMap,zc=new WeakMap,$c={})}},Vj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Hz(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Yz(r,a,n,"aria-hidden")):function(){return null}},Qu="Dialog",[Yj]=Iu(Qu),[Xz,or]=Yj(Qu),Xj=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]=Mx({prop:r,defaultProp:a??!1,onChange:i,caller:Qu});return s.jsx(Xz,{scope:t,triggerRef:l,contentRef:c,contentId:nr(),titleId:nr(),descriptionId:nr(),open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(u=>!u),[h]),modal:o,children:n})};Xj.displayName=Qu;var qj="DialogTrigger",qz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(qj,n),i=Cn(t,a.triggerRef);return s.jsx(ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ox(a.open),...r,ref:i,onClick:_t(e.onClick,a.onOpenToggle)})});qz.displayName=qj;var Px="DialogPortal",[Gz,Gj]=Yj(Px,{forceMount:void 0}),Kj=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=or(Px,t);return s.jsx(Gz,{scope:t,forceMount:n,children:m.Children.map(r,o=>s.jsx(Ia,{present:n||i.open,children:s.jsx(Ex,{asChild:!0,container:a,children:o})}))})};Kj.displayName=Px;var eu="DialogOverlay",Qj=m.forwardRef((e,t)=>{const n=Gj(eu,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=or(eu,e.__scopeDialog);return i.modal?s.jsx(Ia,{present:r||i.open,children:s.jsx(Qz,{...a,ref:t})}):null});Qj.displayName=eu;var Kz=Lu("DialogOverlay.RemoveScroll"),Qz=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(eu,n);return s.jsx(Tx,{as:Kz,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(ut.div,{"data-state":Ox(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ta="DialogContent",Zj=m.forwardRef((e,t)=>{const n=Gj(Ta,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=or(Ta,e.__scopeDialog);return s.jsx(Ia,{present:r||i.open,children:i.modal?s.jsx(Zz,{...a,ref:t}):s.jsx(Jz,{...a,ref:t})})});Zj.displayName=Ta;var Zz=m.forwardRef((e,t)=>{const n=or(Ta,e.__scopeDialog),r=m.useRef(null),a=Cn(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Vj(i)},[]),s.jsx(Jj,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:_t(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:_t(e.onFocusOutside,i=>i.preventDefault())})}),Jz=m.forwardRef((e,t)=>{const n=or(Ta,e.__scopeDialog),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(Jj,{...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()}})}),Jj=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=or(Ta,n),c=m.useRef(null),d=Cn(t,c);return $j(),s.jsxs(s.Fragment,{children:[s.jsx(Dx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Fu,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ox(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(r$,{titleId:l.titleId}),s.jsx(a$,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Ax="DialogTitle",e$=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(Ax,n);return s.jsx(ut.h2,{id:a.titleId,...r,ref:t})});e$.displayName=Ax;var e2="DialogDescription",t$=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(e2,n);return s.jsx(ut.p,{id:a.descriptionId,...r,ref:t})});t$.displayName=e2;var t2="DialogClose",n$=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=or(t2,n);return s.jsx(ut.button,{type:"button",...r,ref:t,onClick:_t(e.onClick,()=>a.onOpenChange(!1))})});n$.displayName=t2;function Ox(e){return e?"open":"closed"}var n2="DialogTitleWarning",[$F,r2]=SA(n2,{contentName:Ta,titleName:Ax,docsSlug:"dialog"}),r$=({titleId:e})=>{const t=r2(n2),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
400
-
401
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
402
-
403
- 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},s$="DialogDescriptionWarning",a$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r2(s$).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},i$=Xj,o$=Kj,l$=Qj,c$=Zj,yo='[cmdk-group=""]',uf='[cmdk-group-items=""]',d$='[cmdk-group-heading=""]',s2='[cmdk-item=""]',qv=`${s2}:not([aria-disabled="true"])`,Hm="cmdk-item-select",Qa="data-value",u$=(e,t,n)=>ez(e,t,n),a2=m.createContext(void 0),Ul=()=>m.useContext(a2),i2=m.createContext(void 0),zx=()=>m.useContext(i2),o2=m.createContext(void 0),l2=m.forwardRef((e,t)=>{let n=Za(()=>{var P,B;return{search:"",value:(B=(P=e.value)!=null?P:e.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Za(()=>new Set),a=Za(()=>new Map),i=Za(()=>new Map),o=Za(()=>new Set),l=c2(e),{label:c,children:d,value:h,onValueChange:u,filter:f,shouldFilter:p,loop:w,disablePointerSelection:v=!1,vimBindings:b=!0,...g}=e,y=nr(),x=nr(),N=nr(),j=m.useRef(null),k=N$();Pa(()=>{if(h!==void 0){let P=h.trim();n.current.value=P,S.emit()}},[h]),Pa(()=>{k(6,L)},[]);let S=m.useMemo(()=>({subscribe:P=>(o.current.add(P),()=>o.current.delete(P)),snapshot:()=>n.current,setState:(P,B,q)=>{var G,se,re,Z;if(!Object.is(n.current[P],B)){if(n.current[P]=B,P==="search")$(),I(),k(1,U);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let R=document.getElementById(N);R?R.focus():(G=document.getElementById(y))==null||G.focus()}if(k(7,()=>{var R;n.current.selectedItemId=(R=E())==null?void 0:R.id,S.emit()}),q||k(5,L),((se=l.current)==null?void 0:se.value)!==void 0){let R=B??"";(Z=(re=l.current).onValueChange)==null||Z.call(re,R);return}}S.emit()}},emit:()=>{o.current.forEach(P=>P())}}),[]),M=m.useMemo(()=>({value:(P,B,q)=>{var G;B!==((G=i.current.get(P))==null?void 0:G.value)&&(i.current.set(P,{value:B,keywords:q}),n.current.filtered.items.set(P,A(B,q)),k(2,()=>{I(),S.emit()}))},item:(P,B)=>(r.current.add(P),B&&(a.current.has(B)?a.current.get(B).add(P):a.current.set(B,new Set([P]))),k(3,()=>{$(),I(),n.current.value||U(),S.emit()}),()=>{i.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let q=E();k(4,()=>{$(),(q==null?void 0:q.getAttribute("id"))===P&&U(),S.emit()})}),group:P=>(a.current.has(P)||a.current.set(P,new Set),()=>{i.current.delete(P),a.current.delete(P)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:N,labelId:x,listInnerRef:j}),[]);function A(P,B){var q,G;let se=(G=(q=l.current)==null?void 0:q.filter)!=null?G:u$;return P?se(P,n.current.search,B):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let P=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(G=>{let se=a.current.get(G),re=0;se.forEach(Z=>{let R=P.get(Z);re=Math.max(R,re)}),B.push([G,re])});let q=j.current;O().sort((G,se)=>{var re,Z;let R=G.getAttribute("id"),ee=se.getAttribute("id");return((re=P.get(ee))!=null?re:0)-((Z=P.get(R))!=null?Z:0)}).forEach(G=>{let se=G.closest(uf);se?se.appendChild(G.parentElement===se?G:G.closest(`${uf} > *`)):q.appendChild(G.parentElement===q?G:G.closest(`${uf} > *`))}),B.sort((G,se)=>se[1]-G[1]).forEach(G=>{var se;let re=(se=j.current)==null?void 0:se.querySelector(`${yo}[${Qa}="${encodeURIComponent(G[0])}"]`);re==null||re.parentElement.appendChild(re)})}function U(){let P=O().find(q=>q.getAttribute("aria-disabled")!=="true"),B=P==null?void 0:P.getAttribute(Qa);S.setState("value",B||void 0)}function $(){var P,B,q,G;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let re of r.current){let Z=(B=(P=i.current.get(re))==null?void 0:P.value)!=null?B:"",R=(G=(q=i.current.get(re))==null?void 0:q.keywords)!=null?G:[],ee=A(Z,R);n.current.filtered.items.set(re,ee),ee>0&&se++}for(let[re,Z]of a.current)for(let R of Z)if(n.current.filtered.items.get(R)>0){n.current.filtered.groups.add(re);break}n.current.filtered.count=se}function L(){var P,B,q;let G=E();G&&(((P=G.parentElement)==null?void 0:P.firstChild)===G&&((q=(B=G.closest(yo))==null?void 0:B.querySelector(d$))==null||q.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function E(){var P;return(P=j.current)==null?void 0:P.querySelector(`${s2}[aria-selected="true"]`)}function O(){var P;return Array.from(((P=j.current)==null?void 0:P.querySelectorAll(qv))||[])}function D(P){let B=O()[P];B&&S.setState("value",B.getAttribute(Qa))}function T(P){var B;let q=E(),G=O(),se=G.findIndex(Z=>Z===q),re=G[se+P];(B=l.current)!=null&&B.loop&&(re=se+P<0?G[G.length-1]:se+P===G.length?G[0]:G[se+P]),re&&S.setState("value",re.getAttribute(Qa))}function C(P){let B=E(),q=B==null?void 0:B.closest(yo),G;for(;q&&!G;)q=P>0?y$(q,yo):b$(q,yo),G=q==null?void 0:q.querySelector(qv);G?S.setState("value",G.getAttribute(Qa)):T(P)}let _=()=>D(O().length-1),z=P=>{P.preventDefault(),P.metaKey?_():P.altKey?C(1):T(1)},H=P=>{P.preventDefault(),P.metaKey?D(0):P.altKey?C(-1):T(-1)};return m.createElement(ut.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:P=>{var B;(B=g.onKeyDown)==null||B.call(g,P);let q=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||q))switch(P.key){case"n":case"j":{b&&P.ctrlKey&&z(P);break}case"ArrowDown":{z(P);break}case"p":case"k":{b&&P.ctrlKey&&H(P);break}case"ArrowUp":{H(P);break}case"Home":{P.preventDefault(),D(0);break}case"End":{P.preventDefault(),_();break}case"Enter":{P.preventDefault();let G=E();if(G){let se=new Event(Hm);G.dispatchEvent(se)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:k$},c),Zu(e,P=>m.createElement(i2.Provider,{value:S},m.createElement(a2.Provider,{value:M},P))))}),h$=m.forwardRef((e,t)=>{var n,r;let a=nr(),i=m.useRef(null),o=m.useContext(o2),l=Ul(),c=c2(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Pa(()=>{if(!d)return l.item(a,o==null?void 0:o.id)},[d]);let h=d2(a,i,[e.value,e.children,i],e.keywords),u=zx(),f=Bs(k=>k.value&&k.value===h.current),p=Bs(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(Hm,w),()=>k.removeEventListener(Hm,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:b,value:g,onSelect:y,forceMount:x,keywords:N,...j}=e;return m.createElement(ut.div,{ref:_a(i,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!f,"data-disabled":!!b,"data-selected":!!f,onPointerMove:b||l.getDisablePointerSelection()?void 0:v,onClick:b?void 0:w},e.children)}),f$=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=nr(),l=m.useRef(null),c=m.useRef(null),d=nr(),h=Ul(),u=Bs(p=>a||h.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Pa(()=>h.group(o),[]),d2(o,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:a}),[a]);return m.createElement(ut.div,{ref:_a(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),Zu(e,p=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},m.createElement(o2.Provider,{value:f},p))))}),m$=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=m.useRef(null),i=Bs(o=>!o.search);return!n&&!i?null:m.createElement(ut.div,{ref:_a(a,t),...r,"cmdk-separator":"",role:"separator"})}),p$=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=zx(),o=Bs(d=>d.search),l=Bs(d=>d.selectedItemId),c=Ul();return m.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),m.createElement(ut.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)}})}),x$=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=m.useRef(null),o=m.useRef(null),l=Bs(d=>d.selectedItemId),c=Ul();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(ut.div,{ref:_a(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},Zu(e,d=>m.createElement("div",{ref:_a(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),g$=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...l}=e;return m.createElement(i$,{open:n,onOpenChange:r},m.createElement(o$,{container:o},m.createElement(l$,{"cmdk-overlay":"",className:a}),m.createElement(c$,{"aria-label":e.label,"cmdk-dialog":"",className:i},m.createElement(l2,{ref:t,...l}))))}),v$=m.forwardRef((e,t)=>Bs(n=>n.filtered.count===0)?m.createElement(ut.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),w$=m.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return m.createElement(ut.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Zu(e,o=>m.createElement("div",{"aria-hidden":!0},o)))}),bo=Object.assign(l2,{List:x$,Item:h$,Input:p$,Group:f$,Separator:m$,Dialog:g$,Empty:v$,Loading:w$});function y$(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function b$(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function c2(e){let t=m.useRef(e);return Pa(()=>{t.current=e}),t}var Pa=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Za(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Bs(e){let t=zx(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function d2(e,t,n,r=[]){let a=m.useRef(),i=Ul();return Pa(()=>{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(Qa,l),a.current=l}),a}var N$=()=>{let[e,t]=m.useState(),n=Za(()=>new Map);return Pa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function j$(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Zu({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(j$(t),{ref:t.ref},n(t.props.children)):n(t)}var k$={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function S$({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{}})()},[]);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:Ma,action:()=>n("/users"),category:"Navigation",keywords:["user","account","profile"]},{id:"organizations",title:"Organizations",description:"Manage organizations and teams",icon:xr,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:fv,action:()=>n("/sessions"),category:"Navigation",keywords:["session","login","active"]},{id:"tools",title:"Tools",description:"View tools and utilities",icon:xx,action:()=>n("/tools"),category:"Navigation",keywords:["utilities","tools"]},{id:"database",title:"Database",description:"View database and schema",icon:lt,disabled:!0,action:()=>n("/database"),category:"Navigation",keywords:["database","schema"]},{id:"settings",title:"Settings",description:"Configure Better Auth Studio",icon:bi,action:()=>n("/settings"),category:"Navigation",keywords:["config","setup","preferences"]},{id:"dashboard",title:"Dashboard",description:"View overview and statistics",icon:fv,action:()=>n("/"),category:"Navigation",keywords:["overview","stats","home"]},{id:"create-user",title:"Create User",description:"Add a new user to the system",icon:Am,action:()=>n("/users"),category:"Actions",keywords:["add","new","register"]},{id:"create-organization",title:"Create Organization",description:"Create a new organization",icon:zs,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:qd,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(bo,{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(Ea,{className:"w-4 h-4 text-gray-400 mr-3"}),s.jsx(bo.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(bo.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(Ea,{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(bo.Group,{heading:u,className:"text-xs text-gray-400 font-medium mb-4 px-2",children:f.map(p=>{const w=p.icon,v=p.disabled;return s.jsxs(bo.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(sd,{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(AP,{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 Gv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Kv=Gd,u2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Kv(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=Gv(h)||Gv(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,b]=w;return Array.isArray(b)?b.includes({...i,...l}[v]):{...i,...l}[v]===b})?[...d,u,f]:d},[]);return Kv(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Vm=u2("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"}}),Y=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?EA:"button";return s.jsx(o,{className:De(Vm({variant:t,size:n,className:e})),ref:i,...a})});Y.displayName="Button";function C$({children:e}){const t=Gi(),{counts:n,loading:r}=Gu(),[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:BP},{name:"Users",href:"/users",icon:Ma,badge:r?"...":c(n.users)},{name:"Organizations",href:"/organizations",icon:xr,badge:r?"...":c(n.organizations)},{name:"Database",href:"/database",icon:lt},{name:"Tools",href:"/tools",icon:xx},{name:"Settings",href:"/settings",icon:bi}];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(Ea,{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(Y,{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(Y,{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(Gp,{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(S$,{isOpen:a,onClose:()=>i(!1)})]})}function tu(e){"@babel/helpers - typeof";return tu=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},tu(e)}function Aa(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 en(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Ar(e){en(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||tu(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 E$(e,t){en(2,arguments);var n=Ar(e).getTime(),r=Aa(t);return new Date(n+r)}var M$={};function Ju(){return M$}function _$(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 D$(e){return en(1,arguments),e instanceof Date||tu(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function T$(e){if(en(1,arguments),!D$(e)&&typeof e!="number")return!1;var t=Ar(e);return!isNaN(Number(t))}function P$(e,t){en(2,arguments);var n=Aa(t);return E$(e,-n)}var A$=864e5;function O$(e){en(1,arguments);var t=Ar(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/A$)+1}function nu(e){en(1,arguments);var t=1,n=Ar(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 h2(e){en(1,arguments);var t=Ar(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var a=nu(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var o=nu(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function z$(e){en(1,arguments);var t=h2(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=nu(n);return r}var $$=6048e5;function R$(e){en(1,arguments);var t=Ar(e),n=nu(t).getTime()-z$(t).getTime();return Math.round(n/$$)+1}function ru(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Ju(),u=Aa((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=Ar(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 f2(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Ar(e),u=h.getUTCFullYear(),f=Ju(),p=Aa((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=ru(w,t),b=new Date(0);b.setUTCFullYear(u,0,p),b.setUTCHours(0,0,0,0);var g=ru(b,t);return h.getTime()>=v.getTime()?u+1:h.getTime()>=g.getTime()?u:u-1}function I$(e,t){var n,r,a,i,o,l,c,d;en(1,arguments);var h=Ju(),u=Aa((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=f2(e,t),p=new Date(0);p.setUTCFullYear(f,0,u),p.setUTCHours(0,0,0,0);var w=ru(p,t);return w}var L$=6048e5;function F$(e,t){en(1,arguments);var n=Ar(e),r=ru(n,t).getTime()-I$(n,t).getTime();return Math.round(r/L$)+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 fs={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)}},Ga={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},U$={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 fs.y(t,n)},Y:function(t,n,r,a){var i=f2(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=h2(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 fs.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=F$(t,a);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):Ye(i,n.length)},I:function(t,n,r){var a=R$(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"}):fs.d(t,n)},D:function(t,n,r){var a=O$(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=Ga.noon:a===0?i=Ga.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=Ga.evening:a>=12?i=Ga.afternoon:a>=4?i=Ga.morning:i=Ga.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 fs.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):fs.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"}):fs.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):fs.s(t,n)},S:function(t,n){return fs.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 Zv(o);case"XXXX":case"XX":return ta(o);case"XXXXX":case"XXX":default:return ta(o,":")}},x:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Zv(o);case"xxxx":case"xx":return ta(o);case"xxxxx":case"xxx":default:return ta(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"+Qv(o,":");case"OOOO":default:return"GMT"+ta(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"+Qv(o,":");case"zzzz":default:return"GMT"+ta(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 Qv(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 Zv(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Ye(Math.abs(e)/60,2)}return ta(e,t)}function ta(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 Jv=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"})}},m2=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"})}},B$=function(t,n){var r=t.match(/(P+)(p+)?/)||[],a=r[1],i=r[2];if(!i)return Jv(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}}",Jv(a,n)).replace("{{time}}",m2(i,n))},W$={p:m2,P:B$},H$=["D","DD"],V$=["YY","YYYY"];function Y$(e){return H$.indexOf(e)!==-1}function X$(e){return V$.indexOf(e)!==-1}function ew(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 q$={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"}},G$=function(t,n,r){var a,i=q$[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 hf(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 K$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Q$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Z$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},J$={date:hf({formats:K$,defaultWidth:"full"}),time:hf({formats:Q$,defaultWidth:"full"}),dateTime:hf({formats:Z$,defaultWidth:"full"})},eR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},tR=function(t,n,r,a){return eR[t]};function No(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 nR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},sR={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"]},aR={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"]},iR={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"}},oR={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"}},lR=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"},cR={ordinalNumber:lR,era:No({values:nR,defaultWidth:"wide"}),quarter:No({values:rR,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:No({values:sR,defaultWidth:"wide"}),day:No({values:aR,defaultWidth:"wide"}),dayPeriod:No({values:iR,defaultWidth:"wide",formattingValues:oR,defaultFormattingWidth:"wide"})};function jo(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)?uR(l,function(u){return u.test(o)}):dR(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 dR(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function uR(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function hR(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 fR=/^(\d+)(th|st|nd|rd)?/i,mR=/\d+/i,pR={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},xR={any:[/^b/i,/^(a|c)/i]},gR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vR={any:[/1/i,/2/i,/3/i,/4/i]},wR={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},yR={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]},bR={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},NR={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]},jR={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},kR={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}},SR={ordinalNumber:hR({matchPattern:fR,parsePattern:mR,valueCallback:function(t){return parseInt(t,10)}}),era:jo({matchPatterns:pR,defaultMatchWidth:"wide",parsePatterns:xR,defaultParseWidth:"any"}),quarter:jo({matchPatterns:gR,defaultMatchWidth:"wide",parsePatterns:vR,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:jo({matchPatterns:wR,defaultMatchWidth:"wide",parsePatterns:yR,defaultParseWidth:"any"}),day:jo({matchPatterns:bR,defaultMatchWidth:"wide",parsePatterns:NR,defaultParseWidth:"any"}),dayPeriod:jo({matchPatterns:jR,defaultMatchWidth:"any",parsePatterns:kR,defaultParseWidth:"any"})},CR={code:"en-US",formatDistance:G$,formatLong:J$,formatRelative:tR,localize:cR,match:SR,options:{weekStartsOn:0,firstWeekContainsDate:1}},ER=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,MR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_R=/^'([^]*?)'?$/,DR=/''/g,TR=/[a-zA-Z]/;function An(e,t,n){var r,a,i,o,l,c,d,h,u,f,p,w,v,b;en(2,arguments);var g=String(t),y=Ju(),x=(r=(a=void 0)!==null&&a!==void 0?a:y.locale)!==null&&r!==void 0?r:CR,N=Aa((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(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Aa((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||(b=v.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&u!==void 0?u:0);if(!(j>=0&&j<=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=Ar(e);if(!T$(k))throw new RangeError("Invalid time value");var S=_$(k),M=P$(k,S),A={firstWeekContainsDate:N,weekStartsOn:j,locale:x,_originalDate:k},I=g.match(MR).map(function(U){var $=U[0];if($==="p"||$==="P"){var L=W$[$];return L(U,x.formatLong)}return U}).join("").match(ER).map(function(U){if(U==="''")return"'";var $=U[0];if($==="'")return PR(U);var L=U$[$];if(L)return X$(U)&&ew(U,t,String(e)),Y$(U)&&ew(U,t,String(e)),L(M,U,x.localize,A);if($.match(TR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return U}).join("");return I}function PR(e){var t=e.match(_R);return t?t[1].replace(DR,"'"):e}function AR(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 ff={},Oo={};function la(e,t){try{const r=(ff[e]||(ff[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in Oo?Oo[r]:tw(r,r.split(":"))}catch{if(e in Oo)return Oo[e];const n=e==null?void 0:e.match(OR);return n?tw(e,n.slice(1)):NaN}}const OR=/([+-]\d\d):?(\d\d)?/;function tw(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return Oo[e]=n*60+r>0?n*60+r+a:n*60-r-a}class br extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(la(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)),p2(this),Ym(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new br(...n,t):new br(Date.now(),t)}withTimeZone(t){return new br(+this,t)}getTimezoneOffset(){const t=-la(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ym(this),+this}[Symbol.for("constructDateFrom")](t){return new br(+new Date(t),this.timeZone)}}const nw=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!nw.test(e))return;const t=e.replace(nw,"$1UTC");br.prototype[t]&&(e.startsWith("get")?br.prototype[e]=function(){return this.internal[t]()}:(br.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),zR(this),+this},br.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ym(this),+this}))});function Ym(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-la(e.timeZone,e)*60))}function zR(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()),p2(e)}function p2(e){const t=la(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(-(la(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=la(e.timeZone,e),p=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-p,b=p!==n,g=v-c;if(b&&g){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+g);const y=la(e.timeZone,e),x=y>0?Math.floor(y):Math.ceil(y),N=p-x;N&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N))}}class Vt extends br{static tz(t,...n){return n.length?new Vt(...n,t):new Vt(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} (${AR(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 Vt(+this,t)}[Symbol.for("constructDateFrom")](t){return new Vt(+new Date(t),this.timeZone)}}const x2=6048e5,$R=864e5,rw=Symbol.for("constructDateFrom");function St(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&rw in e?e[rw](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ke(e,t){return St(t||e,e)}function g2(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(t)?St(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function v2(e,t,n){const r=Ke(e,n==null?void 0:n.in);if(isNaN(t))return St(e,NaN);if(!t)return r;const a=r.getDate(),i=St(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 RR={};function Bl(){return RR}function Wi(e,t){var l,c,d,h;const n=Bl(),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 Sl(e,t){return Wi(e,{...t,weekStartsOn:1})}function w2(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=St(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=Sl(a),o=St(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const l=Sl(o);return n.getTime()>=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function sw(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 Ji(e,...t){const n=St.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Cl(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function y2(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t),i=Cl(r),o=Cl(a),l=+i-sw(i),c=+o-sw(o);return Math.round((l-c)/$R)}function IR(e,t){const n=w2(e,t),r=St(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Sl(r)}function LR(e,t,n){return g2(e,t*7,n)}function FR(e,t,n){return v2(e,t*12,n)}function UR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=St.bind(null,a));const i=Ke(a,r);(!n||n<i||isNaN(+i))&&(n=i)}),St(r,n||NaN)}function BR(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=St.bind(null,a));const i=Ke(a,r);(!n||n>i||isNaN(+i))&&(n=i)}),St(r,n||NaN)}function WR(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return+Cl(r)==+Cl(a)}function b2(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function HR(e){return!(!b2(e)&&typeof e!="number"||isNaN(+Ke(e)))}function VR(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t),i=r.getFullYear()-a.getFullYear(),o=r.getMonth()-a.getMonth();return i*12+o}function YR(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 N2(e,t){const[n,r]=Ji(e,t.start,t.end);return{start:n,end:r}}function XR(e,t){const{start:n,end:r}=N2(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(St(n,o)),o.setMonth(o.getMonth()+l);return a?c.reverse():c}function qR(e,t){const n=Ke(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function GR(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 j2(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 KR(e,t){const{start:n,end:r}=N2(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(St(n,o)),o.setFullYear(o.getFullYear()+l);return a?c.reverse():c}function k2(e,t){var l,c,d,h;const n=Bl(),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 QR(e,t){return k2(e,{...t,weekStartsOn:1})}const ZR={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"}},JR=(e,t,n)=>{let r;const a=ZR[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 mf(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const eI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},tI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rI={date:mf({formats:eI,defaultWidth:"full"}),time:mf({formats:tI,defaultWidth:"full"}),dateTime:mf({formats:nI,defaultWidth:"full"})},sI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},aI=(e,t,n,r)=>sI[e];function ko(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 iI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},oI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lI={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"]},cI={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"]},dI={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"}},uI={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"}},hI=(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"},fI={ordinalNumber:hI,era:ko({values:iI,defaultWidth:"wide"}),quarter:ko({values:oI,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ko({values:lI,defaultWidth:"wide"}),day:ko({values:cI,defaultWidth:"wide"}),dayPeriod:ko({values:dI,defaultWidth:"wide",formattingValues:uI,defaultFormattingWidth:"wide"})};function So(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)?pI(l,u=>u.test(o)):mI(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 mI(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function pI(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function xI(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 gI=/^(\d+)(th|st|nd|rd)?/i,vI=/\d+/i,wI={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},yI={any:[/^b/i,/^(a|c)/i]},bI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},NI={any:[/1/i,/2/i,/3/i,/4/i]},jI={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},kI={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]},SI={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},CI={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]},EI={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},MI={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}},_I={ordinalNumber:xI({matchPattern:gI,parsePattern:vI,valueCallback:e=>parseInt(e,10)}),era:So({matchPatterns:wI,defaultMatchWidth:"wide",parsePatterns:yI,defaultParseWidth:"any"}),quarter:So({matchPatterns:bI,defaultMatchWidth:"wide",parsePatterns:NI,defaultParseWidth:"any",valueCallback:e=>e+1}),month:So({matchPatterns:jI,defaultMatchWidth:"wide",parsePatterns:kI,defaultParseWidth:"any"}),day:So({matchPatterns:SI,defaultMatchWidth:"wide",parsePatterns:CI,defaultParseWidth:"any"}),dayPeriod:So({matchPatterns:EI,defaultMatchWidth:"any",parsePatterns:MI,defaultParseWidth:"any"})},$x={code:"en-US",formatDistance:JR,formatLong:rI,formatRelative:aI,localize:fI,match:_I,options:{weekStartsOn:0,firstWeekContainsDate:1}};function DI(e,t){const n=Ke(e,t==null?void 0:t.in);return y2(n,j2(n))+1}function S2(e,t){const n=Ke(e,t==null?void 0:t.in),r=+Sl(n)-+IR(n);return Math.round(r/x2)+1}function C2(e,t){var h,u,f,p;const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=Bl(),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=St((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=Wi(o,t),c=St((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Wi(c,t);return+n>=+l?r+1:+n>=+d?r:r-1}function TI(e,t){var l,c,d,h;const n=Bl(),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=C2(e,t),i=St((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),Wi(i,t)}function E2(e,t){const n=Ke(e,t==null?void 0:t.in),r=+Wi(n,t)-+TI(n,t);return Math.round(r/x2)+1}function Xe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ms={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)}},Ka={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},aw={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 ms.y(e,t)},Y:function(e,t,n,r){const a=C2(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=w2(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 ms.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=E2(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Xe(a,t.length)},I:function(e,t,n){const r=S2(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"}):ms.d(e,t)},D:function(e,t,n){const r=DI(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=Ka.noon:r===0?a=Ka.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=Ka.evening:r>=12?a=Ka.afternoon:r>=4?a=Ka.morning:a=Ka.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 ms.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ms.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"}):ms.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ms.s(e,t)},S:function(e,t){return ms.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ow(r);case"XXXX":case"XX":return na(r);case"XXXXX":case"XXX":default:return na(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ow(r);case"xxxx":case"xx":return na(r);case"xxxxx":case"xxx":default:return na(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+iw(r,":");case"OOOO":default:return"GMT"+na(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+iw(r,":");case"zzzz":default:return"GMT"+na(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 iw(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 ow(e,t){return e%60===0?(e>0?"-":"+")+Xe(Math.abs(e)/60,2):na(e,t)}function na(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 lw=(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"})}},M2=(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"})}},PI=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return lw(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}}",lw(r,t)).replace("{{time}}",M2(a,t))},AI={p:M2,P:PI},OI=/^D+$/,zI=/^Y+$/,$I=["D","DD","YY","YYYY"];function RI(e){return OI.test(e)}function II(e){return zI.test(e)}function LI(e,t,n){const r=FI(e,t,n);if(console.warn(r),$I.includes(e))throw new RangeError(r)}function FI(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 UI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,BI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,WI=/^'([^]*?)'?$/,HI=/''/g,VI=/[a-zA-Z]/;function YI(e,t,n){var h,u,f,p,w,v,b,g;const r=Bl(),a=(n==null?void 0:n.locale)??r.locale??$x,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=(b=r.locale)==null?void 0:b.options)==null?void 0:g.weekStartsOn)??0,l=Ke(e,n==null?void 0:n.in);if(!HR(l))throw new RangeError("Invalid time value");let c=t.match(BI).map(y=>{const x=y[0];if(x==="p"||x==="P"){const N=AI[x];return N(y,a.formatLong)}return y}).join("").match(UI).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const x=y[0];if(x==="'")return{isToken:!1,value:XI(y)};if(aw[x])return{isToken:!0,value:y};if(x.match(VI))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)&&II(x)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&RI(x))&&LI(x,t,String(e));const N=aw[x[0]];return N(l,x,a.localize,d)}).join("")}function XI(e){const t=e.match(WI);return t?t[1].replace(HI,"'"):e}function qI(e,t){const n=Ke(e,t==null?void 0:t.in),r=n.getFullYear(),a=n.getMonth(),i=St(n,0);return i.setFullYear(r,a+1,0),i.setHours(0,0,0,0),i.getDate()}function GI(e,t){return Ke(e,t==null?void 0:t.in).getMonth()}function KI(e,t){return Ke(e,t==null?void 0:t.in).getFullYear()}function QI(e,t){return+Ke(e)>+Ke(t)}function ZI(e,t){return+Ke(e)<+Ke(t)}function JI(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function e8(e,t,n){const[r,a]=Ji(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()}function t8(e,t,n){const r=Ke(e,n==null?void 0:n.in),a=r.getFullYear(),i=r.getDate(),o=St(e,0);o.setFullYear(a,t,15),o.setHours(0,0,0,0);const l=qI(o);return r.setMonth(t,Math.min(i,l)),r}function n8(e,t,n){const r=Ke(e,n==null?void 0:n.in);return isNaN(+r)?St(e,NaN):(r.setFullYear(t),r)}const cw=5,r8=4;function s8(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),i=t.addDays(a,cw*7-1);return t.getMonth(e)===t.getMonth(i)?cw:r8}function _2(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 a8(e,t){const n=_2(e,t),r=s8(e,t);return t.addDays(n,r*7-1)}class jn{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Vt.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 Vt(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):g2(r,a)},this.addMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,a):v2(r,a)},this.addWeeks=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,a):LR(r,a)},this.addYears=(r,a)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,a):FR(r,a)},this.differenceInCalendarDays=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):y2(r,a)},this.differenceInCalendarMonths=(r,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):VR(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):XR(r)},this.eachYearOfInterval=r=>{var l;const a=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(r):KR(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):a8(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):QR(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):YR(r)},this.endOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,a):k2(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):GR(r)},this.format=(r,a,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(r,a,this.options):YI(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):S2(r)},this.getMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):GI(r,this.options)},this.getYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):KI(r,this.options)},this.getWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):E2(r,this.options)},this.isAfter=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,a):QI(r,a)},this.isBefore=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,a):ZI(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):b2(r)},this.isSameDay=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,a):WR(r,a)},this.isSameMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,a):JI(r,a)},this.isSameYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,a):e8(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):UR(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):BR(r)},this.setMonth=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,a):t8(r,a)},this.setYear=(r,a)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,a):n8(r,a)},this.startOfBroadcastWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):_2(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):Cl(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):Sl(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):qR(r)},this.startOfWeek=(r,a)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):Wi(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):j2(r)},this.options={locale:$x,...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&&jn.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&&jn.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)}}jn.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 jn;class D2{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 i8{constructor(t,n){this.date=t,this.weeks=n}}class o8{constructor(t,n){this.days=n,this.weekNumber=t}}function l8(e){return Q.createElement("button",{...e})}function c8(e){return Q.createElement("span",{...e})}function d8(e){const{size:t=24,orientation:n="left",className:r}=e;return Q.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Q.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Q.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Q.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Q.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function u8(e){const{day:t,modifiers:n,...r}=e;return Q.createElement("td",{...r})}function h8(e){const{day:t,modifiers:n,...r}=e,a=Q.useRef(null);return Q.useEffect(()=>{var i;n.focused&&((i=a.current)==null||i.focus())},[n.focused]),Q.createElement("button",{ref:a,...r})}var ke;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(ke||(ke={}));var ft;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ft||(ft={}));var Jn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Jn||(Jn={}));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 f8(e){const{options:t,className:n,components:r,classNames:a,...i}=e,o=[a[ke.Dropdown],n].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return Q.createElement("span",{"data-disabled":i.disabled,className:a[ke.DropdownRoot]},Q.createElement(r.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:h})=>Q.createElement(r.Option,{key:c,value:c,disabled:h},d))),Q.createElement("span",{className:a[ke.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,Q.createElement(r.Chevron,{orientation:"down",size:18,className:a[ke.Chevron]})))}function m8(e){return Q.createElement("div",{...e})}function p8(e){return Q.createElement("div",{...e})}function x8(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement("div",{...r},e.children)}function g8(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement("div",{...r})}function v8(e){return Q.createElement("table",{...e})}function w8(e){return Q.createElement("div",{...e})}const T2=m.createContext(void 0);function Wl(){const e=m.useContext(T2);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function y8(e){const{components:t}=Wl();return Q.createElement(t.Dropdown,{...e})}function b8(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Wl(),h=m.useCallback(f=>{a&&(n==null||n(f))},[a,n]),u=m.useCallback(f=>{r&&(t==null||t(f))},[r,t]);return Q.createElement("nav",{...i},Q.createElement(o.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:u},Q.createElement(o.Chevron,{disabled:r?void 0:!0,className:l[ke.Chevron],orientation:"left"})),Q.createElement(o.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":d(a),onClick:h},Q.createElement(o.Chevron,{disabled:a?void 0:!0,orientation:"right",className:l[ke.Chevron]})))}function N8(e){const{components:t}=Wl();return Q.createElement(t.Button,{...e})}function j8(e){return Q.createElement("option",{...e})}function k8(e){const{components:t}=Wl();return Q.createElement(t.Button,{...e})}function S8(e){const{rootRef:t,...n}=e;return Q.createElement("div",{...n,ref:t})}function C8(e){return Q.createElement("select",{...e})}function E8(e){const{week:t,...n}=e;return Q.createElement("tr",{...n})}function M8(e){return Q.createElement("th",{...e})}function _8(e){return Q.createElement("thead",{"aria-hidden":!0},Q.createElement("tr",{...e}))}function D8(e){const{week:t,...n}=e;return Q.createElement("th",{...n})}function T8(e){return Q.createElement("th",{...e})}function P8(e){return Q.createElement("tbody",{...e})}function A8(e){const{components:t}=Wl();return Q.createElement(t.Dropdown,{...e})}const O8=Object.freeze(Object.defineProperty({__proto__:null,Button:l8,CaptionLabel:c8,Chevron:d8,Day:u8,DayButton:h8,Dropdown:f8,DropdownNav:m8,Footer:p8,Month:x8,MonthCaption:g8,MonthGrid:v8,Months:w8,MonthsDropdown:y8,Nav:b8,NextMonthButton:N8,Option:j8,PreviousMonthButton:k8,Root:S8,Select:C8,Week:E8,WeekNumber:D8,WeekNumberHeader:T8,Weekday:M8,Weekdays:_8,Weeks:P8,YearsDropdown:A8},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 P2(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Rx(e){return!!(e&&typeof e=="object"&&"from"in e)}function A2(e){return!!(e&&typeof e=="object"&&"after"in e)}function O2(e){return!!(e&&typeof e=="object"&&"before"in e)}function z2(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function $2(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($2(l,n))return l.includes(e);if(Rx(l))return Wr(l,e,!1,n);if(z2(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(P2(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 A2(l)?i(e,l.after)>0:O2(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function z8(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:b}=a,g=n&&p(n),y=r&&v(r),x={[ft.focused]:[],[ft.outside]:[],[ft.disabled]:[],[ft.hidden]:[],[ft.today]:[]},N={};for(const j of e){const{date:k,displayMonth:S}=j,M=!!(S&&!f(k,S)),A=!!(g&&w(k,g)),I=!!(y&&b(k,y)),U=!!(i&&Hr(k,i,a)),$=!!(o&&Hr(k,o,a))||A||I||!d&&!c&&M||d&&c===!1&&M,L=u(k,h??a.today());M&&x.outside.push(j),U&&x.disabled.push(j),$&&x.hidden.push(j),L&&x.today.push(j),l&&Object.keys(l).forEach(E=>{const O=l==null?void 0:l[E];O&&Hr(k,O,a)&&(N[E]?N[E].push(j):N[E]=[j])})}return j=>{const k={[ft.focused]:!1,[ft.disabled]:!1,[ft.hidden]:!1,[ft.outside]:!1,[ft.today]:!1},S={};for(const M in x){const A=x[M];k[M]=A.some(I=>I===j)}for(const M in N)S[M]=N[M].some(A=>A===j);return{...k,...S}}}function $8(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[i])=>(n[i]?a.push(n[i]):t[ft[i]]?a.push(t[ft[i]]):t[Jn[i]]&&a.push(t[Jn[i]]),a),[t[ke.Day]])}function R8(e){return{...O8,...e}}function I8(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 Ix(){const e={};for(const t in ke)e[ke[t]]=`rdp-${ke[t]}`;for(const t in ft)e[ft[t]]=`rdp-${ft[t]}`;for(const t in Jn)e[Jn[t]]=`rdp-${Jn[t]}`;for(const t in mn)e[mn[t]]=`rdp-${mn[t]}`;return e}function R2(e,t,n){return(n??new jn(t)).formatMonthYear(e)}const L8=R2;function F8(e,t,n){return(n??new jn(t)).format(e,"d")}function U8(e,t=Or){return t.format(e,"LLLL")}function B8(e,t,n){return(n??new jn(t)).format(e,"cccccc")}function W8(e,t=Or){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function H8(){return""}function I2(e,t=Or){return t.format(e,"yyyy")}const V8=I2,Y8=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:R2,formatDay:F8,formatMonthCaption:L8,formatMonthDropdown:U8,formatWeekNumber:W8,formatWeekNumberHeader:H8,formatWeekdayName:B8,formatYearCaption:V8,formatYearDropdown:I2},Symbol.toStringTag,{value:"Module"}));function X8(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...Y8,...e}}function q8(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 G8(e,t={},n={}){let r={...t==null?void 0:t[ke.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function K8(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 Q8(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 L2(e,t,n,r){let a=(r??new jn(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const Z8=L2;function F2(e,t,n){return(n??new jn(t)).formatMonthYear(e)}const J8=F2;function eL(e,t,n,r){let a=(r??new jn(n)).format(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a}function tL(e){return"Choose the Month"}function nL(){return""}function rL(e){return"Go to the Next Month"}function sL(e){return"Go to the Previous Month"}function aL(e,t,n){return(n??new jn(t)).format(e,"cccc")}function iL(e,t){return`Week ${e}`}function oL(e){return"Week Number"}function lL(e){return"Choose the Year"}const cL=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:J8,labelDay:Z8,labelDayButton:L2,labelGrid:F2,labelGridcell:eL,labelMonthDropdown:tL,labelNav:nL,labelNext:rL,labelPrevious:sL,labelWeekNumber:iL,labelWeekNumberHeader:oL,labelWeekday:aL,labelYearDropdown:lL},Symbol.toStringTag,{value:"Module"})),Hl=e=>e instanceof HTMLElement?e:null,pf=e=>[...e.querySelectorAll("[data-animated-month]")??[]],dL=e=>Hl(e.querySelector("[data-animated-month]")),xf=e=>Hl(e.querySelector("[data-animated-caption]")),gf=e=>Hl(e.querySelector("[data-animated-weeks]")),uL=e=>Hl(e.querySelector("[data-animated-nav]")),hL=e=>Hl(e.querySelector("[data-animated-weekdays]"));function fL(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?(pf(v).forEach(x=>{if(!(x instanceof HTMLElement))return;const N=dL(x);N&&x.contains(N)&&x.removeChild(N);const j=xf(x);j&&j.classList.remove(f);const k=gf(x);k&&k.classList.remove(p)}),o.current=v):o.current=null,c.current||h||a)return;const b=w instanceof HTMLElement?pf(w):[],g=pf(e.current);if(g!=null&&g.every(y=>y instanceof HTMLElement)&&b&&b.every(y=>y instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const y=uL(e.current);y&&(y.style.zIndex="1"),g.forEach((x,N)=>{const j=b[N];if(!j)return;x.style.position="relative",x.style.overflow="hidden";const k=xf(x);k&&k.classList.add(f);const S=gf(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(j)&&x.removeChild(j)};j.style.pointerEvents="none",j.style.position="absolute",j.style.overflow="hidden",j.setAttribute("aria-hidden","true");const A=hL(j);A&&(A.style.opacity="0");const I=xf(j);I&&(I.classList.add(u?n[mn.caption_before_exit]:n[mn.caption_after_exit]),I.addEventListener("animationend",M));const U=gf(j);U&&U.classList.add(u?n[mn.weeks_before_exit]:n[mn.weeks_after_exit]),x.insertBefore(j,x.firstChild)})}})}function mL(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:b,startOfBroadcastWeek:g,startOfISOWeek:y,startOfWeek:x}=r,N=c?g(a,r):o?y(a):x(a),j=c?f(i):o?p(w(i)):v(w(i)),k=h(j,N),S=u(i,a)+1,M=[];for(let U=0;U<=k;U++){const $=d(N,U);if(t&&b($,t))break;M.push($)}const I=(c?35:42)*S;if(l&&M.length<I){const U=I-M.length;for(let $=0;$<U;$++){const L=d(M[M.length-1],1);M.push(L)}}return M}function pL(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 xL(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 dw(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 gL(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,b)=>{const g=n.broadcastCalendar?u(b,r):n.ISOWeek?f(b):p(b),y=n.broadcastCalendar?i(b):n.ISOWeek?o(l(b)):c(l(b)),x=t.filter(S=>S>=g&&S<=y),N=n.broadcastCalendar?35:42;if(n.fixedWeeks&&x.length<N){const S=t.filter(M=>{const A=N-x.length;return M>y&&M<=a(y,A)});x.push(...S)}const j=x.reduce((S,M)=>{const A=n.ISOWeek?d(M):h(M),I=S.find($=>$.weekNumber===A),U=new D2(M,b,r);return I?I.days.push(U):S.push(new o8(A,[U])),S},[]),k=new i8(b,j);return v.push(k),v},[]);return n.reverseMonths?w.reverse():w}function vL(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 b=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=o(n):f?n=h(f,0,1):!n&&b&&(n=a(c(e.today??u(),-100))),r?r=l(r):p?r=h(p,11,31):!r&&b&&(r=d(e.today??u())),[n&&i(n),r&&i(r)]}function wL(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 yL(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 bL(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function eh(e,t){const[n,r]=m.useState(e);return[t===void 0?n:t,r]}function NL(e,t){const[n,r]=vL(e,t),{startOfMonth:a,endOfMonth:i}=t,o=dw(e,n,r,t),[l,c]=eh(o,e.month?o:void 0);m.useEffect(()=>{const k=dw(e,n,r,t);c(k)},[e.timeZone]);const d=xL(l,r,e,t),h=mL(d,e.endMonth?i(e.endMonth):void 0,e,t),u=gL(d,h,e,t),f=bL(u),p=pL(u),w=yL(l,n,e,t),v=wL(l,r,e,t),{disableNavigation:b,onMonthChange:g}=e,y=k=>f.some(S=>S.days.some(M=>M.isEqualTo(k))),x=k=>{if(b)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 pr;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(pr||(pr={}));function uw(e){return!e[ft.disabled]&&!e[ft.hidden]&&!e[ft.outside]}function jL(e,t,n,r){let a,i=-1;for(const o of e){const l=t(o);uw(l)&&(l[ft.focused]&&i<pr.FocusedModifier?(a=o,i=pr.FocusedModifier):r!=null&&r.isEqualTo(o)&&i<pr.LastFocused?(a=o,i=pr.LastFocused):n(o.date)&&i<pr.Selected?(a=o,i=pr.Selected):l[ft.today]&&i<pr.Today&&(a=o,i=pr.Today))}return a||(a=e.find(o=>uw(t(o)))),a}function kL(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:b,min:g,startOfBroadcastWeek:y,startOfISOWeek:x,startOfWeek:N}=o;let k={day:d,week:u,month:h,year:f,startOfWeek:S=>c?y(S,o):l?x(S):N(S),endOfWeek:S=>c?p(S):l?w(S):v(S)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=b([r,k]):t==="after"&&a&&(k=g([a,k])),k}function U2(e,t,n,r,a,i,o,l=0){if(l>365)return;const c=kL(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 D2(c,u,o);return!d&&!h?f:U2(e,t,f,r,a,i,o,l+1)}function SL(e,t,n,r,a){const{autoFocus:i}=e,[o,l]=m.useState(),c=jL(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,b)=>{if(!d)return;const g=U2(v,b,d,t.navStart,t.navEnd,e,a);g&&(e.disableNavigation&&!t.days.some(x=>x.isEqualTo(g))||(t.goToDay(g),h(g)))}}}function CL(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=eh(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 b=[...l??[]];if(d(p)){if((l==null?void 0:l.length)===h||r&&(l==null?void 0:l.length)===1)return;b=l==null?void 0:l.filter(g=>!c(g,p))}else(l==null?void 0:l.length)===u?b=[p]:b=[...b,p];return a||o(b),a==null||a(b,p,w,v),b},isSelected:d}}function EL(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 ML(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 hw(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 _L(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):$2(l,n)?l.some(c=>Wr(e,c,!1,n)):Rx(l)?l.from&&l.to?hw(e,{from:l.from,to:l.to},n):!1:z2(l)?ML(e,l.dayOfWeek,n):P2(l)?n.isAfter(l.before,l.after)?hw(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Hr(e.from,l,n)||Hr(e.to,l,n):A2(l)||O2(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 DL(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:i,onSelect:o}=e,[l,c]=eh(a,o?a:void 0),d=o?a:l;return{selected:d,select:(f,p,w)=>{const{min:v,max:b}=e,g=f?EL(f,d,v,b,i,t):void 0;return r&&n&&(g!=null&&g.from)&&g.to&&_L({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 TL(e,t){const{selected:n,required:r,onSelect:a}=e,[i,o]=eh(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 PL(e,t){const n=TL(e,t),r=CL(e,t),a=DL(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function AL(e){var Se;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new Vt(t.today,t.timeZone)),t.month&&(t.month=new Vt(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new Vt(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new Vt(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new Vt(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new Vt(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(Se=t.selected)==null?void 0:Se.map(he=>new Vt(he,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new Vt(t.selected.from,t.timeZone):void 0,to:t.selected.to?new Vt(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:i,locale:o,classNames:l}=m.useMemo(()=>{const he={...$x,...t.locale};return{dateLib:new jn({locale:he,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:R8(t.components),formatters:X8(t.formatters),labels:{...cL,...t.labels},locale:he,classNames:{...Ix(),...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:b,onDayMouseLeave:g,onNextClick:y,onPrevClick:x,showWeekNumber:N,styles:j}=t,{formatCaption:k,formatDay:S,formatMonthDropdown:M,formatWeekNumber:A,formatWeekNumberHeader:I,formatWeekdayName:U,formatYearDropdown:$}=r,L=NL(t,i),{days:E,months:O,navStart:D,navEnd:T,previousMonth:C,nextMonth:_,goToMonth:z}=L,H=z8(E,t,D,T,i),{isSelected:P,select:B,selected:q}=PL(t,i)??{},{blur:G,focused:se,isFocusTarget:re,moveFocus:Z,setFocused:R}=SL(t,L,H,P??(()=>!1),i),{labelDayButton:ee,labelGridcell:J,labelGrid:F,labelMonthDropdown:K,labelNav:ne,labelPrevious:ce,labelNext:ge,labelWeekday:ve,labelWeekNumber:Ae,labelWeekNumberHeader:Te,labelYearDropdown:tt}=a,ht=m.useMemo(()=>K8(i,t.ISOWeek),[i,t.ISOWeek]),Le=d!==void 0||p!==void 0,Oe=m.useCallback(()=>{C&&(z(C),x==null||x(C))},[C,z,x]),Ge=m.useCallback(()=>{_&&(z(_),y==null||y(_))},[z,_,y]),Je=m.useCallback((he,Pe)=>Me=>{Me.preventDefault(),Me.stopPropagation(),R(he),B==null||B(he.date,Pe,Me),p==null||p(he.date,Pe,Me)},[B,p,R]),ot=m.useCallback((he,Pe)=>Me=>{R(he),w==null||w(he.date,Pe,Me)},[w,R]),Ot=m.useCallback((he,Pe)=>Me=>{G(),f==null||f(he.date,Pe,Me)},[G,f]),zt=m.useCallback((he,Pe)=>Me=>{const Fe={ArrowLeft:[Me.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Me.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Me.shiftKey?"year":"week","after"],ArrowUp:[Me.shiftKey?"year":"week","before"],PageUp:[Me.shiftKey?"year":"month","before"],PageDown:[Me.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Fe[Me.key]){Me.preventDefault(),Me.stopPropagation();const[bt,fe]=Fe[Me.key];Z(bt,fe)}v==null||v(he.date,Pe,Me)},[Z,v,t.dir]),ae=m.useCallback((he,Pe)=>Me=>{b==null||b(he.date,Pe,Me)},[b]),me=m.useCallback((he,Pe)=>Me=>{g==null||g(he.date,Pe,Me)},[g]),ze=m.useCallback(he=>Pe=>{const Me=Number(Pe.target.value),Fe=i.setMonth(i.startOfMonth(he),Me);z(Fe)},[i,z]),X=m.useCallback(he=>Pe=>{const Me=Number(Pe.target.value),Fe=i.setYear(i.startOfMonth(he),Me);z(Fe)},[i,z]),{className:le,style:W}=m.useMemo(()=>({className:[l[ke.Root],t.className].filter(Boolean).join(" "),style:{...j==null?void 0:j[ke.Root],...t.style}}),[l,t.className,t.style,j]),te=I8(t),ue=m.useRef(null);fL(ue,!!t.animate,{classNames:l,months:O,focused:se,dateLib:i});const Ne={dayPickerProps:t,selected:q,select:B,isSelected:P,months:O,nextMonth:_,previousMonth:C,goToMonth:z,getModifiers:H,components:n,classNames:l,styles:j,labels:a,formatters:r};return Q.createElement(T2.Provider,{value:Ne},Q.createElement(n.Root,{rootRef:t.animate?ue: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},Q.createElement(n.Months,{className:l[ke.Months],style:j==null?void 0:j[ke.Months]},!t.hideNavigation&&!h&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:j==null?void 0:j[ke.Nav],"aria-label":ne(),onPreviousClick:Oe,onNextClick:Ge,previousMonth:C,nextMonth:_}),O.map((he,Pe)=>Q.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:l[ke.Month],style:j==null?void 0:j[ke.Month],key:Pe,displayIndex:Pe,calendarMonth:he},h==="around"&&!t.hideNavigation&&Pe===0&&Q.createElement(n.PreviousMonthButton,{type:"button",className:l[ke.PreviousMonthButton],tabIndex:C?void 0:-1,"aria-disabled":C?void 0:!0,"aria-label":ce(C),onClick:Oe,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:C?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Q.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:l[ke.MonthCaption],style:j==null?void 0:j[ke.MonthCaption],calendarMonth:he,displayIndex:Pe},c!=null&&c.startsWith("dropdown")?Q.createElement(n.DropdownNav,{className:l[ke.Dropdowns],style:j==null?void 0:j[ke.Dropdowns]},(()=>{const Me=c==="dropdown"||c==="dropdown-months"?Q.createElement(n.MonthsDropdown,{key:"month",className:l[ke.MonthsDropdown],"aria-label":K(),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:ze(he.date),options:q8(he.date,D,T,r,i),style:j==null?void 0:j[ke.Dropdown],value:i.getMonth(he.date)}):Q.createElement("span",{key:"month"},M(he.date,i)),Fe=c==="dropdown"||c==="dropdown-years"?Q.createElement(n.YearsDropdown,{key:"year",className:l[ke.YearsDropdown],"aria-label":tt(i.options),classNames:l,components:n,disabled:!!t.disableNavigation,onChange:X(he.date),options:Q8(D,T,r,i,!!t.reverseYears),style:j==null?void 0:j[ke.Dropdown],value:i.getYear(he.date)}):Q.createElement("span",{key:"year"},$(he.date,i));return i.getMonthYearOrder()==="year-first"?[Fe,Me]:[Me,Fe]})(),Q.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(he.date,i.options,i))):Q.createElement(n.CaptionLabel,{className:l[ke.CaptionLabel],role:"status","aria-live":"polite"},k(he.date,i.options,i))),h==="around"&&!t.hideNavigation&&Pe===u-1&&Q.createElement(n.NextMonthButton,{type:"button",className:l[ke.NextMonthButton],tabIndex:_?void 0:-1,"aria-disabled":_?void 0:!0,"aria-label":ge(_),onClick:Ge,"data-animated-button":t.animate?"true":void 0},Q.createElement(n.Chevron,{disabled:_?void 0:!0,className:l[ke.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Pe===u-1&&h==="after"&&!t.hideNavigation&&Q.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:l[ke.Nav],style:j==null?void 0:j[ke.Nav],"aria-label":ne(),onPreviousClick:Oe,onNextClick:Ge,previousMonth:C,nextMonth:_}),Q.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":F(he.date,i.options,i)||void 0,className:l[ke.MonthGrid],style:j==null?void 0:j[ke.MonthGrid]},!t.hideWeekdays&&Q.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:l[ke.Weekdays],style:j==null?void 0:j[ke.Weekdays]},N&&Q.createElement(n.WeekNumberHeader,{"aria-label":Te(i.options),className:l[ke.WeekNumberHeader],style:j==null?void 0:j[ke.WeekNumberHeader],scope:"col"},I()),ht.map(Me=>Q.createElement(n.Weekday,{"aria-label":ve(Me,i.options,i),className:l[ke.Weekday],key:String(Me),style:j==null?void 0:j[ke.Weekday],scope:"col"},U(Me,i.options,i)))),Q.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:l[ke.Weeks],style:j==null?void 0:j[ke.Weeks]},he.weeks.map(Me=>Q.createElement(n.Week,{className:l[ke.Week],key:Me.weekNumber,style:j==null?void 0:j[ke.Week],week:Me},N&&Q.createElement(n.WeekNumber,{week:Me,style:j==null?void 0:j[ke.WeekNumber],"aria-label":Ae(Me.weekNumber,{locale:o}),className:l[ke.WeekNumber],scope:"row",role:"rowheader"},A(Me.weekNumber,i)),Me.days.map(Fe=>{const{date:bt}=Fe,fe=H(Fe);if(fe[ft.focused]=!fe.hidden&&!!(se!=null&&se.isEqualTo(Fe)),fe[Jn.selected]=(P==null?void 0:P(bt))||fe.selected,Rx(q)){const{from:En,to:Qe}=q;fe[Jn.range_start]=!!(En&&Qe&&i.isSameDay(bt,En)),fe[Jn.range_end]=!!(En&&Qe&&i.isSameDay(bt,Qe)),fe[Jn.range_middle]=Wr(q,bt,!0,i)}const Ve=G8(fe,j,t.modifiersStyles),vt=$8(fe,l,t.modifiersClassNames),Nt=!Le&&!fe.hidden?J(bt,fe,i.options,i):void 0;return Q.createElement(n.Day,{key:`${i.format(bt,"yyyy-MM-dd")}_${i.format(Fe.displayMonth,"yyyy-MM")}`,day:Fe,modifiers:fe,className:vt.join(" "),style:Ve,role:"gridcell","aria-selected":fe.selected||void 0,"aria-label":Nt,"data-day":i.format(bt,"yyyy-MM-dd"),"data-month":Fe.outside?i.format(bt,"yyyy-MM"):void 0,"data-selected":fe.selected||void 0,"data-disabled":fe.disabled||void 0,"data-hidden":fe.hidden||void 0,"data-outside":Fe.outside||void 0,"data-focused":fe.focused||void 0,"data-today":fe.today||void 0},!fe.hidden&&Le?Q.createElement(n.DayButton,{className:l[ke.DayButton],style:j==null?void 0:j[ke.DayButton],type:"button",day:Fe,modifiers:fe,disabled:fe.disabled||void 0,tabIndex:re(Fe)?0:-1,"aria-label":ee(bt,fe,i.options,i),onClick:Je(Fe,fe),onBlur:Ot(Fe,fe),onFocus:ot(Fe,fe),onKeyDown:zt(Fe,fe),onMouseEnter:ae(Fe,fe),onMouseLeave:me(Fe,fe)},S(bt,i.options,i)):!fe.hidden&&S(Fe.date,i.options,i))})))))))),t.footer&&Q.createElement(n.Footer,{className:l[ke.Footer],style:j==null?void 0:j[ke.Footer],role:"status","aria-live":"polite"},t.footer)))}function On({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:o,...l}){const c=Ix();return s.jsx(AL,{showOutsideDays:n,className:De("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:De("w-fit",c.root),months:De("relative flex flex-col gap-4 md:flex-row",c.months),month:De("flex w-full flex-col gap-4",c.month),nav:De("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:De(Vm({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:De(Vm({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:De("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:De("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:De("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:De("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:De("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:De("flex",c.weekdays),weekday:De("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:De("mt-2 flex w-full",c.week),week_number_header:De("w-[--cell-size] select-none",c.week_number_header),week_number:De("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:De("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:De("bg-accent rounded-l-md",c.range_start),range_middle:De("rounded-none",c.range_middle),range_end:De("bg-accent rounded-r-md",c.range_end),today:De("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:De("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:De("text-muted-foreground opacity-50",c.disabled),hidden:De("invisible",c.hidden),...t},components:{Root:({className:d,rootRef:h,...u})=>s.jsx("div",{"data-slot":"calendar",ref:h,className:De(d),...u}),Chevron:({className:d,orientation:h,...u})=>h==="left"?s.jsx(WN,{className:De("size-4",d),...u}):h==="right"?s.jsx(fx,{className:De("size-4",d),...u}):s.jsx(Ru,{className:De("size-4",d),...u}),DayButton:OL,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 OL({className:e,day:t,modifiers:n,...r}){const a=Ix(),i=m.useRef(null);return m.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),s.jsx(Y,{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:De("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 th="Popover",[B2]=Iu(th,[Vu]),Vl=Vu(),[zL,Xs]=B2(th),W2=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=Vl(t),c=m.useRef(null),[d,h]=m.useState(!1),[u,f]=Mx({prop:r,defaultProp:a??!1,onChange:i,caller:th});return s.jsx(bj,{...l,children:s.jsx(zL,{scope:t,contentId:nr(),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})})};W2.displayName=th;var H2="PopoverAnchor",$L=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(H2,n),i=Vl(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return m.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(Cx,{...i,...r,ref:t})});$L.displayName=H2;var V2="PopoverTrigger",Y2=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(V2,n),i=Vl(n),o=Cn(t,a.triggerRef),l=s.jsx(ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Q2(a.open),...r,ref:o,onClick:_t(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(Cx,{asChild:!0,...i,children:l})});Y2.displayName=V2;var Lx="PopoverPortal",[RL,IL]=B2(Lx,{forceMount:void 0}),X2=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Xs(Lx,t);return s.jsx(RL,{scope:t,forceMount:n,children:s.jsx(Ia,{present:n||i.open,children:s.jsx(Ex,{asChild:!0,container:a,children:r})})})};X2.displayName=Lx;var Hi="PopoverContent",q2=m.forwardRef((e,t)=>{const n=IL(Hi,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Xs(Hi,e.__scopePopover);return s.jsx(Ia,{present:r||i.open,children:i.modal?s.jsx(FL,{...a,ref:t}):s.jsx(UL,{...a,ref:t})})});q2.displayName=Hi;var LL=Lu("PopoverContent.RemoveScroll"),FL=m.forwardRef((e,t)=>{const n=Xs(Hi,e.__scopePopover),r=m.useRef(null),a=Cn(t,r),i=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return Vj(o)},[]),s.jsx(Tx,{as:LL,allowPinchZoom:!0,children:s.jsx(G2,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_t(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:_t(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:_t(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),UL=m.forwardRef((e,t)=>{const n=Xs(Hi,e.__scopePopover),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(G2,{...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()}})}),G2=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=Xs(Hi,n),p=Vl(n);return $j(),s.jsx(Dx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Fu,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:s.jsx(Nj,{"data-state":Q2(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)"}})})})}),K2="PopoverClose",BL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xs(K2,n);return s.jsx(ut.button,{type:"button",...r,ref:t,onClick:_t(e.onClick,()=>a.onOpenChange(!1))})});BL.displayName=K2;var WL="PopoverArrow",HL=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Vl(n);return s.jsx(jj,{...a,...r,ref:t})});HL.displayName=WL;function Q2(e){return e?"open":"closed"}var VL=W2,YL=Y2,XL=X2,Z2=q2;const zn=VL,$n=YL,pn=m.forwardRef(({className:e,align:t="start",sideOffset:n=4,...r},a)=>s.jsx(XL,{children:s.jsx(Z2,{ref:a,align:t,sideOffset:n,className:De("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=Z2.displayName;const fw=({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"})}),Rc=({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"})}),qL=({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"})}),Yn=({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"})}),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:"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"})}),KL=({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"})}),ws=({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"})}),QL=({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"})}),J2=({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"})}),Ic=({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"})}),Kt=({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"})}),ek=({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"})}),ZL=({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"})}),mw=({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"})}),Yo=({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"})}),vf=({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"})}),ca=e=>s.jsx(Cr,{...e,className:"w-4 h-4 animate-spin"}),JL=({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"})}),eF=({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"})}),Ln=({className:e="",size:t=24})=>s.jsx(GL,{className:e,size:t}),pw=({className:e="",size:t=24})=>s.jsx(QL,{className:e,size:t}),Xm=({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"})}),tk=({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"})}),tF=({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"})}),cd=({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"})}),xw=({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"})}),Fx=({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"})}),gw=({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"})}),$s=(e,t,n)=>{const r=document.createElement(e),[a,i]=Array.isArray(t)?[void 0,t]:[t,n];return a&&Object.assign(r,a),i==null||i.forEach(o=>r.appendChild(o)),r},nF=(e,t)=>{var n;return t==="left"?e.offsetLeft:(((n=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:n.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},rF=e=>e.offsetWidth>0&&e.offsetHeight>0,sF=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function aF(e,t,{reverse:n=!1}={}){const r=e.length;for(let a=n?r-1:0;n?a>=0:a<r;n?a--:a++)t(e[a],a)}function iF(e,t,n,r){const a=t.formatToParts(e);n&&a.unshift({type:"prefix",value:n}),r&&a.push({type:"suffix",value:r});const i=[],o=[],l=[],c=[],d={},h=v=>`${v}:${d[v]=(d[v]??-1)+1}`;let u="",f=!1,p=!1;for(const v of a){u+=v.value;const b=v.type==="minusSign"||v.type==="plusSign"?"sign":v.type;b==="integer"?(f=!0,o.push(...v.value.split("").map(g=>({type:b,value:parseInt(g)})))):b==="group"?o.push({type:b,value:v.value}):b==="decimal"?(p=!0,l.push({type:b,value:v.value,key:h(b)})):b==="fraction"?l.push(...v.value.split("").map(g=>({type:b,value:parseInt(g),key:h(b),pos:-1-d[b]}))):(f||p?c:i).push({type:b,value:v.value,key:h(b)})}const w=[];for(let v=o.length-1;v>=0;v--){const b=o[v];w.unshift(b.type==="integer"?{...b,key:h(b.type),pos:d[b.type]}:{...b,key:h(b.type)})}return{pre:i,integer:w,fraction:l,post:c,valueAsString:u,value:typeof e=="string"?parseFloat(e):e}}const oF=String.raw,lF=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),cF=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),vw=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,su="--_number-flow-d-opacity",Ux="--_number-flow-d-width",au="--_number-flow-dx",Bx="--_number-flow-d",dF=(()=>{try{return CSS.registerProperty({name:su,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:au,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:Ux,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Bx,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),uF="var(--number-flow-char-height, 1em)",xs="var(--number-flow-mask-height, 0.25em)",ww=`calc(${xs} / 2)`,qm="var(--number-flow-mask-width, 0.5em)",Qs=`calc(${qm} / var(--scale-x))`,Lc="#000 0, transparent 71%",yw=oF`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${uF} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${Ux}) / var(--width));transform:translateX(var(${au})) scaleX(var(--scale-x));margin:0 calc(-1 * ${qm});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Qs},#000 calc(100% - ${Qs}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${xs},#000 calc(100% - ${xs}),transparent 100% ),radial-gradient(at bottom right,${Lc}),radial-gradient(at bottom left,${Lc}),radial-gradient(at top left,${Lc}),radial-gradient(at top right,${Lc});-webkit-mask-size:100% calc(100% - ${xs} * 2),calc(100% - ${Qs} * 2) 100%,${Qs} ${xs},${Qs} ${xs},${Qs} ${xs},${Qs} ${xs};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${ww} ${qm};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${au})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${Bx})}.digit__num,.number .section::after{padding:${ww} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${su}))}`,hF=HTMLElement,fF=cF&&lF&&dF;let Fc;class nk extends hF{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...n}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,n)}get animated(){return this._animated}set animated(t){var n;this.animated!==t&&(this._animated=t,(n=this.shadowRoot)==null||n.getAnimations().forEach(r=>r.finish()))}set data(t){var n;if(t==null)return;const{pre:r,integer:a,fraction:i,post:o,value:l}=t;if(this.created){const c=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(c.value,l):this.trend,this.computedAnimated=fF&&this._animated&&(!this.respectMotionPreference||!(vw!=null&&vw.matches))&&rF(this),(n=this.plugins)==null||n.forEach(d=>{var h;return(h=d.onUpdate)==null?void 0:h.call(d,t,c,this)}),this.batched||this.willUpdate(),this._pre.update(r),this._num.update({integer:a,fraction:i}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)Fc||(Fc=new CSSStyleSheet,Fc.replaceSync(yw)),this.shadowRoot.adoptedStyleSheets=[Fc];else{const c=document.createElement("style");c.textContent=yw,this.shadowRoot.appendChild(c)}this._pre=new Nw(this,r,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new mF(this,a,i),this.shadowRoot.appendChild(this._num.el),this._post=new Nw(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(n=>n.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}nk.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};class mF{constructor(t,n,r,{className:a,...i}={}){this.flow=t,this._integer=new bw(t,n,{justify:"right",part:"integer"}),this._fraction=new bw(t,r,{justify:"left",part:"fraction"}),this._inner=$s("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=$s("span",{...i,part:"number",className:`number ${a??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:n}){this._integer.update(t),this._fraction.update(n)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const n=this._prevLeft-t.left,r=this.el.offsetWidth,a=this._prevWidth-r;this.el.style.setProperty("--width",String(r)),this.el.animate({[au]:[`${n}px`,"0px"],[Ux]:[a,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class rk{constructor(t,n,{justify:r,className:a,...i},o){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=r;const l=n.map(c=>this.addChar(c).el);this.el=$s("span",{...i,className:`section section--justify-${r} ${a??""}`},o?o(l):l)}addChar(t,{startDigitsAtZero:n=!1,...r}={}){const a=t.type==="integer"||t.type==="fraction"?new ak(this,t.type,n?0:t.value,t.pos,{...r,onRemove:this.onCharRemove(t.key)}):new pF(this,t.type,t.value,{...r,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,a),a}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(n=>{n.el.style.top=`${n.el.offsetTop}px`,n.el.style[this.justify]=`${nF(n.el,this.justify)}px`}),t.forEach(n=>{n.el.setAttribute("inert",""),n.present=!1})}addNewAndUpdateExisting(t){const n=new Map,r=new Map,a=this.justify==="left",i=a?"prepend":"append";if(aF(t,o=>{let l;this.children.has(o.key)?(l=this.children.get(o.key),r.set(o,l),this.unpop(l),l.present=!0):(l=this.addChar(o,{startDigitsAtZero:!0,animateIn:!0}),n.set(o,l)),this.el[i](l.el)},{reverse:a}),this.flow.computedAnimated){const o=this.el.getBoundingClientRect();n.forEach(l=>{l.willUpdate(o)})}n.forEach((o,l)=>{o.update(l.value)}),r.forEach((o,l)=>{o.update(l.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(n=>n.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(a=>a.didUpdate(t));const n=t[this.justify],r=this._prevOffset-n;r&&this.children.size&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class bw extends rk{update(t){const n=new Map;this.children.forEach((r,a)=>{t.find(i=>i.key===a)||n.set(a,r),this.unpop(r)}),this.addNewAndUpdateExisting(t),n.forEach(r=>{r instanceof ak&&r.update(0)}),this.pop(n)}}class Nw extends rk{update(t){const n=new Map;this.children.forEach((r,a)=>{t.find(i=>i.key===a)||n.set(a,r)}),this.pop(n),this.addNewAndUpdateExisting(t)}}class Gm{constructor(t,n,{onRemove:r,animateIn:a=!1}={}){this.flow=t,this.el=n,this._present=!0,this._remove=()=>{var i;this.el.remove(),(i=this._onRemove)==null||i.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&a&&this.el.animate({[su]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=r}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[su]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class sk extends Gm{constructor(t,n,r,a){super(t.flow,r,a),this.section=t,this.value=n,this.el=r}}class ak extends sk{constructor(t,n,r,a,i){var o,l;const c=(((l=(o=t.flow.digits)==null?void 0:o[a])==null?void 0:l.max)??9)+1,d=Array.from({length:c}).map((u,f)=>{const p=$s("span",{className:"digit__num"},[document.createTextNode(String(f))]);return f!==r&&p.setAttribute("inert",""),p.style.setProperty("--n",String(f)),p}),h=$s("span",{part:`digit ${n}-digit`,className:"digit"},d);h.style.setProperty("--current",String(r)),h.style.setProperty("--length",String(c)),super(t,r,h,i),this.pos=a,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=d,this.length=c}willUpdate(t){const n=this.el.getBoundingClientRect();this._prevValue=this.value;const r=n[this.section.justify]-t[this.section.justify],a=n.width/2;this._prevCenter=this.section.justify==="left"?r+a:r-a}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((n,r)=>r===t?n.removeAttribute("inert"):n.setAttribute("inert","")),this.value=t}didUpdate(t){const n=this.el.getBoundingClientRect(),r=n[this.section.justify]-t[this.section.justify],a=n.width/2,i=this.section.justify==="left"?r+a:r-a,o=this._prevCenter-i;o&&this.el.animate({transform:[`translateX(${o}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const l=this.getDelta();l&&(this.el.classList.add("is-spinning"),this.el.animate({[Bx]:[-l,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const a of this.flow.plugins){const i=(t=a.getDelta)==null?void 0:t.call(a,this.value,this._prevValue,this);if(i!=null)return i}const n=this.value-this._prevValue,r=this.flow.computedTrend||Math.sign(n);return r<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:r>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:n}}class pF extends sk{constructor(t,n,r,a){const i=$s("span",{className:"symbol__value",textContent:r});super(t,r,$s("span",{part:`symbol ${n}`,className:"symbol"},[i]),a),this.type=n,this._children=new Map,this._onChildRemove=o=>()=>{this._children.delete(o)},this._children.set(r,new Gm(this.flow,i,{onRemove:this._onChildRemove(r)}))}willUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect();this._prevOffset=n[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const n=this._children.get(this.value);n&&(n.present=!1);const r=this._children.get(t);if(r)r.present=!0;else{const a=$s("span",{className:"symbol__value",textContent:t});this.el.appendChild(a),this._children.set(t,new Gm(this.flow,a,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const n=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],r=this._prevOffset-n;r&&this.el.animate({transform:[`translateX(${r}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var Ew;const xF=parseInt((Ew=m.version.match(/^(\d+)\./))==null?void 0:Ew[1]),Wx=xF>=19,gF=["data","digits"];class Hx extends nk{attributeChangedCallback(t,n,r){this[t]=JSON.parse(r)}}Hx.observedAttributes=Wx?[]:gF;sF("number-flow-react",Hx);const wf={},jw=Wx?e=>e:JSON.stringify;function kw(e){const{transformTiming:t,spinTiming:n,opacityTiming:r,animated:a,respectMotionPreference:i,trend:o,plugins:l,...c}=e;return[{transformTiming:t,spinTiming:n,opacityTiming:r,animated:a,respectMotionPreference:i,trend:o,plugins:l},c]}class vF extends m.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[n]=kw(this.props);Object.entries(n).forEach(([r,a])=>{this.el[r]=a??Hx.defaultProps[r]}),t!=null&&t.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t!=null&&t.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),Wx&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){var n;if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>{var r;return(r=this.props.group)==null?void 0:r.didUpdate()};if(!this.props.isolate)return(n=this.el)==null||n.willUpdate(),()=>{var r;return(r=this.el)==null?void 0:r.didUpdate()}}return null}componentDidUpdate(t,n,r){r==null||r()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:n,className:r,data:a,willChange:i,isolate:o,group:l,digits:c,onAnimationsStart:d,onAnimationsFinish:h,...u}]=kw(this.props);return m.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":i?"":void 0,class:r,...u,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:jw(c),data:jw(a)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const wF=m.forwardRef(function({value:t,locales:n,format:r,prefix:a,suffix:i,...o},l){m.useImperativeHandle(l,()=>c.current,[]);const c=m.useRef(),d=m.useContext(yF);d==null||d.useRegister(c);const h=m.useMemo(()=>n?JSON.stringify(n):"",[n]),u=m.useMemo(()=>r?JSON.stringify(r):"",[r]),f=m.useMemo(()=>{var w;const p=wf[w=`${h}:${u}`]??(wf[w]=new Intl.NumberFormat(n,r));return iF(t,p,a,i)},[t,h,u,a,i]);return m.createElement(vF,{...o,group:d,data:f,innerRef:c})}),yF=m.createContext(void 0),bF={notation:"compact",maximumFractionDigits:1};function Nr({value:e,loading:t=!1,className:n,prefix:r,suffix:a,format:i,trend:o,fallback:l="…"}){const c=m.useMemo(()=>{if(e==null)return 0;const u=Number(e);return Number.isFinite(u)?u:0},[e]);if(t)return s.jsxs("span",{className:Gd("inline-flex items-baseline",n),children:[r,l,a]});const d=wF,h=typeof o=="boolean"?o?1:0:o;return s.jsxs("span",{className:Gd("inline-flex",n),children:[r,s.jsx(d,{value:c,format:i??bF,trend:h,className:"inline-flex"}),a]})}function Oa({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"})},[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(ra,{className:"w-3 h-3 text-red-400"});case"progress":return u.status==="running"?s.jsx(Cr,{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(ra,{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(YP,{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(Ru,{className:"w-3 h-3"}):s.jsx(RP,{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 ik=document.createElement("style");ik.textContent=`
404
- @keyframes fadeIn {
405
- from {
406
- opacity: 0;
407
- transform: translateX(-10px);
408
- }
409
- to {
410
- opacity: 1;
411
- transform: translateX(0);
412
- }
413
- }
414
-
415
- .animate-fadeIn {
416
- animation: fadeIn 0.3s ease-out forwards;
417
- }
418
- `;document.head.appendChild(ik);const Ie=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}));Ie.displayName="Input";const He=m.forwardRef(({className:e,...t},n)=>s.jsx("label",{className:`text-sm font-light text-white ${e}`,ref:n,...t}));He.displayName="Label";function ok({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(Y,{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(WN,{className:"w-4 h-4"}),"Previous"]}),l.map((c,d)=>{if(c==="...")return s.jsx(Y,{variant:"outline",size:"sm",disabled:!0,className:"border border-dashed border-white/20 text-white rounded-none",children:s.jsx(WP,{className:"w-4 h-4"})},`dots-${d}`);const h=c,u=e===h;return s.jsx(Y,{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(Y,{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(fx,{className:"w-4 h-4"})]})]})]})}const Yl=m.createContext({isOpen:!1,setIsOpen:()=>{}}),pa=m.forwardRef(({className:e,value:t,onValueChange:n,children:r,...a},i)=>{const[o,l]=m.useState(!1);return s.jsx(Yl.Provider,{value:{value:t,onValueChange:n,isOpen:o,setIsOpen:l},children:s.jsx("div",{ref:i,className:`relative ${e}`,...a,children:r})})});pa.displayName="Select";const xa=m.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:a,setIsOpen:i}=m.useContext(Yl);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(Ru,{className:`h-4 w-4 text-gray-400 transition-transform ${a?"rotate-180":""}`})]})});xa.displayName="SelectTrigger";const Vx=m.forwardRef(({className:e,placeholder:t,...n},r)=>{const{value:a}=m.useContext(Yl);return s.jsx("span",{ref:r,className:`text-sm text-white ${e}`,...n,children:a||t})});Vx.displayName="SelectValue";const ga=m.forwardRef(({className:e,children:t,...n},r)=>{const{isOpen:a}=m.useContext(Yl);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});ga.displayName="SelectContent";const sn=m.forwardRef(({className:e,children:t,value:n,...r},a)=>{const{onValueChange:i,setIsOpen:o}=m.useContext(Yl);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})});sn.displayName="SelectItem";function lk(){const e=Dr(),{counts:t,refetchCounts:n}=Gu(),[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,b]=m.useState(1),[g]=m.useState(20),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(!1),[M,A]=m.useState(!1),[I,U]=m.useState(!1),[$,L]=m.useState(!1),[E,O]=m.useState(null),[D,T]=m.useState([]),[C,_]=m.useState(!1),[z,H]=m.useState({name:"",slug:""}),[P,B]=m.useState({name:"",slug:""});m.useEffect(()=>{R()},[]);const q=ae=>ae.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),G=ae=>{const me=q(ae);H({name:ae,slug:me})},se=ae=>{H(me=>({...me,slug:q(ae)}))},re=ae=>{const me=q(ae);B({name:ae,slug:me})},Z=ae=>{B(me=>({...me,slug:q(ae)}))},R=async()=>{try{const me=await(await fetch("/api/plugins")).json(),ze=(me==null?void 0:me.plugins).find(X=>X.id==="organization");c({enabled:!!ze,availablePlugins:(me==null?void 0:me.plugins).map(X=>X.id),configPath:me.configPath,organizationPlugin:(me==null?void 0:me.plugins).find(X=>X.id==="organization")}),ze?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),V.error("Failed to fetch organizations")}finally{o(!1)}},J=async ae=>{T([]),_(!0),T([{id:"start",type:"info",message:`Starting organization seeding process for ${ae} organizations...`,timestamp:new Date}]);try{const ze=await(await fetch("/api/seed/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:ae})})).json();if(ze.success){const X=ze.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});T(W=>[...W,...X]);const le=ze.results.filter(W=>W.success).length;T(W=>[...W,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${le}/${ae} organizations successfully`,timestamp:new Date}]),await ee(),await n()}else T(X=>[...X,{id:"error",type:"error",message:`❌ Seeding failed: ${ze.error||"Unknown error"}`,timestamp:new Date}])}catch(me){T(ze=>[...ze,{id:"error",type:"error",message:`❌ Network error: ${me}`,timestamp:new Date}])}finally{_(!1)}},F=ae=>{O(ae),U(!0)},K=ae=>{O(ae),B({name:ae.name,slug:ae.slug}),S(!0)},ne=ae=>{O(ae),A(!0)},ce=async()=>{if(!z.name){V.error("Please fill in the organization name");return}const ae=V.loading("Creating organization...");try{const ze=await(await fetch("/api/organizations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:z.name,slug:z.slug})})).json();ze.success?(await ee(),x(!1),H({name:"",slug:""}),V.success("Organization created successfully!",{id:ae})):V.error(`Error creating organization: ${ze.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error creating organization:",me),V.error("Error creating organization",{id:ae})}},ge=async()=>{if(!E){V.error("No organization selected");return}if(!P.name){V.error("Please fill in the organization name");return}const ae=V.loading("Updating organization...");try{const ze=await(await fetch(`/api/organizations/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,slug:P.slug})})).json();ze.success?(await ee(),S(!1),O(null),B({name:"",slug:""}),V.success("Organization updated successfully!",{id:ae})):V.error(`Error updating organization: ${ze.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error updating organization:",me),V.error("Error updating organization",{id:ae})}},ve=async()=>{if(!E){V.error("No organization selected");return}const ae=V.loading("Deleting organization...");try{const ze=await(await fetch(`/api/organizations/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ze.success?(await ee(),await n(),A(!1),O(null),V.success("Organization deleted successfully!",{id:ae})):V.error(`Error deleting organization: ${ze.error||"Unknown error"}`,{id:ae})}catch(me){console.error("Error deleting organization:",me),V.error("Error deleting organization",{id:ae})}},Ae=()=>{if(r.length===0){V.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()]),ze=[ae.join(","),...me.map(te=>te.map(ue=>`"${ue}"`).join(","))].join(`
419
- `),X=new Blob([ze],{type:"text/csv;charset=utf-8;"}),le=document.createElement("a"),W=URL.createObjectURL(X);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),V.success(`Exported ${r.length} organizations to CSV`)},Te=ae=>{p.some(me=>me.type===ae)||w([...p,{type:ae}])},tt=ae=>{w(p.filter(me=>me.type!==ae))},ht=()=>{w([])},Le=(ae,me)=>{w(ze=>ze.map(X=>X.type===ae?{...X,dateRange:me}:X))},Oe=r.filter(ae=>{const me=ae.name.toLowerCase().includes(d.toLowerCase())||ae.slug.toLowerCase().includes(d.toLowerCase());if(p.length===0)return me;const ze=p.every(X=>{var le,W,te,ue;switch(X.type){case"createdAt":{if(!((le=X.dateRange)!=null&&le.from)&&!((W=X.dateRange)!=null&&W.to))return!0;const Ne=new Date(ae.createdAt);return!((te=X.dateRange)!=null&&te.from&&X.dateRange.from>Ne||(ue=X.dateRange)!=null&&ue.to&&X.dateRange.to<Ne)}default:return!0}});return me&&ze}),Ge=Math.ceil(Oe.length/g),Je=(v-1)*g,ot=Je+g,Ot=Oe.slice(Je,ot),zt=ae=>{b(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(Cr,{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(xr,{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(Y,{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.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:s.jsx(Nr,{value:t.organizations??0,className:"text-white font-mono text-sm",prefix:s.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),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(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:Ae,children:[s.jsx(HN,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>L(!0),children:[s.jsx(lt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>x(!0),children:[s.jsx(zs,{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(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{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(pa,{value:"",onValueChange:Te,children:[s.jsx(xa,{className:"w-[180px]",children:s.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[s.jsx(zs,{className:"w-4 h-4"}),s.jsx("span",{children:"Add Filter"})]})}),s.jsx(ga,{children:!p.some(ae=>ae.type==="createdAt")&&s.jsx(sn,{value:"createdAt",children:"Created Date"})})]})}),p.length>0&&s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(Y,{onClick:ht,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,ze,X,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(mx,{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(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yd,{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(On,{mode:"single",selected:(ze=ae.dateRange)==null?void 0:ze.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(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yd,{className:"mr-1 h-3 w-3"}),(X=ae.dateRange)!=null&&X.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(On,{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(Pt,{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:Oe.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(xr,{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(Y,{onClick:()=>x(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[s.jsx(zs,{className:"w-4 h-4 mr-2"}),"Create Organization"]}),s.jsxs(Y,{onClick:()=>L(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(lt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):Ot.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(xr,{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(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:me=>{me.stopPropagation(),F(ae)},children:s.jsx(Ll,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:me=>{me.stopPropagation(),K(ae)},children:s.jsx(Ca,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:me=>{me.stopPropagation(),ne(ae)},children:s.jsx(px,{className:"w-4 h-4"})})]})})]},ae.id))})]})}),s.jsx(ok,{currentPage:v,totalPages:Ge,onPageChange:zt,totalItems:Oe.length,startIndex:Je,endIndex:ot})]}),$&&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(xr,{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(Y,{variant:"ghost",size:"sm",onClick:()=>L(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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(He,{htmlFor:"organization-count",className:"text-sm text-gray-400 font-light",children:"Number of organizations"}),s.jsx(Ie,{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(Y,{onClick:()=>{var me;const ae=parseInt(((me=document.getElementById("organization-count"))==null?void 0:me.value)||"5",10);J(ae)},disabled:C,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:C?s.jsxs(s.Fragment,{children:[s.jsx(Cr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(lt,{className:"w-3 h-3 mr-2"}),"Seed Organizations"]})})]})}),D.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Organization Seeding Terminal",lines:D,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(Y,{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(Y,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"create-name",value:z.name,onChange:ae=>G(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(He,{htmlFor:"create-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),s.jsx(Ie,{id:"create-slug",value:z.slug,onChange:ae=>se(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(Y,{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(Y,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),k&&E&&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(Y,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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(xr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.slug})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"edit-name",value:P.name,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.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-slug",className:"text-sm text-gray-400 font-light",children:"Slug"}),s.jsx(Ie,{id:"edit-slug",value:P.slug,onChange:ae=>Z(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(Y,{variant:"outline",onClick:()=>{S(!1),B({name:"",slug:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ge,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),M&&E&&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(Y,{variant:"ghost",size:"sm",onClick:()=>A(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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(xr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.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(Y,{variant:"outline",onClick:()=>A(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ve,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),I&&E&&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(Y,{variant:"ghost",size:"sm",onClick:()=>U(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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(xr,{className:"w-8 h-8 text-white"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-white font-light",children:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.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:E.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(E.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(E.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(Y,{onClick:()=>U(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function ck(){const e=Dr(),{counts:t,refetchCounts:n}=Gu(),[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),[b,g]=m.useState(!1),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(!1),[M,A]=m.useState(!1),[I,U]=m.useState(!1),[$,L]=m.useState(!1),[E,O]=m.useState(null),[D,T]=m.useState(null),[C,_]=m.useState(""),[z,H]=m.useState(),[P,B]=m.useState(!1),[q,G]=m.useState([]),[se,re]=m.useState(!1),Z=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();B(le.enabled)}catch{B(!1)}},[]);m.useEffect(()=>{Z(),R();const X=()=>{D&&T(null)};return document.addEventListener("click",X),()=>document.removeEventListener("click",X)},[D,R,Z]);const ee=async X=>{G([]),re(!0),G([{id:"start",type:"info",message:`Starting user seeding process for ${X} users...`,timestamp:new Date}]);try{const W=await(await fetch("/api/seed/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:X})})).json();if(W.success){const te=W.results.map((Ne,Se)=>Ne.success?{id:`user-${Se}`,type:"progress",message:`Creating user: ${Ne.user.name} (${Ne.user.email})`,timestamp:new Date,status:"completed"}:{id:`user-${Se}`,type:"error",message:`Failed to create user ${Se+1}: ${Ne.error}`,timestamp:new Date});G(Ne=>[...Ne,...te]);const ue=W.results.filter(Ne=>Ne.success).length;G(Ne=>[...Ne,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${ue}/${X} users successfully`,timestamp:new Date}]),await Z(),await n()}else G(te=>[...te,{id:"error",type:"error",message:`❌ Seeding failed: ${W.error||"Unknown error"}`,timestamp:new Date}])}catch(le){G(W=>[...W,{id:"error",type:"error",message:`❌ Network error: ${le}`,timestamp:new Date}])}finally{re(!1)}},J=X=>{O(X),j(!0)},F=X=>{O(X),g(!0)},K=X=>{O(X),x(!0)},ne=async()=>{var ue,Ne,Se;const X=(ue=document.getElementById("create-name"))==null?void 0:ue.value,le=(Ne=document.getElementById("create-email"))==null?void 0:Ne.value,W=(Se=document.getElementById("create-password"))==null?void 0:Se.value;if(!X||!le||!W){V.error("Please fill in all fields");return}const te=V.loading("Creating user...");try{const Pe=await(await fetch("/api/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:X,email:le,password:W})})).json();Pe.success?(await Z(),v(!1),document.getElementById("create-name").value="",document.getElementById("create-email").value="",document.getElementById("create-password").value="",V.success("User created successfully!",{id:te})):V.error(`Error creating user: ${Pe.error||"Unknown error"}`,{id:te})}catch{V.error("Error creating user",{id:te})}},ce=async()=>{var te,ue;if(!E){V.error("No user selected");return}const X=(te=document.getElementById("edit-name"))==null?void 0:te.value,le=(ue=document.getElementById("edit-email"))==null?void 0:ue.value;if(!X||!le){V.error("Please fill in all fields");return}const W=V.loading("Updating user...");try{const Se=await(await fetch(`/api/users/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:X,email:le})})).json();Se.success?(await Z(),g(!1),O(null),V.success("User updated successfully!",{id:W})):V.error(`Error updating user: ${Se.error||"Unknown error"}`,{id:W})}catch{V.error("Error updating user",{id:W})}},ge=async()=>{if(!E){V.error("No user selected");return}const X=V.loading("Deleting user...");try{const W=await(await fetch(`/api/users/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();W.success?(await Z(),await n(),x(!1),O(null),V.success("User deleted successfully!",{id:X})):V.error(`Error deleting user: ${W.error||"Unknown error"}`,{id:X})}catch{V.error("Error deleting user",{id:X})}},ve=async()=>{if(!E)return;if(!P){V.error("Admin plugin is not enabled");return}const X=V.loading("Banning user...");try{const le=await fetch("/api/admin/ban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:E.id,banReason:C||"No reason provided",banExpiresIn:z})}),W=await le.json();le.ok?(V.success("User banned successfully!",{id:X}),A(!1),_(""),H(void 0),O(null),T(null),Z()):V.error(`Error banning user: ${W.error||W.message||"Unknown error"}`,{id:X})}catch{V.error("Error banning user",{id:X})}},Ae=async()=>{if(!E)return;if(!P){V.error("Admin plugin is not enabled");return}const X=V.loading("Unbanning user...");try{const le=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:E.id})}),W=await le.json();le.ok?(V.success("User unbanned successfully!",{id:X}),U(!1),O(null),T(null),Z()):V.error(`Error unbanning user: ${W.error||W.message||"Unknown error"}`,{id:X})}catch{V.error("Error unbanning user",{id:X})}},Te=async()=>{var W;if(!E){V.error("No user selected");return}const X=(W=document.getElementById("update-password"))==null?void 0:W.value;if(!X){V.error("Please enter a new password");return}const le=V.loading("Updating password...");try{const te=await fetch(`/api/users/${E.id}/password`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:X})}),ue=await te.json();te.ok&&ue.success?(V.success("Password updated successfully!",{id:le}),L(!1),O(null),document.getElementById("update-password").value=""):V.error(`Error updating password: ${ue.error||"Unknown error"}`,{id:le})}catch{V.error("Error updating password",{id:le})}},tt=()=>{if(r.length===0){V.error("No users to export");return}const X=["ID","Name","Email","Email Verified","Created At","Updated At"],le=r.map(Se=>[Se.id,Se.name||"",Se.email||"",!!Se.emailVerified,new Date(Se.createdAt).toLocaleString(),new Date(Se.updatedAt).toLocaleString()]),W=[X.join(","),...le.map(Se=>Se.map(he=>`"${he}"`).join(","))].join(`
420
- `),te=new Blob([W],{type:"text/csv;charset=utf-8;"}),ue=document.createElement("a"),Ne=URL.createObjectURL(te);ue.setAttribute("href",Ne),ue.setAttribute("download",`users-export-${new Date().toISOString().split("T")[0]}.csv`),ue.style.visibility="hidden",document.body.appendChild(ue),ue.click(),document.body.removeChild(ue),V.success(`Exported ${r.length} users to CSV`)},ht=X=>{d.some(W=>W.type===X)||(h(W=>[...W,{type:X}]),f(1))},Le=X=>{h(le=>le.filter(W=>W.type!==X)),f(1)},Oe=(X,le)=>{h(W=>W.map(te=>te.type===X?{...te,value:le}:te))},Ge=(X,le)=>{h(W=>W.map(te=>te.type===X?{...te,dateRange:le}:te))},Je=r.filter(X=>{const le=X.name.toLowerCase().includes(l.toLowerCase())||X.email.toLowerCase().includes(l.toLowerCase());if(d.length===0)return le;const W=d.every(te=>{var ue,Ne,Se,he,Pe;switch(te.type){case"emailVerified":return te.value===void 0?!0:X.emailVerified===(te.value==="true");case"banned":return te.value===void 0?!0:X.banned===(te.value==="true");case"active":return X.banned!==!0;case"createdAt":{if(!((ue=te.dateRange)!=null&&ue.from)&&!((Ne=te.dateRange)!=null&&Ne.to))return!0;const Me=new Date(X.createdAt);return!((Se=te.dateRange)!=null&&Se.from&&te.dateRange.from>Me||(he=te.dateRange)!=null&&he.to&&te.dateRange.to<Me)}case"role":return te.value?(Pe=X.role)==null?void 0:Pe.toLowerCase().includes(te.value.toLowerCase()):!0;default:return!0}});return le&&W}),ot=r.filter(X=>X.banned).length,Ot=Math.ceil(Je.length/p),zt=(u-1)*p,ae=zt+p,me=Je.slice(zt,ae),ze=X=>{f(X)};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(Cr,{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.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:s.jsx(Nr,{value:t.users??0,className:"text-white font-mono text-sm",prefix:s.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),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(Mc,{className:"w-3 h-3"}),s.jsxs("span",{children:[ot," Banned"]})]})})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:tt,children:[s.jsx(HN,{className:"w-4 h-4 mr-2"}),"Export CSV"]}),s.jsxs(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",onClick:()=>S(!0),children:[s.jsx(lt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>v(!0),children:[s.jsx(Am,{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(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search users...",value:l,onChange:X=>c(X.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(pa,{value:"",onValueChange:ht,children:[s.jsx(xa,{className:"w-[180px]",children:s.jsxs("div",{className:"flex mr-3 items-center space-x-2",children:[s.jsx(zs,{className:"w-4 h-4"}),s.jsx("span",{children:"Add Filter"})]})}),s.jsxs(ga,{children:[!d.some(X=>X.type==="emailVerified")&&s.jsx(sn,{value:"emailVerified",children:"Email Verified"}),!d.some(X=>X.type==="banned")&&s.jsx(sn,{value:"banned",children:"Banned Status"}),!d.some(X=>X.type==="createdAt")&&s.jsx(sn,{value:"createdAt",children:"Created Date"}),!d.some(X=>X.type==="role")&&s.jsx(sn,{value:"role",children:"Role"})]})]})}),d.length>0&&s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(Y,{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(X=>{var le,W,te,ue;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(mx,{className:"w-3 h-3 text-white"}),X.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(pa,{value:X.value||"",onValueChange:Ne=>Oe("emailVerified",Ne),children:[s.jsx(xa,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:X.value==="true"?"True":X.value==="false"?"False":"Select"})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"true",children:"True"}),s.jsx(sn,{value:"false",children:"False"})]})]})]}),X.type==="banned"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Banned:"}),s.jsxs(pa,{value:X.value||"",onValueChange:Ne=>Oe("banned",Ne),children:[s.jsx(xa,{className:"h-7 w-24 text-xs",children:s.jsx("span",{children:X.value==="true"?"Yes":X.value==="false"?"No":"Select"})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"true",children:"Yes"}),s.jsx(sn,{value:"false",children:"No"})]})]})]}),X.type==="createdAt"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Created:"}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yd,{className:"mr-1 h-3 w-3"}),(le=X.dateRange)!=null&&le.from?An(X.dateRange.from,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(W=X.dateRange)==null?void 0:W.from,onSelect:Ne=>{var Se;return Ge("createdAt",{from:Ne,to:(Se=X.dateRange)==null?void 0:Se.to})},initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yd,{className:"mr-1 h-3 w-3"}),(te=X.dateRange)!=null&&te.to?An(X.dateRange.to,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:(ue=X.dateRange)==null?void 0:ue.to,onSelect:Ne=>{var Se;return Ge("createdAt",{from:(Se=X.dateRange)==null?void 0:Se.from,to:Ne})},initialFocus:!0,disabled:Ne=>{var Se;return(Se=X.dateRange)!=null&&Se.from?Ne<X.dateRange.from:!1},className:"rounded-none"})})]})]}),X.type==="role"&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-white",children:"Role:"}),s.jsx(Ie,{type:"text",value:X.value||"",onChange:Ne=>Oe("role",Ne.target.value),className:"h-7 w-32 text-xs bg-black border-white/20 text-white",placeholder:"Enter role..."})]}),s.jsx("button",{onClick:()=>Le(X.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:s.jsx(Pt,{className:"w-3 h-3 text-white"})})]},X.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(Ma,{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(Y,{onClick:()=>v(!0),className:"bg-white text-black hover:bg-gray-200 rounded-none",children:[s.jsx(Am,{className:"w-4 h-4 mr-2"}),"Create User"]}),s.jsxs(Y,{onClick:()=>S(!0),className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(lt,{className:"w-4 h-4 mr-2"}),"Seed Data"]})]})]})})}):me.map(X=>s.jsxs("tr",{className:`border-b border-dashed hover:bg-white/5 cursor-pointer ${X.banned?"border-red-500/30 bg-red-500/5":"border-white/5"}`,onClick:()=>e(`/users/${X.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:X.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${X.id}`,alt:X.name,className:`w-10 h-10 rounded-none border border-dashed ${X.banned?"border-red-400/50 opacity-60":"border-white/20"}`}),X.banned&&s.jsx("div",{className:"absolute -top-1 -right-1 bg-red-500 rounded-full p-0.5",children:s.jsx(Mc,{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:X.name}),X.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:X.email})]})]})}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[X.emailVerified?s.jsx($P,{className:"w-4 h-4 text-green-400"}):s.jsx(qd,{className:"w-4 h-4 text-yellow-400"}),s.jsx("span",{className:"text-sm text-gray-400",children:X.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(X.createdAt).toLocaleDateString(),s.jsx("p",{className:"text-xs",children:new Date(X.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(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:le=>{le.stopPropagation(),T(D===X.id?null:X.id)},children:s.jsx(HP,{className:"w-4 h-4"})}),D===X.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(),T(null),J(X)},children:[s.jsx(Ll,{className:"w-4 h-4"}),s.jsx("span",{children:"View"})]}),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(),T(null),F(X)},children:[s.jsx(Ca,{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(),T(null),O(X),L(!0)},children:[s.jsx(Mn,{className:"w-4 h-4"}),s.jsx("span",{children:"Update Password"})]}),P&&(X.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(),O(X),U(!0),T(null)},children:[s.jsx(Mc,{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(),O(X),A(!0),T(null)},children:[s.jsx(Mc,{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(),T(null),K(X)},children:[s.jsx(px,{className:"w-4 h-4"}),s.jsx("span",{children:"Delete User"})]})]})]})})]},X.id))})]})}),s.jsx(ok,{currentPage:u,totalPages:Ot,onPageChange:ze,totalItems:Je.length,startIndex:zt,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(Ma,{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(Y,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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(He,{htmlFor:"user-count",className:"text-sm text-gray-400 font-light",children:"Number of users"}),s.jsx(Ie,{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(Y,{onClick:()=>{var le;const X=parseInt(((le=document.getElementById("user-count"))==null?void 0:le.value)||"5",10);ee(X)},disabled:se,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:se?s.jsxs(s.Fragment,{children:[s.jsx(Cr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(lt,{className:"w-3 h-3 mr-2"}),"Seed Users"]})})]})]}),q.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"User Seeding Terminal",lines:q,isRunning:se,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(Y,{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(Y,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{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(He,{htmlFor:"create-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Ie,{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(He,{htmlFor:"create-password",className:"text-sm text-gray-400 font-light",children:"Password"}),s.jsx(Ie,{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(Y,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ne,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create"})]})]})}),b&&E&&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(Y,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.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:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-name",className:"text-sm text-gray-400 font-light",children:"Name"}),s.jsx(Ie,{id:"edit-name",defaultValue:E.name,className:"mt-1 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-email",className:"text-sm text-gray-400 font-light",children:"Email"}),s.jsx(Ie,{id:"edit-email",type:"email",defaultValue:E.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(Y,{variant:"outline",onClick:()=>g(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ce,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),y&&E&&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(Y,{variant:"ghost",size:"sm",onClick:()=>x(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.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:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.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(Y,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ge,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete"})]})]})}),N&&E&&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(Y,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.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:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.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:E.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:E.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(E.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(E.updatedAt).toLocaleString()})]})]})]}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsx(Y,{onClick:()=>j(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})}),M&&E&&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:E.name})," from accessing the system."]}),s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),s.jsx(Ie,{id:"banReason",value:C,onChange:X=>_(X.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(He,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),s.jsx(Ie,{id:"banExpires",type:"number",value:z||"",onChange:X=>H(X.target.value?Number(X.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(Y,{variant:"outline",onClick:()=>{A(!1),_(""),H(void 0),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ve,className:"bg-red-600 text-white hover:bg-red-700 rounded-none",children:"Ban User"})]})]})}),I&&E&&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:E.name}),"? This will restore their access to the system."]}),s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{U(!1),O(null)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:Ae,className:"bg-green-600 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),$&&E&&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(Y,{variant:"ghost",size:"sm",onClick:()=>{L(!1),O(null),document.getElementById("update-password").value=""},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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:E.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${E.id}`,alt:E.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:E.name}),s.jsx("div",{className:"text-sm text-gray-400",children:E.email})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"update-password",className:"text-sm text-gray-400 font-light",children:"New Password"}),s.jsx(Ie,{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(Y,{variant:"outline",onClick:()=>{L(!1),O(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(Y,{onClick:Te,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Password"})]})]})})]})}const Co=[{id:"signups",label:"Signups",analyticsKey:"newUsers",barClass:"bg-white/25 border border-white/10",dotClass:"bg-white/25"},{id:"logins",label:"Logins",analyticsKey:"activeUsers",barClass:"bg-white/20 border border-white/10",dotClass:"bg-white/20"},{id:"organizations",label:"Organizations",analyticsKey:"organizations",barClass:"bg-white/15 border border-white/10",dotClass:"bg-white/15"},{id:"teams",label:"Teams",analyticsKey:"teams",barClass:"bg-white/10 border border-white/10",dotClass:"bg-white/10"},{id:"sessions",label:"Sessions",analyticsKey:"sessions",barClass:"bg-white/5 border border-white/10",dotClass:"bg-white/5"}];function NF(){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(null),[p,w]=m.useState(!1),[v,b]=m.useState("Daily"),[g,y]=m.useState("Daily"),[x,N]=m.useState("Daily"),[j,k]=m.useState("Daily"),[S,M]=m.useState(!1),[A,I]=m.useState(!1),[U,$]=m.useState(!1),[L,E]=m.useState(!1),[O,D]=m.useState(null),[T,C]=m.useState(null),[_,z]=m.useState(null),[H,P]=m.useState(null),[B,q]=m.useState(null),[G,se]=m.useState(void 0),[re,Z]=m.useState(void 0),[R,ee]=m.useState(void 0),[J,F]=m.useState(void 0),[K,ne]=m.useState(void 0),[ce,ge]=m.useState(void 0),[ve,Ae]=m.useState(void 0),[Te,tt]=m.useState(void 0),[ht,Le]=m.useState([]),[Oe,Ge]=m.useState([]),[Je,ot]=m.useState(0),[Ot,zt]=m.useState([]),[ae,me]=m.useState([]),[ze,X]=m.useState(0),[le,W]=m.useState(0),[te,ue]=m.useState(0),[Ne,Se]=m.useState(0),[he,Pe]=m.useState(0),[Me,Fe]=m.useState(!1),[bt,fe]=m.useState(!1),[Ve,vt]=m.useState({signups:[],logins:[],organizations:[],teams:[],sessions:[]}),[Nt,En]=m.useState([]),[Qe,$t]=m.useState(!1),[lr,qt]=m.useState(0),[Rt,La]=m.useState(0),[hn,Xl]=m.useState(0),[eo,to]=m.useState(0),[nh,rh]=m.useState(0),[qs,no]=m.useState([]),[ql,Fa]=m.useState(0),[Ua,Ba]=m.useState(0),[ro,Gl]=m.useState(0),{counts:rs,loading:cr}=Gu(),ss=Dr(),Wa=["Daily","Weekly","Monthly","Yearly","Custom"],Kl={Daily:"1D",Weekly:"1W",Monthly:"1M",Yearly:"1Y",Custom:"Custom"},sh=m.useMemo(()=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}),[]),as=de=>de==null?"...":sh.format(Number(de)),is=de=>de==null?"...":Number(de).toLocaleString(),so=m.useMemo(()=>Co.reduce((de,pe)=>(de[pe.id]=(Ve[pe.id]||[]).reduce((xe,ie)=>xe+ie,0),de),{}),[Ve]),Ql=m.useMemo(()=>Object.values(so).reduce((de,pe)=>de+pe,0),[so]),ah=(de,pe)=>{const xe=de.currentTarget.getBoundingClientRect();P(pe),q({x:xe.left+xe.width/2,y:xe.top})},ih=(()=>{const de=[];return O!=null&&O.isOutdated?de.push({id:"version-check",title:`Update Better-Auth to v${O.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:""}):O&&de.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:""}),de.push(),de})(),nt=m.useCallback(async(de,pe,xe,ie)=>{try{const be=new URLSearchParams({type:de,period:pe});return xe&&be.append("from",xe.toISOString()),ie&&be.append("to",ie.toISOString()),await(await fetch(`/api/analytics?${be.toString()}`)).json()}catch{return null}},[]);m.useEffect(()=>{(async()=>{try{const xe=await(await fetch("/api/users/all")).json();xe!=null&&xe.success&&xe.users&&no(xe.users)}catch{no([])}})()},[]),m.useEffect(()=>{(async()=>{try{const xe=await(await fetch("/api/stats")).json();xe&&a(xe.activeUsers||0)}catch{a(0)}})()},[]),m.useEffect(()=>{(async()=>{const pe=await nt("users",l,G,re);pe&&(Le(pe.data||[]),Ge(pe.labels||[]),ot(pe.percentageChange||0))})()},[l,G,re,nt]),m.useEffect(()=>{if(qs.length===0){Fa(0),Ba(0);return}const de=new Date;let pe,xe=de,ie,be;if(g==="Custom"){if(!R||!J){Fa(0),Ba(0);return}pe=new Date(R),xe=new Date(J),xe.setHours(23,59,59,999);const Ut=xe.getTime()-pe.getTime();be=new Date(pe.getTime()-1),ie=new Date(be.getTime()-Ut)}else switch(g){case"Daily":pe=new Date(de),pe.setHours(0,0,0,0),be=new Date(pe.getTime()-1),ie=new Date(be.getTime()-24*60*60*1e3);break;case"Weekly":pe=new Date(de),pe.setDate(de.getDate()-de.getDay()),pe.setHours(0,0,0,0),be=new Date(pe.getTime()-1),ie=new Date(be.getTime()-7*24*60*60*1e3);break;case"Monthly":pe=new Date(de.getFullYear(),de.getMonth(),1),pe.setHours(0,0,0,0),be=new Date(pe.getTime()-1),ie=new Date(de.getFullYear(),de.getMonth()-1,1),ie.setHours(0,0,0,0);break;case"Yearly":pe=new Date(de.getFullYear(),0,1),pe.setHours(0,0,0,0),be=new Date(pe.getTime()-1),ie=new Date(de.getFullYear()-1,0,1),ie.setHours(0,0,0,0);break;default:Fa(0),Ba(0);return}const _e=qs.filter(Ut=>{if(!Ut.createdAt)return!1;const os=new Date(Ut.createdAt);return os>=pe&&os<=xe}),je=qs.filter(Ut=>{if(!Ut.createdAt)return!1;const os=new Date(Ut.createdAt);return os>=ie&&os<=be}),we=_e.length,Ue=je.length;let tn=0;Ue>0?tn=(we-Ue)/Ue*100:we>0&&(tn=100),Fa(we),Ba(tn)},[qs,g,R,J]),m.useEffect(()=>{(async()=>{if(!(d==="Custom"&&(!R||!J))){$t(!0);try{const[pe,xe,ie,be,_e]=await Promise.all([nt("newUsers",d,R,J),nt("activeUsers",d,R,J),nt("organizations",d,R,J),nt("teams",d,R,J),nt("sessions",d,R,J)]);pe&&(zt(pe.data||[]),me(pe.labels||[])),vt({signups:(pe==null?void 0:pe.data)||[],logins:(xe==null?void 0:xe.data)||[],organizations:(ie==null?void 0:ie.data)||[],teams:(be==null?void 0:be.data)||[],sessions:(_e==null?void 0:_e.data)||[]}),En((pe==null?void 0:pe.labels)||(xe==null?void 0:xe.labels)||(ie==null?void 0:ie.labels)||(be==null?void 0:be.labels)||(_e==null?void 0:_e.labels)||[])}finally{$t(!1)}}})()},[d,R,J,nt]),m.useEffect(()=>{(async()=>{const pe=await nt("activeUsers","1D");pe&&X(pe.percentageChange||0)})()},[nt]),m.useEffect(()=>{},[rs.organizations,rs.teams,cr]),m.useEffect(()=>{(async()=>{const pe=Kl[x]||"1D",xe=pe==="Custom";if(!(xe&&(!K||!ce))){Fe(!0);try{const ie=await nt("organizations",pe,xe?K:void 0,xe?ce:void 0);ie&&(Se(ie.total||0),W(ie.percentageChange||0))}catch{Se(0),W(0)}finally{Fe(!1)}}})()},[x,K,ce,nt]),m.useEffect(()=>{(async()=>{const pe=Kl[j]||"1D",xe=pe==="Custom";if(!(xe&&(!ve||!Te))){fe(!0);try{const ie=await nt("teams",pe,xe?ve:void 0,xe?Te:void 0);ie&&(Pe(ie.total||0),ue(ie.percentageChange||0))}catch{Pe(0),ue(0)}finally{fe(!1)}}})()},[j,ve,Te,nt]),m.useEffect(()=>{(async()=>{const pe=await nt("users","1D");pe&&qt(pe.percentageChange||0);const xe=await nt("organizations","1D");xe&&La(xe.percentageChange||0);const ie=await nt("activeUsers","1D");ie&&Xl(ie.percentageChange||0);const[be,_e,je,we,Ue]=await Promise.all([nt("newUsers","1D"),nt("activeUsers","1D"),nt("organizations","1D"),nt("teams","1D"),nt("sessions","1D")]);be?(o(be.total||0),Gl(be.percentageChange||0)):(o(0),Gl(0));const Ut=[(be==null?void 0:be.total)||0,(_e==null?void 0:_e.total)||0,(je==null?void 0:je.total)||0,(we==null?void 0:we.total)||0,(Ue==null?void 0:Ue.total)||0].reduce((Ks,dh)=>Ks+dh,0);rh(Ut);const io=[(be==null?void 0:be.previousTotal)||0,(_e==null?void 0:_e.previousTotal)||0,(je==null?void 0:je.previousTotal)||0,(we==null?void 0:we.previousTotal)||0,(Ue==null?void 0:Ue.previousTotal)||0].reduce((Ks,dh)=>Ks+dh,0);if(io>0){const Ks=(Ut-io)/io*100;to(Ks)}else Ut>0?to(100):to(0)})()},[nt]),m.useEffect(()=>{(async()=>{try{const xe=await(await fetch("/api/version-check")).json();xe&&D({current:xe.current||"1.0.0",latest:xe.latest||"1.0.0",isOutdated:xe.isOutdated||!1})}catch{try{const be=(await(await fetch("/api/package-info")).json()).betterAuthVersion||"1.0.0",_e="1.5.0";D({current:be,latest:_e,isOutdated:be!==_e})}catch{D({current:"1.0.0",latest:"1.5.0",isOutdated:!0})}}})()},[]);const Zl=de=>{switch(de){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"}},Jl=de=>{switch(de){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"}},oh=de=>{f(de),w(!0)},ao=()=>{w(!1),setTimeout(()=>f(null),300)},Gs=(de,pe="users")=>{const xe=pe==="users"?Oe:ae,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[de]||7;if(xe&&xe.length>0&&xe.length===be)return de==="1D"?xe.filter((je,we)=>we%4===0).map(je=>{const we=parseInt(je.replace("h",""),10);return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):de==="1W"?xe.map(je=>je.length>3?je.substring(0,3):je):de==="1M"?xe.map(je=>{const we=je.split(" ");return we.length>=2?we[1]:je}):de==="1Y"||de==="3M"||de==="6M"?xe.map(je=>je.length>3?je.substring(0,3):je):xe.map(je=>je.length>3?je.substring(0,3):je);const _e=new Date;switch(de){case"1D":return["12am","4am","8am","12pm","4pm","8pm"];case"1W":return Array.from({length:7},(je,we)=>new Date(_e.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"short"}));case"1M":return Array.from({length:30},(je,we)=>new Date(_e.getTime()-(29-we)*24*60*60*1e3).getDate().toString());case"3M":return Array.from({length:3},(je,we)=>new Date(_e.getFullYear(),_e.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"short"}));case"6M":return Array.from({length:6},(je,we)=>new Date(_e.getFullYear(),_e.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"short"}));case"1Y":return Array.from({length:12},(je,we)=>new Date(_e.getFullYear(),_e.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"short"}));case"ALL":return Array.from({length:7},(je,we)=>new Date(_e.getFullYear(),_e.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"short"}));default:return["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]}},lh=(de,pe="users")=>{const xe=pe==="users"?Oe:ae,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[de]||7;if(xe&&xe.length>0&&xe.length===be)return de==="1D"?xe.map(je=>{const we=parseInt(je.replace("h",""),10);return we===0?"12am":we<12?`${we}am`:we===12?"12pm":`${we-12}pm`}):de==="1Y"||de==="3M"||de==="6M"?xe.map(je=>{const we=["January","February","March","April","May","June","July","August","September","October","November","December"],tn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(je);return tn!==-1?we[tn]:je}):xe;const _e=new Date;switch(de){case"1D":return Array.from({length:24},(je,we)=>{const Ue=new Date;return Ue.setHours(we,0,0,0),Ue.toLocaleTimeString("en-US",{hour:"numeric",hour12:!0})});case"1W":return Array.from({length:7},(je,we)=>new Date(_e.getTime()-(6-we)*24*60*60*1e3).toLocaleDateString("en-US",{weekday:"long"}));case"1M":return Array.from({length:30},(je,we)=>{const Ue=new Date(_e.getTime()-(29-we)*24*60*60*1e3),tn=Ue.toLocaleDateString("en-US",{month:"short"}),Ut=Ue.getDate();return`${tn} ${Ut}`});case"3M":return Array.from({length:3},(je,we)=>new Date(_e.getFullYear(),_e.getMonth()-(2-we),1).toLocaleDateString("en-US",{month:"long"}));case"6M":return Array.from({length:6},(je,we)=>new Date(_e.getFullYear(),_e.getMonth()-(5-we),1).toLocaleDateString("en-US",{month:"long"}));case"1Y":return Array.from({length:12},(je,we)=>new Date(_e.getFullYear(),_e.getMonth()-(11-we),1).toLocaleDateString("en-US",{month:"long"}));case"ALL":return Array.from({length:7},(je,we)=>new Date(_e.getFullYear(),_e.getMonth()-(6-we),1).toLocaleDateString("en-US",{month:"long"}));default:return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},ch=(de,pe="users")=>{const xe=pe==="users"?ht:Ot,be={"1D":24,"1W":7,"1M":30,"3M":3,"6M":6,"1Y":12,ALL:7}[de]||7;if(!xe||xe.length===0)return Array(be).fill(0);const _e=[...xe];for(;_e.length<be;)_e.push(0);const je=_e.slice(0,be),we=Math.max(...je,1);return je.map(Ue=>Ue/we*100)},ec=()=>{const de=Nt.length>0?Nt:Gs(d,"users"),pe=de.map((ie,be)=>Co.reduce((_e,je)=>{var we;return _e+(((we=Ve[je.id])==null?void 0:we[be])??0)},0)),xe=Math.max(...pe,1);return 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:cr?"...":as(rs.users)}),s.jsxs("div",{className:`flex items-center gap-1 ${lr>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${lr<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(lr).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(Ln,{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:cr?"...":as(rs.organizations)}),s.jsxs("div",{className:`flex items-center gap-1 ${Rt>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${Rt<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(Rt).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(gw,{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:cr?"...":as(rs.sessions)}),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(pw,{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:"Activity Hits"}),s.jsx("span",{className:"text-white text-lg font-medium",children:cr?"...":as(nh??0)}),s.jsxs("div",{className:`flex items-center gap-1 ${eo>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${eo<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(eo).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:cr?"...":as(i??0)}),s.jsxs("div",{className:`flex items-center gap-1 ${ro>=0?"text-green-500":"text-red-500"}`,children:[s.jsx("svg",{className:`w-3 h-3 ${ro<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(ro).toFixed(1),"%"]})]})]})]})]})}),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(ie=>s.jsx("button",{onClick:()=>c(ie),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${l===ie?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ie},ie))})]}),s.jsxs("div",{className:"flex justify-between items-end mb-6",children:[s.jsx("p",{className:"text-4xl text-white font-light",children:cr?"...":as(rs.users)}),s.jsxs("div",{className:"flex items-center gap-1 px-2 py-1",children:[s.jsx("svg",{className:`w-3 h-3 ${Je>=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 ${Je>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Je).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:ch(l,"users").map((ie,be)=>{const _e=T===be;return s.jsx("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group",style:{height:`${ie}%`,background:"url(#usersBarGradient)"},onMouseEnter:je=>{const we=je.currentTarget.getBoundingClientRect(),Ue=we.left+we.width/2,tn=we.top,Ut=150,os=60,io=Math.max(Ut/2,Math.min(window.innerWidth-Ut/2,Ue)),Ks=Math.max(os+10,Math.min(window.innerHeight-10,tn));C(be),z({x:io,y:Ks})},onMouseLeave:()=>{C(null),z(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:_e?1:.8}})},be)})}),T!==null&&_&&s.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${_.x}px`,top:`${_.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:lh(l,"users")[T]}),s.jsxs("div",{className:"text-sm text-white font-sans font-medium",children:[ht[T]!==void 0?ht[T].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:Gs(l,"users").map((ie,be)=>s.jsx("span",{className:"flex-1 text-center truncate",children:ie},be))})]})]}),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.jsxs("div",{children:[s.jsx("h3",{className:"text-sm text-white uppercase font-light",children:"Activity Hits"}),s.jsx("p",{className:"text-4xl text-white font-light mt-1",children:Qe?"...":is(Ql)}),s.jsx("p",{className:"text-xs text-gray-400",children:"Tracked events in selected period"})]}),s.jsx("div",{className:"flex items-center space-x-1 overflow-x-auto",children:["1D","1W","1M","3M","6M","1Y","ALL"].map(ie=>s.jsx("button",{onClick:()=>h(ie),className:`px-2 py-1 text-xs font-light transition-colors whitespace-nowrap ${d===ie?"bg-white/20 text-white border border-white/30":"text-gray-500 hover:text-white"}`,children:ie},ie))})]}),s.jsxs("div",{className:"space-y-2 relative",children:[s.jsx("div",{className:"h-40 flex items-end gap-1",children:de.map((ie,be)=>{const _e=pe[be]||0;return s.jsx("div",{className:"flex-1 flex flex-col justify-end gap-[1px] h-full cursor-pointer",onMouseEnter:je=>ah(je,be),onMouseLeave:()=>{P(null),q(null)},children:Co.map(je=>{var tn;const we=((tn=Ve[je.id])==null?void 0:tn[be])??0,Ue=_e===0||xe===0?0:Math.max(we/xe*100,we>0?4:0);return s.jsx("div",{className:`w-full ${je.barClass}`,style:{height:`${Ue}%`}},`${je.id}-${be}`)})},`${ie}-${be}`)})}),Qe&&s.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm flex items-center justify-center text-xs uppercase text-gray-400 pointer-events-none",children:"Loading activity..."}),H!==null&&B&&s.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${B.x}px`,top:`${B.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 min-w-[180px]",children:[s.jsx("div",{className:"text-xs text-gray-400 mb-2 font-mono uppercase",children:de[H]||`Bucket ${H+1}`}),s.jsx("div",{className:"space-y-1",children:Co.map(ie=>{var be;return s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[s.jsx("span",{className:`w-2 h-2 rounded-sm ${ie.dotClass}`}),ie.label]}),s.jsx("span",{className:"text-white font-medium",children:((be=Ve[ie.id])==null?void 0:be[H])??0})]},ie.id)})})]})}),s.jsx("div",{className:`flex justify-between ${d==="1M"?"text-[10px]":"text-xs"} text-gray-500 font-mono`,children:de.map((ie,be)=>s.jsx("span",{className:"flex-1 text-center truncate",children:ie},be))}),s.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3 mt-4 pt-4 border-t border-white/10",children:Co.map(ie=>s.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`w-2 h-2 rounded-sm ${ie.dotClass}`}),ie.label]}),s.jsx("span",{className:"text-white font-medium",children:Qe?"...":is(so[ie.id]||0)})]},ie.id))})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[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:()=>M(!S),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(Rc,{className:"w-3 h-3"}),s.jsx("span",{children:v})]}),S&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Wa.map(ie=>s.jsx("button",{onClick:()=>{b(ie),M(!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:ie},ie))})]}),v==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yn,{className:"mr-1 h-3 w-3"}),G?An(G,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:G,onSelect:se,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yn,{className:"mr-1 h-3 w-3"}),re?An(re,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:re,onSelect:Z,initialFocus:!0,disabled:ie=>G?ie<G:!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",children:is(r)}),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 ${ze>=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 ${ze>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(ze).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:()=>I(!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(Rc,{className:"w-3 h-3"}),s.jsx("span",{children:g})]}),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:Wa.map(ie=>s.jsx("button",{onClick:()=>{y(ie),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:ie},ie))})]}),g==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yn,{className:"mr-1 h-3 w-3"}),R?An(R,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:R,onSelect:ee,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yn,{className:"mr-1 h-3 w-3"}),J?An(J,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:J,onSelect:F,initialFocus:!0,disabled:ie=>R?ie<R:!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",children:is(ql)}),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 ${Ua>=0?"text-green-500":"text-red-500 rotate-180"}`,viewBox:"0 0 12 12",fill:"currentColor",style:Ua<0?{transform:"rotate(180deg)"}:{},children:s.jsx("path",{d:"M6 0 L12 12 L0 12 Z"})}),s.jsxs("span",{className:`text-xs font-medium ${Ua>=0?"text-green-500":"text-red-500"}`,children:[Math.abs(Ua).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:()=>$(!U),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(Rc,{className:"w-3 h-3"}),s.jsx("span",{children:x})]}),U&&s.jsx("div",{className:"absolute top-6 left-0 w-[150px] z-10 bg-black border border-white/10 rounded-none shadow-lg",children:Wa.map(ie=>s.jsx("button",{onClick:()=>{N(ie),$(!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:ie},ie))})]}),x==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yn,{className:"mr-1 h-3 w-3"}),K?An(K,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:K,onSelect:ne,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yn,{className:"mr-1 h-3 w-3"}),ce?An(ce,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:ce,onSelect:ge,initialFocus:!0,disabled:ie=>K?ie<K:!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",children:Me?"...":is(Ne)}),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 ${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:"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:()=>E(!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(Rc,{className:"w-3 h-3"}),s.jsx("span",{children:j})]}),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:Wa.map(ie=>s.jsx("button",{onClick:()=>{k(ie),E(!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:ie},ie))})]}),j==="Custom"&&s.jsxs("div",{className:"h-0 flex items-center gap-2",children:[s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yn,{className:"mr-1 h-3 w-3"}),ve?An(ve,"MMM dd yyyy"):"From"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:ve,onSelect:Ae,initialFocus:!0,className:"rounded-none"})})]}),s.jsxs(zn,{children:[s.jsx($n,{asChild:!0,children:s.jsxs(Y,{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(Yn,{className:"mr-1 h-3 w-3"}),Te?An(Te,"MMM dd yyyy"):"To"]})}),s.jsx(pn,{className:"w-auto p-0 bg-black border-white/10",children:s.jsx(On,{mode:"single",selected:Te,onSelect:tt,initialFocus:!0,disabled:ie=>ve?ie<ve:!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",children:bt?"...":is(he)}),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 ${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 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(Mn,{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:ih.map((ie,be)=>s.jsx("div",{onClick:()=>oh(ie),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 ${be*.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:ie.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 ${Zl(ie.severity)}`,children:ie.severity}),s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 border rounded-sm capitalize font-mono ${Jl(ie.status)}`,children:ie.status})]})]}),s.jsx(OP,{className:"w-3.5 h-3.5 text-gray-500 group-hover:text-white transition-all flex-shrink-0 mt-0.5"})]})},ie.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"?ec():e==="users"?s.jsx(ck,{}):e==="organizations"?s.jsx(lk,{}):ec()}),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(gw,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-lg text-white font-light",children:"Quick Actions"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{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(ws,{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(Ln,{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(ws,{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(pw,{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(ws,{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(ws,{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(tk,{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(ws,{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(J2,{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(ws,{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(Y,{variant:"ghost",size:"sm",onClick:()=>n(!1),className:"text-gray-400 hover:text-white rounded-none",children:"Close"})]})})]})}),p&&u&&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:ao,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:de=>de.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(Mn,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light",children:u.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 ${Zl(u.severity)}`,children:[u.severity," Severity"]}),s.jsx("span",{className:`text-xs px-2 py-1 border rounded-none capitalize ${Jl(u.status)}`,children:u.status}),u.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:u.cve})]})]}),s.jsx("button",{onClick:ao,className:"p-2 hover:bg-white/10 transition-colors rounded-none",children:s.jsx(Kt,{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(u.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"}),u.description.includes("npm install")?s.jsxs("div",{children:[s.jsx("p",{className:"text-white leading-relaxed mb-3",children:u.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"),V.success("Command copied to clipboard")},className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-white/10 rounded",title:"Copy command",children:s.jsx(Xm,{className:"w-4 h-4 text-gray-400 hover:text-white"})})]})})})]}):s.jsx("p",{className:"text-white leading-relaxed",children:u.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:u.affectedComponents.map((de,pe)=>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 ${pe*.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:de})]},pe))})]}),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:[u.status==="applied"&&s.jsxs(s.Fragment,{children:[s.jsx(Fx,{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."})]})]}),u.status==="scheduled"&&s.jsxs(s.Fragment,{children:[s.jsx(ek,{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."})]})]}),u.status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(tF,{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(Y,{variant:"ghost",onClick:ao,className:"text-gray-400 hover:text-white rounded-none",children:"Close"})})]})]})}),s.jsx("style",{children:`
421
- @keyframes fadeIn {
422
- from {
423
- opacity: 0;
424
- }
425
- to {
426
- opacity: 1;
427
- }
428
- }
429
-
430
- @keyframes slideUp {
431
- from {
432
- opacity: 0;
433
- transform: translateY(20px);
434
- }
435
- to {
436
- opacity: 1;
437
- transform: translateY(0);
438
- }
439
- }
440
-
441
- @keyframes slideIn {
442
- from {
443
- opacity: 0;
444
- transform: translateX(-10px);
445
- }
446
- to {
447
- opacity: 1;
448
- transform: translateX(0);
449
- }
450
- }
451
-
452
- .custom-scrollbar::-webkit-scrollbar {
453
- width: 6px;
454
- }
455
-
456
- .custom-scrollbar::-webkit-scrollbar-track {
457
- background: rgba(255, 255, 255, 0.05);
458
- }
459
-
460
- .custom-scrollbar::-webkit-scrollbar-thumb {
461
- background: rgba(255, 255, 255, 0.2);
462
- border-radius: 3px;
463
- }
464
-
465
- .custom-scrollbar::-webkit-scrollbar-thumb:hover {
466
- background: rgba(255, 255, 255, 0.3);
467
- }
468
- `})]})}const _n=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:De("rounded-lg border border-gray-700 bg-gray-900 text-white shadow-sm",e),...t}));_n.displayName="Card";const Dn=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:De("flex flex-col space-y-1.5 p-6",e),...t}));Dn.displayName="CardHeader";const Tn=m.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:De("text-2xl font-semibold leading-none tracking-tight text-white",e),...t}));Tn.displayName="CardTitle";const fr=m.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:De("text-sm text-gray-300",e),...t}));fr.displayName="CardDescription";const Pn=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:De("p-6 pt-0",e),...t}));Pn.displayName="CardContent";const jF=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:De("flex items-center p-6 pt-0",e),...t}));jF.displayName="CardFooter";const kF={databaseSchemaNode:Um},Sw=[{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 SF(){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]=tP([]),[p,w,v]=nP([]),b=m.useCallback(k=>{const S=Sw.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 A of M)if(k===A||k.includes(A))return A;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(A=>({name:A.id,displayName:A.name||A.id,description:A.description||`${A.id} plugin for Better Auth`,color:b(A.id)}));d(M),l(M.map(A=>A.name))}}catch{d(Sw),l(["organization"])}},[b]),x=m.useCallback(async k=>{try{r(!0);const S=k.length>0?`?plugins=${k.join(",")}`:"",A=await(await fetch(`/api/database/schema${S}`)).json();A.success?t(A.schema):i(A.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,A)=>{const I=M.fields.map(U=>({id:`${M.name}-${U.name}`,isPrimary:U.primaryKey||!1,isNullable:!U.required,isUnique:U.unique||!1,isIdentity:!1,name:U.name,format:U.type,plugin:g(M.name,U.name,o)}));k.push({id:M.name,type:"databaseSchemaNode",position:{x:A%3*380,y:Math.floor(A/3)*320},data:{name:M.name,displayName:M.displayName,isForeign:!1,plugin:g(M.name,"",o),columns:I.map(U=>{var $;return{...U,description:(($=M.fields.find(L=>L.name===U.name))==null?void 0:$.description)||""}}),relationships:M.relationships}})}),e.tables.forEach(M=>{M.relationships.forEach(A=>{if(A.type==="many-to-one")return;const I=M.name,U=A.target,$=k.find(E=>E.id===I),L=k.find(E=>E.id===U);if($&&L){const E=A.type==="one-to-one"?"1:1":"1:N";S.push({id:`${I}-${U}-${A.field}`,source:I,target:U,type:"smoothstep",animated:!1,style:{stroke:"#6b7280",strokeWidth:2,strokeDasharray:"0"},label:E,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 N=m.useCallback(k=>w(S=>Y1(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 j=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(lt,{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(Dn,{children:s.jsxs(Tn,{className:"font-light text-xl text-white flex items-center space-x-2",children:[s.jsx(bi,{className:"w-5 h-5"}),s.jsx("span",{children:"Plugins"})]})}),s.jsx(Pn,{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(Dn,{children:s.jsx(Tn,{className:"text-white text-sm",children:"Schema Info"})}),s.jsxs(Pn,{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(eP,{nodes:h,edges:p,onNodesChange:f,onEdgesChange:v,onConnect:N,nodeTypes:kF,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(EP,{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(oP,{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(lt,{className:"w-16 h-16 text-white opacity-50"}),s.jsx(VP,{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:j})]})}const CF=u2("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 at({className:e,variant:t,...n}){return s.jsx("div",{className:De(CF({variant:t}),e),...n})}function EF(){const{orgId:e}=qp(),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),[b,g]=m.useState(!1),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(!1),[M,A]=m.useState(!1),[I,U]=m.useState(!1),[$,L]=m.useState(!1),[E,O]=m.useState(null),[D,T]=m.useState(""),[C,_]=m.useState(""),[z,H]=m.useState([]),[P,B]=m.useState({name:""}),[q,G]=m.useState(!1),[se,re]=m.useState([]),[Z,R]=m.useState(!1),[ee,J]=m.useState([]),[F,K]=m.useState(!1);m.useEffect(()=>{e&&(ce(),ve(),ge(),Te(),tt(),Ae())},[e]),m.useEffect(()=>{w&&e&&Ae()},[]),m.useEffect(()=>{f==="members"&&e&&tt()},[f,e]),m.useEffect(()=>{f==="invitations"&&e&&Te()},[f,e]);const ne=W=>{B({name:W})},ce=async()=>{try{const te=await(await fetch(`/api/organizations/${e}`)).json();te.success&&te.organization||te.organization?r(te.organization):V.error("Organization not found")}catch(W){console.error("Failed to fetch organization:",W),V.error("Failed to load organization")}finally{u(!1)}},ge=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)}},ve=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)}},Ae=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),V.error("Failed to load teams")}},Te=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),V.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),V.error("Failed to load members")}},ht=async W=>{re([]),R(!0),re([{id:"start",type:"info",message:`Starting member seeding process for ${W} members...`,timestamp:new Date}]);try{const ue=await(await fetch(`/api/organizations/${e}/seed-members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(ue.success){const Ne=ue.results.map((he,Pe)=>he.success?{id:`member-${Pe}`,type:"progress",message:`Adding member: ${he.member.user.name} (${he.member.user.email})`,timestamp:new Date,status:"completed"}:{id:`member-${Pe}`,type:"error",message:`Failed to add member ${Pe+1}: ${he.error}`,timestamp:new Date});re(he=>[...he,...Ne]);const Se=ue.results.filter(he=>he.success).length;re(he=>[...he,{id:"complete",type:"success",message:`✅ Seeding completed! Added ${Se}/${W} members successfully`,timestamp:new Date}]),await tt(),V.success(`Successfully added ${Se} members!`)}else re(Ne=>[...Ne,{id:"error",type:"error",message:`❌ Seeding failed: ${ue.error||"Unknown error"}`,timestamp:new Date}]),V.error(ue.error||"Failed to seed members")}catch(te){re(ue=>[...ue,{id:"error",type:"error",message:`❌ Network error: ${te}`,timestamp:new Date}]),V.error("Failed to seed members")}finally{R(!1)}},Le=async W=>{J([]),K(!0),J([{id:"start",type:"info",message:`Starting team seeding process for ${W} teams...`,timestamp:new Date}]);try{const ue=await(await fetch(`/api/organizations/${e}/seed-teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:W})})).json();if(ue.success){const Ne=ue.results.map((he,Pe)=>he.success?{id:`team-${Pe}`,type:"progress",message:`Creating team: ${he.team.name}`,timestamp:new Date,status:"completed"}:{id:`team-${Pe}`,type:"error",message:`Failed to create team ${Pe+1}: ${he.error}`,timestamp:new Date});J(he=>[...he,...Ne]);const Se=ue.results.filter(he=>he.success).length;J(he=>[...he,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${Se}/${W} teams successfully`,timestamp:new Date}]),await Ae(),V.success(`Successfully created ${Se} teams!`)}else J(Ne=>[...Ne,{id:"error",type:"error",message:`❌ Seeding failed: ${ue.error||"Unknown error"}`,timestamp:new Date}]),V.error(ue.error||"Failed to seed teams")}catch(te){J(ue=>[...ue,{id:"error",type:"error",message:`❌ Network error: ${te}`,timestamp:new Date}]),V.error("Failed to seed teams")}finally{K(!1)}},Oe=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=()=>{Oe(),x(!0)},Je=async()=>{if(!D){V.error("Please enter an email address");return}if(!C){V.error("Please select an inviter");return}G(!0);const W=V.loading("Sending invitation...");try{const ue=await(await fetch(`/api/organizations/${e}/invitations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:D,role:"member",inviterId:C})})).json();ue.success?(await Te(),x(!1),T(""),_(""),V.success("Invitation sent successfully!",{id:W})):V.error(`Error sending invitation: ${ue.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error sending invitation:",te),V.error("Error sending invitation",{id:W})}finally{G(!1)}},ot=async W=>{const te=V.loading("Cancelling invitation...");try{const Ne=await(await fetch(`/api/invitations/${W}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Ne.success?(await Te(),V.success("Invitation cancelled successfully!",{id:te})):V.error(`Error cancelling invitation: ${Ne.error||"Unknown error"}`,{id:te})}catch(ue){console.error("Error cancelling invitation:",ue),V.error("Error cancelling invitation",{id:te})}},Ot=async(W,te)=>{const ue=V.loading("Resending invitation...");try{const Se=await(await fetch(`/api/invitations/${W}/resend`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();Se.success?(await Te(),V.success(`Invitation resent to ${te}!`,{id:ue})):V.error(`Error resending invitation: ${Se.error||"Unknown error"}`,{id:ue})}catch(Ne){console.error("Error resending invitation:",Ne),V.error("Error resending invitation",{id:ue})}},zt=async(W,te)=>{const ue=V.loading(`Removing ${te}...`);try{const Se=await(await fetch(`/api/members/${W}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();Se.success?(await tt(),V.success(`${te} removed from organization!`,{id:ue})):V.error(`Error removing member: ${Se.error||"Unknown error"}`,{id:ue})}catch(Ne){console.error("Error removing member:",Ne),V.error("Error removing member",{id:ue})}},ae=async()=>{if(!P.name){V.error("Please enter a team name");return}const W=V.loading("Creating team...");try{const ue=await(await fetch(`/api/organizations/${e}/teams`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name,organizationId:e})})).json();ue.success?(await Ae(),A(!1),B({name:""}),V.success("Team created successfully!",{id:W})):V.error(`Error creating team: ${ue.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error creating team:",te),V.error("Error creating team",{id:W})}},me=async()=>{if(!E||!P.name){V.error("Please enter a team name");return}const W=V.loading("Updating team...");try{const ue=await(await fetch(`/api/teams/${E.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:P.name})})).json();ue.success?(await Ae(),U(!1),O(null),B({name:""}),V.success("Team updated successfully!",{id:W})):V.error(`Error updating team: ${ue.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error updating team:",te),V.error("Error updating team",{id:W})}},ze=async()=>{if(!E){V.error("No team selected");return}const W=V.loading("Deleting team...");try{const ue=await(await fetch(`/api/teams/${E.id}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();ue.success?(await Ae(),L(!1),O(null),V.success("Team deleted successfully!",{id:W})):V.error(`Error deleting team: ${ue.error||"Unknown error"}`,{id:W})}catch(te){console.error("Error deleting team:",te),V.error("Error deleting team",{id:W})}},X=W=>{O(W),B({name:W.name}),U(!0)},le=W=>{O(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(ca,{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(Y,{onClick:()=>j(!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(Y,{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(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Ca,{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(Ln,{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(Ln,{className:"w-4 h-4"}),s.jsxs("span",{className:"inline-flex items-start",children:["Details",s.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(Nr,{value:0,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),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.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(Nr,{value:c.length,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),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.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(Nr,{value:o.length,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]}),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.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(Nr,{value:a.length,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),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(Yn,{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(Y,{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(Y,{onClick:()=>A(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Yo,{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(Y,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:te=>{te.stopPropagation(),X(W)},children:[s.jsx(Ca,{className:"w-4 h-4 mr-1"}),"Edit"]}),s.jsxs(Y,{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(cd,{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(Y,{onClick:()=>A(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Yo,{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(Y,{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(at,{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(Y,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>zt(W.id,W.user.name),children:[s.jsx(cd,{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(Y,{onClick:()=>j(!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(Y,{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(at,{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(ek,{className:"w-3 h-3"}),W.status==="accepted"&&s.jsx(Fx,{className:"w-3 h-3"}),W.status==="expired"&&s.jsx(Kt,{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(Y,{variant:"outline",size:"sm",className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>Ot(W.id,W.email),children:[s.jsx(xw,{className:"w-4 h-4 mr-1"}),"Resend"]}),s.jsxs(Y,{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(cd,{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(Y,{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(Y,{variant:"ghost",size:"sm",onClick:()=>{x(!1),T(""),_("")},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"invite-email",className:"text-sm text-gray-400 font-light",children:"Email Address"}),s.jsx(Ie,{id:"invite-email",type:"email",value:D,onChange:W=>T(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(He,{htmlFor:"inviter-select",className:"text-sm text-gray-400 font-light",children:"Inviter"}),s.jsxs(pa,{value:C,onValueChange:_,children:[s.jsx(xa,{children:s.jsx(Vx,{placeholder:"Select an inviter..."})}),s.jsx(ga,{children:z.map(W=>s.jsx(sn,{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(Y,{variant:"outline",onClick:()=>{x(!1),T(""),_("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsxs(Y,{onClick:Je,disabled:q,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none disabled:opacity-50",children:[q?s.jsx(ca,{className:"w-3 h-3 mr-2 animate-spin"}):s.jsx(xw,{className:"w-4 h-4 mr-2"}),q?"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(Y,{variant:"ghost",size:"sm",onClick:()=>{A(!1),B({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{children:[s.jsx(He,{htmlFor:"team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),s.jsx(Ie,{id:"team-name",value:P.name,onChange:W=>ne(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(Y,{variant:"outline",onClick:()=>{A(!1),B({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ae,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Create Team"})]})]})}),I&&E&&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(Y,{variant:"ghost",size:"sm",onClick:()=>{U(!1),B({name:""})},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{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:E.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",E.id]})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),s.jsx(Ie,{id:"edit-team-name",value:P.name,onChange:W=>ne(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(Y,{variant:"outline",onClick:()=>{U(!1),B({name:""})},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:me,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update Team"})]})]})}),$&&E&&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(Y,{variant:"ghost",size:"sm",onClick:()=>L(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{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:E.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["Team ID: ",E.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(Y,{variant:"outline",onClick:()=>L(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:ze,className:"bg-red-600 hover:bg-red-700 text-white border border-red-600 rounded-none",children:"Delete Team"})]})]})}),N&&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(Y,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{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(He,{htmlFor:"member-count",className:"text-sm text-gray-400 font-light",children:"Number of members to add"}),s.jsx(Ie,{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(Y,{onClick:()=>{var te;const W=parseInt(((te=document.getElementById("member-count"))==null?void 0:te.value)||"5");ht(W)},disabled:Z,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:Z?s.jsxs(s.Fragment,{children:[s.jsx(ca,{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"]})})]})]}),se.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Member Seeding Terminal",lines:se,isRunning:Z,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(Y,{variant:"outline",onClick:()=>j(!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(Y,{variant:"ghost",size:"sm",onClick:()=>S(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{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(Ln,{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(He,{htmlFor:"team-count",className:"text-sm text-gray-400 font-light",children:"Number of teams to create"}),s.jsx(Ie,{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(Y,{onClick:()=>{var te;const W=parseInt(((te=document.getElementById("team-count"))==null?void 0:te.value)||"3");Le(W)},disabled:F,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:F?s.jsxs(s.Fragment,{children:[s.jsx(ca,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ln,{className:"w-3 h-3 mr-2"}),"Seed Teams"]})})]})]}),ee.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Team Seeding Terminal",lines:ee,isRunning:F,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(Y,{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(Gp,{to:"/organizations",children:s.jsxs(Y,{variant:"ghost",className:"text-gray-400 hover:text-white rounded-none",children:[s.jsx(KL,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})})}),s.jsx("br",{}),s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ln,{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 MF(){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),[b,g]=m.useState(!1),[y,x]=m.useState(null),[N,j]=m.useState([]),[k,S]=m.useState(!1),M=m.useCallback(async()=>{try{const _=await(await fetch("/api/sessions")).json();t(_.sessions||[])}catch{}finally{r(!1)}},[]);m.useEffect(()=>{M()},[M]);const A=async C=>{j([]),S(!0),j([{id:"start",type:"info",message:`Starting session seeding process for ${C} sessions...`,timestamp:new Date}]);try{const z=await(await fetch("/api/seed/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:C})})).json();if(z.success){const H=z.results.map((B,q)=>B.success?{id:`session-${q}`,type:"progress",message:`Creating session: ${B.session.id}`,timestamp:new Date,status:"completed"}:{id:`session-${q}`,type:"error",message:`Failed to create session ${q+1}: ${B.error}`,timestamp:new Date});j(B=>[...B,...H]);const P=z.results.filter(B=>B.success).length;j(B=>[...B,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${P}/${C} sessions successfully`,timestamp:new Date}]),await M()}else j(H=>[...H,{id:"error",type:"error",message:`❌ Seeding failed: ${z.error||"Unknown error"}`,timestamp:new Date}])}catch(_){j(z=>[...z,{id:"error",type:"error",message:`❌ Network error: ${_}`,timestamp:new Date}])}finally{S(!1)}},I=async C=>{j([]),S(!0),j([{id:"start",type:"info",message:`Starting account seeding process for ${C} accounts...`,timestamp:new Date}]);try{const z=await(await fetch("/api/seed/accounts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:C})})).json();if(z.success){const H=z.results.map((B,q)=>B.success?{id:`account-${q}`,type:"progress",message:`Creating account: ${B.account.provider}`,timestamp:new Date,status:"completed"}:{id:`account-${q}`,type:"error",message:`Failed to create account ${q+1}: ${B.error}`,timestamp:new Date});j(B=>[...B,...H]);const P=z.results.filter(B=>B.success).length;j(B=>[...B,{id:"complete",type:"success",message:`✅ Seeding completed! Created ${P}/${C} accounts successfully`,timestamp:new Date}]),await M()}else j(H=>[...H,{id:"error",type:"error",message:`❌ Seeding failed: ${z.error||"Unknown error"}`,timestamp:new Date}])}catch(_){j(z=>[...z,{id:"error",type:"error",message:`❌ Network error: ${_}`,timestamp:new Date}])}finally{S(!1)}},U=C=>{x(C),v(!0)},$=C=>{x(C),u(!0)},L=C=>{x(C),p(!0)},E=async C=>{d(!1)},O=async C=>{u(!1)},D=async()=>{p(!1)},T=e.filter(C=>{const _=C.id.toLowerCase().includes(a.toLowerCase())||C.userId.toLowerCase().includes(a.toLowerCase()),z=o==="all"||o==="active"&&new Date(C.expiresAt)>new Date||o==="expired"&&new Date(C.expiresAt)<=new Date;return _&&z});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(Cr,{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(Y,{className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",onClick:()=>g(!0),children:[s.jsx(lt,{className:"w-4 h-4 mr-2"}),"Seed"]}),s.jsxs(Y,{className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",onClick:()=>d(!0),children:[s.jsx(zs,{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(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search sessions...",value:a,onChange:C=>i(C.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(mx,{className:"w-4 h-4 text-gray-400"}),s.jsxs(pa,{value:o,onValueChange:l,children:[s.jsx(xa,{children:s.jsx(Vx,{})}),s.jsxs(ga,{children:[s.jsx(sn,{value:"all",children:"All"}),s.jsx(sn,{value:"active",children:"Active"}),s.jsx(sn,{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:T.map(C=>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(lt,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-white font-light",children:["Session ",C.id.slice(0,8),"..."]}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",C.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:C.userId}),s.jsx("td",{className:"py-4 px-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[new Date(C.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(C.expiresAt)>new Date?"Active":"Expired"})]})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(C.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(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>U(C),children:s.jsx(Ll,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:()=>$(C),children:s.jsx(Ca,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 rounded-none",onClick:()=>L(C),children:s.jsx(px,{className:"w-4 h-4"})})]})})]},C.id))})]})})}),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 Data"}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>g(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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(lt,{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(He,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),s.jsx(Ie,{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(Y,{onClick:()=>{var _;const C=parseInt(((_=document.getElementById("session-count"))==null?void 0:_.value)||"5",10);A(C)},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(Cr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(lt,{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(wv,{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(He,{htmlFor:"account-count",className:"text-sm text-gray-400 font-light",children:"Number of accounts"}),s.jsx(Ie,{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(Y,{onClick:()=>{var _;const C=parseInt(((_=document.getElementById("account-count"))==null?void 0:_.value)||"5",10);I(C)},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(Cr,{className:"w-3 h-3 mr-2 animate-spin"}),"Seeding..."]}):s.jsxs(s.Fragment,{children:[s.jsx(wv,{className:"w-3 h-3 mr-2"}),"Seed Accounts"]})})]})]}),N.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Session Seeding Terminal",lines:N,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(Y,{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(Y,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(He,{htmlFor:"create-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),s.jsx(Ie,{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(He,{htmlFor:"create-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),s.jsx(Ie,{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(Y,{variant:"outline",onClick:()=>d(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:()=>E(),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(Y,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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(lt,{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(He,{htmlFor:"edit-user-id",className:"text-sm text-gray-400 font-light",children:"User ID"}),s.jsx(Ie,{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(He,{htmlFor:"edit-expires",className:"text-sm text-gray-400 font-light",children:"Expires At"}),s.jsx(Ie,{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(Y,{variant:"outline",onClick:()=>u(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:()=>O(),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(Y,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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(lt,{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(Y,{variant:"outline",onClick:()=>p(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:D,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(Y,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Pt,{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(lt,{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(Y,{onClick:()=>v(!1),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Close"})})]})})]})}function _F(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 DF(){var y,x,N,j,k,S,M,A,I,U,$,L,E,O,D,T,C,_,z,H,P,B,q,G,se,re,Z,R,ee;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);_F(J=>{J.type==="config_changed"?setTimeout(()=>{f(),p(),w(),v()},500):J.type});const f=m.useCallback(async()=>{var J;try{const K=await(await fetch("/api/config")).json();(J=K.studio)!=null&&J.version&&u(`v${K.studio.version}`),t(K)}catch{}finally{d(!1)}},[]),p=m.useCallback(async()=>{try{const F=await(await fetch("/api/health")).json();r(F.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 F=await(await fetch("/api/plugins")).json();i(F)}catch{i({plugins:[],configPath:null,totalPlugins:0,error:"Failed to fetch plugins"})}},[]),v=m.useCallback(async()=>{try{const F=await(await fetch("/api/db")).json();l(F)}catch{l({success:!1,name:"unknown",version:"unknown",dialect:"unknown",adapter:"unknown",displayName:"Unknown",autoDetected:!1,message:"Failed to fetch database info"})}},[]),b=J=>{switch(J==null?void 0:J.toLowerCase()){case"postgresql":case"postgres":return s.jsxs(at,{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(at,{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(at,{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(Dc,{className:"w-3 h-3"}),"Local"]});default:return s.jsxs(at,{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(hr,{className:"w-3 h-3"}),"Unknown"]})}};m.useEffect(()=>{f(),p(),w(),v()},[f,v,w,p]);const g=J=>{switch(J.toLowerCase()){case"google":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"github":return s.jsx(Mn,{className:"w-5 h-5 text-white"});case"discord":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"twitter":return s.jsx(Ht,{className:"w-5 h-5 text-white"});default:return s.jsx(Ht,{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(Dn,{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(bi,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Application"})]}),s.jsxs(fr,{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(Pn,{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(Ht,{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(Xd,{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-mono 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(sd,{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(Mn,{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(Dn,{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(lt,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Database"})]}),s.jsxs(fr,{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(Pn,{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(lt,{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())+((N=e==null?void 0:e.database)==null?void 0:N.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)||((j=e==null?void 0:e.database)==null?void 0:j.type))&&b((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(lt,{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:((M=e==null?void 0:e.database)==null?void 0:M.dialect)||(o==null?void 0:o.dialect)})})]}),((A=e==null?void 0:e.database)==null?void 0:A.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(Xd,{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(at,{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(bi,{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(gv,{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(at,{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(hr,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Disabled"]})})]}),!(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(hr,{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(at,{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(Dn,{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(Mn,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Providers"})]}),s.jsxs(fr,{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(Pn,{className:"p-0",children:e!=null&&e.socialProviders&&e.socialProviders.length>0?e.socialProviders.map((J,F)=>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(J.type),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white capitalize",children:J.type}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:J.clientId?"Configured":"Not configured"})]})]}),s.jsx(at,{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.clientId?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Active"]}):s.jsxs(s.Fragment,{children:[s.jsx(hr,{className:"w-3 h-3"}),"Setup Required"]})})]},F)):s.jsxs("div",{className:"text-center py-8",children:[s.jsx(Mn,{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(Dn,{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(qd,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Email & Password"})]}),s.jsxs(fr,{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(Pn,{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(qd,{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(at,{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.emailAndPassword)!=null&&U.enabled?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(ra,{className:"w-3 h-3"}),"Disabled"]})})]}),(($=e==null?void 0:e.emailAndPassword)==null?void 0:$.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(Ma,{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(at,{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:(L=e==null?void 0:e.emailAndPassword)!=null&&L.disableSignUp?s.jsxs(s.Fragment,{children:[s.jsx(ra,{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(Mn,{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(at,{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.requireEmailVerification?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Required"]}):s.jsxs(s.Fragment,{children:[s.jsx(hr,{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(sd,{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:[((O=e==null?void 0:e.emailAndPassword)==null?void 0:O.minPasswordLength)||8," -"," ",((D=e==null?void 0:e.emailAndPassword)==null?void 0:D.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(qh,{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(at,{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.emailAndPassword)!=null&&T.autoSignIn?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(hr,{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(Dn,{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(_c,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Session"})]}),s.jsxs(fr,{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(Pn,{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(_c,{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:(C=e==null?void 0:e.session)!=null&&C.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(gv,{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(qh,{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(at,{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.session)!=null&&z.disableSessionRefresh?s.jsxs(s.Fragment,{children:[s.jsx(ra,{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(lt,{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(at,{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.storeSessionInDatabase?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(Dc,{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(Dn,{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(Mn,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Rate Limiting"})]}),s.jsxs(fr,{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(Pn,{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(Mn,{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(at,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(P=e==null?void 0:e.rateLimit)!=null&&P.enabled?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(hr,{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(_c,{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:(B=e==null?void 0:e.rateLimit)!=null&&B.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(Mn,{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(lt,{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:((G=e==null?void 0:e.rateLimit)==null?void 0:G.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(Dn,{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(bi,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Advanced"})]}),s.jsxs(fr,{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(Pn,{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(sd,{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(at,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(se=e==null?void 0:e.advanced)!=null&&se.useSecureCookies?s.jsxs(s.Fragment,{children:[s.jsx(Et,{className:"w-3 h-3"}),"Enabled"]}):s.jsxs(s.Fragment,{children:[s.jsx(hr,{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(Mn,{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(at,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(re=e==null?void 0:e.advanced)!=null&&re.disableCSRFCheck?s.jsxs(s.Fragment,{children:[s.jsx(ra,{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(Ll,{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(at,{variant:"secondary",className:"text-xs group-hover:bg-white group-hover:border-black group-hover:text-black bg-black/70 border border-white/15 rounded-none border-dashed flex items-center gap-1",children:(R=(Z=e==null?void 0:e.advanced)==null?void 0:Z.ipAddress)!=null&&R.disableIpTracking?s.jsxs(s.Fragment,{children:[s.jsx(ra,{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(zP,{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(at,{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=e==null?void 0:e.telemetry)!=null&&ee.enabled?s.jsxs(s.Fragment,{children:[s.jsx(hr,{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(Dn,{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(Dc,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"System Info"})]}),s.jsxs(fr,{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(Pn,{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(qh,{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(Dc,{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(Ht,{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(_c,{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(Dn,{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(xv,{className:"w-4 h-4 text-white"}),s.jsx("span",{children:"Plugins"})]}),s.jsxs(fr,{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(Pn,{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((J,F)=>s.jsxs("div",{className:`flex items-center justify-between p-3 px-5 ${F<a.plugins.length-1?"border-b border-white/15":""}`,children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(xv,{className:"w-5 h-5 text-white"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-light uppercase text-white",children:J.name.slice(0,1).toUpperCase()+J.name.slice(1).replace("-"," ")}),s.jsx("p",{className:"text-[10px] font-light uppercase font-mono text-gray-400",children:J.description})]})]}),s.jsx("div",{className:"text-right flex items-center space-x-2",children:s.jsxs(at,{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"]})})]},J.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(hr,{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(at,{variant:"secondary",className:"text-xs bg-yellow-900/50 border border-yellow-500/30 text-yellow-400 rounded-sm",children:"None"})]})})]})]})]})}function Cw(){var D,T;const{orgId:e,teamId:t}=qp(),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,b]=m.useState(""),[g,y]=m.useState([]),[x,N]=m.useState([]),[j,k]=m.useState({name:""}),S=m.useCallback(async()=>{if(t)try{const _=await(await fetch(`/api/teams/${t}`)).json();_.success&&_.team?(a(_.team),k({name:_.team.name})):_.team?(a(_.team),k({name:_.team.name})):V.error("Team not found")}catch{V.error("Failed to load team")}finally{c(!1)}},[t]),M=m.useCallback(async()=>{if(t)try{const _=await(await fetch(`/api/teams/${t}/members`)).json();_.success&&o(_.members||[])}catch{V.error("Failed to load team members")}},[t]),A=async()=>{try{const _=await(await fetch("/api/users?limit=10000")).json(),z=i.map(P=>P.userId),H=(_.users||[]).filter(P=>!z.includes(P.id));y(H)}catch{V.error("Failed to load users")}};m.useEffect(()=>{t&&(S(),M())},[t,S,M]);const I=async()=>{if(!j.name){V.error("Please enter a team name");return}const C=V.loading("Updating team...");try{const z=await(await fetch(`/api/teams/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j.name})})).json();z.success?(await S(),w(!1),V.success("Team updated successfully!",{id:C})):V.error(`Error updating team: ${z.error||"Unknown error"}`,{id:C})}catch{V.error("Error updating team",{id:C})}},U=async()=>{if(x.length===0){V.error("Please select at least one user");return}const C=V.loading(`Adding ${x.length} members...`);try{const z=await(await fetch(`/api/teams/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userIds:x})})).json();z.success?(await M(),f(!1),N([]),b(""),V.success(`Successfully added ${x.length} members!`,{id:C})):V.error(`Error adding members: ${z.error||"Unknown error"}`,{id:C})}catch{V.error("Error adding members",{id:C})}},$=async(C,_)=>{const z=V.loading(`Removing ${_}...`);try{const P=await(await fetch(`/api/team-members/${C}`,{method:"DELETE",headers:{"Content-Type":"application/json"}})).json();P.success?(await M(),V.success(`${_} removed from team!`,{id:z})):V.error(`Error removing member: ${P.error||"Unknown error"}`,{id:z})}catch{V.error("Error removing team member",{id:z})}},L=()=>{A(),f(!0)},E=C=>{N(_=>_.includes(C)?_.filter(z=>z!==C):[..._,C])},O=g.filter(C=>C.name.toLowerCase().includes(v.toLowerCase())||C.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(ca,{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(Y,{onClick:L,className:"border border-dashed border-white/20 text-white hover:bg-white/10 bg-transparent rounded-none",children:[s.jsx(Yo,{className:"w-4 h-4 mr-2"}),"Add Members"]}),s.jsxs(Y,{onClick:()=>w(!0),className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Ca,{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(Gp,{to:`/organizations/${r.organizationId}`,className:"text-gray-400 hover:text-white text-sm font-sans",children:[s.jsx(Ln,{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.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(Nr,{value:i.length,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]})]})}),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:((D=r.organization)==null?void 0:D.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(Yn,{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(Ln,{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(C=>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:C.user.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${C.user.id}`,alt:C.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:C.user.name}),s.jsxs("div",{className:"text-sm text-gray-400",children:["ID: ",C.user.id]})]})]})}),s.jsx("td",{className:"py-4 px-4 text-white",children:C.user.email}),s.jsx("td",{className:"py-4 px-4",children:s.jsx(at,{variant:"secondary",className:"text-xs bg-blue-900/10 border border-dashed border-blue-500/30 text-blue-400/70 rounded-none capitalize",children:C.role})}),s.jsx("td",{className:"py-4 px-4 text-sm text-gray-400",children:new Date(C.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(Y,{variant:"outline",size:"sm",className:"border border-dashed border-red-400/50 text-red-400 hover:bg-red-400/10 rounded-none",onClick:()=>$(C.id,C.user.name),children:[s.jsx(cd,{className:"w-4 h-4 mr-1"}),"Remove"]})})})]},C.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(Y,{onClick:L,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:[s.jsx(Yo,{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(Y,{variant:"ghost",size:"sm",onClick:()=>{f(!1),N([]),b("")},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(J2,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{placeholder:"Search users by name or email...",value:v,onChange:C=>b(C.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:O.length>0?s.jsx("div",{className:"divide-y divide-white/5",children:O.map(C=>s.jsxs("div",{className:`flex items-center space-x-3 p-4 cursor-pointer hover:bg-white/5 ${x.includes(C.id)?"bg-blue-900/20":""}`,onClick:()=>E(C.id),children:[s.jsx("input",{type:"checkbox",checked:x.includes(C.id),onChange:()=>E(C.id),className:"rounded border-gray-300"}),s.jsx("img",{src:C.image||`https://api.dicebear.com/7.x/avataaars/svg?seed=${C.id}`,alt:C.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:C.name}),s.jsx("div",{className:"text-sm text-gray-400",children:C.email})]})]},C.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(Y,{variant:"outline",onClick:()=>{f(!1),N([]),b("")},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsxs(Y,{onClick:U,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(Yo,{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(Y,{variant:"ghost",size:"sm",onClick:()=>w(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{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:(T=r.organization)==null?void 0:T.name})]})]}),s.jsxs("div",{children:[s.jsx(He,{htmlFor:"edit-team-name",className:"text-sm text-gray-400 font-light",children:"Team Name"}),s.jsx(Ie,{id:"edit-team-name",value:j.name,onChange:C=>k({name:C.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(Y,{variant:"outline",onClick:()=>w(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{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 TF(){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(j){console.error("Failed to check teams plugin status:",j),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(j){console.error("Failed to fetch teams:",j),V.error("Failed to load teams")}finally{a(!1)}},b=t.filter(j=>{var S;const k=j.name.toLowerCase().includes(l.toLowerCase())||((S=j.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(j.createdAt)>M}return k}),g=u*p,y=g-p,x=b.slice(y,g),N=Math.ceil(b.length/p);return r?s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx(Cr,{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.jsx("sup",{className:"text-xs text-gray-500 ml-1 mt-0 inline-flex items-baseline",children:s.jsx(Nr,{value:b.length,className:"text-white font-mono text-sm",prefix:s.jsx("span",{className:"mr-1 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-1 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]}),s.jsxs("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light flex items-baseline gap-1",children:[s.jsx(Nr,{value:b.length,className:"text-white font-mono text-sm",format:{notation:"standard",maximumFractionDigits:0}}),s.jsxs("span",{children:["team",b.length!==1?"s":""," found"]})]})]}),s.jsx("div",{className:"flex items-center space-x-3",children:s.jsxs(Y,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[s.jsx(zs,{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(Ea,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),s.jsx(Ie,{type:"text",placeholder:"Search teams...",value:l,onChange:j=>c(j.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(Y,{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(Y,{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(Ma,{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(Y,{onClick:()=>e("/teams/new"),className:"bg-white text-black hover:bg-gray-200 border-dashed",children:[s.jsx(zs,{className:"w-4 h-4 mr-2"}),"Create Team"]})]}):s.jsx("div",{className:"grid gap-4",children:x.map(j=>{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/${j.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(Ma,{className:"w-5 h-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium",children:j.name}),s.jsxs("p",{className:"text-gray-400 text-sm",children:[(k=j.organization)==null?void 0:k.name," • ",j.memberCount||0," members"]})]})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx(at,{variant:"secondary",className:"text-xs bg-green-900/50 border border-dashed rounded-none border-green-500/30 text-green-400",children:"Active"})})]})},j.id)})}),N>1&&s.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[s.jsx(Y,{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 ",N]}),s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>f(Math.min(N,u+1)),disabled:u===N,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(xr,{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(Y,{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 yf=`// Example custom migration script
469
- import { migrateUser } from '@better-auth/migration';
470
-
471
- async function run() {
472
- const legacyUsers = await fetchLegacyUsers();
473
-
474
- for (const user of legacyUsers) {
475
- await migrateUser({
476
- email: user.email,
477
- passwordHash: user.passwordHash,
478
- metadata: user.metadata,
479
- });
480
- }
481
-
482
- return {
483
- migrated: legacyUsers.length,
484
- timestamp: new Date().toISOString(),
485
- };
486
- }
487
-
488
- run().then(console.log).catch(console.error);`,Eo=[{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';
489
- import { generateRandomString, symmetricEncrypt } from "better-auth/crypto";
490
- import { clerkClient } from '@clerk/clerk-sdk-node';
491
- import { auth } from "@/lib/auth";
492
- import * as fs from "node:fs/promises";
493
-
494
- function getCSVData(csv: string) {
495
- const lines = csv.split('\\n').filter(line => line.trim());
496
- const headers = lines[0]?.split(',').map(header => header.trim()) || [];
497
- const jsonData = lines.slice(1).map(line => {
498
- const values = line.split(',').map(value => value.trim());
499
- return headers.reduce((obj, header, index) => {
500
- obj[header] = values[index] || '';
501
- return obj;
502
- }, {} as Record<string, string>);
503
- });
504
- return jsonData as Array<{
505
- id: string;
506
- first_name: string;
507
- last_name: string;
508
- username: string;
509
- primary_email_address: string;
510
- primary_phone_number: string;
511
- verified_email_addresses: string;
512
- unverified_email_addresses: string;
513
- verified_phone_numbers: string;
514
- unverified_phone_numbers: string;
515
- totp_secret: string;
516
- password_digest: string;
517
- password_hasher: string;
518
- }>;
519
- }
520
-
521
- async function getClerkUsers(totalUsers: number) {
522
- const clerkUsers: any[] = [];
523
- for (let i = 0; i < totalUsers; i += 500) {
524
- const response = await fetch(\`https://api.clerk.com/v1/users?offset=\${i}&limit=500\`, {
525
- headers: { Authorization: \`Bearer \${process.env.CLERK_SECRET_KEY}\` },
526
- });
527
- if (!response.ok) throw new Error(\`Failed to fetch users: \${response.statusText}\`);
528
- clerkUsers.push(...((await response.json()) as any));
529
- }
530
- return clerkUsers;
531
- }
532
-
533
- export async function generateBackupCodes(secret: string) {
534
- const backupCodes = Array.from({ length: 10 })
535
- .map(() => generateRandomString(10, "a-z", "0-9", "A-Z"))
536
- .map(code => \`\${code.slice(0,5)}-\${code.slice(5)}\`);
537
- return symmetricEncrypt({ data: JSON.stringify(backupCodes), key: secret });
538
- }
539
-
540
- function safeDateConversion(timestamp?: number): Date {
541
- if (!timestamp) return new Date();
542
- const date = new Date(timestamp);
543
- if (isNaN(date.getTime())) return new Date();
544
- const year = date.getFullYear();
545
- if (year < 2000 || year > 2100) return new Date();
546
- return date;
547
- }
548
-
549
- async function migrateFromClerk() {
550
- const exportedUserCSV = await fs.readFile("exported_users.csv", "utf-8");
551
- const jsonData = getCSVData(exportedUserCSV);
552
- const clerkUsers = await getClerkUsers(jsonData.length);
553
-
554
- const ctx = await auth.$context;
555
- const isAdminEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "admin");
556
- const isTwoFactorEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "two-factor");
557
- const isUsernameEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "username");
558
- const isPhoneNumberEnabled = ctx.options?.plugins?.find(plugin => plugin.id === "phone-number");
559
-
560
- for (const user of jsonData) {
561
- const {
562
- id,
563
- first_name,
564
- last_name,
565
- username,
566
- primary_email_address,
567
- primary_phone_number,
568
- verified_email_addresses,
569
- verified_phone_numbers,
570
- totp_secret,
571
- password_digest,
572
- } = user;
573
-
574
- const clerkUser = clerkUsers.find((item) => item?.id === id);
575
-
576
- const createdUser = await ctx.adapter.create({
577
- model: "user",
578
- data: {
579
- id,
580
- email: primary_email_address,
581
- emailVerified: verified_email_addresses.length > 0,
582
- name: \`\${first_name} \${last_name}\`,
583
- image: clerkUser?.image_url,
584
- createdAt: safeDateConversion(clerkUser?.created_at),
585
- updatedAt: safeDateConversion(clerkUser?.updated_at),
586
- ...(isTwoFactorEnabled ? { twoFactorEnabled: clerkUser?.two_factor_enabled } : {}),
587
- ...(isAdminEnabled ? {
588
- banned: clerkUser?.banned,
589
- banExpiresAt: clerkUser?.lockout_expires_in_seconds,
590
- role: "user",
591
- } : {}),
592
- ...(isUsernameEnabled ? { username } : {}),
593
- ...(isPhoneNumberEnabled ? {
594
- phoneNumber: primary_phone_number,
595
- phoneNumberVerified: verified_phone_numbers.length > 0,
596
- } : {}),
597
- },
598
- forceAllowId: true,
599
- }).catch(async () => {
600
- return await ctx.adapter.findOne({
601
- model: 'user',
602
- where: [{ field: 'id', value: id }],
603
- });
604
- });
605
-
606
- const externalAccounts = clerkUser?.external_accounts ?? [];
607
- for (const externalAccount of externalAccounts) {
608
- const {
609
- id: externalId,
610
- provider,
611
- provider_user_id,
612
- approved_scopes,
613
- created_at,
614
- updated_at,
615
- } = externalAccount;
616
-
617
- if (provider === 'credential') {
618
- await ctx.adapter.create({
619
- model: 'account',
620
- data: {
621
- id: externalId,
622
- providerId: provider,
623
- accountId: provider_user_id,
624
- scope: approved_scopes,
625
- userId: createdUser?.id,
626
- createdAt: safeDateConversion(created_at),
627
- updatedAt: safeDateConversion(updated_at),
628
- password: password_digest,
629
- },
630
- });
631
- } else {
632
- await ctx.adapter.create({
633
- model: 'account',
634
- data: {
635
- id: externalId,
636
- providerId: provider.replace('oauth_', ''),
637
- accountId: provider_user_id,
638
- scope: approved_scopes,
639
- userId: createdUser?.id,
640
- createdAt: safeDateConversion(created_at),
641
- updatedAt: safeDateConversion(updated_at),
642
- },
643
- forceAllowId: true,
644
- });
645
- }
646
- }
647
-
648
- if (isTwoFactorEnabled && totp_secret) {
649
- await ctx.adapter.create({
650
- model: 'twoFactor',
651
- data: {
652
- userId: createdUser?.id,
653
- secret: totp_secret,
654
- backupCodes: await generateBackupCodes(totp_secret),
655
- },
656
- });
657
- }
658
- }
659
- }
660
-
661
- migrateFromClerk()
662
- .then(() => {
663
- console.log('Migration completed');
664
- process.exit(0);
665
- })
666
- .catch((error) => {
667
- console.error('Migration failed:', error);
668
- process.exit(1);
669
- });`},{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 PF(){const[e,t]=I4(),[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),[b,g]=m.useState(""),[y,x]=m.useState(yf),N=(R,ee,J,F)=>{i(K=>[...K,{id:F??`log-${Date.now()}-${Math.random()}`,type:R,message:ee,timestamp:new Date,status:J}])},j=m.useRef(new Set),k=m.useRef(new Set),S=m.useRef(new Map),M=m.useRef(null),A=()=>Eo.find(R=>!R.disabled)??Eo[0],I=Eo.find(R=>R.id===b)??A();m.useEffect(()=>{g(w?R=>{var ee;return R||((ee=A())==null?void 0:ee.id)||""}:"")},[w,A]);const U=R=>{g(R),R!=="custom"&&x(yf)},$=async R=>{try{await navigator.clipboard.writeText(R),V.success("Copied to clipboard")}catch{V.error("Failed to copy to clipboard")}},L=R=>{switch(R.toLowerCase()){case"github":return s.jsx(FP,{className:"w-5 h-5 text-white"});case"google":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"discord":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"twitter":case"x":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"facebook":return s.jsx(Ht,{className:"w-5 h-5 text-white"});case"apple":return s.jsx(Ht,{className:"w-5 h-5 text-white"});default:return s.jsx(Ht,{className:"w-5 h-5 text-white"})}},E=()=>{M.current&&!M.current.closed&&M.current.close(),M.current=null},O=(R,ee,J,F,K)=>{let ne=S.current.get(R);ne||(ne=new Map,S.current.set(R,ne));const ce=ne.get(J);if(ce){i(ve=>ve.map(Ae=>Ae.id===ce?{...Ae,type:ee,message:F,status:K,timestamp:new Date}:Ae));return}const ge=`session-${R}-${J}-${Date.now()}`;ne.set(J,ge),N(ee,F,K,ge)},D=(R,ee,J=0)=>{j.current.has(R)||j.current.add(R),fetch(`/api/tools/oauth/status?testSessionId=${encodeURIComponent(R)}`).then(K=>K.json()).then(K=>{if(K.hasResult){j.current.delete(R),T(K.result);return}if(J+1>=15){j.current.delete(R),O(R,"error","timeout","⌛ Timed out waiting for account creation. Check Better Auth logs.","failed"),E(),r(null),V.error("OAuth test timed out waiting for account creation");return}setTimeout(()=>D(R,ee,J+1),2e3)}).catch(K=>{J+1<15?setTimeout(()=>D(R,ee,J+1),2e3):(j.current.delete(R),O(R,"error","poll-error",`⚠️ Failed to check OAuth status: ${K}`,"failed"),E(),r(null),V.error("Failed to check OAuth status"))})},T=R=>{l(!0);const ee=R.testSessionId;if(R.success){if(k.current.has(ee)&&R.userInfo)return;if(O(ee,"success","waiting","✅ Verified with Better Auth.","completed"),R.userInfo){k.current.add(ee);const J=[R.userInfo.name?`👤 ${R.userInfo.name}`:null,R.userInfo.email?`✉️ ${R.userInfo.email}`:null].filter(Boolean).join(" | "),F=J?`✅ ${R.provider} OAuth succeeded — ${J}`:`✅ ${R.provider} OAuth succeeded!`;O(ee,"success","completed",F,"completed"),O(ee,"info","timestamp",`⏰ Completed at ${new Date(R.timestamp).toLocaleTimeString()}`,"completed"),V.success(`OAuth test for ${R.provider} passed!`),E(),r(null),S.current.delete(ee)}else O(ee,"progress","await-finalize","⌛ OAuth flow finished. Waiting for Better Auth to finalize account...","running"),j.current.has(ee)||(j.current.add(ee),D(ee,R.provider))}else{if(k.current.has(ee))return;O(ee,"error","waiting","❌ Verification failed with Better Auth.","failed");const J=R.error?` — ${R.error}`:"";O(ee,"error","failed",`❌ ${R.provider} OAuth failed${J}`,"failed"),V.error(`OAuth test for ${R.provider} failed`),E(),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),T(ee),t({})}catch{}},[e,t,T]),m.useEffect(()=>{(async()=>{try{const J=await(await fetch("/api/tools/oauth/providers")).json();J.success&&J.providers&&u(J.providers.filter(F=>F.enabled))}catch{}})()},[]);const C=async()=>{if(h.length===0){V.error("No OAuth providers configured"),N("error","❌ No OAuth providers found in configuration","failed"),N("info","💡 Please configure at least one OAuth provider in your Better Auth config","failed");return}d(!0)},_=async R=>{d(!1),p(""),r("test-oauth"),l(!0),i([]),N("info",`🔍 Testing ${R} OAuth...`,"running");const ee=new Date().toISOString();try{N("progress","📡 Contacting Better Auth...","running");const F=await(await fetch("/api/tools/oauth/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:R})})).json();if(F.success&&F.startUrl){S.current.delete(F.testSessionId),O(F.testSessionId,"progress","popup-open",`🌐 Opening ${F.provider} OAuth popup...`,"running");const K={testSessionId:F.testSessionId,provider:F.provider,providerId:R,startTime:ee};k.current.delete(F.testSessionId),sessionStorage.setItem("oauth_test_session",JSON.stringify(K));const ne=600,ce=700,ge=(window.screen.width-ne)/2,ve=(window.screen.height-ce)/2,Ae=window.open(F.startUrl,"oauth-test",`width=${ne},height=${ce},left=${ge},top=${ve},scrollbars=yes,resizable=yes`);if(!Ae){N("error","❌ Failed to open OAuth window. Please allow popups for this site.","failed"),N("error","💡 Check your browser popup blocker settings","failed"),V.error("Failed to open OAuth window. Please allow popups."),r(null);return}M.current=Ae;let Te=!1;const tt=Oe=>{if(Oe.origin===window.location.origin){if(Oe.data&&Oe.data.type==="oauth_test_state"){if(Oe.data.status==="redirect")j.current.has(K.testSessionId)||D(K.testSessionId,K.provider);else if(Oe.data.status==="error"){Te=!0;const Ge=sessionStorage.getItem("oauth_test_session");let Je=F.provider;if(Ge)try{Je=JSON.parse(Ge).provider||Je}catch{}T({success:!1,provider:Je,testSessionId:Oe.data.testSessionId,error:Oe.data.error||"Failed to start OAuth test"}),window.removeEventListener("message",tt),clearInterval(ht),clearTimeout(Le),E()}return}if(Oe.data&&Oe.data.type==="oauth_test_result"){window.removeEventListener("message",tt),clearInterval(ht),clearTimeout(Le),Te=!0;const Ge=Oe.data.result;T(Ge),j.current.has(Ge.testSessionId)||D(Ge.testSessionId,Ge.provider),E()}}};window.addEventListener("message",tt);const ht=setInterval(()=>{Ae.closed&&(clearInterval(ht),clearTimeout(Le),window.removeEventListener("message",tt),!sessionStorage.getItem(`oauth_test_result_${K.testSessionId}`)&&!Te&&(Te=!0,D(K.testSessionId,K.provider)))},500),Le=setTimeout(()=>{Ae.closed||(clearInterval(ht),window.removeEventListener("message",tt),E(),Te||(Te=!0),N("error","❌ OAuth test timed out after 5 minutes","failed"),N("error","💡 Possible reasons:","failed"),N("error"," • Authentication took too long","failed"),N("error"," • Provider is not responding","failed"),N("error"," • Network connectivity issues","failed"),V.error("OAuth test timed out"),r(null))},5*60*1e3)}else N("error",`❌ Failed to initiate OAuth test: ${F.error||"Unknown error"}`,"failed"),F.details&&N("error",`💡 Details: ${JSON.stringify(F.details)}`,"failed"),F.cause&&N("error",`💡 Cause: ${F.cause}`,"failed"),V.error(F.error||"Failed to start OAuth test"),r(null)}catch(J){N("error",`❌ Network error: ${J}`,"failed"),V.error("Failed to start OAuth test"),r(null)}},z=()=>{v(!0)},H=async(R,ee)=>{const J=Eo.find(K=>K.id===R);if(!J){V.error("Unknown migration provider");return}if(J.disabled){V.info(`${J.name} migration is coming soon`);return}v(!1),r("run-migration"),l(!0),i([]);const F=K=>new Promise(ne=>setTimeout(ne,K));try{if(N("info",`🚀 Preparing ${J.name} migration...`,"running"),J.highlights)for(const ce of J.highlights)await F(350),N("progress",ce,"running");N("progress","📡 Sending migration payload to server...","running");const ne=await(await fetch("/api/tools/migrations/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:J.id,script:J.custom?ee:J.script})})).json();if(ne.success)N("progress","🚀 Migration job acknowledged. Follow server logs for live progress.","running"),N("success",`✅ ${J.name} migration request accepted.`,"completed"),ne.message&&N("info",ne.message,"completed"),V.success(`${J.name} migration flow completed`);else throw new Error(ne.error||"Migration request failed")}catch(K){N("error",`❌ Migration failed: ${K}`,"failed"),V.error("Migration failed")}finally{r(null)}},se=[{id:"test-oauth",name:"Test OAuth",description:"Test OAuth provider connections",icon:Ht,action:C,category:"oauth"},{id:"run-migration",name:"Run Migration",description:"Run database migrations",icon:Vr,action:z,category:"database"},{id:"test-db",name:"Test Database",description:"Test database connection",icon:Vr,action:async()=>{r("test-db"),l(!0),i([]),N("info","Testing database connection...","running");try{const ee=await(await fetch("/api/database/test")).json();await new Promise(J=>setTimeout(J,1e3)),N("progress","Checking on database con!","running"),ee.success?(N("success","✅ Database connection successful!","completed"),ee.result&&Array.isArray(ee.result)&&ee.result.length>0&&(N("info","📄 Sample user record (first row):","completed"),N("info",JSON.stringify(ee.result[0],null,2),"completed")),V.success("Database connection test successful")):(N("error",`❌ Database connection failed: ${ee.error||"Unknown error"}`,"failed"),V.error("Database connection test failed"))}catch(R){N("error",`❌ Network error: ${R}`,"failed"),V.error("Failed to test database connection")}finally{r(null)}},category:"database"},{id:"validate-config",name:"Validate Config",description:"Validate Better Auth configuration",icon:Fx,action:async()=>{r("validate-config"),l(!0),i([]),N("info","Validating Better Auth configuration...","running");try{await new Promise(R=>setTimeout(R,500)),N("progress","Checking database connection...","running"),await new Promise(R=>setTimeout(R,500)),N("progress","Validating plugins configuration...","running"),await new Promise(R=>setTimeout(R,500)),N("success","✅ Configuration is valid!","completed"),V.success("Configuration validated successfully")}catch(R){N("error",`❌ Configuration validation failed: ${R}`,"failed"),V.error("Configuration validation failed")}finally{r(null)}},category:"utilities"},{id:"generate-api-key",name:"Generate API Key",description:"Generate a new API key",icon:Xd,action:async()=>{r("generate-api-key"),l(!0),i([]),N("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?(N("success","✅ API key generated successfully!","completed"),N("info",`API Key: ${ee.apiKey}`,"completed"),V.success("API key generated successfully")):(N("error",`❌ Failed to generate API key: ${ee.error||"Unknown error"}`,"failed"),V.error("Failed to generate API key"))}catch(R){N("error",`❌ Network error: ${R}`,"failed"),V.error("Failed to generate API key")}finally{r(null)}},category:"utilities"},{id:"health-check",name:"Health Check",description:"Run system health check",icon:vv,action:async()=>{r("health-check"),l(!0),i([]),N("info","Running system health check...","running");try{await new Promise(R=>setTimeout(R,500)),N("progress","Checking API endpoints...","running"),await new Promise(R=>setTimeout(R,500)),N("progress","Checking database health...","running"),await new Promise(R=>setTimeout(R,500)),N("progress","Checking plugins status...","running"),await new Promise(R=>setTimeout(R,500)),N("success","✅ System health check passed!","completed"),V.success("System health check passed")}catch(R){N("error",`❌ Health check failed: ${R}`,"failed"),V.error("Health check failed")}finally{r(null)}},category:"testing"}],Z=[{id:"oauth",name:"OAuth",icon:Ht},{id:"database",name:"Database",icon:Vr},{id:"testing",name:"Testing",icon:vv},{id:"utilities",name:"Utilities",icon:tk}].map(R=>({...R,tools:se.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(xx,{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(Y,{variant:"ghost",size:"sm",onClick:()=>l(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{className:"w-4 h-4"})})]}),s.jsx(Oa,{title:"Tool Execution Logs",lines:a,isRunning:n!==null,className:"w-full",defaultCollapsed:!1})]}),s.jsx("div",{className:"space-y-8",children:Z.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 J=ee.icon,F=n===ee.id;return s.jsxs("button",{onClick:()=>ee.action(),disabled:ee.id!=="test-oauth"&&ee.id!=="test-db"||F||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:F?s.jsx(ca,{className:"w-6 h-6 text-white animate-spin"}):s.jsx(J,{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(qL,{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(ws,{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(Ht,{className:"w-6 h-6 text-white"}),s.jsx("h3",{className:"text-xl text-white font-light",children:"Select OAuth Provider"})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>{d(!1),p("")},className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{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(Ht,{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.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(()=>{_(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(ws,{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(Y,{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(Y,{variant:"ghost",size:"sm",onClick:()=>v(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{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:Eo.map(R=>{const ee=(I==null?void 0:I.id)===R.id;return s.jsxs("button",{onClick:()=>U(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(pv,{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(pv,{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(Y,{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(Y,{variant:"outline",size:"sm",className:"rounded-none",onClick:()=>x(yf),children:"Reset"}),s.jsxs(Y,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>$(y),children:[s.jsx(Xm,{className:"w-4 h-4"}),"Copy Script"]}),s.jsx(Y,{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(Y,{variant:"ghost",size:"sm",className:"rounded-none text-gray-400 hover:text-white",onClick:()=>$(I.script),children:[s.jsx(Xm,{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(Y,{className:"rounded-none",onClick:()=>H(I.id),children:["Run ",I.name," Migration"]})})]})]})]})]})})]})}function AF(){const{userId:e}=qp(),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),[b,g]=m.useState(!1),[y,x]=m.useState(!1),[N,j]=m.useState(!1),[k,S]=m.useState(""),[M,A]=m.useState(),[I,U]=m.useState(!1),[$,L]=m.useState([]),[E,O]=m.useState(!1),[D,T]=m.useState({}),C=m.useRef({}),_=m.useCallback(async()=>{try{const K=await(await fetch("/api/admin/status")).json();U(K.enabled)}catch{U(!1)}},[]),z=m.useCallback(async F=>{try{const K=await fetch("/api/geo/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ipAddress:F})});if(K.ok){const ne=await K.json();if(ne.success&&ne.location)return ne.location}return null}catch{return null}},[]),H=m.useCallback(async F=>{const K=F.filter(ge=>!C.current[ge.id]);if(K.length===0)return;const ne=await Promise.all(K.map(async ge=>{const ve=await z(ge.ipAddress);return ve?{sessionId:ge.id,location:ve}:null})),ce={};ne.forEach(ge=>{ge&&(ce[ge.sessionId]=ge.location)}),Object.keys(ce).length>0&&(C.current={...C.current,...ce},T(C.current))},[z]),P=F=>{if(!F)return"🌍";const K=F.toUpperCase().split("").map(ne=>127397+ne.charCodeAt(0));return String.fromCodePoint(...K)},B=m.useCallback(async()=>{try{const F=await fetch(`/api/users/${e}`);if(F.ok){const K=await F.json();r(K.user)}else V.error("Failed to fetch user details"),t("/users")}catch{V.error("Failed to fetch user details"),t("/users")}finally{u(!1)}},[e,t]),q=m.useCallback(async()=>{try{const[F,K,ne]=await Promise.all([fetch(`/api/users/${e}/organizations`),fetch(`/api/users/${e}/teams`),fetch(`/api/users/${e}/sessions`)]);if(F.ok){const ce=await F.json();i(ce.memberships||[])}if(K.ok){const ce=await K.json();l(ce.memberships||[])}if(ne.ok){const ge=(await ne.json()).sessions||[];d(ge),H(ge)}}catch{}},[e,H]),G=async()=>{var ce,ge;if(!n)return;const F=(ce=document.getElementById("edit-name"))==null?void 0:ce.value,K=(ge=document.getElementById("edit-email"))==null?void 0:ge.value;if(!F||!K){V.error("Please fill in all fields");return}const ne=V.loading("Updating user...");try{const Ae=await(await fetch(`/api/users/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:F,email:K})})).json();Ae.success?(r({...n,name:F,email:K}),v(!1),V.success("User updated successfully!",{id:ne})):V.error(`Error updating user: ${Ae.error||"Unknown error"}`,{id:ne})}catch{V.error("Error updating user",{id:ne})}},se=async()=>{if(!n)return;if(!I){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use ban functionality.");return}const F=V.loading("Banning user...");try{const K=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})}),ne=await K.json();K.ok?(V.success("User banned successfully!",{id:F}),g(!1),S(""),A(void 0),B()):K.status===403?V.error("You do not have permission to ban users. Admin role required.",{id:F}):ne.adminPluginEnabled&&ne.instructions?V.error(`${ne.error}`,{id:F,duration:6e3,description:`Use: ${ne.instructions.example}`}):V.error(`Error banning user: ${ne.error||ne.message||"Unknown error"}`,{id:F})}catch{V.error("Error banning user",{id:F})}},re=async()=>{if(!n)return;if(!I){V.error("Admin plugin is not enabled. Please enable the admin plugin in your Better Auth configuration to use unban functionality.");return}const F=V.loading("Unbanning user...");try{const K=await fetch("/api/admin/unban-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})}),ne=await K.json();K.ok?(V.success("User unbanned successfully!",{id:F}),x(!1),B()):K.status===403?V.error("You do not have permission to unban users. Admin role required.",{id:F}):ne.adminPluginEnabled&&ne.instructions?V.error(`${ne.error}`,{id:F,duration:6e3,description:`Use: ${ne.instructions.example}`}):V.error(`Error unbanning user: ${ne.error||ne.message||"Unknown error"}`,{id:F})}catch{V.error("Error unbanning user",{id:F})}},Z=async F=>{const K=V.loading("Removing user from organization...");try{const ce=await(await fetch(`/api/organizations/members/${F}`,{method:"DELETE"})).json();ce.success?(i(ge=>ge.filter(ve=>ve.id!==F)),V.success("User removed from organization!",{id:K})):V.error(`Error removing user: ${ce.error||"Unknown error"}`,{id:K})}catch{V.error("Error removing user from organization",{id:K})}},R=async F=>{const K=V.loading("Removing user from team...");try{const ce=await(await fetch(`/api/teams/members/${F}`,{method:"DELETE"})).json();ce.success?(l(ge=>ge.filter(ve=>ve.id!==F)),V.success("User removed from team!",{id:K})):V.error(`Error removing user: ${ce.error||"Unknown error"}`,{id:K})}catch{V.error("Error removing user from team",{id:K})}},ee=async F=>{const K=V.loading("Deleting session...");try{const ce=await(await fetch(`/api/sessions/${F}`,{method:"DELETE"})).json();ce.success?(d(ge=>ge.filter(ve=>ve.id!==F)),V.success("Session deleted successfully!",{id:K})):V.error(`Error deleting session: ${ce.error||"Unknown error"}`,{id:K})}catch{V.error("Error deleting session",{id:K})}};m.useEffect(()=>{e&&(B(),q(),_())},[e,_,B,q]);const J=async(F=3)=>{if(e){L([]),O(!0),L([{id:"start",type:"info",message:`Starting session seeding process for ${F} sessions...`,timestamp:new Date}]);try{const ne=await(await fetch(`/api/users/${e}/seed-sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:F})})).json();if(ne.success){const ce=ne.results.map((ve,Ae)=>ve.success?{id:`session-${Ae}`,type:"progress",message:`Creating session ${Ae+1}: ${ve.session.token.substring(0,20)}... from ${ve.session.ipAddress}`,timestamp:new Date,status:"completed"}:{id:`session-${Ae}`,type:"error",message:`Failed to create session ${Ae+1}: ${ve.error}`,timestamp:new Date});L(ve=>[...ve,...ce]);const ge=ne.results.filter(ve=>ve.success).length;L(ve=>[...ve,{id:"complete",type:"success",message:`✅ Session seeding completed! Created ${ge}/${F} sessions successfully`,timestamp:new Date}]),q()}else L(ce=>[...ce,{id:"error",type:"error",message:`❌ Session seeding failed: ${ne.error||"Unknown error"}`,timestamp:new Date}])}catch(K){L(ne=>[...ne,{id:"error",type:"error",message:`❌ Network error: ${K}`,timestamp:new Date}])}finally{O(!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(Ic,{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),V.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(Y,{variant:"outline",onClick:()=>v(!0),className:"border border-white/20 text-white hover:bg-white/10 rounded-none",children:[s.jsx(Ca,{className:"w-4 h-4 mr-2"}),"Edit User"]}),n.banned?s.jsxs(Y,{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(vf,{className:"w-4 h-4 mr-2"}),"Unban User"]}):s.jsxs(Y,{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(vf,{className:"w-4 h-4 mr-2"}),"Ban User"]})]})]})}),s.jsxs("div",{className:"border border-dashed border-white/20 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:Ic},{id:"organizations",name:"Organizations",icon:Ln,count:a.length},{id:"teams",name:"Teams",icon:Ze,count:o.length},{id:"sessions",name:"Sessions",icon:mv,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.jsx("sup",{className:"text-xs text-gray-500 ml-1 inline-flex items-baseline",children:s.jsx(Nr,{value:F.count,className:"text-white/80 font-mono text-xs",prefix:s.jsx("span",{className:"mr-0.5 text-gray-500",children:"["}),suffix:s.jsx("span",{className:"ml-0.5 text-gray-500",children:"]"}),format:{notation:"standard",maximumFractionDigits:0}})})]})]},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(Ic,{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(eF,{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(JL,{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(Yn,{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(Ln,{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(Ln,{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(Y,{variant:"outline",size:"sm",onClick:()=>Z(F.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[s.jsx(mw,{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(Y,{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(mw,{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(Y,{variant:"outline",onClick:()=>{L([]),O(!1),j(!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(mv,{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 K,ne,ce,ge;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(fw,{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(ZL,{className:"w-3.5 h-3.5 text-gray-400"}),s.jsxs("span",{className:"text-gray-400 uppercase font-mono text-xs",children:[((K=D[F.id])==null?void 0:K.city)||"...",","," ",((ne=D[F.id])==null?void 0:ne.country)||"..."]}),((ce=D[F.id])==null?void 0:ce.countryCode)&&s.jsx("span",{className:"text-xs ml-1",children:P((ge=D[F.id])==null?void 0:ge.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(Y,{variant:"outline",size:"sm",onClick:()=>ee(F.id),className:"border border-dashed border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-none",children:[s.jsx(vf,{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(Y,{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(Ic,{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(Y,{variant:"outline",onClick:()=>v(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:G,className:"bg-white hover:bg-white/90 text-black border border-white/20 rounded-none",children:"Update"})]})]})}),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 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(He,{htmlFor:"banReason",className:"text-white",children:"Ban Reason"}),s.jsx(Ie,{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(He,{htmlFor:"banExpires",className:"text-white",children:"Ban Duration (seconds)"}),s.jsx(Ie,{id:"banExpires",type:"number",value:M||"",onChange:F=>A(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(Y,{variant:"outline",onClick:()=>{g(!1),S(""),A(void 0)},className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:se,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(Y,{variant:"outline",onClick:()=>x(!1),className:"border border-dashed border-white/20 text-white hover:bg-white/10 rounded-none",children:"Cancel"}),s.jsx(Y,{onClick:re,className:"bg-green-400 text-white hover:bg-green-700 rounded-none",children:"Unban User"})]})]})}),N&&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(fw,{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(Y,{variant:"ghost",size:"sm",onClick:()=>j(!1),className:"text-gray-400 hover:text-white rounded-none",children:s.jsx(Kt,{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(He,{htmlFor:"session-count",className:"text-sm text-gray-400 font-light",children:"Number of sessions"}),s.jsx(Ie,{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(Y,{onClick:()=>{var K;const F=parseInt(((K=document.getElementById("session-count"))==null?void 0:K.value)||"3",10);J(F)},disabled:E,className:"bg-transparent hover:bg-white/90 bg-white text-black border border-white/20 rounded-none mt-6 disabled:opacity-50",children:E?s.jsxs(s.Fragment,{children:[s.jsx(ca,{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"]})})]})}),$.length>0&&s.jsx("div",{className:"mt-6",children:s.jsx(Oa,{title:"Session 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(Y,{variant:"outline",onClick:()=>j(!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 OF(){return s.jsx(V6,{children:s.jsxs(O4,{children:[s.jsx(C$,{children:s.jsxs(C4,{children:[s.jsx(nn,{path:"/",element:s.jsx(NF,{})}),s.jsx(nn,{path:"/users",element:s.jsx(ck,{})}),s.jsx(nn,{path:"/users/:userId",element:s.jsx(AF,{})}),s.jsx(nn,{path:"/organizations",element:s.jsx(lk,{})}),s.jsx(nn,{path:"/organizations/:orgId",element:s.jsx(EF,{})}),s.jsx(nn,{path:"/teams",element:s.jsx(TF,{})}),s.jsx(nn,{path:"/teams/:teamId",element:s.jsx(Cw,{})}),s.jsx(nn,{path:"/organizations/:orgId/teams/:teamId",element:s.jsx(Cw,{})}),s.jsx(nn,{path:"/sessions",element:s.jsx(MF,{})}),s.jsx(nn,{path:"/database",element:s.jsx(SF,{})}),s.jsx(nn,{path:"/database/demo",element:s.jsx(H6,{})}),s.jsx(nn,{path:"/tools",element:s.jsx(PF,{})}),s.jsx(nn,{path:"/settings",element:s.jsx(DF,{})})]})}),s.jsx(uE,{className:"rounded-none border-dashed border-white/20",theme:"dark",position:"top-right",richColors:!0,closeButton:!0})]})})}bf.createRoot(document.getElementById("root")).render(s.jsx(Q.StrictMode,{children:s.jsx(OF,{})}));