Files
SupportBot/public/dashboard/assets/index-BpDEEtaJ.js
T
2026-08-06 16:30:04 +01:00

207 lines
835 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var h3=Object.defineProperty;var g3=(e,n,a)=>n in e?h3(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var $b=(e,n,a)=>g3(e,typeof n!="symbol"?n+"":n,a);function x3(e,n){for(var a=0;a<n.length;a++){const o=n[a];if(typeof o!="string"&&!Array.isArray(o)){for(const l in o)if(l!=="default"&&!(l in e)){const c=Object.getOwnPropertyDescriptor(o,l);c&&Object.defineProperty(e,l,c.get?c:{enumerable:!0,get:()=>o[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function a(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(l){if(l.ep)return;l.ep=!0;const c=a(l);fetch(l.href,c)}})();function A0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jm={exports:{}},Fi={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Bb;function v3(){if(Bb)return Fi;Bb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,l,c){var d=null;if(c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),"key"in l){c={};for(var m in l)m!=="key"&&(c[m]=l[m])}else c=l;return l=c.ref,{$$typeof:e,type:o,key:d,ref:l!==void 0?l:null,props:c}}return Fi.Fragment=n,Fi.jsx=a,Fi.jsxs=a,Fi}var Ub;function b3(){return Ub||(Ub=1,Jm.exports=v3()),Jm.exports}var s=b3(),ep={exports:{}},Pe={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Hb;function y3(){if(Hb)return Pe;Hb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function w(_){return _===null||typeof _!="object"?null:(_=y&&_[y]||_["@@iterator"],typeof _=="function"?_:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function N(_,D,G){this.props=_,this.context=D,this.refs=E,this.updater=G||j}N.prototype.isReactComponent={},N.prototype.setState=function(_,D){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,D,"setState")},N.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function k(){}k.prototype=N.prototype;function T(_,D,G){this.props=_,this.context=D,this.refs=E,this.updater=G||j}var A=T.prototype=new k;A.constructor=T,S(A,N.prototype),A.isPureReactComponent=!0;var O=Array.isArray;function M(){}var z={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function K(_,D,G){var V=G.ref;return{$$typeof:e,type:_,key:D,ref:V!==void 0?V:null,props:G}}function U(_,D){return K(_.type,D,_.props)}function q(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function ue(_){var D={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(G){return D[G]})}var pe=/\/+/g;function xe(_,D){return typeof _=="object"&&_!==null&&_.key!=null?ue(""+_.key):D.toString(36)}function se(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(M,M):(_.status="pending",_.then(function(D){_.status==="pending"&&(_.status="fulfilled",_.value=D)},function(D){_.status==="pending"&&(_.status="rejected",_.reason=D)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function L(_,D,G,V,F){var oe=typeof _;(oe==="undefined"||oe==="boolean")&&(_=null);var ae=!1;if(_===null)ae=!0;else switch(oe){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(_.$$typeof){case e:case n:ae=!0;break;case b:return ae=_._init,L(ae(_._payload),D,G,V,F)}}if(ae)return F=F(_),ae=V===""?"."+xe(_,0):V,O(F)?(G="",ae!=null&&(G=ae.replace(pe,"$&/")+"/"),L(F,D,G,"",function(Y){return Y})):F!=null&&(q(F)&&(F=U(F,G+(F.key==null||_&&_.key===F.key?"":(""+F.key).replace(pe,"$&/")+"/")+ae)),D.push(F)),1;ae=0;var be=V===""?".":V+":";if(O(_))for(var ve=0;ve<_.length;ve++)V=_[ve],oe=be+xe(V,ve),ae+=L(V,D,G,oe,F);else if(ve=w(_),typeof ve=="function")for(_=ve.call(_),ve=0;!(V=_.next()).done;)V=V.value,oe=be+xe(V,ve++),ae+=L(V,D,G,oe,F);else if(oe==="object"){if(typeof _.then=="function")return L(se(_),D,G,V,F);throw D=String(_),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return ae}function I(_,D,G){if(_==null)return _;var V=[],F=0;return L(_,V,"","",function(oe){return D.call(G,oe,F++)}),V}function H(_){if(_._status===-1){var D=_._result;D=D(),D.then(function(G){(_._status===0||_._status===-1)&&(_._status=1,_._result=G)},function(G){(_._status===0||_._status===-1)&&(_._status=2,_._result=G)}),_._status===-1&&(_._status=0,_._result=D)}if(_._status===1)return _._result.default;throw _._result}var Z=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},te={map:I,forEach:function(_,D,G){I(_,function(){D.apply(this,arguments)},G)},count:function(_){var D=0;return I(_,function(){D++}),D},toArray:function(_){return I(_,function(D){return D})||[]},only:function(_){if(!q(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return Pe.Activity=g,Pe.Children=te,Pe.Component=N,Pe.Fragment=a,Pe.Profiler=l,Pe.PureComponent=T,Pe.StrictMode=o,Pe.Suspense=p,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(_){return z.H.useMemoCache(_)}},Pe.cache=function(_){return function(){return _.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(_,D,G){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var V=S({},_.props),F=_.key;if(D!=null)for(oe in D.key!==void 0&&(F=""+D.key),D)!B.call(D,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&D.ref===void 0||(V[oe]=D[oe]);var oe=arguments.length-2;if(oe===1)V.children=G;else if(1<oe){for(var ae=Array(oe),be=0;be<oe;be++)ae[be]=arguments[be+2];V.children=ae}return K(_.type,F,V)},Pe.createContext=function(_){return _={$$typeof:d,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:c,_context:_},_},Pe.createElement=function(_,D,G){var V,F={},oe=null;if(D!=null)for(V in D.key!==void 0&&(oe=""+D.key),D)B.call(D,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(F[V]=D[V]);var ae=arguments.length-2;if(ae===1)F.children=G;else if(1<ae){for(var be=Array(ae),ve=0;ve<ae;ve++)be[ve]=arguments[ve+2];F.children=be}if(_&&_.defaultProps)for(V in ae=_.defaultProps,ae)F[V]===void 0&&(F[V]=ae[V]);return K(_,oe,F)},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(_){return{$$typeof:m,render:_}},Pe.isValidElement=q,Pe.lazy=function(_){return{$$typeof:b,_payload:{_status:-1,_result:_},_init:H}},Pe.memo=function(_,D){return{$$typeof:h,type:_,compare:D===void 0?null:D}},Pe.startTransition=function(_){var D=z.T,G={};z.T=G;try{var V=_(),F=z.S;F!==null&&F(G,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(M,Z)}catch(oe){Z(oe)}finally{D!==null&&G.types!==null&&(D.types=G.types),z.T=D}},Pe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Pe.use=function(_){return z.H.use(_)},Pe.useActionState=function(_,D,G){return z.H.useActionState(_,D,G)},Pe.useCallback=function(_,D){return z.H.useCallback(_,D)},Pe.useContext=function(_){return z.H.useContext(_)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(_,D){return z.H.useDeferredValue(_,D)},Pe.useEffect=function(_,D){return z.H.useEffect(_,D)},Pe.useEffectEvent=function(_){return z.H.useEffectEvent(_)},Pe.useId=function(){return z.H.useId()},Pe.useImperativeHandle=function(_,D,G){return z.H.useImperativeHandle(_,D,G)},Pe.useInsertionEffect=function(_,D){return z.H.useInsertionEffect(_,D)},Pe.useLayoutEffect=function(_,D){return z.H.useLayoutEffect(_,D)},Pe.useMemo=function(_,D){return z.H.useMemo(_,D)},Pe.useOptimistic=function(_,D){return z.H.useOptimistic(_,D)},Pe.useReducer=function(_,D,G){return z.H.useReducer(_,D,G)},Pe.useRef=function(_){return z.H.useRef(_)},Pe.useState=function(_){return z.H.useState(_)},Pe.useSyncExternalStore=function(_,D,G){return z.H.useSyncExternalStore(_,D,G)},Pe.useTransition=function(){return z.H.useTransition()},Pe.version="19.2.6",Pe}var Vb;function Ku(){return Vb||(Vb=1,ep.exports=y3()),ep.exports}var f=Ku();const me=A0(f),Ah=x3({__proto__:null,default:me},[f]);var tp={exports:{}},Wi={},np={exports:{}},rp={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Gb;function w3(){return Gb||(Gb=1,(function(e){function n(L,I){var H=L.length;L.push(I);e:for(;0<H;){var Z=H-1>>>1,te=L[Z];if(0<l(te,I))L[Z]=I,L[H]=te,H=Z;else break e}}function a(L){return L.length===0?null:L[0]}function o(L){if(L.length===0)return null;var I=L[0],H=L.pop();if(H!==I){L[0]=H;e:for(var Z=0,te=L.length,_=te>>>1;Z<_;){var D=2*(Z+1)-1,G=L[D],V=D+1,F=L[V];if(0>l(G,H))V<te&&0>l(F,G)?(L[Z]=F,L[V]=H,Z=V):(L[Z]=G,L[D]=H,Z=D);else if(V<te&&0>l(F,H))L[Z]=F,L[V]=H,Z=V;else break e}}return I}function l(L,I){var H=L.sortIndex-I.sortIndex;return H!==0?H:L.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();e.unstable_now=function(){return d.now()-m}}var p=[],h=[],b=1,g=null,y=3,w=!1,j=!1,S=!1,E=!1,N=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(L){for(var I=a(h);I!==null;){if(I.callback===null)o(h);else if(I.startTime<=L)o(h),I.sortIndex=I.expirationTime,n(p,I);else break;I=a(h)}}function O(L){if(S=!1,A(L),!j)if(a(p)!==null)j=!0,M||(M=!0,ue());else{var I=a(h);I!==null&&se(O,I.startTime-L)}}var M=!1,z=-1,B=5,K=-1;function U(){return E?!0:!(e.unstable_now()-K<B)}function q(){if(E=!1,M){var L=e.unstable_now();K=L;var I=!0;try{e:{j=!1,S&&(S=!1,k(z),z=-1),w=!0;var H=y;try{t:{for(A(L),g=a(p);g!==null&&!(g.expirationTime>L&&U());){var Z=g.callback;if(typeof Z=="function"){g.callback=null,y=g.priorityLevel;var te=Z(g.expirationTime<=L);if(L=e.unstable_now(),typeof te=="function"){g.callback=te,A(L),I=!0;break t}g===a(p)&&o(p),A(L)}else o(p);g=a(p)}if(g!==null)I=!0;else{var _=a(h);_!==null&&se(O,_.startTime-L),I=!1}}break e}finally{g=null,y=H,w=!1}I=void 0}}finally{I?ue():M=!1}}}var ue;if(typeof T=="function")ue=function(){T(q)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,xe=pe.port2;pe.port1.onmessage=q,ue=function(){xe.postMessage(null)}}else ue=function(){N(q,0)};function se(L,I){z=N(function(){L(e.unstable_now())},I)}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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(L){switch(y){case 1:case 2:case 3:var I=3;break;default:I=y}var H=y;y=I;try{return L()}finally{y=H}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(L,I){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var H=y;y=L;try{return I()}finally{y=H}},e.unstable_scheduleCallback=function(L,I,H){var Z=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Z+H:Z):H=Z,L){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=H+te,L={id:b++,callback:I,priorityLevel:L,startTime:H,expirationTime:te,sortIndex:-1},H>Z?(L.sortIndex=H,n(h,L),a(p)===null&&L===a(h)&&(S?(k(z),z=-1):S=!0,se(O,H-Z))):(L.sortIndex=te,n(p,L),j||w||(j=!0,M||(M=!0,ue()))),L},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(L){var I=y;return function(){var H=y;y=I;try{return L.apply(this,arguments)}finally{y=H}}}})(rp)),rp}var Fb;function C3(){return Fb||(Fb=1,np.exports=w3()),np.exports}var ap={exports:{}},ln={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Wb;function S3(){if(Wb)return ln;Wb=1;var e=Ku();function n(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(p,h,b){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:p,containerInfo:h,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,ln.createPortal=function(p,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return c(p,h,null,b)},ln.flushSync=function(p){var h=d.T,b=o.p;try{if(d.T=null,o.p=2,p)return p()}finally{d.T=h,o.p=b,o.d.f()}},ln.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(p,h))},ln.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},ln.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var b=h.as,g=m(b,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?o.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:w}):b==="script"&&o.d.X(p,{crossOrigin:g,integrity:y,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ln.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=m(h.as,h.crossOrigin);o.d.M(p,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(p)},ln.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,g=m(b,h.crossOrigin);o.d.L(p,b,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},ln.preloadModule=function(p,h){if(typeof p=="string")if(h){var b=m(h.as,h.crossOrigin);o.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(p)},ln.requestFormReset=function(p){o.d.r(p)},ln.unstable_batchedUpdates=function(p,h){return p(h)},ln.useFormState=function(p,h,b){return d.H.useFormState(p,h,b)},ln.useFormStatus=function(){return d.H.useHostTransitionStatus()},ln.version="19.2.6",ln}var Yb;function M0(){if(Yb)return ap.exports;Yb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),ap.exports=S3(),ap.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qb;function j3(){if(qb)return Wi;qb=1;var e=C3(),n=Ku(),a=M0();function o(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var r=t,i=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(i=r.return),t=r.return;while(t)}return r.tag===3?i:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function m(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(c(t)!==t)throw Error(o(188))}function h(t){var r=t.alternate;if(!r){if(r=c(t),r===null)throw Error(o(188));return r!==t?null:t}for(var i=t,u=r;;){var x=i.return;if(x===null)break;var v=x.alternate;if(v===null){if(u=x.return,u!==null){i=u;continue}break}if(x.child===v.child){for(v=x.child;v;){if(v===i)return p(x),t;if(v===u)return p(x),r;v=v.sibling}throw Error(o(188))}if(i.return!==u.return)i=x,u=v;else{for(var C=!1,R=x.child;R;){if(R===i){C=!0,i=x,u=v;break}if(R===u){C=!0,u=x,i=v;break}R=R.sibling}if(!C){for(R=v.child;R;){if(R===i){C=!0,i=v,u=x;break}if(R===u){C=!0,u=v,i=x;break}R=R.sibling}if(!C)throw Error(o(189))}}if(i.alternate!==u)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?t:r}function b(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=b(t),r!==null)return r;t=t.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function ue(t){return t===null||typeof t!="object"?null:(t=q&&t[q]||t["@@iterator"],typeof t=="function"?t:null)}var pe=Symbol.for("react.client.reference");function xe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===pe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case S:return"Fragment";case N:return"Profiler";case E:return"StrictMode";case O:return"Suspense";case M:return"SuspenseList";case K:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case j:return"Portal";case T:return t.displayName||"Context";case k:return(t._context.displayName||"Context")+".Consumer";case A:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case z:return r=t.displayName||null,r!==null?r:xe(t.type)||"Memo";case B:r=t._payload,t=t._init;try{return xe(t(r))}catch{}}return null}var se=Array.isArray,L=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},Z=[],te=-1;function _(t){return{current:t}}function D(t){0>te||(t.current=Z[te],Z[te]=null,te--)}function G(t,r){te++,Z[te]=t.current,t.current=r}var V=_(null),F=_(null),oe=_(null),ae=_(null);function be(t,r){switch(G(oe,r),G(F,t),G(V,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?lb(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=lb(r),t=cb(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}D(V),G(V,t)}function ve(){D(V),D(F),D(oe)}function Y(t){t.memoizedState!==null&&G(ae,t);var r=V.current,i=cb(r,t.type);r!==i&&(G(F,t),G(V,i))}function le(t){F.current===t&&(D(V),D(F)),ae.current===t&&(D(ae),Ui._currentValue=H)}var ye,Te;function Le(t){if(ye===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);ye=r&&r[1]||"",Te=-1<i.stack.indexOf(`
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ye+t+Te}var rt=!1;function ht(t,r){if(!t||rt)return"";rt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ne){var J=ne}Reflect.construct(t,[],de)}else{try{de.call()}catch(ne){J=ne}t.call(de.prototype)}}else{try{throw Error()}catch(ne){J=ne}(de=t())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ne){if(ne&&J&&typeof ne.stack=="string")return[ne.stack,J.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),C=v[0],R=v[1];if(C&&R){var P=C.split(`
`),Q=R.split(`
`);for(x=u=0;u<P.length&&!P[u].includes("DetermineComponentFrameRoot");)u++;for(;x<Q.length&&!Q[x].includes("DetermineComponentFrameRoot");)x++;if(u===P.length||x===Q.length)for(u=P.length-1,x=Q.length-1;1<=u&&0<=x&&P[u]!==Q[x];)x--;for(;1<=u&&0<=x;u--,x--)if(P[u]!==Q[x]){if(u!==1||x!==1)do if(u--,x--,0>x||P[u]!==Q[x]){var ie=`
`+P[u].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",t.displayName)),ie}while(1<=u&&0<=x);break}}}finally{rt=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Le(i):""}function Mt(t,r){switch(t.tag){case 26:case 27:case 5:return Le(t.type);case 16:return Le("Lazy");case 13:return t.child!==r&&r!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return ht(t.type,!1);case 11:return ht(t.type.render,!1);case 1:return ht(t.type,!0);case 31:return Le("Activity");default:return""}}function Tr(t){try{var r="",i=null;do r+=Mt(t,i),i=t,t=t.return;while(t);return r}catch(u){return`
Error generating stack: `+u.message+`
`+u.stack}}var _t=Object.prototype.hasOwnProperty,Ya=e.unstable_scheduleCallback,qa=e.unstable_cancelCallback,qt=e.unstable_shouldYield,dr=e.unstable_requestPaint,Kt=e.unstable_now,ti=e.unstable_getCurrentPriorityLevel,fr=e.unstable_ImmediatePriority,Lo=e.unstable_UserBlockingPriority,Rr=e.unstable_NormalPriority,Xt=e.unstable_LowPriority,Qn=e.unstable_IdlePriority,zo=e.log,mr=e.unstable_setDisableYieldValue,pr=null,Ht=null;function ee(t){if(typeof zo=="function"&&mr(t),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(pr,t)}catch{}}var re=Math.clz32?Math.clz32:De,ke=Math.log,we=Math.LN2;function De(t){return t>>>=0,t===0?32:31-(ke(t)/we|0)|0}var at=256,ct=262144,mt=4194304;function Zt(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Me(t,r,i){var u=t.pendingLanes;if(u===0)return 0;var x=0,v=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var R=u&134217727;return R!==0?(u=R&~v,u!==0?x=Zt(u):(C&=R,C!==0?x=Zt(C):i||(i=R&~t,i!==0&&(x=Zt(i))))):(R=u&~v,R!==0?x=Zt(R):C!==0?x=Zt(C):i||(i=u&~t,i!==0&&(x=Zt(i)))),x===0?0:r!==0&&r!==x&&(r&v)===0&&(v=x&-x,i=r&-r,v>=i||v===32&&(i&4194048)!==0)?r:x}function Je(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function St(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kt(){var t=mt;return mt<<=1,(mt&62914560)===0&&(mt=4194304),t}function Jn(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function wt(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function dn(t,r,i,u,x,v){var C=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var R=t.entanglements,P=t.expirationTimes,Q=t.hiddenUpdates;for(i=C&~i;0<i;){var ie=31-re(i),de=1<<ie;R[ie]=0,P[ie]=-1;var J=Q[ie];if(J!==null)for(Q[ie]=null,ie=0;ie<J.length;ie++){var ne=J[ie];ne!==null&&(ne.lane&=-536870913)}i&=~de}u!==0&&Ka(t,u,0),v!==0&&x===0&&t.tag!==0&&(t.suspendedLanes|=v&~(C&~r))}function Ka(t,r,i){t.pendingLanes|=r,t.suspendedLanes&=~r;var u=31-re(r);t.entangledLanes|=r,t.entanglements[u]=t.entanglements[u]|1073741824|i&261930}function fn(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var u=31-re(i),x=1<<u;x&r|t[u]&r&&(t[u]|=r),i&=~x}}function mn(t,r){var i=r&-r;return i=(i&42)!==0?1:Po(i),(i&(t.suspendedLanes|r))!==0?0:i}function Po(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function er(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Hd(){var t=I.p;return t!==0?t:(t=window.event,t===void 0?32:_b(t.type))}function qg(t,r){var i=I.p;try{return I.p=t,r()}finally{I.p=i}}var sa=Math.random().toString(36).slice(2),Qt="__reactFiber$"+sa,pn="__reactProps$"+sa,Io="__reactContainer$"+sa,Vd="__reactEvents$"+sa,aN="__reactListeners$"+sa,oN="__reactHandles$"+sa,Kg="__reactResources$"+sa,ni="__reactMarker$"+sa;function Gd(t){delete t[Qt],delete t[pn],delete t[Vd],delete t[aN],delete t[oN]}function $o(t){var r=t[Qt];if(r)return r;for(var i=t.parentNode;i;){if(r=i[Io]||i[Qt]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=gb(t);t!==null;){if(i=t[Qt])return i;t=gb(t)}return r}t=i,i=t.parentNode}return null}function Bo(t){if(t=t[Qt]||t[Io]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function ri(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(o(33))}function Uo(t){var r=t[Kg];return r||(r=t[Kg]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Vt(t){t[ni]=!0}var Xg=new Set,Zg={};function Xa(t,r){Ho(t,r),Ho(t+"Capture",r)}function Ho(t,r){for(Zg[t]=r,t=0;t<r.length;t++)Xg.add(r[t])}var sN=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Qg={},Jg={};function iN(t){return _t.call(Jg,t)?!0:_t.call(Qg,t)?!1:sN.test(t)?Jg[t]=!0:(Qg[t]=!0,!1)}function Hl(t,r,i){if(iN(r))if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+i)}}function Vl(t,r,i){if(i===null)t.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+i)}}function Ar(t,r,i,u){if(u===null)t.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(r,i,""+u)}}function In(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ex(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function lN(t,r,i){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var x=u.get,v=u.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return x.call(this)},set:function(C){i=""+C,v.call(this,C)}}),Object.defineProperty(t,r,{enumerable:u.enumerable}),{getValue:function(){return i},setValue:function(C){i=""+C},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Fd(t){if(!t._valueTracker){var r=ex(t)?"checked":"value";t._valueTracker=lN(t,r,""+t[r])}}function tx(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var i=r.getValue(),u="";return t&&(u=ex(t)?t.checked?"true":"false":t.value),t=u,t!==i?(r.setValue(t),!0):!1}function Gl(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var cN=/[\n"\\]/g;function $n(t){return t.replace(cN,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Wd(t,r,i,u,x,v,C,R){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),r!=null?C==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+In(r)):t.value!==""+In(r)&&(t.value=""+In(r)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),r!=null?Yd(t,C,In(r)):i!=null?Yd(t,C,In(i)):u!=null&&t.removeAttribute("value"),x==null&&v!=null&&(t.defaultChecked=!!v),x!=null&&(t.checked=x&&typeof x!="function"&&typeof x!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+In(R):t.removeAttribute("name")}function nx(t,r,i,u,x,v,C,R){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.type=v),r!=null||i!=null){if(!(v!=="submit"&&v!=="reset"||r!=null)){Fd(t);return}i=i!=null?""+In(i):"",r=r!=null?""+In(r):i,R||r===t.value||(t.value=r),t.defaultValue=r}u=u??x,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=R?t.checked:!!u,t.defaultChecked=!!u,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),Fd(t)}function Yd(t,r,i){r==="number"&&Gl(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function Vo(t,r,i,u){if(t=t.options,r){r={};for(var x=0;x<i.length;x++)r["$"+i[x]]=!0;for(i=0;i<t.length;i++)x=r.hasOwnProperty("$"+t[i].value),t[i].selected!==x&&(t[i].selected=x),x&&u&&(t[i].defaultSelected=!0)}else{for(i=""+In(i),r=null,x=0;x<t.length;x++){if(t[x].value===i){t[x].selected=!0,u&&(t[x].defaultSelected=!0);return}r!==null||t[x].disabled||(r=t[x])}r!==null&&(r.selected=!0)}}function rx(t,r,i){if(r!=null&&(r=""+In(r),r!==t.value&&(t.value=r),i==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=i!=null?""+In(i):""}function ax(t,r,i,u){if(r==null){if(u!=null){if(i!=null)throw Error(o(92));if(se(u)){if(1<u.length)throw Error(o(93));u=u[0]}i=u}i==null&&(i=""),r=i}i=In(r),t.defaultValue=i,u=t.textContent,u===i&&u!==""&&u!==null&&(t.value=u),Fd(t)}function Go(t,r){if(r){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=r;return}}t.textContent=r}var uN=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ox(t,r,i){var u=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?u?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":u?t.setProperty(r,i):typeof i!="number"||i===0||uN.has(r)?r==="float"?t.cssFloat=i:t[r]=(""+i).trim():t[r]=i+"px"}function sx(t,r,i){if(r!=null&&typeof r!="object")throw Error(o(62));if(t=t.style,i!=null){for(var u in i)!i.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var x in r)u=r[x],r.hasOwnProperty(x)&&i[x]!==u&&ox(t,x,u)}else for(var v in r)r.hasOwnProperty(v)&&ox(t,v,r[v])}function qd(t){if(t.indexOf("-")===-1)return!1;switch(t){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 dN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),fN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Fl(t){return fN.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Mr(){}var Kd=null;function Xd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Fo=null,Wo=null;function ix(t){var r=Bo(t);if(r&&(t=r.stateNode)){var i=t[pn]||null;e:switch(t=r.stateNode,r.type){case"input":if(Wd(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+$n(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var u=i[r];if(u!==t&&u.form===t.form){var x=u[pn]||null;if(!x)throw Error(o(90));Wd(u,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(r=0;r<i.length;r++)u=i[r],u.form===t.form&&tx(u)}break e;case"textarea":rx(t,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&Vo(t,!!i.multiple,r,!1)}}}var Zd=!1;function lx(t,r,i){if(Zd)return t(r,i);Zd=!0;try{var u=t(r);return u}finally{if(Zd=!1,(Fo!==null||Wo!==null)&&(_c(),Fo&&(r=Fo,t=Wo,Wo=Fo=null,ix(r),t)))for(r=0;r<t.length;r++)ix(t[r])}}function ai(t,r){var i=t.stateNode;if(i===null)return null;var u=i[pn]||null;if(u===null)return null;i=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(o(231,r,typeof i));return i}var _r=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qd=!1;if(_r)try{var oi={};Object.defineProperty(oi,"passive",{get:function(){Qd=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{Qd=!1}var ia=null,Jd=null,Wl=null;function cx(){if(Wl)return Wl;var t,r=Jd,i=r.length,u,x="value"in ia?ia.value:ia.textContent,v=x.length;for(t=0;t<i&&r[t]===x[t];t++);var C=i-t;for(u=1;u<=C&&r[i-u]===x[v-u];u++);return Wl=x.slice(t,1<u?1-u:void 0)}function Yl(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function ql(){return!0}function ux(){return!1}function hn(t){function r(i,u,x,v,C){this._reactName=i,this._targetInst=x,this.type=u,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var R in t)t.hasOwnProperty(R)&&(i=t[R],this[R]=i?i(v):v[R]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?ql:ux,this.isPropagationStopped=ux,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=ql)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ql)},persist:function(){},isPersistent:ql}),r}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kl=hn(Za),si=g({},Za,{view:0,detail:0}),mN=hn(si),ef,tf,ii,Xl=g({},si,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ii&&(ii&&t.type==="mousemove"?(ef=t.screenX-ii.screenX,tf=t.screenY-ii.screenY):tf=ef=0,ii=t),ef)},movementY:function(t){return"movementY"in t?t.movementY:tf}}),dx=hn(Xl),pN=g({},Xl,{dataTransfer:0}),hN=hn(pN),gN=g({},si,{relatedTarget:0}),nf=hn(gN),xN=g({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),vN=hn(xN),bN=g({},Za,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),yN=hn(bN),wN=g({},Za,{data:0}),fx=hn(wN),CN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SN={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"},jN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NN(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=jN[t])?!!r[t]:!1}function rf(){return NN}var EN=g({},si,{key:function(t){if(t.key){var r=CN[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Yl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?SN[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rf,charCode:function(t){return t.type==="keypress"?Yl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Yl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),kN=hn(EN),TN=g({},Xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mx=hn(TN),RN=g({},si,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rf}),AN=hn(RN),MN=g({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),_N=hn(MN),ON=g({},Xl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),DN=hn(ON),LN=g({},Za,{newState:0,oldState:0}),zN=hn(LN),PN=[9,13,27,32],af=_r&&"CompositionEvent"in window,li=null;_r&&"documentMode"in document&&(li=document.documentMode);var IN=_r&&"TextEvent"in window&&!li,px=_r&&(!af||li&&8<li&&11>=li),hx=" ",gx=!1;function xx(t,r){switch(t){case"keyup":return PN.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Yo=!1;function $N(t,r){switch(t){case"compositionend":return vx(r);case"keypress":return r.which!==32?null:(gx=!0,hx);case"textInput":return t=r.data,t===hx&&gx?null:t;default:return null}}function BN(t,r){if(Yo)return t==="compositionend"||!af&&xx(t,r)?(t=cx(),Wl=Jd=ia=null,Yo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return px&&r.locale!=="ko"?null:r.data;default:return null}}var UN={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 bx(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!UN[t.type]:r==="textarea"}function yx(t,r,i,u){Fo?Wo?Wo.push(u):Wo=[u]:Fo=u,r=$c(r,"onChange"),0<r.length&&(i=new Kl("onChange","change",null,i,u),t.push({event:i,listeners:r}))}var ci=null,ui=null;function HN(t){nb(t,0)}function Zl(t){var r=ri(t);if(tx(r))return t}function wx(t,r){if(t==="change")return r}var Cx=!1;if(_r){var of;if(_r){var sf="oninput"in document;if(!sf){var Sx=document.createElement("div");Sx.setAttribute("oninput","return;"),sf=typeof Sx.oninput=="function"}of=sf}else of=!1;Cx=of&&(!document.documentMode||9<document.documentMode)}function jx(){ci&&(ci.detachEvent("onpropertychange",Nx),ui=ci=null)}function Nx(t){if(t.propertyName==="value"&&Zl(ui)){var r=[];yx(r,ui,t,Xd(t)),lx(HN,r)}}function VN(t,r,i){t==="focusin"?(jx(),ci=r,ui=i,ci.attachEvent("onpropertychange",Nx)):t==="focusout"&&jx()}function GN(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Zl(ui)}function FN(t,r){if(t==="click")return Zl(r)}function WN(t,r){if(t==="input"||t==="change")return Zl(r)}function YN(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Sn=typeof Object.is=="function"?Object.is:YN;function di(t,r){if(Sn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var i=Object.keys(t),u=Object.keys(r);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var x=i[u];if(!_t.call(r,x)||!Sn(t[x],r[x]))return!1}return!0}function Ex(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function kx(t,r){var i=Ex(t);t=0;for(var u;i;){if(i.nodeType===3){if(u=t+i.textContent.length,t<=r&&u>=r)return{node:i,offset:r-t};t=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Ex(i)}}function Tx(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Tx(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Rx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Gl(t.document);r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=Gl(t.document)}return r}function lf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var qN=_r&&"documentMode"in document&&11>=document.documentMode,qo=null,cf=null,fi=null,uf=!1;function Ax(t,r,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;uf||qo==null||qo!==Gl(u)||(u=qo,"selectionStart"in u&&lf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),fi&&di(fi,u)||(fi=u,u=$c(cf,"onSelect"),0<u.length&&(r=new Kl("onSelect","select",null,r,i),t.push({event:r,listeners:u}),r.target=qo)))}function Qa(t,r){var i={};return i[t.toLowerCase()]=r.toLowerCase(),i["Webkit"+t]="webkit"+r,i["Moz"+t]="moz"+r,i}var Ko={animationend:Qa("Animation","AnimationEnd"),animationiteration:Qa("Animation","AnimationIteration"),animationstart:Qa("Animation","AnimationStart"),transitionrun:Qa("Transition","TransitionRun"),transitionstart:Qa("Transition","TransitionStart"),transitioncancel:Qa("Transition","TransitionCancel"),transitionend:Qa("Transition","TransitionEnd")},df={},Mx={};_r&&(Mx=document.createElement("div").style,"AnimationEvent"in window||(delete Ko.animationend.animation,delete Ko.animationiteration.animation,delete Ko.animationstart.animation),"TransitionEvent"in window||delete Ko.transitionend.transition);function Ja(t){if(df[t])return df[t];if(!Ko[t])return t;var r=Ko[t],i;for(i in r)if(r.hasOwnProperty(i)&&i in Mx)return df[t]=r[i];return t}var _x=Ja("animationend"),Ox=Ja("animationiteration"),Dx=Ja("animationstart"),KN=Ja("transitionrun"),XN=Ja("transitionstart"),ZN=Ja("transitioncancel"),Lx=Ja("transitionend"),zx=new Map,ff="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ff.push("scrollEnd");function tr(t,r){zx.set(t,r),Xa(r,[t])}var Ql=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Bn=[],Xo=0,mf=0;function Jl(){for(var t=Xo,r=mf=Xo=0;r<t;){var i=Bn[r];Bn[r++]=null;var u=Bn[r];Bn[r++]=null;var x=Bn[r];Bn[r++]=null;var v=Bn[r];if(Bn[r++]=null,u!==null&&x!==null){var C=u.pending;C===null?x.next=x:(x.next=C.next,C.next=x),u.pending=x}v!==0&&Px(i,x,v)}}function ec(t,r,i,u){Bn[Xo++]=t,Bn[Xo++]=r,Bn[Xo++]=i,Bn[Xo++]=u,mf|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function pf(t,r,i,u){return ec(t,r,i,u),tc(t)}function eo(t,r){return ec(t,null,null,r),tc(t)}function Px(t,r,i){t.lanes|=i;var u=t.alternate;u!==null&&(u.lanes|=i);for(var x=!1,v=t.return;v!==null;)v.childLanes|=i,u=v.alternate,u!==null&&(u.childLanes|=i),v.tag===22&&(t=v.stateNode,t===null||t._visibility&1||(x=!0)),t=v,v=v.return;return t.tag===3?(v=t.stateNode,x&&r!==null&&(x=31-re(i),t=v.hiddenUpdates,u=t[x],u===null?t[x]=[r]:u.push(r),r.lane=i|536870912),v):null}function tc(t){if(50<Di)throw Di=0,Sm=null,Error(o(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Zo={};function QN(t,r,i,u){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(t,r,i,u){return new QN(t,r,i,u)}function hf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Or(t,r){var i=t.alternate;return i===null?(i=jn(t.tag,r,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=r,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,r=t.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function Ix(t,r){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,r=i.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function nc(t,r,i,u,x,v){var C=0;if(u=t,typeof t=="function")hf(t)&&(C=1);else if(typeof t=="string")C=r3(t,i,V.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case K:return t=jn(31,i,r,x),t.elementType=K,t.lanes=v,t;case S:return to(i.children,x,v,r);case E:C=8,x|=24;break;case N:return t=jn(12,i,r,x|2),t.elementType=N,t.lanes=v,t;case O:return t=jn(13,i,r,x),t.elementType=O,t.lanes=v,t;case M:return t=jn(19,i,r,x),t.elementType=M,t.lanes=v,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case T:C=10;break e;case k:C=9;break e;case A:C=11;break e;case z:C=14;break e;case B:C=16,u=null;break e}C=29,i=Error(o(130,t===null?"null":typeof t,"")),u=null}return r=jn(C,i,r,x),r.elementType=t,r.type=u,r.lanes=v,r}function to(t,r,i,u){return t=jn(7,t,u,r),t.lanes=i,t}function gf(t,r,i){return t=jn(6,t,null,r),t.lanes=i,t}function $x(t){var r=jn(18,null,null,0);return r.stateNode=t,r}function xf(t,r,i){return r=jn(4,t.children!==null?t.children:[],t.key,r),r.lanes=i,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Bx=new WeakMap;function Un(t,r){if(typeof t=="object"&&t!==null){var i=Bx.get(t);return i!==void 0?i:(r={value:t,source:r,stack:Tr(r)},Bx.set(t,r),r)}return{value:t,source:r,stack:Tr(r)}}var Qo=[],Jo=0,rc=null,mi=0,Hn=[],Vn=0,la=null,hr=1,gr="";function Dr(t,r){Qo[Jo++]=mi,Qo[Jo++]=rc,rc=t,mi=r}function Ux(t,r,i){Hn[Vn++]=hr,Hn[Vn++]=gr,Hn[Vn++]=la,la=t;var u=hr;t=gr;var x=32-re(u)-1;u&=~(1<<x),i+=1;var v=32-re(r)+x;if(30<v){var C=x-x%5;v=(u&(1<<C)-1).toString(32),u>>=C,x-=C,hr=1<<32-re(r)+x|i<<x|u,gr=v+t}else hr=1<<v|i<<x|u,gr=t}function vf(t){t.return!==null&&(Dr(t,1),Ux(t,1,0))}function bf(t){for(;t===rc;)rc=Qo[--Jo],Qo[Jo]=null,mi=Qo[--Jo],Qo[Jo]=null;for(;t===la;)la=Hn[--Vn],Hn[Vn]=null,gr=Hn[--Vn],Hn[Vn]=null,hr=Hn[--Vn],Hn[Vn]=null}function Hx(t,r){Hn[Vn++]=hr,Hn[Vn++]=gr,Hn[Vn++]=la,hr=r.id,gr=r.overflow,la=t}var Jt=null,xt=null,Qe=!1,ca=null,Gn=!1,yf=Error(o(519));function ua(t){var r=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pi(Un(r,t)),yf}function Vx(t){var r=t.stateNode,i=t.type,u=t.memoizedProps;switch(r[Qt]=t,r[pn]=u,i){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(i=0;i<zi.length;i++)Fe(zi[i],r);break;case"source":Fe("error",r);break;case"img":case"image":case"link":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"input":Fe("invalid",r),nx(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Fe("invalid",r);break;case"textarea":Fe("invalid",r),ax(r,u.value,u.defaultValue,u.children)}i=u.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||u.suppressHydrationWarning===!0||sb(r.textContent,i)?(u.popover!=null&&(Fe("beforetoggle",r),Fe("toggle",r)),u.onScroll!=null&&Fe("scroll",r),u.onScrollEnd!=null&&Fe("scrollend",r),u.onClick!=null&&(r.onclick=Mr),r=!0):r=!1,r||ua(t,!0)}function Gx(t){for(Jt=t.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:Gn=!1;return;case 27:case 3:Gn=!0;return;default:Jt=Jt.return}}function es(t){if(t!==Jt)return!1;if(!Qe)return Gx(t),Qe=!0,!1;var r=t.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||Im(t.type,t.memoizedProps)),i=!i),i&&xt&&ua(t),Gx(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));xt=hb(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));xt=hb(t)}else r===27?(r=xt,ja(t.type)?(t=Vm,Vm=null,xt=t):xt=r):xt=Jt?Wn(t.stateNode.nextSibling):null;return!0}function no(){xt=Jt=null,Qe=!1}function wf(){var t=ca;return t!==null&&(bn===null?bn=t:bn.push.apply(bn,t),ca=null),t}function pi(t){ca===null?ca=[t]:ca.push(t)}var Cf=_(null),ro=null,Lr=null;function da(t,r,i){G(Cf,r._currentValue),r._currentValue=i}function zr(t){t._currentValue=Cf.current,D(Cf)}function Sf(t,r,i){for(;t!==null;){var u=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),t===i)break;t=t.return}}function jf(t,r,i,u){var x=t.child;for(x!==null&&(x.return=t);x!==null;){var v=x.dependencies;if(v!==null){var C=x.child;v=v.firstContext;e:for(;v!==null;){var R=v;v=x;for(var P=0;P<r.length;P++)if(R.context===r[P]){v.lanes|=i,R=v.alternate,R!==null&&(R.lanes|=i),Sf(v.return,i,t),u||(C=null);break e}v=R.next}}else if(x.tag===18){if(C=x.return,C===null)throw Error(o(341));C.lanes|=i,v=C.alternate,v!==null&&(v.lanes|=i),Sf(C,i,t),C=null}else C=x.child;if(C!==null)C.return=x;else for(C=x;C!==null;){if(C===t){C=null;break}if(x=C.sibling,x!==null){x.return=C.return,C=x;break}C=C.return}x=C}}function ts(t,r,i,u){t=null;for(var x=r,v=!1;x!==null;){if(!v){if((x.flags&524288)!==0)v=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var C=x.alternate;if(C===null)throw Error(o(387));if(C=C.memoizedProps,C!==null){var R=x.type;Sn(x.pendingProps.value,C.value)||(t!==null?t.push(R):t=[R])}}else if(x===ae.current){if(C=x.alternate,C===null)throw Error(o(387));C.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(t!==null?t.push(Ui):t=[Ui])}x=x.return}t!==null&&jf(r,t,i,u),r.flags|=262144}function ac(t){for(t=t.firstContext;t!==null;){if(!Sn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ao(t){ro=t,Lr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function en(t){return Fx(ro,t)}function oc(t,r){return ro===null&&ao(t),Fx(t,r)}function Fx(t,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},Lr===null){if(t===null)throw Error(o(308));Lr=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Lr=Lr.next=r;return i}var JN=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(i,u){t.push(u)}};this.abort=function(){r.aborted=!0,t.forEach(function(i){return i()})}},e4=e.unstable_scheduleCallback,t4=e.unstable_NormalPriority,Ot={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nf(){return{controller:new JN,data:new Map,refCount:0}}function hi(t){t.refCount--,t.refCount===0&&e4(t4,function(){t.controller.abort()})}var gi=null,Ef=0,ns=0,rs=null;function n4(t,r){if(gi===null){var i=gi=[];Ef=0,ns=Rm(),rs={status:"pending",value:void 0,then:function(u){i.push(u)}}}return Ef++,r.then(Wx,Wx),r}function Wx(){if(--Ef===0&&gi!==null){rs!==null&&(rs.status="fulfilled");var t=gi;gi=null,ns=0,rs=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function r4(t,r){var i=[],u={status:"pending",value:null,reason:null,then:function(x){i.push(x)}};return t.then(function(){u.status="fulfilled",u.value=r;for(var x=0;x<i.length;x++)(0,i[x])(r)},function(x){for(u.status="rejected",u.reason=x,x=0;x<i.length;x++)(0,i[x])(void 0)}),u}var Yx=L.S;L.S=function(t,r){A1=Kt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&n4(t,r),Yx!==null&&Yx(t,r)};var oo=_(null);function kf(){var t=oo.current;return t!==null?t:pt.pooledCache}function sc(t,r){r===null?G(oo,oo.current):G(oo,r.pool)}function qx(){var t=kf();return t===null?null:{parent:Ot._currentValue,pool:t}}var as=Error(o(460)),Tf=Error(o(474)),ic=Error(o(542)),lc={then:function(){}};function Kx(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Xx(t,r,i){switch(i=t[i],i===void 0?t.push(r):i!==r&&(r.then(Mr,Mr),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Qx(t),t;default:if(typeof r.status=="string")r.then(Mr,Mr);else{if(t=pt,t!==null&&100<t.shellSuspendCounter)throw Error(o(482));t=r,t.status="pending",t.then(function(u){if(r.status==="pending"){var x=r;x.status="fulfilled",x.value=u}},function(u){if(r.status==="pending"){var x=r;x.status="rejected",x.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Qx(t),t}throw io=r,as}}function so(t){try{var r=t._init;return r(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(io=i,as):i}}var io=null;function Zx(){if(io===null)throw Error(o(459));var t=io;return io=null,t}function Qx(t){if(t===as||t===ic)throw Error(o(483))}var os=null,xi=0;function cc(t){var r=xi;return xi+=1,os===null&&(os=[]),Xx(os,t,r)}function vi(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function uc(t,r){throw r.$$typeof===y?Error(o(525)):(t=Object.prototype.toString.call(r),Error(o(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Jx(t){function r(W,$){if(t){var X=W.deletions;X===null?(W.deletions=[$],W.flags|=16):X.push($)}}function i(W,$){if(!t)return null;for(;$!==null;)r(W,$),$=$.sibling;return null}function u(W){for(var $=new Map;W!==null;)W.key!==null?$.set(W.key,W):$.set(W.index,W),W=W.sibling;return $}function x(W,$){return W=Or(W,$),W.index=0,W.sibling=null,W}function v(W,$,X){return W.index=X,t?(X=W.alternate,X!==null?(X=X.index,X<$?(W.flags|=67108866,$):X):(W.flags|=67108866,$)):(W.flags|=1048576,$)}function C(W){return t&&W.alternate===null&&(W.flags|=67108866),W}function R(W,$,X,ce){return $===null||$.tag!==6?($=gf(X,W.mode,ce),$.return=W,$):($=x($,X),$.return=W,$)}function P(W,$,X,ce){var _e=X.type;return _e===S?ie(W,$,X.props.children,ce,X.key):$!==null&&($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===B&&so(_e)===$.type)?($=x($,X.props),vi($,X),$.return=W,$):($=nc(X.type,X.key,X.props,null,W.mode,ce),vi($,X),$.return=W,$)}function Q(W,$,X,ce){return $===null||$.tag!==4||$.stateNode.containerInfo!==X.containerInfo||$.stateNode.implementation!==X.implementation?($=xf(X,W.mode,ce),$.return=W,$):($=x($,X.children||[]),$.return=W,$)}function ie(W,$,X,ce,_e){return $===null||$.tag!==7?($=to(X,W.mode,ce,_e),$.return=W,$):($=x($,X),$.return=W,$)}function de(W,$,X){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=gf(""+$,W.mode,X),$.return=W,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case w:return X=nc($.type,$.key,$.props,null,W.mode,X),vi(X,$),X.return=W,X;case j:return $=xf($,W.mode,X),$.return=W,$;case B:return $=so($),de(W,$,X)}if(se($)||ue($))return $=to($,W.mode,X,null),$.return=W,$;if(typeof $.then=="function")return de(W,cc($),X);if($.$$typeof===T)return de(W,oc(W,$),X);uc(W,$)}return null}function J(W,$,X,ce){var _e=$!==null?$.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return _e!==null?null:R(W,$,""+X,ce);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case w:return X.key===_e?P(W,$,X,ce):null;case j:return X.key===_e?Q(W,$,X,ce):null;case B:return X=so(X),J(W,$,X,ce)}if(se(X)||ue(X))return _e!==null?null:ie(W,$,X,ce,null);if(typeof X.then=="function")return J(W,$,cc(X),ce);if(X.$$typeof===T)return J(W,$,oc(W,X),ce);uc(W,X)}return null}function ne(W,$,X,ce,_e){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return W=W.get(X)||null,R($,W,""+ce,_e);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case w:return W=W.get(ce.key===null?X:ce.key)||null,P($,W,ce,_e);case j:return W=W.get(ce.key===null?X:ce.key)||null,Q($,W,ce,_e);case B:return ce=so(ce),ne(W,$,X,ce,_e)}if(se(ce)||ue(ce))return W=W.get(X)||null,ie($,W,ce,_e,null);if(typeof ce.then=="function")return ne(W,$,X,cc(ce),_e);if(ce.$$typeof===T)return ne(W,$,X,oc($,ce),_e);uc($,ce)}return null}function Ne(W,$,X,ce){for(var _e=null,et=null,Re=$,Ue=$=0,Ke=null;Re!==null&&Ue<X.length;Ue++){Re.index>Ue?(Ke=Re,Re=null):Ke=Re.sibling;var tt=J(W,Re,X[Ue],ce);if(tt===null){Re===null&&(Re=Ke);break}t&&Re&&tt.alternate===null&&r(W,Re),$=v(tt,$,Ue),et===null?_e=tt:et.sibling=tt,et=tt,Re=Ke}if(Ue===X.length)return i(W,Re),Qe&&Dr(W,Ue),_e;if(Re===null){for(;Ue<X.length;Ue++)Re=de(W,X[Ue],ce),Re!==null&&($=v(Re,$,Ue),et===null?_e=Re:et.sibling=Re,et=Re);return Qe&&Dr(W,Ue),_e}for(Re=u(Re);Ue<X.length;Ue++)Ke=ne(Re,W,Ue,X[Ue],ce),Ke!==null&&(t&&Ke.alternate!==null&&Re.delete(Ke.key===null?Ue:Ke.key),$=v(Ke,$,Ue),et===null?_e=Ke:et.sibling=Ke,et=Ke);return t&&Re.forEach(function(Ra){return r(W,Ra)}),Qe&&Dr(W,Ue),_e}function Oe(W,$,X,ce){if(X==null)throw Error(o(151));for(var _e=null,et=null,Re=$,Ue=$=0,Ke=null,tt=X.next();Re!==null&&!tt.done;Ue++,tt=X.next()){Re.index>Ue?(Ke=Re,Re=null):Ke=Re.sibling;var Ra=J(W,Re,tt.value,ce);if(Ra===null){Re===null&&(Re=Ke);break}t&&Re&&Ra.alternate===null&&r(W,Re),$=v(Ra,$,Ue),et===null?_e=Ra:et.sibling=Ra,et=Ra,Re=Ke}if(tt.done)return i(W,Re),Qe&&Dr(W,Ue),_e;if(Re===null){for(;!tt.done;Ue++,tt=X.next())tt=de(W,tt.value,ce),tt!==null&&($=v(tt,$,Ue),et===null?_e=tt:et.sibling=tt,et=tt);return Qe&&Dr(W,Ue),_e}for(Re=u(Re);!tt.done;Ue++,tt=X.next())tt=ne(Re,W,Ue,tt.value,ce),tt!==null&&(t&&tt.alternate!==null&&Re.delete(tt.key===null?Ue:tt.key),$=v(tt,$,Ue),et===null?_e=tt:et.sibling=tt,et=tt);return t&&Re.forEach(function(p3){return r(W,p3)}),Qe&&Dr(W,Ue),_e}function ft(W,$,X,ce){if(typeof X=="object"&&X!==null&&X.type===S&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case w:e:{for(var _e=X.key;$!==null;){if($.key===_e){if(_e=X.type,_e===S){if($.tag===7){i(W,$.sibling),ce=x($,X.props.children),ce.return=W,W=ce;break e}}else if($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===B&&so(_e)===$.type){i(W,$.sibling),ce=x($,X.props),vi(ce,X),ce.return=W,W=ce;break e}i(W,$);break}else r(W,$);$=$.sibling}X.type===S?(ce=to(X.props.children,W.mode,ce,X.key),ce.return=W,W=ce):(ce=nc(X.type,X.key,X.props,null,W.mode,ce),vi(ce,X),ce.return=W,W=ce)}return C(W);case j:e:{for(_e=X.key;$!==null;){if($.key===_e)if($.tag===4&&$.stateNode.containerInfo===X.containerInfo&&$.stateNode.implementation===X.implementation){i(W,$.sibling),ce=x($,X.children||[]),ce.return=W,W=ce;break e}else{i(W,$);break}else r(W,$);$=$.sibling}ce=xf(X,W.mode,ce),ce.return=W,W=ce}return C(W);case B:return X=so(X),ft(W,$,X,ce)}if(se(X))return Ne(W,$,X,ce);if(ue(X)){if(_e=ue(X),typeof _e!="function")throw Error(o(150));return X=_e.call(X),Oe(W,$,X,ce)}if(typeof X.then=="function")return ft(W,$,cc(X),ce);if(X.$$typeof===T)return ft(W,$,oc(W,X),ce);uc(W,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,$!==null&&$.tag===6?(i(W,$.sibling),ce=x($,X),ce.return=W,W=ce):(i(W,$),ce=gf(X,W.mode,ce),ce.return=W,W=ce),C(W)):i(W,$)}return function(W,$,X,ce){try{xi=0;var _e=ft(W,$,X,ce);return os=null,_e}catch(Re){if(Re===as||Re===ic)throw Re;var et=jn(29,Re,null,W.mode);return et.lanes=ce,et.return=W,et}finally{}}}var lo=Jx(!0),ev=Jx(!1),fa=!1;function Rf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Af(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ma(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function pa(t,r,i){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(nt&2)!==0){var x=u.pending;return x===null?r.next=r:(r.next=x.next,x.next=r),u.pending=r,r=tc(t),Px(t,null,i),r}return ec(t,u,r,i),tc(t)}function bi(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var u=r.lanes;u&=t.pendingLanes,i|=u,r.lanes=i,fn(t,i)}}function Mf(t,r){var i=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var x=null,v=null;if(i=i.firstBaseUpdate,i!==null){do{var C={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};v===null?x=v=C:v=v.next=C,i=i.next}while(i!==null);v===null?x=v=r:v=v.next=r}else x=v=r;i={baseState:u.baseState,firstBaseUpdate:x,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}var _f=!1;function yi(){if(_f){var t=rs;if(t!==null)throw t}}function wi(t,r,i,u){_f=!1;var x=t.updateQueue;fa=!1;var v=x.firstBaseUpdate,C=x.lastBaseUpdate,R=x.shared.pending;if(R!==null){x.shared.pending=null;var P=R,Q=P.next;P.next=null,C===null?v=Q:C.next=Q,C=P;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,R=ie.lastBaseUpdate,R!==C&&(R===null?ie.firstBaseUpdate=Q:R.next=Q,ie.lastBaseUpdate=P))}if(v!==null){var de=x.baseState;C=0,ie=Q=P=null,R=v;do{var J=R.lane&-536870913,ne=J!==R.lane;if(ne?(qe&J)===J:(u&J)===J){J!==0&&J===ns&&(_f=!0),ie!==null&&(ie=ie.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ne=t,Oe=R;J=r;var ft=i;switch(Oe.tag){case 1:if(Ne=Oe.payload,typeof Ne=="function"){de=Ne.call(ft,de,J);break e}de=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Oe.payload,J=typeof Ne=="function"?Ne.call(ft,de,J):Ne,J==null)break e;de=g({},de,J);break e;case 2:fa=!0}}J=R.callback,J!==null&&(t.flags|=64,ne&&(t.flags|=8192),ne=x.callbacks,ne===null?x.callbacks=[J]:ne.push(J))}else ne={lane:J,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ie===null?(Q=ie=ne,P=de):ie=ie.next=ne,C|=J;if(R=R.next,R===null){if(R=x.shared.pending,R===null)break;ne=R,R=ne.next,ne.next=null,x.lastBaseUpdate=ne,x.shared.pending=null}}while(!0);ie===null&&(P=de),x.baseState=P,x.firstBaseUpdate=Q,x.lastBaseUpdate=ie,v===null&&(x.shared.lanes=0),ba|=C,t.lanes=C,t.memoizedState=de}}function tv(t,r){if(typeof t!="function")throw Error(o(191,t));t.call(r)}function nv(t,r){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)tv(i[t],r)}var ss=_(null),dc=_(0);function rv(t,r){t=Fr,G(dc,t),G(ss,r),Fr=t|r.baseLanes}function Of(){G(dc,Fr),G(ss,ss.current)}function Df(){Fr=dc.current,D(ss),D(dc)}var Nn=_(null),Fn=null;function ha(t){var r=t.alternate;G(Tt,Tt.current&1),G(Nn,t),Fn===null&&(r===null||ss.current!==null||r.memoizedState!==null)&&(Fn=t)}function Lf(t){G(Tt,Tt.current),G(Nn,t),Fn===null&&(Fn=t)}function av(t){t.tag===22?(G(Tt,Tt.current),G(Nn,t),Fn===null&&(Fn=t)):ga()}function ga(){G(Tt,Tt.current),G(Nn,Nn.current)}function En(t){D(Nn),Fn===t&&(Fn=null),D(Tt)}var Tt=_(0);function fc(t){for(var r=t;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Um(i)||Hm(i)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Pr=0,$e=null,ut=null,Dt=null,mc=!1,is=!1,co=!1,pc=0,Ci=0,ls=null,a4=0;function jt(){throw Error(o(321))}function zf(t,r){if(r===null)return!1;for(var i=0;i<r.length&&i<t.length;i++)if(!Sn(t[i],r[i]))return!1;return!0}function Pf(t,r,i,u,x,v){return Pr=v,$e=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,L.H=t===null||t.memoizedState===null?Uv:Qf,co=!1,v=i(u,x),co=!1,is&&(v=sv(r,i,u,x)),ov(t),v}function ov(t){L.H=Ni;var r=ut!==null&&ut.next!==null;if(Pr=0,Dt=ut=$e=null,mc=!1,Ci=0,ls=null,r)throw Error(o(300));t===null||Lt||(t=t.dependencies,t!==null&&ac(t)&&(Lt=!0))}function sv(t,r,i,u){$e=t;var x=0;do{if(is&&(ls=null),Ci=0,is=!1,25<=x)throw Error(o(301));if(x+=1,Dt=ut=null,t.updateQueue!=null){var v=t.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}L.H=Hv,v=r(i,u)}while(is);return v}function o4(){var t=L.H,r=t.useState()[0];return r=typeof r.then=="function"?Si(r):r,t=t.useState()[0],(ut!==null?ut.memoizedState:null)!==t&&($e.flags|=1024),r}function If(){var t=pc!==0;return pc=0,t}function $f(t,r,i){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~i}function Bf(t){if(mc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}mc=!1}Pr=0,Dt=ut=$e=null,is=!1,Ci=pc=0,ls=null}function cn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?$e.memoizedState=Dt=t:Dt=Dt.next=t,Dt}function Rt(){if(ut===null){var t=$e.alternate;t=t!==null?t.memoizedState:null}else t=ut.next;var r=Dt===null?$e.memoizedState:Dt.next;if(r!==null)Dt=r,ut=t;else{if(t===null)throw $e.alternate===null?Error(o(467)):Error(o(310));ut=t,t={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Dt===null?$e.memoizedState=Dt=t:Dt=Dt.next=t}return Dt}function hc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Si(t){var r=Ci;return Ci+=1,ls===null&&(ls=[]),t=Xx(ls,t,r),r=$e,(Dt===null?r.memoizedState:Dt.next)===null&&(r=r.alternate,L.H=r===null||r.memoizedState===null?Uv:Qf),t}function gc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Si(t);if(t.$$typeof===T)return en(t)}throw Error(o(438,String(t)))}function Uf(t){var r=null,i=$e.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var u=$e.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(x){return x.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=hc(),$e.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(t),u=0;u<t;u++)i[u]=U;return r.index++,i}function Ir(t,r){return typeof r=="function"?r(t):r}function xc(t){var r=Rt();return Hf(r,ut,t)}function Hf(t,r,i){var u=t.queue;if(u===null)throw Error(o(311));u.lastRenderedReducer=i;var x=t.baseQueue,v=u.pending;if(v!==null){if(x!==null){var C=x.next;x.next=v.next,v.next=C}r.baseQueue=x=v,u.pending=null}if(v=t.baseState,x===null)t.memoizedState=v;else{r=x.next;var R=C=null,P=null,Q=r,ie=!1;do{var de=Q.lane&-536870913;if(de!==Q.lane?(qe&de)===de:(Pr&de)===de){var J=Q.revertLane;if(J===0)P!==null&&(P=P.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),de===ns&&(ie=!0);else if((Pr&J)===J){Q=Q.next,J===ns&&(ie=!0);continue}else de={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},P===null?(R=P=de,C=v):P=P.next=de,$e.lanes|=J,ba|=J;de=Q.action,co&&i(v,de),v=Q.hasEagerState?Q.eagerState:i(v,de)}else J={lane:de,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},P===null?(R=P=J,C=v):P=P.next=J,$e.lanes|=de,ba|=de;Q=Q.next}while(Q!==null&&Q!==r);if(P===null?C=v:P.next=R,!Sn(v,t.memoizedState)&&(Lt=!0,ie&&(i=rs,i!==null)))throw i;t.memoizedState=v,t.baseState=C,t.baseQueue=P,u.lastRenderedState=v}return x===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Vf(t){var r=Rt(),i=r.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=t;var u=i.dispatch,x=i.pending,v=r.memoizedState;if(x!==null){i.pending=null;var C=x=x.next;do v=t(v,C.action),C=C.next;while(C!==x);Sn(v,r.memoizedState)||(Lt=!0),r.memoizedState=v,r.baseQueue===null&&(r.baseState=v),i.lastRenderedState=v}return[v,u]}function iv(t,r,i){var u=$e,x=Rt(),v=Qe;if(v){if(i===void 0)throw Error(o(407));i=i()}else i=r();var C=!Sn((ut||x).memoizedState,i);if(C&&(x.memoizedState=i,Lt=!0),x=x.queue,Wf(uv.bind(null,u,x,t),[t]),x.getSnapshot!==r||C||Dt!==null&&Dt.memoizedState.tag&1){if(u.flags|=2048,cs(9,{destroy:void 0},cv.bind(null,u,x,i,r),null),pt===null)throw Error(o(349));v||(Pr&127)!==0||lv(u,r,i)}return i}function lv(t,r,i){t.flags|=16384,t={getSnapshot:r,value:i},r=$e.updateQueue,r===null?(r=hc(),$e.updateQueue=r,r.stores=[t]):(i=r.stores,i===null?r.stores=[t]:i.push(t))}function cv(t,r,i,u){r.value=i,r.getSnapshot=u,dv(r)&&fv(t)}function uv(t,r,i){return i(function(){dv(r)&&fv(t)})}function dv(t){var r=t.getSnapshot;t=t.value;try{var i=r();return!Sn(t,i)}catch{return!0}}function fv(t){var r=eo(t,2);r!==null&&yn(r,t,2)}function Gf(t){var r=cn();if(typeof t=="function"){var i=t;if(t=i(),co){ee(!0);try{i()}finally{ee(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:t},r}function mv(t,r,i,u){return t.baseState=i,Hf(t,ut,typeof u=="function"?u:Ir)}function s4(t,r,i,u,x){if(yc(t))throw Error(o(485));if(t=r.action,t!==null){var v={payload:x,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){v.listeners.push(C)}};L.T!==null?i(!0):v.isTransition=!1,u(v),i=r.pending,i===null?(v.next=r.pending=v,pv(r,v)):(v.next=i.next,r.pending=i.next=v)}}function pv(t,r){var i=r.action,u=r.payload,x=t.state;if(r.isTransition){var v=L.T,C={};L.T=C;try{var R=i(x,u),P=L.S;P!==null&&P(C,R),hv(t,r,R)}catch(Q){Ff(t,r,Q)}finally{v!==null&&C.types!==null&&(v.types=C.types),L.T=v}}else try{v=i(x,u),hv(t,r,v)}catch(Q){Ff(t,r,Q)}}function hv(t,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(u){gv(t,r,u)},function(u){return Ff(t,r,u)}):gv(t,r,i)}function gv(t,r,i){r.status="fulfilled",r.value=i,xv(r),t.state=i,r=t.pending,r!==null&&(i=r.next,i===r?t.pending=null:(i=i.next,r.next=i,pv(t,i)))}function Ff(t,r,i){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=i,xv(r),r=r.next;while(r!==u)}t.action=null}function xv(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function vv(t,r){return r}function bv(t,r){if(Qe){var i=pt.formState;if(i!==null){e:{var u=$e;if(Qe){if(xt){t:{for(var x=xt,v=Gn;x.nodeType!==8;){if(!v){x=null;break t}if(x=Wn(x.nextSibling),x===null){x=null;break t}}v=x.data,x=v==="F!"||v==="F"?x:null}if(x){xt=Wn(x.nextSibling),u=x.data==="F!";break e}}ua(u)}u=!1}u&&(r=i[0])}}return i=cn(),i.memoizedState=i.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vv,lastRenderedState:r},i.queue=u,i=Iv.bind(null,$e,u),u.dispatch=i,u=Gf(!1),v=Zf.bind(null,$e,!1,u.queue),u=cn(),x={state:r,dispatch:null,action:t,pending:null},u.queue=x,i=s4.bind(null,$e,x,v,i),x.dispatch=i,u.memoizedState=t,[r,i,!1]}function yv(t){var r=Rt();return wv(r,ut,t)}function wv(t,r,i){if(r=Hf(t,r,vv)[0],t=xc(Ir)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=Si(r)}catch(C){throw C===as?ic:C}else u=r;r=Rt();var x=r.queue,v=x.dispatch;return i!==r.memoizedState&&($e.flags|=2048,cs(9,{destroy:void 0},i4.bind(null,x,i),null)),[u,v,t]}function i4(t,r){t.action=r}function Cv(t){var r=Rt(),i=ut;if(i!==null)return wv(r,i,t);Rt(),r=r.memoizedState,i=Rt();var u=i.queue.dispatch;return i.memoizedState=t,[r,u,!1]}function cs(t,r,i,u){return t={tag:t,create:i,deps:u,inst:r,next:null},r=$e.updateQueue,r===null&&(r=hc(),$e.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=t.next=t:(u=i.next,i.next=t,t.next=u,r.lastEffect=t),t}function Sv(){return Rt().memoizedState}function vc(t,r,i,u){var x=cn();$e.flags|=t,x.memoizedState=cs(1|r,{destroy:void 0},i,u===void 0?null:u)}function bc(t,r,i,u){var x=Rt();u=u===void 0?null:u;var v=x.memoizedState.inst;ut!==null&&u!==null&&zf(u,ut.memoizedState.deps)?x.memoizedState=cs(r,v,i,u):($e.flags|=t,x.memoizedState=cs(1|r,v,i,u))}function jv(t,r){vc(8390656,8,t,r)}function Wf(t,r){bc(2048,8,t,r)}function l4(t){$e.flags|=4;var r=$e.updateQueue;if(r===null)r=hc(),$e.updateQueue=r,r.events=[t];else{var i=r.events;i===null?r.events=[t]:i.push(t)}}function Nv(t){var r=Rt().memoizedState;return l4({ref:r,nextImpl:t}),function(){if((nt&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}function Ev(t,r){return bc(4,2,t,r)}function kv(t,r){return bc(4,4,t,r)}function Tv(t,r){if(typeof r=="function"){t=t();var i=r(t);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Rv(t,r,i){i=i!=null?i.concat([t]):null,bc(4,4,Tv.bind(null,r,t),i)}function Yf(){}function Av(t,r){var i=Rt();r=r===void 0?null:r;var u=i.memoizedState;return r!==null&&zf(r,u[1])?u[0]:(i.memoizedState=[t,r],t)}function Mv(t,r){var i=Rt();r=r===void 0?null:r;var u=i.memoizedState;if(r!==null&&zf(r,u[1]))return u[0];if(u=t(),co){ee(!0);try{t()}finally{ee(!1)}}return i.memoizedState=[u,r],u}function qf(t,r,i){return i===void 0||(Pr&1073741824)!==0&&(qe&261930)===0?t.memoizedState=r:(t.memoizedState=i,t=_1(),$e.lanes|=t,ba|=t,i)}function _v(t,r,i,u){return Sn(i,r)?i:ss.current!==null?(t=qf(t,i,u),Sn(t,r)||(Lt=!0),t):(Pr&42)===0||(Pr&1073741824)!==0&&(qe&261930)===0?(Lt=!0,t.memoizedState=i):(t=_1(),$e.lanes|=t,ba|=t,r)}function Ov(t,r,i,u,x){var v=I.p;I.p=v!==0&&8>v?v:8;var C=L.T,R={};L.T=R,Zf(t,!1,r,i);try{var P=x(),Q=L.S;if(Q!==null&&Q(R,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var ie=r4(P,u);ji(t,r,ie,Rn(t))}else ji(t,r,u,Rn(t))}catch(de){ji(t,r,{then:function(){},status:"rejected",reason:de},Rn())}finally{I.p=v,C!==null&&R.types!==null&&(C.types=R.types),L.T=C}}function c4(){}function Kf(t,r,i,u){if(t.tag!==5)throw Error(o(476));var x=Dv(t).queue;Ov(t,x,r,H,i===null?c4:function(){return Lv(t),i(u)})}function Dv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:H},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:i},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Lv(t){var r=Dv(t);r.next===null&&(r=t.alternate.memoizedState),ji(t,r.next.queue,{},Rn())}function Xf(){return en(Ui)}function zv(){return Rt().memoizedState}function Pv(){return Rt().memoizedState}function u4(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var i=Rn();t=ma(i);var u=pa(r,t,i);u!==null&&(yn(u,r,i),bi(u,r,i)),r={cache:Nf()},t.payload=r;return}r=r.return}}function d4(t,r,i){var u=Rn();i={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},yc(t)?$v(r,i):(i=pf(t,r,i,u),i!==null&&(yn(i,t,u),Bv(i,r,u)))}function Iv(t,r,i){var u=Rn();ji(t,r,i,u)}function ji(t,r,i,u){var x={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(yc(t))$v(r,x);else{var v=t.alternate;if(t.lanes===0&&(v===null||v.lanes===0)&&(v=r.lastRenderedReducer,v!==null))try{var C=r.lastRenderedState,R=v(C,i);if(x.hasEagerState=!0,x.eagerState=R,Sn(R,C))return ec(t,r,x,0),pt===null&&Jl(),!1}catch{}finally{}if(i=pf(t,r,x,u),i!==null)return yn(i,t,u),Bv(i,r,u),!0}return!1}function Zf(t,r,i,u){if(u={lane:2,revertLane:Rm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},yc(t)){if(r)throw Error(o(479))}else r=pf(t,i,u,2),r!==null&&yn(r,t,2)}function yc(t){var r=t.alternate;return t===$e||r!==null&&r===$e}function $v(t,r){is=mc=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function Bv(t,r,i){if((i&4194048)!==0){var u=r.lanes;u&=t.pendingLanes,i|=u,r.lanes=i,fn(t,i)}}var Ni={readContext:en,use:gc,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};Ni.useEffectEvent=jt;var Uv={readContext:en,use:gc,useCallback:function(t,r){return cn().memoizedState=[t,r===void 0?null:r],t},useContext:en,useEffect:jv,useImperativeHandle:function(t,r,i){i=i!=null?i.concat([t]):null,vc(4194308,4,Tv.bind(null,r,t),i)},useLayoutEffect:function(t,r){return vc(4194308,4,t,r)},useInsertionEffect:function(t,r){vc(4,2,t,r)},useMemo:function(t,r){var i=cn();r=r===void 0?null:r;var u=t();if(co){ee(!0);try{t()}finally{ee(!1)}}return i.memoizedState=[u,r],u},useReducer:function(t,r,i){var u=cn();if(i!==void 0){var x=i(r);if(co){ee(!0);try{i(r)}finally{ee(!1)}}}else x=r;return u.memoizedState=u.baseState=x,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:x},u.queue=t,t=t.dispatch=d4.bind(null,$e,t),[u.memoizedState,t]},useRef:function(t){var r=cn();return t={current:t},r.memoizedState=t},useState:function(t){t=Gf(t);var r=t.queue,i=Iv.bind(null,$e,r);return r.dispatch=i,[t.memoizedState,i]},useDebugValue:Yf,useDeferredValue:function(t,r){var i=cn();return qf(i,t,r)},useTransition:function(){var t=Gf(!1);return t=Ov.bind(null,$e,t.queue,!0,!1),cn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,i){var u=$e,x=cn();if(Qe){if(i===void 0)throw Error(o(407));i=i()}else{if(i=r(),pt===null)throw Error(o(349));(qe&127)!==0||lv(u,r,i)}x.memoizedState=i;var v={value:i,getSnapshot:r};return x.queue=v,jv(uv.bind(null,u,v,t),[t]),u.flags|=2048,cs(9,{destroy:void 0},cv.bind(null,u,v,i,r),null),i},useId:function(){var t=cn(),r=pt.identifierPrefix;if(Qe){var i=gr,u=hr;i=(u&~(1<<32-re(u)-1)).toString(32)+i,r="_"+r+"R_"+i,i=pc++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=a4++,r="_"+r+"r_"+i.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Xf,useFormState:bv,useActionState:bv,useOptimistic:function(t){var r=cn();r.memoizedState=r.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=Zf.bind(null,$e,!0,i),i.dispatch=r,[t,r]},useMemoCache:Uf,useCacheRefresh:function(){return cn().memoizedState=u4.bind(null,$e)},useEffectEvent:function(t){var r=cn(),i={impl:t};return r.memoizedState=i,function(){if((nt&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},Qf={readContext:en,use:gc,useCallback:Av,useContext:en,useEffect:Wf,useImperativeHandle:Rv,useInsertionEffect:Ev,useLayoutEffect:kv,useMemo:Mv,useReducer:xc,useRef:Sv,useState:function(){return xc(Ir)},useDebugValue:Yf,useDeferredValue:function(t,r){var i=Rt();return _v(i,ut.memoizedState,t,r)},useTransition:function(){var t=xc(Ir)[0],r=Rt().memoizedState;return[typeof t=="boolean"?t:Si(t),r]},useSyncExternalStore:iv,useId:zv,useHostTransitionStatus:Xf,useFormState:yv,useActionState:yv,useOptimistic:function(t,r){var i=Rt();return mv(i,ut,t,r)},useMemoCache:Uf,useCacheRefresh:Pv};Qf.useEffectEvent=Nv;var Hv={readContext:en,use:gc,useCallback:Av,useContext:en,useEffect:Wf,useImperativeHandle:Rv,useInsertionEffect:Ev,useLayoutEffect:kv,useMemo:Mv,useReducer:Vf,useRef:Sv,useState:function(){return Vf(Ir)},useDebugValue:Yf,useDeferredValue:function(t,r){var i=Rt();return ut===null?qf(i,t,r):_v(i,ut.memoizedState,t,r)},useTransition:function(){var t=Vf(Ir)[0],r=Rt().memoizedState;return[typeof t=="boolean"?t:Si(t),r]},useSyncExternalStore:iv,useId:zv,useHostTransitionStatus:Xf,useFormState:Cv,useActionState:Cv,useOptimistic:function(t,r){var i=Rt();return ut!==null?mv(i,ut,t,r):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:Uf,useCacheRefresh:Pv};Hv.useEffectEvent=Nv;function Jf(t,r,i,u){r=t.memoizedState,i=i(u,r),i=i==null?r:g({},r,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var em={enqueueSetState:function(t,r,i){t=t._reactInternals;var u=Rn(),x=ma(u);x.payload=r,i!=null&&(x.callback=i),r=pa(t,x,u),r!==null&&(yn(r,t,u),bi(r,t,u))},enqueueReplaceState:function(t,r,i){t=t._reactInternals;var u=Rn(),x=ma(u);x.tag=1,x.payload=r,i!=null&&(x.callback=i),r=pa(t,x,u),r!==null&&(yn(r,t,u),bi(r,t,u))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var i=Rn(),u=ma(i);u.tag=2,r!=null&&(u.callback=r),r=pa(t,u,i),r!==null&&(yn(r,t,i),bi(r,t,i))}};function Vv(t,r,i,u,x,v,C){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,v,C):r.prototype&&r.prototype.isPureReactComponent?!di(i,u)||!di(x,v):!0}function Gv(t,r,i,u){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,u),r.state!==t&&em.enqueueReplaceState(r,r.state,null)}function uo(t,r){var i=r;if("ref"in r){i={};for(var u in r)u!=="ref"&&(i[u]=r[u])}if(t=t.defaultProps){i===r&&(i=g({},i));for(var x in t)i[x]===void 0&&(i[x]=t[x])}return i}function Fv(t){Ql(t)}function Wv(t){console.error(t)}function Yv(t){Ql(t)}function wc(t,r){try{var i=t.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function qv(t,r,i){try{var u=t.onCaughtError;u(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function tm(t,r,i){return i=ma(i),i.tag=3,i.payload={element:null},i.callback=function(){wc(t,r)},i}function Kv(t){return t=ma(t),t.tag=3,t}function Xv(t,r,i,u){var x=i.type.getDerivedStateFromError;if(typeof x=="function"){var v=u.value;t.payload=function(){return x(v)},t.callback=function(){qv(r,i,u)}}var C=i.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(t.callback=function(){qv(r,i,u),typeof x!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var R=u.stack;this.componentDidCatch(u.value,{componentStack:R!==null?R:""})})}function f4(t,r,i,u,x){if(i.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=i.alternate,r!==null&&ts(r,i,x,!0),i=Nn.current,i!==null){switch(i.tag){case 31:case 13:return Fn===null?Oc():i.alternate===null&&Nt===0&&(Nt=3),i.flags&=-257,i.flags|=65536,i.lanes=x,u===lc?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([u]):r.add(u),Em(t,u,x)),!1;case 22:return i.flags|=65536,u===lc?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([u]):i.add(u)),Em(t,u,x)),!1}throw Error(o(435,i.tag))}return Em(t,u,x),Oc(),!1}if(Qe)return r=Nn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=x,u!==yf&&(t=Error(o(422),{cause:u}),pi(Un(t,i)))):(u!==yf&&(r=Error(o(423),{cause:u}),pi(Un(r,i))),t=t.current.alternate,t.flags|=65536,x&=-x,t.lanes|=x,u=Un(u,i),x=tm(t.stateNode,u,x),Mf(t,x),Nt!==4&&(Nt=2)),!1;var v=Error(o(520),{cause:u});if(v=Un(v,i),Oi===null?Oi=[v]:Oi.push(v),Nt!==4&&(Nt=2),r===null)return!0;u=Un(u,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,t=x&-x,i.lanes|=t,t=tm(i.stateNode,u,t),Mf(i,t),!1;case 1:if(r=i.type,v=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ya===null||!ya.has(v))))return i.flags|=65536,x&=-x,i.lanes|=x,x=Kv(x),Xv(x,t,i,u),Mf(i,x),!1}i=i.return}while(i!==null);return!1}var nm=Error(o(461)),Lt=!1;function tn(t,r,i,u){r.child=t===null?ev(r,null,i,u):lo(r,t.child,i,u)}function Zv(t,r,i,u,x){i=i.render;var v=r.ref;if("ref"in u){var C={};for(var R in u)R!=="ref"&&(C[R]=u[R])}else C=u;return ao(r),u=Pf(t,r,i,C,v,x),R=If(),t!==null&&!Lt?($f(t,r,x),$r(t,r,x)):(Qe&&R&&vf(r),r.flags|=1,tn(t,r,u,x),r.child)}function Qv(t,r,i,u,x){if(t===null){var v=i.type;return typeof v=="function"&&!hf(v)&&v.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=v,Jv(t,r,v,u,x)):(t=nc(i.type,null,u,r,r.mode,x),t.ref=r.ref,t.return=r,r.child=t)}if(v=t.child,!um(t,x)){var C=v.memoizedProps;if(i=i.compare,i=i!==null?i:di,i(C,u)&&t.ref===r.ref)return $r(t,r,x)}return r.flags|=1,t=Or(v,u),t.ref=r.ref,t.return=r,r.child=t}function Jv(t,r,i,u,x){if(t!==null){var v=t.memoizedProps;if(di(v,u)&&t.ref===r.ref)if(Lt=!1,r.pendingProps=u=v,um(t,x))(t.flags&131072)!==0&&(Lt=!0);else return r.lanes=t.lanes,$r(t,r,x)}return rm(t,r,i,u,x)}function e1(t,r,i,u){var x=u.children,v=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(v=v!==null?v.baseLanes|i:i,t!==null){for(u=r.child=t.child,x=0;u!==null;)x=x|u.lanes|u.childLanes,u=u.sibling;u=x&~v}else u=0,r.child=null;return t1(t,r,v,i,u)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&sc(r,v!==null?v.cachePool:null),v!==null?rv(r,v):Of(),av(r);else return u=r.lanes=536870912,t1(t,r,v!==null?v.baseLanes|i:i,i,u)}else v!==null?(sc(r,v.cachePool),rv(r,v),ga(),r.memoizedState=null):(t!==null&&sc(r,null),Of(),ga());return tn(t,r,x,i),r.child}function Ei(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function t1(t,r,i,u,x){var v=kf();return v=v===null?null:{parent:Ot._currentValue,pool:v},r.memoizedState={baseLanes:i,cachePool:v},t!==null&&sc(r,null),Of(),av(r),t!==null&&ts(t,r,u,!0),r.childLanes=x,null}function Cc(t,r){return r=jc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function n1(t,r,i){return lo(r,t.child,null,i),t=Cc(r,r.pendingProps),t.flags|=2,En(r),r.memoizedState=null,t}function m4(t,r,i){var u=r.pendingProps,x=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(Qe){if(u.mode==="hidden")return t=Cc(r,u),r.lanes=536870912,Ei(null,t);if(Lf(r),(t=xt)?(t=pb(t,Gn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la!==null?{id:hr,overflow:gr}:null,retryLane:536870912,hydrationErrors:null},i=$x(t),i.return=r,r.child=i,Jt=r,xt=null)):t=null,t===null)throw ua(r);return r.lanes=536870912,null}return Cc(r,u)}var v=t.memoizedState;if(v!==null){var C=v.dehydrated;if(Lf(r),x)if(r.flags&256)r.flags&=-257,r=n1(t,r,i);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(o(558));else if(Lt||ts(t,r,i,!1),x=(i&t.childLanes)!==0,Lt||x){if(u=pt,u!==null&&(C=mn(u,i),C!==0&&C!==v.retryLane))throw v.retryLane=C,eo(t,C),yn(u,t,C),nm;Oc(),r=n1(t,r,i)}else t=v.treeContext,xt=Wn(C.nextSibling),Jt=r,Qe=!0,ca=null,Gn=!1,t!==null&&Hx(r,t),r=Cc(r,u),r.flags|=4096;return r}return t=Or(t.child,{mode:u.mode,children:u.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Sc(t,r){var i=r.ref;if(i===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(t===null||t.ref!==i)&&(r.flags|=4194816)}}function rm(t,r,i,u,x){return ao(r),i=Pf(t,r,i,u,void 0,x),u=If(),t!==null&&!Lt?($f(t,r,x),$r(t,r,x)):(Qe&&u&&vf(r),r.flags|=1,tn(t,r,i,x),r.child)}function r1(t,r,i,u,x,v){return ao(r),r.updateQueue=null,i=sv(r,u,i,x),ov(t),u=If(),t!==null&&!Lt?($f(t,r,v),$r(t,r,v)):(Qe&&u&&vf(r),r.flags|=1,tn(t,r,i,v),r.child)}function a1(t,r,i,u,x){if(ao(r),r.stateNode===null){var v=Zo,C=i.contextType;typeof C=="object"&&C!==null&&(v=en(C)),v=new i(u,v),r.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=em,r.stateNode=v,v._reactInternals=r,v=r.stateNode,v.props=u,v.state=r.memoizedState,v.refs={},Rf(r),C=i.contextType,v.context=typeof C=="object"&&C!==null?en(C):Zo,v.state=r.memoizedState,C=i.getDerivedStateFromProps,typeof C=="function"&&(Jf(r,i,C,u),v.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(C=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),C!==v.state&&em.enqueueReplaceState(v,v.state,null),wi(r,u,v,x),yi(),v.state=r.memoizedState),typeof v.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(t===null){v=r.stateNode;var R=r.memoizedProps,P=uo(i,R);v.props=P;var Q=v.context,ie=i.contextType;C=Zo,typeof ie=="object"&&ie!==null&&(C=en(ie));var de=i.getDerivedStateFromProps;ie=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",R=r.pendingProps!==R,ie||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(R||Q!==C)&&Gv(r,v,u,C),fa=!1;var J=r.memoizedState;v.state=J,wi(r,u,v,x),yi(),Q=r.memoizedState,R||J!==Q||fa?(typeof de=="function"&&(Jf(r,i,de,u),Q=r.memoizedState),(P=fa||Vv(r,i,P,u,J,Q,C))?(ie||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(r.flags|=4194308)):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=Q),v.props=u,v.state=Q,v.context=C,u=P):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{v=r.stateNode,Af(t,r),C=r.memoizedProps,ie=uo(i,C),v.props=ie,de=r.pendingProps,J=v.context,Q=i.contextType,P=Zo,typeof Q=="object"&&Q!==null&&(P=en(Q)),R=i.getDerivedStateFromProps,(Q=typeof R=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==de||J!==P)&&Gv(r,v,u,P),fa=!1,J=r.memoizedState,v.state=J,wi(r,u,v,x),yi();var ne=r.memoizedState;C!==de||J!==ne||fa||t!==null&&t.dependencies!==null&&ac(t.dependencies)?(typeof R=="function"&&(Jf(r,i,R,u),ne=r.memoizedState),(ie=fa||Vv(r,i,ie,u,J,ne,P)||t!==null&&t.dependencies!==null&&ac(t.dependencies))?(Q||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ne,P),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ne,P)),typeof v.componentDidUpdate=="function"&&(r.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===t.memoizedProps&&J===t.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&J===t.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=ne),v.props=u,v.state=ne,v.context=P,u=ie):(typeof v.componentDidUpdate!="function"||C===t.memoizedProps&&J===t.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&J===t.memoizedState||(r.flags|=1024),u=!1)}return v=u,Sc(t,r),u=(r.flags&128)!==0,v||u?(v=r.stateNode,i=u&&typeof i.getDerivedStateFromError!="function"?null:v.render(),r.flags|=1,t!==null&&u?(r.child=lo(r,t.child,null,x),r.child=lo(r,null,i,x)):tn(t,r,i,x),r.memoizedState=v.state,t=r.child):t=$r(t,r,x),t}function o1(t,r,i,u){return no(),r.flags|=256,tn(t,r,i,u),r.child}var am={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function om(t){return{baseLanes:t,cachePool:qx()}}function sm(t,r,i){return t=t!==null?t.childLanes&~i:0,r&&(t|=Tn),t}function s1(t,r,i){var u=r.pendingProps,x=!1,v=(r.flags&128)!==0,C;if((C=v)||(C=t!==null&&t.memoizedState===null?!1:(Tt.current&2)!==0),C&&(x=!0,r.flags&=-129),C=(r.flags&32)!==0,r.flags&=-33,t===null){if(Qe){if(x?ha(r):ga(),(t=xt)?(t=pb(t,Gn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la!==null?{id:hr,overflow:gr}:null,retryLane:536870912,hydrationErrors:null},i=$x(t),i.return=r,r.child=i,Jt=r,xt=null)):t=null,t===null)throw ua(r);return Hm(t)?r.lanes=32:r.lanes=536870912,null}var R=u.children;return u=u.fallback,x?(ga(),x=r.mode,R=jc({mode:"hidden",children:R},x),u=to(u,x,i,null),R.return=r,u.return=r,R.sibling=u,r.child=R,u=r.child,u.memoizedState=om(i),u.childLanes=sm(t,C,i),r.memoizedState=am,Ei(null,u)):(ha(r),im(r,R))}var P=t.memoizedState;if(P!==null&&(R=P.dehydrated,R!==null)){if(v)r.flags&256?(ha(r),r.flags&=-257,r=lm(t,r,i)):r.memoizedState!==null?(ga(),r.child=t.child,r.flags|=128,r=null):(ga(),R=u.fallback,x=r.mode,u=jc({mode:"visible",children:u.children},x),R=to(R,x,i,null),R.flags|=2,u.return=r,R.return=r,u.sibling=R,r.child=u,lo(r,t.child,null,i),u=r.child,u.memoizedState=om(i),u.childLanes=sm(t,C,i),r.memoizedState=am,r=Ei(null,u));else if(ha(r),Hm(R)){if(C=R.nextSibling&&R.nextSibling.dataset,C)var Q=C.dgst;C=Q,u=Error(o(419)),u.stack="",u.digest=C,pi({value:u,source:null,stack:null}),r=lm(t,r,i)}else if(Lt||ts(t,r,i,!1),C=(i&t.childLanes)!==0,Lt||C){if(C=pt,C!==null&&(u=mn(C,i),u!==0&&u!==P.retryLane))throw P.retryLane=u,eo(t,u),yn(C,t,u),nm;Um(R)||Oc(),r=lm(t,r,i)}else Um(R)?(r.flags|=192,r.child=t.child,r=null):(t=P.treeContext,xt=Wn(R.nextSibling),Jt=r,Qe=!0,ca=null,Gn=!1,t!==null&&Hx(r,t),r=im(r,u.children),r.flags|=4096);return r}return x?(ga(),R=u.fallback,x=r.mode,P=t.child,Q=P.sibling,u=Or(P,{mode:"hidden",children:u.children}),u.subtreeFlags=P.subtreeFlags&65011712,Q!==null?R=Or(Q,R):(R=to(R,x,i,null),R.flags|=2),R.return=r,u.return=r,u.sibling=R,r.child=u,Ei(null,u),u=r.child,R=t.child.memoizedState,R===null?R=om(i):(x=R.cachePool,x!==null?(P=Ot._currentValue,x=x.parent!==P?{parent:P,pool:P}:x):x=qx(),R={baseLanes:R.baseLanes|i,cachePool:x}),u.memoizedState=R,u.childLanes=sm(t,C,i),r.memoizedState=am,Ei(t.child,u)):(ha(r),i=t.child,t=i.sibling,i=Or(i,{mode:"visible",children:u.children}),i.return=r,i.sibling=null,t!==null&&(C=r.deletions,C===null?(r.deletions=[t],r.flags|=16):C.push(t)),r.child=i,r.memoizedState=null,i)}function im(t,r){return r=jc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function jc(t,r){return t=jn(22,t,null,r),t.lanes=0,t}function lm(t,r,i){return lo(r,t.child,null,i),t=im(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function i1(t,r,i){t.lanes|=r;var u=t.alternate;u!==null&&(u.lanes|=r),Sf(t.return,r,i)}function cm(t,r,i,u,x,v){var C=t.memoizedState;C===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:x,treeForkCount:v}:(C.isBackwards=r,C.rendering=null,C.renderingStartTime=0,C.last=u,C.tail=i,C.tailMode=x,C.treeForkCount=v)}function l1(t,r,i){var u=r.pendingProps,x=u.revealOrder,v=u.tail;u=u.children;var C=Tt.current,R=(C&2)!==0;if(R?(C=C&1|2,r.flags|=128):C&=1,G(Tt,C),tn(t,r,u,i),u=Qe?mi:0,!R&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&i1(t,i,r);else if(t.tag===19)i1(t,i,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(x){case"forwards":for(i=r.child,x=null;i!==null;)t=i.alternate,t!==null&&fc(t)===null&&(x=i),i=i.sibling;i=x,i===null?(x=r.child,r.child=null):(x=i.sibling,i.sibling=null),cm(r,!1,x,i,v,u);break;case"backwards":case"unstable_legacy-backwards":for(i=null,x=r.child,r.child=null;x!==null;){if(t=x.alternate,t!==null&&fc(t)===null){r.child=x;break}t=x.sibling,x.sibling=i,i=x,x=t}cm(r,!0,i,null,v,u);break;case"together":cm(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function $r(t,r,i){if(t!==null&&(r.dependencies=t.dependencies),ba|=r.lanes,(i&r.childLanes)===0)if(t!==null){if(ts(t,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(o(153));if(r.child!==null){for(t=r.child,i=Or(t,t.pendingProps),r.child=i,i.return=r;t.sibling!==null;)t=t.sibling,i=i.sibling=Or(t,t.pendingProps),i.return=r;i.sibling=null}return r.child}function um(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&ac(t)))}function p4(t,r,i){switch(r.tag){case 3:be(r,r.stateNode.containerInfo),da(r,Ot,t.memoizedState.cache),no();break;case 27:case 5:Y(r);break;case 4:be(r,r.stateNode.containerInfo);break;case 10:da(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Lf(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(ha(r),r.flags|=128,null):(i&r.child.childLanes)!==0?s1(t,r,i):(ha(r),t=$r(t,r,i),t!==null?t.sibling:null);ha(r);break;case 19:var x=(t.flags&128)!==0;if(u=(i&r.childLanes)!==0,u||(ts(t,r,i,!1),u=(i&r.childLanes)!==0),x){if(u)return l1(t,r,i);r.flags|=128}if(x=r.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),G(Tt,Tt.current),u)break;return null;case 22:return r.lanes=0,e1(t,r,i,r.pendingProps);case 24:da(r,Ot,t.memoizedState.cache)}return $r(t,r,i)}function c1(t,r,i){if(t!==null)if(t.memoizedProps!==r.pendingProps)Lt=!0;else{if(!um(t,i)&&(r.flags&128)===0)return Lt=!1,p4(t,r,i);Lt=(t.flags&131072)!==0}else Lt=!1,Qe&&(r.flags&1048576)!==0&&Ux(r,mi,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(t=so(r.elementType),r.type=t,typeof t=="function")hf(t)?(u=uo(t,u),r.tag=1,r=a1(null,r,t,u,i)):(r.tag=0,r=rm(null,r,t,u,i));else{if(t!=null){var x=t.$$typeof;if(x===A){r.tag=11,r=Zv(null,r,t,u,i);break e}else if(x===z){r.tag=14,r=Qv(null,r,t,u,i);break e}}throw r=xe(t)||t,Error(o(306,r,""))}}return r;case 0:return rm(t,r,r.type,r.pendingProps,i);case 1:return u=r.type,x=uo(u,r.pendingProps),a1(t,r,u,x,i);case 3:e:{if(be(r,r.stateNode.containerInfo),t===null)throw Error(o(387));u=r.pendingProps;var v=r.memoizedState;x=v.element,Af(t,r),wi(r,u,null,i);var C=r.memoizedState;if(u=C.cache,da(r,Ot,u),u!==v.cache&&jf(r,[Ot],i,!0),yi(),u=C.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:C.cache},r.updateQueue.baseState=v,r.memoizedState=v,r.flags&256){r=o1(t,r,u,i);break e}else if(u!==x){x=Un(Error(o(424)),r),pi(x),r=o1(t,r,u,i);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(xt=Wn(t.firstChild),Jt=r,Qe=!0,ca=null,Gn=!0,i=ev(r,null,u,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(no(),u===x){r=$r(t,r,i);break e}tn(t,r,u,i)}r=r.child}return r;case 26:return Sc(t,r),t===null?(i=yb(r.type,null,r.pendingProps,null))?r.memoizedState=i:Qe||(i=r.type,t=r.pendingProps,u=Bc(oe.current).createElement(i),u[Qt]=r,u[pn]=t,nn(u,i,t),Vt(u),r.stateNode=u):r.memoizedState=yb(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return Y(r),t===null&&Qe&&(u=r.stateNode=xb(r.type,r.pendingProps,oe.current),Jt=r,Gn=!0,x=xt,ja(r.type)?(Vm=x,xt=Wn(u.firstChild)):xt=x),tn(t,r,r.pendingProps.children,i),Sc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Qe&&((x=u=xt)&&(u=G4(u,r.type,r.pendingProps,Gn),u!==null?(r.stateNode=u,Jt=r,xt=Wn(u.firstChild),Gn=!1,x=!0):x=!1),x||ua(r)),Y(r),x=r.type,v=r.pendingProps,C=t!==null?t.memoizedProps:null,u=v.children,Im(x,v)?u=null:C!==null&&Im(x,C)&&(r.flags|=32),r.memoizedState!==null&&(x=Pf(t,r,o4,null,null,i),Ui._currentValue=x),Sc(t,r),tn(t,r,u,i),r.child;case 6:return t===null&&Qe&&((t=i=xt)&&(i=F4(i,r.pendingProps,Gn),i!==null?(r.stateNode=i,Jt=r,xt=null,t=!0):t=!1),t||ua(r)),null;case 13:return s1(t,r,i);case 4:return be(r,r.stateNode.containerInfo),u=r.pendingProps,t===null?r.child=lo(r,null,u,i):tn(t,r,u,i),r.child;case 11:return Zv(t,r,r.type,r.pendingProps,i);case 7:return tn(t,r,r.pendingProps,i),r.child;case 8:return tn(t,r,r.pendingProps.children,i),r.child;case 12:return tn(t,r,r.pendingProps.children,i),r.child;case 10:return u=r.pendingProps,da(r,r.type,u.value),tn(t,r,u.children,i),r.child;case 9:return x=r.type._context,u=r.pendingProps.children,ao(r),x=en(x),u=u(x),r.flags|=1,tn(t,r,u,i),r.child;case 14:return Qv(t,r,r.type,r.pendingProps,i);case 15:return Jv(t,r,r.type,r.pendingProps,i);case 19:return l1(t,r,i);case 31:return m4(t,r,i);case 22:return e1(t,r,i,r.pendingProps);case 24:return ao(r),u=en(Ot),t===null?(x=kf(),x===null&&(x=pt,v=Nf(),x.pooledCache=v,v.refCount++,v!==null&&(x.pooledCacheLanes|=i),x=v),r.memoizedState={parent:u,cache:x},Rf(r),da(r,Ot,x)):((t.lanes&i)!==0&&(Af(t,r),wi(r,null,null,i),yi()),x=t.memoizedState,v=r.memoizedState,x.parent!==u?(x={parent:u,cache:u},r.memoizedState=x,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=x),da(r,Ot,u)):(u=v.cache,da(r,Ot,u),u!==x.cache&&jf(r,[Ot],i,!0))),tn(t,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(o(156,r.tag))}function Br(t){t.flags|=4}function dm(t,r,i,u,x){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(x&335544128)===x)if(t.stateNode.complete)t.flags|=8192;else if(z1())t.flags|=8192;else throw io=lc,Tf}else t.flags&=-16777217}function u1(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Nb(r))if(z1())t.flags|=8192;else throw io=lc,Tf}function Nc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?kt():536870912,t.lanes|=r,ms|=r)}function ki(t,r){if(!Qe)switch(t.tailMode){case"hidden":r=t.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function vt(t){var r=t.alternate!==null&&t.alternate.child===t.child,i=0,u=0;if(r)for(var x=t.child;x!==null;)i|=x.lanes|x.childLanes,u|=x.subtreeFlags&65011712,u|=x.flags&65011712,x.return=t,x=x.sibling;else for(x=t.child;x!==null;)i|=x.lanes|x.childLanes,u|=x.subtreeFlags,u|=x.flags,x.return=t,x=x.sibling;return t.subtreeFlags|=u,t.childLanes=i,r}function h4(t,r,i){var u=r.pendingProps;switch(bf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(r),null;case 1:return vt(r),null;case 3:return i=r.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),zr(Ot),ve(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(es(r)?Br(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,wf())),vt(r),null;case 26:var x=r.type,v=r.memoizedState;return t===null?(Br(r),v!==null?(vt(r),u1(r,v)):(vt(r),dm(r,x,null,u,i))):v?v!==t.memoizedState?(Br(r),vt(r),u1(r,v)):(vt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==u&&Br(r),vt(r),dm(r,x,t,u,i)),null;case 27:if(le(r),i=oe.current,x=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==u&&Br(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return vt(r),null}t=V.current,es(r)?Vx(r):(t=xb(x,u,i),r.stateNode=t,Br(r))}return vt(r),null;case 5:if(le(r),x=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==u&&Br(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return vt(r),null}if(v=V.current,es(r))Vx(r);else{var C=Bc(oe.current);switch(v){case 1:v=C.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:v=C.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":v=C.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":v=C.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":v=C.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?C.createElement("select",{is:u.is}):C.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?C.createElement(x,{is:u.is}):C.createElement(x)}}v[Qt]=r,v[pn]=u;e:for(C=r.child;C!==null;){if(C.tag===5||C.tag===6)v.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===r)break e;for(;C.sibling===null;){if(C.return===null||C.return===r)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}r.stateNode=v;e:switch(nn(v,x,u),x){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Br(r)}}return vt(r),dm(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,i),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==u&&Br(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(o(166));if(t=oe.current,es(r)){if(t=r.stateNode,i=r.memoizedProps,u=null,x=Jt,x!==null)switch(x.tag){case 27:case 5:u=x.memoizedProps}t[Qt]=r,t=!!(t.nodeValue===i||u!==null&&u.suppressHydrationWarning===!0||sb(t.nodeValue,i)),t||ua(r,!0)}else t=Bc(t).createTextNode(u),t[Qt]=r,r.stateNode=t}return vt(r),null;case 31:if(i=r.memoizedState,t===null||t.memoizedState!==null){if(u=es(r),i!==null){if(t===null){if(!u)throw Error(o(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Qt]=r}else no(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;vt(r),t=!1}else i=wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return r.flags&256?(En(r),r):(En(r),null);if((r.flags&128)!==0)throw Error(o(558))}return vt(r),null;case 13:if(u=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(x=es(r),u!==null&&u.dehydrated!==null){if(t===null){if(!x)throw Error(o(318));if(x=r.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(o(317));x[Qt]=r}else no(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;vt(r),x=!1}else x=wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=x),x=!0;if(!x)return r.flags&256?(En(r),r):(En(r),null)}return En(r),(r.flags&128)!==0?(r.lanes=i,r):(i=u!==null,t=t!==null&&t.memoizedState!==null,i&&(u=r.child,x=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(x=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==x&&(u.flags|=2048)),i!==t&&i&&(r.child.flags|=8192),Nc(r,r.updateQueue),vt(r),null);case 4:return ve(),t===null&&Om(r.stateNode.containerInfo),vt(r),null;case 10:return zr(r.type),vt(r),null;case 19:if(D(Tt),u=r.memoizedState,u===null)return vt(r),null;if(x=(r.flags&128)!==0,v=u.rendering,v===null)if(x)ki(u,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(v=fc(t),v!==null){for(r.flags|=128,ki(u,!1),t=v.updateQueue,r.updateQueue=t,Nc(r,t),r.subtreeFlags=0,t=i,i=r.child;i!==null;)Ix(i,t),i=i.sibling;return G(Tt,Tt.current&1|2),Qe&&Dr(r,u.treeForkCount),r.child}t=t.sibling}u.tail!==null&&Kt()>Ac&&(r.flags|=128,x=!0,ki(u,!1),r.lanes=4194304)}else{if(!x)if(t=fc(v),t!==null){if(r.flags|=128,x=!0,t=t.updateQueue,r.updateQueue=t,Nc(r,t),ki(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!Qe)return vt(r),null}else 2*Kt()-u.renderingStartTime>Ac&&i!==536870912&&(r.flags|=128,x=!0,ki(u,!1),r.lanes=4194304);u.isBackwards?(v.sibling=r.child,r.child=v):(t=u.last,t!==null?t.sibling=v:r.child=v,u.last=v)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Kt(),t.sibling=null,i=Tt.current,G(Tt,x?i&1|2:i&1),Qe&&Dr(r,u.treeForkCount),t):(vt(r),null);case 22:case 23:return En(r),Df(),u=r.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(i&536870912)!==0&&(r.flags&128)===0&&(vt(r),r.subtreeFlags&6&&(r.flags|=8192)):vt(r),i=r.updateQueue,i!==null&&Nc(r,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==i&&(r.flags|=2048),t!==null&&D(oo),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),zr(Ot),vt(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function g4(t,r){switch(bf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return zr(Ot),ve(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return le(r),null;case 31:if(r.memoizedState!==null){if(En(r),r.alternate===null)throw Error(o(340));no()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(En(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(o(340));no()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return D(Tt),null;case 4:return ve(),null;case 10:return zr(r.type),null;case 22:case 23:return En(r),Df(),t!==null&&D(oo),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return zr(Ot),null;case 25:return null;default:return null}}function d1(t,r){switch(bf(r),r.tag){case 3:zr(Ot),ve();break;case 26:case 27:case 5:le(r);break;case 4:ve();break;case 31:r.memoizedState!==null&&En(r);break;case 13:En(r);break;case 19:D(Tt);break;case 10:zr(r.type);break;case 22:case 23:En(r),Df(),t!==null&&D(oo);break;case 24:zr(Ot)}}function Ti(t,r){try{var i=r.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var x=u.next;i=x;do{if((i.tag&t)===t){u=void 0;var v=i.create,C=i.inst;u=v(),C.destroy=u}i=i.next}while(i!==x)}}catch(R){st(r,r.return,R)}}function xa(t,r,i){try{var u=r.updateQueue,x=u!==null?u.lastEffect:null;if(x!==null){var v=x.next;u=v;do{if((u.tag&t)===t){var C=u.inst,R=C.destroy;if(R!==void 0){C.destroy=void 0,x=r;var P=i,Q=R;try{Q()}catch(ie){st(x,P,ie)}}}u=u.next}while(u!==v)}}catch(ie){st(r,r.return,ie)}}function f1(t){var r=t.updateQueue;if(r!==null){var i=t.stateNode;try{nv(r,i)}catch(u){st(t,t.return,u)}}}function m1(t,r,i){i.props=uo(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(u){st(t,r,u)}}function Ri(t,r){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof i=="function"?t.refCleanup=i(u):i.current=u}}catch(x){st(t,r,x)}}function xr(t,r){var i=t.ref,u=t.refCleanup;if(i!==null)if(typeof u=="function")try{u()}catch(x){st(t,r,x)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(x){st(t,r,x)}else i.current=null}function p1(t){var r=t.type,i=t.memoizedProps,u=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&u.focus();break e;case"img":i.src?u.src=i.src:i.srcSet&&(u.srcset=i.srcSet)}}catch(x){st(t,t.return,x)}}function fm(t,r,i){try{var u=t.stateNode;I4(u,t.type,i,r),u[pn]=r}catch(x){st(t,t.return,x)}}function h1(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ja(t.type)||t.tag===4}function mm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||h1(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ja(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function pm(t,r,i){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(t),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Mr));else if(u!==4&&(u===27&&ja(t.type)&&(i=t.stateNode,r=null),t=t.child,t!==null))for(pm(t,r,i),t=t.sibling;t!==null;)pm(t,r,i),t=t.sibling}function Ec(t,r,i){var u=t.tag;if(u===5||u===6)t=t.stateNode,r?i.insertBefore(t,r):i.appendChild(t);else if(u!==4&&(u===27&&ja(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(Ec(t,r,i),t=t.sibling;t!==null;)Ec(t,r,i),t=t.sibling}function g1(t){var r=t.stateNode,i=t.memoizedProps;try{for(var u=t.type,x=r.attributes;x.length;)r.removeAttributeNode(x[0]);nn(r,u,i),r[Qt]=t,r[pn]=i}catch(v){st(t,t.return,v)}}var Ur=!1,zt=!1,hm=!1,x1=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function x4(t,r){if(t=t.containerInfo,zm=Yc,t=Rx(t),lf(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var x=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{i.nodeType,v.nodeType}catch{i=null;break e}var C=0,R=-1,P=-1,Q=0,ie=0,de=t,J=null;t:for(;;){for(var ne;de!==i||x!==0&&de.nodeType!==3||(R=C+x),de!==v||u!==0&&de.nodeType!==3||(P=C+u),de.nodeType===3&&(C+=de.nodeValue.length),(ne=de.firstChild)!==null;)J=de,de=ne;for(;;){if(de===t)break t;if(J===i&&++Q===x&&(R=C),J===v&&++ie===u&&(P=C),(ne=de.nextSibling)!==null)break;de=J,J=de.parentNode}de=ne}i=R===-1||P===-1?null:{start:R,end:P}}else i=null}i=i||{start:0,end:0}}else i=null;for(Pm={focusedElem:t,selectionRange:i},Yc=!1,Gt=r;Gt!==null;)if(r=Gt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Gt=t;else for(;Gt!==null;){switch(r=Gt,v=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i<t.length;i++)x=t[i],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&v!==null){t=void 0,i=r,x=v.memoizedProps,v=v.memoizedState,u=i.stateNode;try{var Ne=uo(i.type,x);t=u.getSnapshotBeforeUpdate(Ne,v),u.__reactInternalSnapshotBeforeUpdate=t}catch(Oe){st(i,i.return,Oe)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,i=t.nodeType,i===9)Bm(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Bm(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(o(163))}if(t=r.sibling,t!==null){t.return=r.return,Gt=t;break}Gt=r.return}}function v1(t,r,i){var u=i.flags;switch(i.tag){case 0:case 11:case 15:Vr(t,i),u&4&&Ti(5,i);break;case 1:if(Vr(t,i),u&4)if(t=i.stateNode,r===null)try{t.componentDidMount()}catch(C){st(i,i.return,C)}else{var x=uo(i.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(x,r,t.__reactInternalSnapshotBeforeUpdate)}catch(C){st(i,i.return,C)}}u&64&&f1(i),u&512&&Ri(i,i.return);break;case 3:if(Vr(t,i),u&64&&(t=i.updateQueue,t!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{nv(t,r)}catch(C){st(i,i.return,C)}}break;case 27:r===null&&u&4&&g1(i);case 26:case 5:Vr(t,i),r===null&&u&4&&p1(i),u&512&&Ri(i,i.return);break;case 12:Vr(t,i);break;case 31:Vr(t,i),u&4&&w1(t,i);break;case 13:Vr(t,i),u&4&&C1(t,i),u&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=E4.bind(null,i),W4(t,i))));break;case 22:if(u=i.memoizedState!==null||Ur,!u){r=r!==null&&r.memoizedState!==null||zt,x=Ur;var v=zt;Ur=u,(zt=r)&&!v?Gr(t,i,(i.subtreeFlags&8772)!==0):Vr(t,i),Ur=x,zt=v}break;case 30:break;default:Vr(t,i)}}function b1(t){var r=t.alternate;r!==null&&(t.alternate=null,b1(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&Gd(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var bt=null,gn=!1;function Hr(t,r,i){for(i=i.child;i!==null;)y1(t,r,i),i=i.sibling}function y1(t,r,i){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(pr,i)}catch{}switch(i.tag){case 26:zt||xr(i,r),Hr(t,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:zt||xr(i,r);var u=bt,x=gn;ja(i.type)&&(bt=i.stateNode,gn=!1),Hr(t,r,i),Ii(i.stateNode),bt=u,gn=x;break;case 5:zt||xr(i,r);case 6:if(u=bt,x=gn,bt=null,Hr(t,r,i),bt=u,gn=x,bt!==null)if(gn)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(i.stateNode)}catch(v){st(i,r,v)}else try{bt.removeChild(i.stateNode)}catch(v){st(i,r,v)}break;case 18:bt!==null&&(gn?(t=bt,fb(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),ws(t)):fb(bt,i.stateNode));break;case 4:u=bt,x=gn,bt=i.stateNode.containerInfo,gn=!0,Hr(t,r,i),bt=u,gn=x;break;case 0:case 11:case 14:case 15:xa(2,i,r),zt||xa(4,i,r),Hr(t,r,i);break;case 1:zt||(xr(i,r),u=i.stateNode,typeof u.componentWillUnmount=="function"&&m1(i,r,u)),Hr(t,r,i);break;case 21:Hr(t,r,i);break;case 22:zt=(u=zt)||i.memoizedState!==null,Hr(t,r,i),zt=u;break;default:Hr(t,r,i)}}function w1(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(i){st(r,r.return,i)}}}function C1(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ws(t)}catch(i){st(r,r.return,i)}}function v4(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new x1),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new x1),r;default:throw Error(o(435,t.tag))}}function kc(t,r){var i=v4(t);r.forEach(function(u){if(!i.has(u)){i.add(u);var x=k4.bind(null,t,u);u.then(x,x)}})}function xn(t,r){var i=r.deletions;if(i!==null)for(var u=0;u<i.length;u++){var x=i[u],v=t,C=r,R=C;e:for(;R!==null;){switch(R.tag){case 27:if(ja(R.type)){bt=R.stateNode,gn=!1;break e}break;case 5:bt=R.stateNode,gn=!1;break e;case 3:case 4:bt=R.stateNode.containerInfo,gn=!0;break e}R=R.return}if(bt===null)throw Error(o(160));y1(v,C,x),bt=null,gn=!1,v=x.alternate,v!==null&&(v.return=null),x.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)S1(r,t),r=r.sibling}var nr=null;function S1(t,r){var i=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:xn(r,t),vn(t),u&4&&(xa(3,t,t.return),Ti(3,t),xa(5,t,t.return));break;case 1:xn(r,t),vn(t),u&512&&(zt||i===null||xr(i,i.return)),u&64&&Ur&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?u:i.concat(u))));break;case 26:var x=nr;if(xn(r,t),vn(t),u&512&&(zt||i===null||xr(i,i.return)),u&4){var v=i!==null?i.memoizedState:null;if(u=t.memoizedState,i===null)if(u===null)if(t.stateNode===null){e:{u=t.type,i=t.memoizedProps,x=x.ownerDocument||x;t:switch(u){case"title":v=x.getElementsByTagName("title")[0],(!v||v[ni]||v[Qt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=x.createElement(u),x.head.insertBefore(v,x.querySelector("head > title"))),nn(v,u,i),v[Qt]=t,Vt(v),u=v;break e;case"link":var C=Sb("link","href",x).get(u+(i.href||""));if(C){for(var R=0;R<C.length;R++)if(v=C[R],v.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&v.getAttribute("rel")===(i.rel==null?null:i.rel)&&v.getAttribute("title")===(i.title==null?null:i.title)&&v.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){C.splice(R,1);break t}}v=x.createElement(u),nn(v,u,i),x.head.appendChild(v);break;case"meta":if(C=Sb("meta","content",x).get(u+(i.content||""))){for(R=0;R<C.length;R++)if(v=C[R],v.getAttribute("content")===(i.content==null?null:""+i.content)&&v.getAttribute("name")===(i.name==null?null:i.name)&&v.getAttribute("property")===(i.property==null?null:i.property)&&v.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&v.getAttribute("charset")===(i.charSet==null?null:i.charSet)){C.splice(R,1);break t}}v=x.createElement(u),nn(v,u,i),x.head.appendChild(v);break;default:throw Error(o(468,u))}v[Qt]=t,Vt(v),u=v}t.stateNode=u}else jb(x,t.type,t.stateNode);else t.stateNode=Cb(x,u,t.memoizedProps);else v!==u?(v===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):v.count--,u===null?jb(x,t.type,t.stateNode):Cb(x,u,t.memoizedProps)):u===null&&t.stateNode!==null&&fm(t,t.memoizedProps,i.memoizedProps)}break;case 27:xn(r,t),vn(t),u&512&&(zt||i===null||xr(i,i.return)),i!==null&&u&4&&fm(t,t.memoizedProps,i.memoizedProps);break;case 5:if(xn(r,t),vn(t),u&512&&(zt||i===null||xr(i,i.return)),t.flags&32){x=t.stateNode;try{Go(x,"")}catch(Ne){st(t,t.return,Ne)}}u&4&&t.stateNode!=null&&(x=t.memoizedProps,fm(t,x,i!==null?i.memoizedProps:x)),u&1024&&(hm=!0);break;case 6:if(xn(r,t),vn(t),u&4){if(t.stateNode===null)throw Error(o(162));u=t.memoizedProps,i=t.stateNode;try{i.nodeValue=u}catch(Ne){st(t,t.return,Ne)}}break;case 3:if(Vc=null,x=nr,nr=Uc(r.containerInfo),xn(r,t),nr=x,vn(t),u&4&&i!==null&&i.memoizedState.isDehydrated)try{ws(r.containerInfo)}catch(Ne){st(t,t.return,Ne)}hm&&(hm=!1,j1(t));break;case 4:u=nr,nr=Uc(t.stateNode.containerInfo),xn(r,t),vn(t),nr=u;break;case 12:xn(r,t),vn(t);break;case 31:xn(r,t),vn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,kc(t,u)));break;case 13:xn(r,t),vn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Rc=Kt()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,kc(t,u)));break;case 22:x=t.memoizedState!==null;var P=i!==null&&i.memoizedState!==null,Q=Ur,ie=zt;if(Ur=Q||x,zt=ie||P,xn(r,t),zt=ie,Ur=Q,vn(t),u&8192)e:for(r=t.stateNode,r._visibility=x?r._visibility&-2:r._visibility|1,x&&(i===null||P||Ur||zt||fo(t)),i=null,r=t;;){if(r.tag===5||r.tag===26){if(i===null){P=i=r;try{if(v=P.stateNode,x)C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{R=P.stateNode;var de=P.memoizedProps.style,J=de!=null&&de.hasOwnProperty("display")?de.display:null;R.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(Ne){st(P,P.return,Ne)}}}else if(r.tag===6){if(i===null){P=r;try{P.stateNode.nodeValue=x?"":P.memoizedProps}catch(Ne){st(P,P.return,Ne)}}}else if(r.tag===18){if(i===null){P=r;try{var ne=P.stateNode;x?mb(ne,!0):mb(P.stateNode,!1)}catch(Ne){st(P,P.return,Ne)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=t.updateQueue,u!==null&&(i=u.retryQueue,i!==null&&(u.retryQueue=null,kc(t,i))));break;case 19:xn(r,t),vn(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,kc(t,u)));break;case 30:break;case 21:break;default:xn(r,t),vn(t)}}function vn(t){var r=t.flags;if(r&2){try{for(var i,u=t.return;u!==null;){if(h1(u)){i=u;break}u=u.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var x=i.stateNode,v=mm(t);Ec(t,v,x);break;case 5:var C=i.stateNode;i.flags&32&&(Go(C,""),i.flags&=-33);var R=mm(t);Ec(t,R,C);break;case 3:case 4:var P=i.stateNode.containerInfo,Q=mm(t);pm(t,Q,P);break;default:throw Error(o(161))}}catch(ie){st(t,t.return,ie)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function j1(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;j1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Vr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)v1(t,r.alternate,r),r=r.sibling}function fo(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:xa(4,r,r.return),fo(r);break;case 1:xr(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&m1(r,r.return,i),fo(r);break;case 27:Ii(r.stateNode);case 26:case 5:xr(r,r.return),fo(r);break;case 22:r.memoizedState===null&&fo(r);break;case 30:fo(r);break;default:fo(r)}t=t.sibling}}function Gr(t,r,i){for(i=i&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,x=t,v=r,C=v.flags;switch(v.tag){case 0:case 11:case 15:Gr(x,v,i),Ti(4,v);break;case 1:if(Gr(x,v,i),u=v,x=u.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(Q){st(u,u.return,Q)}if(u=v,x=u.updateQueue,x!==null){var R=u.stateNode;try{var P=x.shared.hiddenCallbacks;if(P!==null)for(x.shared.hiddenCallbacks=null,x=0;x<P.length;x++)tv(P[x],R)}catch(Q){st(u,u.return,Q)}}i&&C&64&&f1(v),Ri(v,v.return);break;case 27:g1(v);case 26:case 5:Gr(x,v,i),i&&u===null&&C&4&&p1(v),Ri(v,v.return);break;case 12:Gr(x,v,i);break;case 31:Gr(x,v,i),i&&C&4&&w1(x,v);break;case 13:Gr(x,v,i),i&&C&4&&C1(x,v);break;case 22:v.memoizedState===null&&Gr(x,v,i),Ri(v,v.return);break;case 30:break;default:Gr(x,v,i)}r=r.sibling}}function gm(t,r){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&hi(i))}function xm(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&hi(t))}function rr(t,r,i,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)N1(t,r,i,u),r=r.sibling}function N1(t,r,i,u){var x=r.flags;switch(r.tag){case 0:case 11:case 15:rr(t,r,i,u),x&2048&&Ti(9,r);break;case 1:rr(t,r,i,u);break;case 3:rr(t,r,i,u),x&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&hi(t)));break;case 12:if(x&2048){rr(t,r,i,u),t=r.stateNode;try{var v=r.memoizedProps,C=v.id,R=v.onPostCommit;typeof R=="function"&&R(C,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(P){st(r,r.return,P)}}else rr(t,r,i,u);break;case 31:rr(t,r,i,u);break;case 13:rr(t,r,i,u);break;case 23:break;case 22:v=r.stateNode,C=r.alternate,r.memoizedState!==null?v._visibility&2?rr(t,r,i,u):Ai(t,r):v._visibility&2?rr(t,r,i,u):(v._visibility|=2,us(t,r,i,u,(r.subtreeFlags&10256)!==0||!1)),x&2048&&gm(C,r);break;case 24:rr(t,r,i,u),x&2048&&xm(r.alternate,r);break;default:rr(t,r,i,u)}}function us(t,r,i,u,x){for(x=x&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var v=t,C=r,R=i,P=u,Q=C.flags;switch(C.tag){case 0:case 11:case 15:us(v,C,R,P,x),Ti(8,C);break;case 23:break;case 22:var ie=C.stateNode;C.memoizedState!==null?ie._visibility&2?us(v,C,R,P,x):Ai(v,C):(ie._visibility|=2,us(v,C,R,P,x)),x&&Q&2048&&gm(C.alternate,C);break;case 24:us(v,C,R,P,x),x&&Q&2048&&xm(C.alternate,C);break;default:us(v,C,R,P,x)}r=r.sibling}}function Ai(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=t,u=r,x=u.flags;switch(u.tag){case 22:Ai(i,u),x&2048&&gm(u.alternate,u);break;case 24:Ai(i,u),x&2048&&xm(u.alternate,u);break;default:Ai(i,u)}r=r.sibling}}var Mi=8192;function ds(t,r,i){if(t.subtreeFlags&Mi)for(t=t.child;t!==null;)E1(t,r,i),t=t.sibling}function E1(t,r,i){switch(t.tag){case 26:ds(t,r,i),t.flags&Mi&&t.memoizedState!==null&&a3(i,nr,t.memoizedState,t.memoizedProps);break;case 5:ds(t,r,i);break;case 3:case 4:var u=nr;nr=Uc(t.stateNode.containerInfo),ds(t,r,i),nr=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=Mi,Mi=16777216,ds(t,r,i),Mi=u):ds(t,r,i));break;default:ds(t,r,i)}}function k1(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function _i(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var u=r[i];Gt=u,R1(u,t)}k1(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)T1(t),t=t.sibling}function T1(t){switch(t.tag){case 0:case 11:case 15:_i(t),t.flags&2048&&xa(9,t,t.return);break;case 3:_i(t);break;case 12:_i(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Tc(t)):_i(t);break;default:_i(t)}}function Tc(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var u=r[i];Gt=u,R1(u,t)}k1(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:xa(8,r,r.return),Tc(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,Tc(r));break;default:Tc(r)}t=t.sibling}}function R1(t,r){for(;Gt!==null;){var i=Gt;switch(i.tag){case 0:case 11:case 15:xa(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var u=i.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:hi(i.memoizedState.cache)}if(u=i.child,u!==null)u.return=i,Gt=u;else e:for(i=t;Gt!==null;){u=Gt;var x=u.sibling,v=u.return;if(b1(u),u===i){Gt=null;break e}if(x!==null){x.return=v,Gt=x;break e}Gt=v}}}var b4={getCacheForType:function(t){var r=en(Ot),i=r.data.get(t);return i===void 0&&(i=t(),r.data.set(t,i)),i},cacheSignal:function(){return en(Ot).controller.signal}},y4=typeof WeakMap=="function"?WeakMap:Map,nt=0,pt=null,Ge=null,qe=0,ot=0,kn=null,va=!1,fs=!1,vm=!1,Fr=0,Nt=0,ba=0,mo=0,bm=0,Tn=0,ms=0,Oi=null,bn=null,ym=!1,Rc=0,A1=0,Ac=1/0,Mc=null,ya=null,It=0,wa=null,ps=null,Wr=0,wm=0,Cm=null,M1=null,Di=0,Sm=null;function Rn(){return(nt&2)!==0&&qe!==0?qe&-qe:L.T!==null?Rm():Hd()}function _1(){if(Tn===0)if((qe&536870912)===0||Qe){var t=ct;ct<<=1,(ct&3932160)===0&&(ct=262144),Tn=t}else Tn=536870912;return t=Nn.current,t!==null&&(t.flags|=32),Tn}function yn(t,r,i){(t===pt&&(ot===2||ot===9)||t.cancelPendingCommit!==null)&&(hs(t,0),Ca(t,qe,Tn,!1)),wt(t,i),((nt&2)===0||t!==pt)&&(t===pt&&((nt&2)===0&&(mo|=i),Nt===4&&Ca(t,qe,Tn,!1)),vr(t))}function O1(t,r,i){if((nt&6)!==0)throw Error(o(327));var u=!i&&(r&127)===0&&(r&t.expiredLanes)===0||Je(t,r),x=u?S4(t,r):Nm(t,r,!0),v=u;do{if(x===0){fs&&!u&&Ca(t,r,0,!1);break}else{if(i=t.current.alternate,v&&!w4(i)){x=Nm(t,r,!1),v=!1;continue}if(x===2){if(v=r,t.errorRecoveryDisabledLanes&v)var C=0;else C=t.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){r=C;e:{var R=t;x=Oi;var P=R.current.memoizedState.isDehydrated;if(P&&(hs(R,C).flags|=256),C=Nm(R,C,!1),C!==2){if(vm&&!P){R.errorRecoveryDisabledLanes|=v,mo|=v,x=4;break e}v=bn,bn=x,v!==null&&(bn===null?bn=v:bn.push.apply(bn,v))}x=C}if(v=!1,x!==2)continue}}if(x===1){hs(t,0),Ca(t,r,0,!0);break}e:{switch(u=t,v=x,v){case 0:case 1:throw Error(o(345));case 4:if((r&4194048)!==r)break;case 6:Ca(u,r,Tn,!va);break e;case 2:bn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((r&62914560)===r&&(x=Rc+300-Kt(),10<x)){if(Ca(u,r,Tn,!va),Me(u,0,!0)!==0)break e;Wr=r,u.timeoutHandle=ub(D1.bind(null,u,i,bn,Mc,ym,r,Tn,mo,ms,va,v,"Throttled",-0,0),x);break e}D1(u,i,bn,Mc,ym,r,Tn,mo,ms,va,v,null,-0,0)}}break}while(!0);vr(t)}function D1(t,r,i,u,x,v,C,R,P,Q,ie,de,J,ne){if(t.timeoutHandle=-1,de=r.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mr},E1(r,v,de);var Ne=(v&62914560)===v?Rc-Kt():(v&4194048)===v?A1-Kt():0;if(Ne=o3(de,Ne),Ne!==null){Wr=v,t.cancelPendingCommit=Ne(H1.bind(null,t,r,v,i,u,x,C,R,P,ie,de,null,J,ne)),Ca(t,v,C,!Q);return}}H1(t,r,v,i,u,x,C,R,P)}function w4(t){for(var r=t;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var u=0;u<i.length;u++){var x=i[u],v=x.getSnapshot;x=x.value;try{if(!Sn(v(),x))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ca(t,r,i,u){r&=~bm,r&=~mo,t.suspendedLanes|=r,t.pingedLanes&=~r,u&&(t.warmLanes|=r),u=t.expirationTimes;for(var x=r;0<x;){var v=31-re(x),C=1<<v;u[v]=-1,x&=~C}i!==0&&Ka(t,i,r)}function _c(){return(nt&6)===0?(Li(0),!1):!0}function jm(){if(Ge!==null){if(ot===0)var t=Ge.return;else t=Ge,Lr=ro=null,Bf(t),os=null,xi=0,t=Ge;for(;t!==null;)d1(t.alternate,t),t=t.return;Ge=null}}function hs(t,r){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,U4(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),Wr=0,jm(),pt=t,Ge=i=Or(t.current,null),qe=r,ot=0,kn=null,va=!1,fs=Je(t,r),vm=!1,ms=Tn=bm=mo=ba=Nt=0,bn=Oi=null,ym=!1,(r&8)!==0&&(r|=r&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=r;0<u;){var x=31-re(u),v=1<<x;r|=t[x],u&=~v}return Fr=r,Jl(),i}function L1(t,r){$e=null,L.H=Ni,r===as||r===ic?(r=Zx(),ot=3):r===Tf?(r=Zx(),ot=4):ot=r===nm?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,kn=r,Ge===null&&(Nt=1,wc(t,Un(r,t.current)))}function z1(){var t=Nn.current;return t===null?!0:(qe&4194048)===qe?Fn===null:(qe&62914560)===qe||(qe&536870912)!==0?t===Fn:!1}function P1(){var t=L.H;return L.H=Ni,t===null?Ni:t}function I1(){var t=L.A;return L.A=b4,t}function Oc(){Nt=4,va||(qe&4194048)!==qe&&Nn.current!==null||(fs=!0),(ba&134217727)===0&&(mo&134217727)===0||pt===null||Ca(pt,qe,Tn,!1)}function Nm(t,r,i){var u=nt;nt|=2;var x=P1(),v=I1();(pt!==t||qe!==r)&&(Mc=null,hs(t,r)),r=!1;var C=Nt;e:do try{if(ot!==0&&Ge!==null){var R=Ge,P=kn;switch(ot){case 8:jm(),C=6;break e;case 3:case 2:case 9:case 6:Nn.current===null&&(r=!0);var Q=ot;if(ot=0,kn=null,gs(t,R,P,Q),i&&fs){C=0;break e}break;default:Q=ot,ot=0,kn=null,gs(t,R,P,Q)}}C4(),C=Nt;break}catch(ie){L1(t,ie)}while(!0);return r&&t.shellSuspendCounter++,Lr=ro=null,nt=u,L.H=x,L.A=v,Ge===null&&(pt=null,qe=0,Jl()),C}function C4(){for(;Ge!==null;)$1(Ge)}function S4(t,r){var i=nt;nt|=2;var u=P1(),x=I1();pt!==t||qe!==r?(Mc=null,Ac=Kt()+500,hs(t,r)):fs=Je(t,r);e:do try{if(ot!==0&&Ge!==null){r=Ge;var v=kn;t:switch(ot){case 1:ot=0,kn=null,gs(t,r,v,1);break;case 2:case 9:if(Kx(v)){ot=0,kn=null,B1(r);break}r=function(){ot!==2&&ot!==9||pt!==t||(ot=7),vr(t)},v.then(r,r);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:Kx(v)?(ot=0,kn=null,B1(r)):(ot=0,kn=null,gs(t,r,v,7));break;case 5:var C=null;switch(Ge.tag){case 26:C=Ge.memoizedState;case 5:case 27:var R=Ge;if(C?Nb(C):R.stateNode.complete){ot=0,kn=null;var P=R.sibling;if(P!==null)Ge=P;else{var Q=R.return;Q!==null?(Ge=Q,Dc(Q)):Ge=null}break t}}ot=0,kn=null,gs(t,r,v,5);break;case 6:ot=0,kn=null,gs(t,r,v,6);break;case 8:jm(),Nt=6;break e;default:throw Error(o(462))}}j4();break}catch(ie){L1(t,ie)}while(!0);return Lr=ro=null,L.H=u,L.A=x,nt=i,Ge!==null?0:(pt=null,qe=0,Jl(),Nt)}function j4(){for(;Ge!==null&&!qt();)$1(Ge)}function $1(t){var r=c1(t.alternate,t,Fr);t.memoizedProps=t.pendingProps,r===null?Dc(t):Ge=r}function B1(t){var r=t,i=r.alternate;switch(r.tag){case 15:case 0:r=r1(i,r,r.pendingProps,r.type,void 0,qe);break;case 11:r=r1(i,r,r.pendingProps,r.type.render,r.ref,qe);break;case 5:Bf(r);default:d1(i,r),r=Ge=Ix(r,Fr),r=c1(i,r,Fr)}t.memoizedProps=t.pendingProps,r===null?Dc(t):Ge=r}function gs(t,r,i,u){Lr=ro=null,Bf(r),os=null,xi=0;var x=r.return;try{if(f4(t,x,r,i,qe)){Nt=1,wc(t,Un(i,t.current)),Ge=null;return}}catch(v){if(x!==null)throw Ge=x,v;Nt=1,wc(t,Un(i,t.current)),Ge=null;return}r.flags&32768?(Qe||u===1?t=!0:fs||(qe&536870912)!==0?t=!1:(va=t=!0,(u===2||u===9||u===3||u===6)&&(u=Nn.current,u!==null&&u.tag===13&&(u.flags|=16384))),U1(r,t)):Dc(r)}function Dc(t){var r=t;do{if((r.flags&32768)!==0){U1(r,va);return}t=r.return;var i=h4(r.alternate,r,Fr);if(i!==null){Ge=i;return}if(r=r.sibling,r!==null){Ge=r;return}Ge=r=t}while(r!==null);Nt===0&&(Nt=5)}function U1(t,r){do{var i=g4(t.alternate,t);if(i!==null){i.flags&=32767,Ge=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(t=t.sibling,t!==null)){Ge=t;return}Ge=t=i}while(t!==null);Nt=6,Ge=null}function H1(t,r,i,u,x,v,C,R,P){t.cancelPendingCommit=null;do Lc();while(It!==0);if((nt&6)!==0)throw Error(o(327));if(r!==null){if(r===t.current)throw Error(o(177));if(v=r.lanes|r.childLanes,v|=mf,dn(t,i,v,C,R,P),t===pt&&(Ge=pt=null,qe=0),ps=r,wa=t,Wr=i,wm=v,Cm=x,M1=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,T4(Rr,function(){return Y1(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=L.T,L.T=null,x=I.p,I.p=2,C=nt,nt|=4;try{x4(t,r,i)}finally{nt=C,I.p=x,L.T=u}}It=1,V1(),G1(),F1()}}function V1(){if(It===1){It=0;var t=wa,r=ps,i=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||i){i=L.T,L.T=null;var u=I.p;I.p=2;var x=nt;nt|=4;try{S1(r,t);var v=Pm,C=Rx(t.containerInfo),R=v.focusedElem,P=v.selectionRange;if(C!==R&&R&&R.ownerDocument&&Tx(R.ownerDocument.documentElement,R)){if(P!==null&&lf(R)){var Q=P.start,ie=P.end;if(ie===void 0&&(ie=Q),"selectionStart"in R)R.selectionStart=Q,R.selectionEnd=Math.min(ie,R.value.length);else{var de=R.ownerDocument||document,J=de&&de.defaultView||window;if(J.getSelection){var ne=J.getSelection(),Ne=R.textContent.length,Oe=Math.min(P.start,Ne),ft=P.end===void 0?Oe:Math.min(P.end,Ne);!ne.extend&&Oe>ft&&(C=ft,ft=Oe,Oe=C);var W=kx(R,Oe),$=kx(R,ft);if(W&&$&&(ne.rangeCount!==1||ne.anchorNode!==W.node||ne.anchorOffset!==W.offset||ne.focusNode!==$.node||ne.focusOffset!==$.offset)){var X=de.createRange();X.setStart(W.node,W.offset),ne.removeAllRanges(),Oe>ft?(ne.addRange(X),ne.extend($.node,$.offset)):(X.setEnd($.node,$.offset),ne.addRange(X))}}}}for(de=[],ne=R;ne=ne.parentNode;)ne.nodeType===1&&de.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<de.length;R++){var ce=de[R];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Yc=!!zm,Pm=zm=null}finally{nt=x,I.p=u,L.T=i}}t.current=r,It=2}}function G1(){if(It===2){It=0;var t=wa,r=ps,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=L.T,L.T=null;var u=I.p;I.p=2;var x=nt;nt|=4;try{v1(t,r.alternate,r)}finally{nt=x,I.p=u,L.T=i}}It=3}}function F1(){if(It===4||It===3){It=0,dr();var t=wa,r=ps,i=Wr,u=M1;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?It=5:(It=0,ps=wa=null,W1(t,t.pendingLanes));var x=t.pendingLanes;if(x===0&&(ya=null),er(i),r=r.stateNode,Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(pr,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=L.T,x=I.p,I.p=2,L.T=null;try{for(var v=t.onRecoverableError,C=0;C<u.length;C++){var R=u[C];v(R.value,{componentStack:R.stack})}}finally{L.T=r,I.p=x}}(Wr&3)!==0&&Lc(),vr(t),x=t.pendingLanes,(i&261930)!==0&&(x&42)!==0?t===Sm?Di++:(Di=0,Sm=t):Di=0,Li(0)}}function W1(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,hi(r)))}function Lc(){return V1(),G1(),F1(),Y1()}function Y1(){if(It!==5)return!1;var t=wa,r=wm;wm=0;var i=er(Wr),u=L.T,x=I.p;try{I.p=32>i?32:i,L.T=null,i=Cm,Cm=null;var v=wa,C=Wr;if(It=0,ps=wa=null,Wr=0,(nt&6)!==0)throw Error(o(331));var R=nt;if(nt|=4,T1(v.current),N1(v,v.current,C,i),nt=R,Li(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(pr,v)}catch{}return!0}finally{I.p=x,L.T=u,W1(t,r)}}function q1(t,r,i){r=Un(i,r),r=tm(t.stateNode,r,2),t=pa(t,r,2),t!==null&&(wt(t,2),vr(t))}function st(t,r,i){if(t.tag===3)q1(t,t,i);else for(;r!==null;){if(r.tag===3){q1(r,t,i);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ya===null||!ya.has(u))){t=Un(i,t),i=Kv(2),u=pa(r,i,2),u!==null&&(Xv(i,u,r,t),wt(u,2),vr(u));break}}r=r.return}}function Em(t,r,i){var u=t.pingCache;if(u===null){u=t.pingCache=new y4;var x=new Set;u.set(r,x)}else x=u.get(r),x===void 0&&(x=new Set,u.set(r,x));x.has(i)||(vm=!0,x.add(i),t=N4.bind(null,t,r,i),r.then(t,t))}function N4(t,r,i){var u=t.pingCache;u!==null&&u.delete(r),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,pt===t&&(qe&i)===i&&(Nt===4||Nt===3&&(qe&62914560)===qe&&300>Kt()-Rc?(nt&2)===0&&hs(t,0):bm|=i,ms===qe&&(ms=0)),vr(t)}function K1(t,r){r===0&&(r=kt()),t=eo(t,r),t!==null&&(wt(t,r),vr(t))}function E4(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),K1(t,i)}function k4(t,r){var i=0;switch(t.tag){case 31:case 13:var u=t.stateNode,x=t.memoizedState;x!==null&&(i=x.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(r),K1(t,i)}function T4(t,r){return Ya(t,r)}var zc=null,xs=null,km=!1,Pc=!1,Tm=!1,Sa=0;function vr(t){t!==xs&&t.next===null&&(xs===null?zc=xs=t:xs=xs.next=t),Pc=!0,km||(km=!0,A4())}function Li(t,r){if(!Tm&&Pc){Tm=!0;do for(var i=!1,u=zc;u!==null;){if(t!==0){var x=u.pendingLanes;if(x===0)var v=0;else{var C=u.suspendedLanes,R=u.pingedLanes;v=(1<<31-re(42|t)+1)-1,v&=x&~(C&~R),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(i=!0,J1(u,v))}else v=qe,v=Me(u,u===pt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||Je(u,v)||(i=!0,J1(u,v));u=u.next}while(i);Tm=!1}}function R4(){X1()}function X1(){Pc=km=!1;var t=0;Sa!==0&&B4()&&(t=Sa);for(var r=Kt(),i=null,u=zc;u!==null;){var x=u.next,v=Z1(u,r);v===0?(u.next=null,i===null?zc=x:i.next=x,x===null&&(xs=i)):(i=u,(t!==0||(v&3)!==0)&&(Pc=!0)),u=x}It!==0&&It!==5||Li(t),Sa!==0&&(Sa=0)}function Z1(t,r){for(var i=t.suspendedLanes,u=t.pingedLanes,x=t.expirationTimes,v=t.pendingLanes&-62914561;0<v;){var C=31-re(v),R=1<<C,P=x[C];P===-1?((R&i)===0||(R&u)!==0)&&(x[C]=St(R,r)):P<=r&&(t.expiredLanes|=R),v&=~R}if(r=pt,i=qe,i=Me(t,t===r?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,i===0||t===r&&(ot===2||ot===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&qa(u),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||Je(t,i)){if(r=i&-i,r===t.callbackPriority)return r;switch(u!==null&&qa(u),er(i)){case 2:case 8:i=Lo;break;case 32:i=Rr;break;case 268435456:i=Qn;break;default:i=Rr}return u=Q1.bind(null,t),i=Ya(i,u),t.callbackPriority=r,t.callbackNode=i,r}return u!==null&&u!==null&&qa(u),t.callbackPriority=2,t.callbackNode=null,2}function Q1(t,r){if(It!==0&&It!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(Lc()&&t.callbackNode!==i)return null;var u=qe;return u=Me(t,t===pt?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(O1(t,u,r),Z1(t,Kt()),t.callbackNode!=null&&t.callbackNode===i?Q1.bind(null,t):null)}function J1(t,r){if(Lc())return null;O1(t,r,!0)}function A4(){H4(function(){(nt&6)!==0?Ya(fr,R4):X1()})}function Rm(){if(Sa===0){var t=ns;t===0&&(t=at,at<<=1,(at&261888)===0&&(at=256)),Sa=t}return Sa}function eb(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Fl(""+t)}function tb(t,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,t.id&&i.setAttribute("form",t.id),r.parentNode.insertBefore(i,r),t=new FormData(t),i.parentNode.removeChild(i),t}function M4(t,r,i,u,x){if(r==="submit"&&i&&i.stateNode===x){var v=eb((x[pn]||null).action),C=u.submitter;C&&(r=(r=C[pn]||null)?eb(r.formAction):C.getAttribute("formAction"),r!==null&&(v=r,C=null));var R=new Kl("action","action",null,u,x);t.push({event:R,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Sa!==0){var P=C?tb(x,C):new FormData(x);Kf(i,{pending:!0,data:P,method:x.method,action:v},null,P)}}else typeof v=="function"&&(R.preventDefault(),P=C?tb(x,C):new FormData(x),Kf(i,{pending:!0,data:P,method:x.method,action:v},v,P))},currentTarget:x}]})}}for(var Am=0;Am<ff.length;Am++){var Mm=ff[Am],_4=Mm.toLowerCase(),O4=Mm[0].toUpperCase()+Mm.slice(1);tr(_4,"on"+O4)}tr(_x,"onAnimationEnd"),tr(Ox,"onAnimationIteration"),tr(Dx,"onAnimationStart"),tr("dblclick","onDoubleClick"),tr("focusin","onFocus"),tr("focusout","onBlur"),tr(KN,"onTransitionRun"),tr(XN,"onTransitionStart"),tr(ZN,"onTransitionCancel"),tr(Lx,"onTransitionEnd"),Ho("onMouseEnter",["mouseout","mouseover"]),Ho("onMouseLeave",["mouseout","mouseover"]),Ho("onPointerEnter",["pointerout","pointerover"]),Ho("onPointerLeave",["pointerout","pointerover"]),Xa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zi="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(" "),D4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zi));function nb(t,r){r=(r&4)!==0;for(var i=0;i<t.length;i++){var u=t[i],x=u.event;u=u.listeners;e:{var v=void 0;if(r)for(var C=u.length-1;0<=C;C--){var R=u[C],P=R.instance,Q=R.currentTarget;if(R=R.listener,P!==v&&x.isPropagationStopped())break e;v=R,x.currentTarget=Q;try{v(x)}catch(ie){Ql(ie)}x.currentTarget=null,v=P}else for(C=0;C<u.length;C++){if(R=u[C],P=R.instance,Q=R.currentTarget,R=R.listener,P!==v&&x.isPropagationStopped())break e;v=R,x.currentTarget=Q;try{v(x)}catch(ie){Ql(ie)}x.currentTarget=null,v=P}}}}function Fe(t,r){var i=r[Vd];i===void 0&&(i=r[Vd]=new Set);var u=t+"__bubble";i.has(u)||(rb(r,t,2,!1),i.add(u))}function _m(t,r,i){var u=0;r&&(u|=4),rb(i,t,u,r)}var Ic="_reactListening"+Math.random().toString(36).slice(2);function Om(t){if(!t[Ic]){t[Ic]=!0,Xg.forEach(function(i){i!=="selectionchange"&&(D4.has(i)||_m(i,!1,t),_m(i,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Ic]||(r[Ic]=!0,_m("selectionchange",!1,r))}}function rb(t,r,i,u){switch(_b(r)){case 2:var x=l3;break;case 8:x=c3;break;default:x=qm}i=x.bind(null,r,i,t),x=void 0,!Qd||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(x=!0),u?x!==void 0?t.addEventListener(r,i,{capture:!0,passive:x}):t.addEventListener(r,i,!0):x!==void 0?t.addEventListener(r,i,{passive:x}):t.addEventListener(r,i,!1)}function Dm(t,r,i,u,x){var v=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var C=u.tag;if(C===3||C===4){var R=u.stateNode.containerInfo;if(R===x)break;if(C===4)for(C=u.return;C!==null;){var P=C.tag;if((P===3||P===4)&&C.stateNode.containerInfo===x)return;C=C.return}for(;R!==null;){if(C=$o(R),C===null)return;if(P=C.tag,P===5||P===6||P===26||P===27){u=v=C;continue e}R=R.parentNode}}u=u.return}lx(function(){var Q=v,ie=Xd(i),de=[];e:{var J=zx.get(t);if(J!==void 0){var ne=Kl,Ne=t;switch(t){case"keypress":if(Yl(i)===0)break e;case"keydown":case"keyup":ne=kN;break;case"focusin":Ne="focus",ne=nf;break;case"focusout":Ne="blur",ne=nf;break;case"beforeblur":case"afterblur":ne=nf;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=dx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=hN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=AN;break;case _x:case Ox:case Dx:ne=vN;break;case Lx:ne=_N;break;case"scroll":case"scrollend":ne=mN;break;case"wheel":ne=DN;break;case"copy":case"cut":case"paste":ne=yN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=mx;break;case"toggle":case"beforetoggle":ne=zN}var Oe=(r&4)!==0,ft=!Oe&&(t==="scroll"||t==="scrollend"),W=Oe?J!==null?J+"Capture":null:J;Oe=[];for(var $=Q,X;$!==null;){var ce=$;if(X=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||X===null||W===null||(ce=ai($,W),ce!=null&&Oe.push(Pi($,ce,X))),ft)break;$=$.return}0<Oe.length&&(J=new ne(J,Ne,null,i,ie),de.push({event:J,listeners:Oe}))}}if((r&7)===0){e:{if(J=t==="mouseover"||t==="pointerover",ne=t==="mouseout"||t==="pointerout",J&&i!==Kd&&(Ne=i.relatedTarget||i.fromElement)&&($o(Ne)||Ne[Io]))break e;if((ne||J)&&(J=ie.window===ie?ie:(J=ie.ownerDocument)?J.defaultView||J.parentWindow:window,ne?(Ne=i.relatedTarget||i.toElement,ne=Q,Ne=Ne?$o(Ne):null,Ne!==null&&(ft=c(Ne),Oe=Ne.tag,Ne!==ft||Oe!==5&&Oe!==27&&Oe!==6)&&(Ne=null)):(ne=null,Ne=Q),ne!==Ne)){if(Oe=dx,ce="onMouseLeave",W="onMouseEnter",$="mouse",(t==="pointerout"||t==="pointerover")&&(Oe=mx,ce="onPointerLeave",W="onPointerEnter",$="pointer"),ft=ne==null?J:ri(ne),X=Ne==null?J:ri(Ne),J=new Oe(ce,$+"leave",ne,i,ie),J.target=ft,J.relatedTarget=X,ce=null,$o(ie)===Q&&(Oe=new Oe(W,$+"enter",Ne,i,ie),Oe.target=X,Oe.relatedTarget=ft,ce=Oe),ft=ce,ne&&Ne)t:{for(Oe=L4,W=ne,$=Ne,X=0,ce=W;ce;ce=Oe(ce))X++;ce=0;for(var _e=$;_e;_e=Oe(_e))ce++;for(;0<X-ce;)W=Oe(W),X--;for(;0<ce-X;)$=Oe($),ce--;for(;X--;){if(W===$||$!==null&&W===$.alternate){Oe=W;break t}W=Oe(W),$=Oe($)}Oe=null}else Oe=null;ne!==null&&ab(de,J,ne,Oe,!1),Ne!==null&&ft!==null&&ab(de,ft,Ne,Oe,!0)}}e:{if(J=Q?ri(Q):window,ne=J.nodeName&&J.nodeName.toLowerCase(),ne==="select"||ne==="input"&&J.type==="file")var et=wx;else if(bx(J))if(Cx)et=WN;else{et=GN;var Re=VN}else ne=J.nodeName,!ne||ne.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?Q&&qd(Q.elementType)&&(et=wx):et=FN;if(et&&(et=et(t,Q))){yx(de,et,i,ie);break e}Re&&Re(t,J,Q),t==="focusout"&&Q&&J.type==="number"&&Q.memoizedProps.value!=null&&Yd(J,"number",J.value)}switch(Re=Q?ri(Q):window,t){case"focusin":(bx(Re)||Re.contentEditable==="true")&&(qo=Re,cf=Q,fi=null);break;case"focusout":fi=cf=qo=null;break;case"mousedown":uf=!0;break;case"contextmenu":case"mouseup":case"dragend":uf=!1,Ax(de,i,ie);break;case"selectionchange":if(qN)break;case"keydown":case"keyup":Ax(de,i,ie)}var Ue;if(af)e:{switch(t){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Yo?xx(t,i)&&(Ke="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(Ke="onCompositionStart");Ke&&(px&&i.locale!=="ko"&&(Yo||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Yo&&(Ue=cx()):(ia=ie,Jd="value"in ia?ia.value:ia.textContent,Yo=!0)),Re=$c(Q,Ke),0<Re.length&&(Ke=new fx(Ke,t,null,i,ie),de.push({event:Ke,listeners:Re}),Ue?Ke.data=Ue:(Ue=vx(i),Ue!==null&&(Ke.data=Ue)))),(Ue=IN?$N(t,i):BN(t,i))&&(Ke=$c(Q,"onBeforeInput"),0<Ke.length&&(Re=new fx("onBeforeInput","beforeinput",null,i,ie),de.push({event:Re,listeners:Ke}),Re.data=Ue)),M4(de,t,Q,i,ie)}nb(de,r)})}function Pi(t,r,i){return{instance:t,listener:r,currentTarget:i}}function $c(t,r){for(var i=r+"Capture",u=[];t!==null;){var x=t,v=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||v===null||(x=ai(t,i),x!=null&&u.unshift(Pi(t,x,v)),x=ai(t,r),x!=null&&u.push(Pi(t,x,v))),t.tag===3)return u;t=t.return}return[]}function L4(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ab(t,r,i,u,x){for(var v=r._reactName,C=[];i!==null&&i!==u;){var R=i,P=R.alternate,Q=R.stateNode;if(R=R.tag,P!==null&&P===u)break;R!==5&&R!==26&&R!==27||Q===null||(P=Q,x?(Q=ai(i,v),Q!=null&&C.unshift(Pi(i,Q,P))):x||(Q=ai(i,v),Q!=null&&C.push(Pi(i,Q,P)))),i=i.return}C.length!==0&&t.push({event:r,listeners:C})}var z4=/\r\n?/g,P4=/\u0000|\uFFFD/g;function ob(t){return(typeof t=="string"?t:""+t).replace(z4,`
`).replace(P4,"")}function sb(t,r){return r=ob(r),ob(t)===r}function dt(t,r,i,u,x,v){switch(i){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||Go(t,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&Go(t,""+u);break;case"className":Vl(t,"class",u);break;case"tabIndex":Vl(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Vl(t,i,u);break;case"style":sx(t,u,v);break;case"data":if(r!=="object"){Vl(t,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||i!=="href")){t.removeAttribute(i);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(i);break}u=Fl(""+u),t.setAttribute(i,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(i==="formAction"?(r!=="input"&&dt(t,r,"name",x.name,x,null),dt(t,r,"formEncType",x.formEncType,x,null),dt(t,r,"formMethod",x.formMethod,x,null),dt(t,r,"formTarget",x.formTarget,x,null)):(dt(t,r,"encType",x.encType,x,null),dt(t,r,"method",x.method,x,null),dt(t,r,"target",x.target,x,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(i);break}u=Fl(""+u),t.setAttribute(i,u);break;case"onClick":u!=null&&(t.onclick=Mr);break;case"onScroll":u!=null&&Fe("scroll",t);break;case"onScrollEnd":u!=null&&Fe("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(x.children!=null)throw Error(o(60));t.innerHTML=i}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}i=Fl(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(i,""+u):t.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":u===!0?t.setAttribute(i,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(i,u):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(i,u):t.removeAttribute(i);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(i):t.setAttribute(i,u);break;case"popover":Fe("beforetoggle",t),Fe("toggle",t),Hl(t,"popover",u);break;case"xlinkActuate":Ar(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ar(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ar(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ar(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ar(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ar(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ar(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ar(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ar(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Hl(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=dN.get(i)||i,Hl(t,i,u))}}function Lm(t,r,i,u,x,v){switch(i){case"style":sx(t,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(x.children!=null)throw Error(o(60));t.innerHTML=i}}break;case"children":typeof u=="string"?Go(t,u):(typeof u=="number"||typeof u=="bigint")&&Go(t,""+u);break;case"onScroll":u!=null&&Fe("scroll",t);break;case"onScrollEnd":u!=null&&Fe("scrollend",t);break;case"onClick":u!=null&&(t.onclick=Mr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zg.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(x=i.endsWith("Capture"),r=i.slice(2,x?i.length-7:void 0),v=t[pn]||null,v=v!=null?v[i]:null,typeof v=="function"&&t.removeEventListener(r,v,x),typeof u=="function")){typeof v!="function"&&v!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(r,u,x);break e}i in t?t[i]=u:u===!0?t.setAttribute(i,""):Hl(t,i,u)}}}function nn(t,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",t),Fe("load",t);var u=!1,x=!1,v;for(v in i)if(i.hasOwnProperty(v)){var C=i[v];if(C!=null)switch(v){case"src":u=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:dt(t,r,v,C,i,null)}}x&&dt(t,r,"srcSet",i.srcSet,i,null),u&&dt(t,r,"src",i.src,i,null);return;case"input":Fe("invalid",t);var R=v=C=x=null,P=null,Q=null;for(u in i)if(i.hasOwnProperty(u)){var ie=i[u];if(ie!=null)switch(u){case"name":x=ie;break;case"type":C=ie;break;case"checked":P=ie;break;case"defaultChecked":Q=ie;break;case"value":v=ie;break;case"defaultValue":R=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(o(137,r));break;default:dt(t,r,u,ie,i,null)}}nx(t,v,R,P,Q,C,x,!1);return;case"select":Fe("invalid",t),u=C=v=null;for(x in i)if(i.hasOwnProperty(x)&&(R=i[x],R!=null))switch(x){case"value":v=R;break;case"defaultValue":C=R;break;case"multiple":u=R;default:dt(t,r,x,R,i,null)}r=v,i=C,t.multiple=!!u,r!=null?Vo(t,!!u,r,!1):i!=null&&Vo(t,!!u,i,!0);return;case"textarea":Fe("invalid",t),v=x=u=null;for(C in i)if(i.hasOwnProperty(C)&&(R=i[C],R!=null))switch(C){case"value":u=R;break;case"defaultValue":x=R;break;case"children":v=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(o(91));break;default:dt(t,r,C,R,i,null)}ax(t,u,x,v);return;case"option":for(P in i)if(i.hasOwnProperty(P)&&(u=i[P],u!=null))switch(P){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:dt(t,r,P,u,i,null)}return;case"dialog":Fe("beforetoggle",t),Fe("toggle",t),Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":Fe("load",t);break;case"video":case"audio":for(u=0;u<zi.length;u++)Fe(zi[u],t);break;case"image":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"embed":case"source":case"link":Fe("error",t),Fe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in i)if(i.hasOwnProperty(Q)&&(u=i[Q],u!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:dt(t,r,Q,u,i,null)}return;default:if(qd(r)){for(ie in i)i.hasOwnProperty(ie)&&(u=i[ie],u!==void 0&&Lm(t,r,ie,u,i,void 0));return}}for(R in i)i.hasOwnProperty(R)&&(u=i[R],u!=null&&dt(t,r,R,u,i,null))}function I4(t,r,i,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,v=null,C=null,R=null,P=null,Q=null,ie=null;for(ne in i){var de=i[ne];if(i.hasOwnProperty(ne)&&de!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":P=de;default:u.hasOwnProperty(ne)||dt(t,r,ne,null,u,de)}}for(var J in u){var ne=u[J];if(de=i[J],u.hasOwnProperty(J)&&(ne!=null||de!=null))switch(J){case"type":v=ne;break;case"name":x=ne;break;case"checked":Q=ne;break;case"defaultChecked":ie=ne;break;case"value":C=ne;break;case"defaultValue":R=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,r));break;default:ne!==de&&dt(t,r,J,ne,u,de)}}Wd(t,C,R,P,Q,ie,v,x);return;case"select":ne=C=R=J=null;for(v in i)if(P=i[v],i.hasOwnProperty(v)&&P!=null)switch(v){case"value":break;case"multiple":ne=P;default:u.hasOwnProperty(v)||dt(t,r,v,null,u,P)}for(x in u)if(v=u[x],P=i[x],u.hasOwnProperty(x)&&(v!=null||P!=null))switch(x){case"value":J=v;break;case"defaultValue":R=v;break;case"multiple":C=v;default:v!==P&&dt(t,r,x,v,u,P)}r=R,i=C,u=ne,J!=null?Vo(t,!!i,J,!1):!!u!=!!i&&(r!=null?Vo(t,!!i,r,!0):Vo(t,!!i,i?[]:"",!1));return;case"textarea":ne=J=null;for(R in i)if(x=i[R],i.hasOwnProperty(R)&&x!=null&&!u.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:dt(t,r,R,null,u,x)}for(C in u)if(x=u[C],v=i[C],u.hasOwnProperty(C)&&(x!=null||v!=null))switch(C){case"value":J=x;break;case"defaultValue":ne=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(o(91));break;default:x!==v&&dt(t,r,C,x,u,v)}rx(t,J,ne);return;case"option":for(var Ne in i)if(J=i[Ne],i.hasOwnProperty(Ne)&&J!=null&&!u.hasOwnProperty(Ne))switch(Ne){case"selected":t.selected=!1;break;default:dt(t,r,Ne,null,u,J)}for(P in u)if(J=u[P],ne=i[P],u.hasOwnProperty(P)&&J!==ne&&(J!=null||ne!=null))switch(P){case"selected":t.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:dt(t,r,P,J,u,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in i)J=i[Oe],i.hasOwnProperty(Oe)&&J!=null&&!u.hasOwnProperty(Oe)&&dt(t,r,Oe,null,u,J);for(Q in u)if(J=u[Q],ne=i[Q],u.hasOwnProperty(Q)&&J!==ne&&(J!=null||ne!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(o(137,r));break;default:dt(t,r,Q,J,u,ne)}return;default:if(qd(r)){for(var ft in i)J=i[ft],i.hasOwnProperty(ft)&&J!==void 0&&!u.hasOwnProperty(ft)&&Lm(t,r,ft,void 0,u,J);for(ie in u)J=u[ie],ne=i[ie],!u.hasOwnProperty(ie)||J===ne||J===void 0&&ne===void 0||Lm(t,r,ie,J,u,ne);return}}for(var W in i)J=i[W],i.hasOwnProperty(W)&&J!=null&&!u.hasOwnProperty(W)&&dt(t,r,W,null,u,J);for(de in u)J=u[de],ne=i[de],!u.hasOwnProperty(de)||J===ne||J==null&&ne==null||dt(t,r,de,J,u,ne)}function ib(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $4(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,i=performance.getEntriesByType("resource"),u=0;u<i.length;u++){var x=i[u],v=x.transferSize,C=x.initiatorType,R=x.duration;if(v&&R&&ib(C)){for(C=0,R=x.responseEnd,u+=1;u<i.length;u++){var P=i[u],Q=P.startTime;if(Q>R)break;var ie=P.transferSize,de=P.initiatorType;ie&&ib(de)&&(P=P.responseEnd,C+=ie*(P<R?1:(R-Q)/(P-Q)))}if(--u,r+=8*(v+C)/(x.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var zm=null,Pm=null;function Bc(t){return t.nodeType===9?t:t.ownerDocument}function lb(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cb(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Im(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var $m=null;function B4(){var t=window.event;return t&&t.type==="popstate"?t===$m?!1:($m=t,!0):($m=null,!1)}var ub=typeof setTimeout=="function"?setTimeout:void 0,U4=typeof clearTimeout=="function"?clearTimeout:void 0,db=typeof Promise=="function"?Promise:void 0,H4=typeof queueMicrotask=="function"?queueMicrotask:typeof db<"u"?function(t){return db.resolve(null).then(t).catch(V4)}:ub;function V4(t){setTimeout(function(){throw t})}function ja(t){return t==="head"}function fb(t,r){var i=r,u=0;do{var x=i.nextSibling;if(t.removeChild(i),x&&x.nodeType===8)if(i=x.data,i==="/$"||i==="/&"){if(u===0){t.removeChild(x),ws(r);return}u--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")u++;else if(i==="html")Ii(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,Ii(i);for(var v=i.firstChild;v;){var C=v.nextSibling,R=v.nodeName;v[ni]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&v.rel.toLowerCase()==="stylesheet"||i.removeChild(v),v=C}}else i==="body"&&Ii(t.ownerDocument.body);i=x}while(i);ws(r)}function mb(t,r){var i=t;t=0;do{var u=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),u&&u.nodeType===8)if(i=u.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=u}while(i)}function Bm(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Bm(i),Gd(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function G4(t,r,i,u){for(;t.nodeType===1;){var x=i;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[ni])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(v=t.getAttribute("rel"),v==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(v!==x.rel||t.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||t.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||t.getAttribute("title")!==(x.title==null?null:x.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(v=t.getAttribute("src"),(v!==(x.src==null?null:x.src)||t.getAttribute("type")!==(x.type==null?null:x.type)||t.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&v&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var v=x.name==null?null:""+x.name;if(x.type==="hidden"&&t.getAttribute("name")===v)return t}else return t;if(t=Wn(t.nextSibling),t===null)break}return null}function F4(t,r,i){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Wn(t.nextSibling),t===null))return null;return t}function pb(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Wn(t.nextSibling),t===null))return null;return t}function Um(t){return t.data==="$?"||t.data==="$~"}function Hm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function W4(t,r){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||i.readyState!=="loading")r();else{var u=function(){r(),i.removeEventListener("DOMContentLoaded",u)};i.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function Wn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Vm=null;function hb(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(r===0)return Wn(t.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}t=t.nextSibling}return null}function gb(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return t;r--}else i!=="/$"&&i!=="/&"||r++}t=t.previousSibling}return null}function xb(t,r,i){switch(r=Bc(i),t){case"html":if(t=r.documentElement,!t)throw Error(o(452));return t;case"head":if(t=r.head,!t)throw Error(o(453));return t;case"body":if(t=r.body,!t)throw Error(o(454));return t;default:throw Error(o(451))}}function Ii(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Gd(t)}var Yn=new Map,vb=new Set;function Uc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Yr=I.d;I.d={f:Y4,r:q4,D:K4,C:X4,L:Z4,m:Q4,X:e3,S:J4,M:t3};function Y4(){var t=Yr.f(),r=_c();return t||r}function q4(t){var r=Bo(t);r!==null&&r.tag===5&&r.type==="form"?Lv(r):Yr.r(t)}var vs=typeof document>"u"?null:document;function bb(t,r,i){var u=vs;if(u&&typeof r=="string"&&r){var x=$n(r);x='link[rel="'+t+'"][href="'+x+'"]',typeof i=="string"&&(x+='[crossorigin="'+i+'"]'),vb.has(x)||(vb.add(x),t={rel:t,crossOrigin:i,href:r},u.querySelector(x)===null&&(r=u.createElement("link"),nn(r,"link",t),Vt(r),u.head.appendChild(r)))}}function K4(t){Yr.D(t),bb("dns-prefetch",t,null)}function X4(t,r){Yr.C(t,r),bb("preconnect",t,r)}function Z4(t,r,i){Yr.L(t,r,i);var u=vs;if(u&&t&&r){var x='link[rel="preload"][as="'+$n(r)+'"]';r==="image"&&i&&i.imageSrcSet?(x+='[imagesrcset="'+$n(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(x+='[imagesizes="'+$n(i.imageSizes)+'"]')):x+='[href="'+$n(t)+'"]';var v=x;switch(r){case"style":v=bs(t);break;case"script":v=ys(t)}Yn.has(v)||(t=g({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:t,as:r},i),Yn.set(v,t),u.querySelector(x)!==null||r==="style"&&u.querySelector($i(v))||r==="script"&&u.querySelector(Bi(v))||(r=u.createElement("link"),nn(r,"link",t),Vt(r),u.head.appendChild(r)))}}function Q4(t,r){Yr.m(t,r);var i=vs;if(i&&t){var u=r&&typeof r.as=="string"?r.as:"script",x='link[rel="modulepreload"][as="'+$n(u)+'"][href="'+$n(t)+'"]',v=x;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ys(t)}if(!Yn.has(v)&&(t=g({rel:"modulepreload",href:t},r),Yn.set(v,t),i.querySelector(x)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Bi(v)))return}u=i.createElement("link"),nn(u,"link",t),Vt(u),i.head.appendChild(u)}}}function J4(t,r,i){Yr.S(t,r,i);var u=vs;if(u&&t){var x=Uo(u).hoistableStyles,v=bs(t);r=r||"default";var C=x.get(v);if(!C){var R={loading:0,preload:null};if(C=u.querySelector($i(v)))R.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":r},i),(i=Yn.get(v))&&Gm(t,i);var P=C=u.createElement("link");Vt(P),nn(P,"link",t),P._p=new Promise(function(Q,ie){P.onload=Q,P.onerror=ie}),P.addEventListener("load",function(){R.loading|=1}),P.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Hc(C,r,u)}C={type:"stylesheet",instance:C,count:1,state:R},x.set(v,C)}}}function e3(t,r){Yr.X(t,r);var i=vs;if(i&&t){var u=Uo(i).hoistableScripts,x=ys(t),v=u.get(x);v||(v=i.querySelector(Bi(x)),v||(t=g({src:t,async:!0},r),(r=Yn.get(x))&&Fm(t,r),v=i.createElement("script"),Vt(v),nn(v,"link",t),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(x,v))}}function t3(t,r){Yr.M(t,r);var i=vs;if(i&&t){var u=Uo(i).hoistableScripts,x=ys(t),v=u.get(x);v||(v=i.querySelector(Bi(x)),v||(t=g({src:t,async:!0,type:"module"},r),(r=Yn.get(x))&&Fm(t,r),v=i.createElement("script"),Vt(v),nn(v,"link",t),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(x,v))}}function yb(t,r,i,u){var x=(x=oe.current)?Uc(x):null;if(!x)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=bs(i.href),i=Uo(x).hoistableStyles,u=i.get(r),u||(u={type:"style",instance:null,count:0,state:null},i.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=bs(i.href);var v=Uo(x).hoistableStyles,C=v.get(t);if(C||(x=x.ownerDocument||x,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(t,C),(v=x.querySelector($i(t)))&&!v._p&&(C.instance=v,C.state.loading=5),Yn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Yn.set(t,i),v||n3(x,t,i,C.state))),r&&u===null)throw Error(o(528,""));return C}if(r&&u!==null)throw Error(o(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ys(i),i=Uo(x).hoistableScripts,u=i.get(r),u||(u={type:"script",instance:null,count:0,state:null},i.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function bs(t){return'href="'+$n(t)+'"'}function $i(t){return'link[rel="stylesheet"]['+t+"]"}function wb(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function n3(t,r,i,u){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=t.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),nn(r,"link",i),Vt(r),t.head.appendChild(r))}function ys(t){return'[src="'+$n(t)+'"]'}function Bi(t){return"script[async]"+t}function Cb(t,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var u=t.querySelector('style[data-href~="'+$n(i.href)+'"]');if(u)return r.instance=u,Vt(u),u;var x=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),Vt(u),nn(u,"style",x),Hc(u,i.precedence,t),r.instance=u;case"stylesheet":x=bs(i.href);var v=t.querySelector($i(x));if(v)return r.state.loading|=4,r.instance=v,Vt(v),v;u=wb(i),(x=Yn.get(x))&&Gm(u,x),v=(t.ownerDocument||t).createElement("link"),Vt(v);var C=v;return C._p=new Promise(function(R,P){C.onload=R,C.onerror=P}),nn(v,"link",u),r.state.loading|=4,Hc(v,i.precedence,t),r.instance=v;case"script":return v=ys(i.src),(x=t.querySelector(Bi(v)))?(r.instance=x,Vt(x),x):(u=i,(x=Yn.get(v))&&(u=g({},i),Fm(u,x)),t=t.ownerDocument||t,x=t.createElement("script"),Vt(x),nn(x,"link",u),t.head.appendChild(x),r.instance=x);case"void":return null;default:throw Error(o(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Hc(u,i.precedence,t));return r.instance}function Hc(t,r,i){for(var u=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=u.length?u[u.length-1]:null,v=x,C=0;C<u.length;C++){var R=u[C];if(R.dataset.precedence===r)v=R;else if(v!==x)break}v?v.parentNode.insertBefore(t,v.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(t,r.firstChild))}function Gm(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Fm(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Vc=null;function Sb(t,r,i){if(Vc===null){var u=new Map,x=Vc=new Map;x.set(i,u)}else x=Vc,u=x.get(i),u||(u=new Map,x.set(i,u));if(u.has(t))return u;for(u.set(t,null),i=i.getElementsByTagName(t),x=0;x<i.length;x++){var v=i[x];if(!(v[ni]||v[Qt]||t==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var C=v.getAttribute(r)||"";C=t+C;var R=u.get(C);R?R.push(v):u.set(C,[v])}}return u}function jb(t,r,i){t=t.ownerDocument||t,t.head.insertBefore(i,r==="title"?t.querySelector("head > title"):null)}function r3(t,r,i){if(i===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Nb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function a3(t,r,i,u){if(i.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var x=bs(u.href),v=r.querySelector($i(x));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Gc.bind(t),r.then(t,t)),i.state.loading|=4,i.instance=v,Vt(v);return}v=r.ownerDocument||r,u=wb(u),(x=Yn.get(x))&&Gm(u,x),v=v.createElement("link"),Vt(v);var C=v;C._p=new Promise(function(R,P){C.onload=R,C.onerror=P}),nn(v,"link",u),i.instance=v}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=Gc.bind(t),r.addEventListener("load",i),r.addEventListener("error",i))}}var Wm=0;function o3(t,r){return t.stylesheets&&t.count===0&&Wc(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var u=setTimeout(function(){if(t.stylesheets&&Wc(t,t.stylesheets),t.unsuspend){var v=t.unsuspend;t.unsuspend=null,v()}},6e4+r);0<t.imgBytes&&Wm===0&&(Wm=62500*$4());var x=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Wc(t,t.stylesheets),t.unsuspend)){var v=t.unsuspend;t.unsuspend=null,v()}},(t.imgBytes>Wm?50:800)+r);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(x)}}:null}function Gc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Fc=null;function Wc(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Fc=new Map,r.forEach(s3,t),Fc=null,Gc.call(t))}function s3(t,r){if(!(r.state.loading&4)){var i=Fc.get(t);if(i)var u=i.get(null);else{i=new Map,Fc.set(t,i);for(var x=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<x.length;v++){var C=x[v];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(i.set(C.dataset.precedence,C),u=C)}u&&i.set(null,u)}x=r.instance,C=x.getAttribute("data-precedence"),v=i.get(C)||u,v===u&&i.set(null,x),i.set(C,x),this.count++,u=Gc.bind(this),x.addEventListener("load",u),x.addEventListener("error",u),v?v.parentNode.insertBefore(x,v.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(x,t.firstChild)),r.state.loading|=4}}var Ui={$$typeof:T,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function i3(t,r,i,u,x,v,C,R,P){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Jn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jn(0),this.hiddenUpdates=Jn(null),this.identifierPrefix=u,this.onUncaughtError=x,this.onCaughtError=v,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=P,this.incompleteTransitions=new Map}function Eb(t,r,i,u,x,v,C,R,P,Q,ie,de){return t=new i3(t,r,i,C,P,Q,ie,de,R),r=1,v===!0&&(r|=24),v=jn(3,null,null,r),t.current=v,v.stateNode=t,r=Nf(),r.refCount++,t.pooledCache=r,r.refCount++,v.memoizedState={element:u,isDehydrated:i,cache:r},Rf(v),t}function kb(t){return t?(t=Zo,t):Zo}function Tb(t,r,i,u,x,v){x=kb(x),u.context===null?u.context=x:u.pendingContext=x,u=ma(r),u.payload={element:i},v=v===void 0?null:v,v!==null&&(u.callback=v),i=pa(t,u,r),i!==null&&(yn(i,t,r),bi(i,t,r))}function Rb(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<r?i:r}}function Ym(t,r){Rb(t,r),(t=t.alternate)&&Rb(t,r)}function Ab(t){if(t.tag===13||t.tag===31){var r=eo(t,67108864);r!==null&&yn(r,t,67108864),Ym(t,67108864)}}function Mb(t){if(t.tag===13||t.tag===31){var r=Rn();r=Po(r);var i=eo(t,r);i!==null&&yn(i,t,r),Ym(t,r)}}var Yc=!0;function l3(t,r,i,u){var x=L.T;L.T=null;var v=I.p;try{I.p=2,qm(t,r,i,u)}finally{I.p=v,L.T=x}}function c3(t,r,i,u){var x=L.T;L.T=null;var v=I.p;try{I.p=8,qm(t,r,i,u)}finally{I.p=v,L.T=x}}function qm(t,r,i,u){if(Yc){var x=Km(u);if(x===null)Dm(t,r,u,qc,i),Ob(t,u);else if(d3(x,t,r,i,u))u.stopPropagation();else if(Ob(t,u),r&4&&-1<u3.indexOf(t)){for(;x!==null;){var v=Bo(x);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var C=Zt(v.pendingLanes);if(C!==0){var R=v;for(R.pendingLanes|=2,R.entangledLanes|=2;C;){var P=1<<31-re(C);R.entanglements[1]|=P,C&=~P}vr(v),(nt&6)===0&&(Ac=Kt()+500,Li(0))}}break;case 31:case 13:R=eo(v,2),R!==null&&yn(R,v,2),_c(),Ym(v,2)}if(v=Km(u),v===null&&Dm(t,r,u,qc,i),v===x)break;x=v}x!==null&&u.stopPropagation()}else Dm(t,r,u,null,i)}}function Km(t){return t=Xd(t),Xm(t)}var qc=null;function Xm(t){if(qc=null,t=$o(t),t!==null){var r=c(t);if(r===null)t=null;else{var i=r.tag;if(i===13){if(t=d(r),t!==null)return t;t=null}else if(i===31){if(t=m(r),t!==null)return t;t=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return qc=t,null}function _b(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ti()){case fr:return 2;case Lo:return 8;case Rr:case Xt:return 32;case Qn:return 268435456;default:return 32}default:return 32}}var Zm=!1,Na=null,Ea=null,ka=null,Hi=new Map,Vi=new Map,Ta=[],u3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ob(t,r){switch(t){case"focusin":case"focusout":Na=null;break;case"dragenter":case"dragleave":Ea=null;break;case"mouseover":case"mouseout":ka=null;break;case"pointerover":case"pointerout":Hi.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vi.delete(r.pointerId)}}function Gi(t,r,i,u,x,v){return t===null||t.nativeEvent!==v?(t={blockedOn:r,domEventName:i,eventSystemFlags:u,nativeEvent:v,targetContainers:[x]},r!==null&&(r=Bo(r),r!==null&&Ab(r)),t):(t.eventSystemFlags|=u,r=t.targetContainers,x!==null&&r.indexOf(x)===-1&&r.push(x),t)}function d3(t,r,i,u,x){switch(r){case"focusin":return Na=Gi(Na,t,r,i,u,x),!0;case"dragenter":return Ea=Gi(Ea,t,r,i,u,x),!0;case"mouseover":return ka=Gi(ka,t,r,i,u,x),!0;case"pointerover":var v=x.pointerId;return Hi.set(v,Gi(Hi.get(v)||null,t,r,i,u,x)),!0;case"gotpointercapture":return v=x.pointerId,Vi.set(v,Gi(Vi.get(v)||null,t,r,i,u,x)),!0}return!1}function Db(t){var r=$o(t.target);if(r!==null){var i=c(r);if(i!==null){if(r=i.tag,r===13){if(r=d(i),r!==null){t.blockedOn=r,qg(t.priority,function(){Mb(i)});return}}else if(r===31){if(r=m(i),r!==null){t.blockedOn=r,qg(t.priority,function(){Mb(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Kc(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var i=Km(t.nativeEvent);if(i===null){i=t.nativeEvent;var u=new i.constructor(i.type,i);Kd=u,i.target.dispatchEvent(u),Kd=null}else return r=Bo(i),r!==null&&Ab(r),t.blockedOn=i,!1;r.shift()}return!0}function Lb(t,r,i){Kc(t)&&i.delete(r)}function f3(){Zm=!1,Na!==null&&Kc(Na)&&(Na=null),Ea!==null&&Kc(Ea)&&(Ea=null),ka!==null&&Kc(ka)&&(ka=null),Hi.forEach(Lb),Vi.forEach(Lb)}function Xc(t,r){t.blockedOn===r&&(t.blockedOn=null,Zm||(Zm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,f3)))}var Zc=null;function zb(t){Zc!==t&&(Zc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Zc===t&&(Zc=null);for(var r=0;r<t.length;r+=3){var i=t[r],u=t[r+1],x=t[r+2];if(typeof u!="function"){if(Xm(u||i)===null)continue;break}var v=Bo(i);v!==null&&(t.splice(r,3),r-=3,Kf(v,{pending:!0,data:x,method:i.method,action:u},u,x))}}))}function ws(t){function r(P){return Xc(P,t)}Na!==null&&Xc(Na,t),Ea!==null&&Xc(Ea,t),ka!==null&&Xc(ka,t),Hi.forEach(r),Vi.forEach(r);for(var i=0;i<Ta.length;i++){var u=Ta[i];u.blockedOn===t&&(u.blockedOn=null)}for(;0<Ta.length&&(i=Ta[0],i.blockedOn===null);)Db(i),i.blockedOn===null&&Ta.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(u=0;u<i.length;u+=3){var x=i[u],v=i[u+1],C=x[pn]||null;if(typeof v=="function")C||zb(i);else if(C){var R=null;if(v&&v.hasAttribute("formAction")){if(x=v,C=v[pn]||null)R=C.formAction;else if(Xm(x)!==null)continue}else R=C.action;typeof R=="function"?i[u+1]=R:(i.splice(u,3),u-=3),zb(i)}}}function Pb(){function t(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(C){return x=C})},focusReset:"manual",scroll:"manual"})}function r(){x!==null&&(x(),x=null),u||setTimeout(i,20)}function i(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,x=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),x!==null&&(x(),x=null)}}}function Qm(t){this._internalRoot=t}Qc.prototype.render=Qm.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(o(409));var i=r.current,u=Rn();Tb(i,u,t,r,null,null)},Qc.prototype.unmount=Qm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Tb(t.current,2,null,t,null,null),_c(),r[Io]=null}};function Qc(t){this._internalRoot=t}Qc.prototype.unstable_scheduleHydration=function(t){if(t){var r=Hd();t={blockedOn:null,target:t,priority:r};for(var i=0;i<Ta.length&&r!==0&&r<Ta[i].priority;i++);Ta.splice(i,0,t),i===0&&Db(t)}};var Ib=n.version;if(Ib!=="19.2.6")throw Error(o(527,Ib,"19.2.6"));I.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(o(188)):(t=Object.keys(t).join(","),Error(o(268,t)));return t=h(r),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var m3={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jc.isDisabled&&Jc.supportsFiber)try{pr=Jc.inject(m3),Ht=Jc}catch{}}return Wi.createRoot=function(t,r){if(!l(t))throw Error(o(299));var i=!1,u="",x=Fv,v=Wv,C=Yv;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(x=r.onUncaughtError),r.onCaughtError!==void 0&&(v=r.onCaughtError),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),r=Eb(t,1,!1,null,null,i,u,null,x,v,C,Pb),t[Io]=r.current,Om(t),new Qm(r)},Wi.hydrateRoot=function(t,r,i){if(!l(t))throw Error(o(299));var u=!1,x="",v=Fv,C=Wv,R=Yv,P=null;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(x=i.identifierPrefix),i.onUncaughtError!==void 0&&(v=i.onUncaughtError),i.onCaughtError!==void 0&&(C=i.onCaughtError),i.onRecoverableError!==void 0&&(R=i.onRecoverableError),i.formState!==void 0&&(P=i.formState)),r=Eb(t,1,!0,r,i??null,u,x,P,v,C,R,Pb),r.context=kb(null),i=r.current,u=Rn(),u=Po(u),x=ma(u),x.callback=null,pa(i,x,u),i=u,r.current.lanes=i,wt(r,i),vr(r),t[Io]=r.current,Om(t),new Qc(r)},Wi.version="19.2.6",Wi}var Kb;function N3(){if(Kb)return tp.exports;Kb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),tp.exports=j3(),tp.exports}var E3=N3();/**
* react-router v7.15.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/var Xb="popstate";function Zb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function k3(e={}){function n(o,l){var h;let c=(h=l.state)==null?void 0:h.masked,{pathname:d,search:m,hash:p}=c||o.location;return Up("",{pathname:d,search:m,hash:p},l.state&&l.state.usr||null,l.state&&l.state.key||"default",c?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,l){return typeof l=="string"?l:sl(l)}return R3(n,a,null,e)}function yt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Xn(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function T3(){return Math.random().toString(36).substring(2,10)}function Qb(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Up(e,n,a=null,o,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?$s(n):n,state:a,key:n&&n.key||o||T3(),mask:l}}function sl({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function $s(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let o=e.indexOf("?");o>=0&&(n.search=e.substring(o),e=e.substring(0,o)),e&&(n.pathname=e)}return n}function R3(e,n,a,o={}){let{window:l=document.defaultView,v5Compat:c=!1}=o,d=l.history,m="POP",p=null,h=b();h==null&&(h=0,d.replaceState({...d.state,idx:h},""));function b(){return(d.state||{idx:null}).idx}function g(){m="POP";let E=b(),N=E==null?null:E-h;h=E,p&&p({action:m,location:S.location,delta:N})}function y(E,N){m="PUSH";let k=Zb(E)?E:Up(S.location,E,N);h=b()+1;let T=Qb(k,h),A=S.createHref(k.mask||k);try{d.pushState(T,"",A)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;l.location.assign(A)}c&&p&&p({action:m,location:S.location,delta:1})}function w(E,N){m="REPLACE";let k=Zb(E)?E:Up(S.location,E,N);h=b();let T=Qb(k,h),A=S.createHref(k.mask||k);d.replaceState(T,"",A),c&&p&&p({action:m,location:S.location,delta:0})}function j(E){return A3(E)}let S={get action(){return m},get location(){return e(l,d)},listen(E){if(p)throw new Error("A history only accepts one active listener");return l.addEventListener(Xb,g),p=E,()=>{l.removeEventListener(Xb,g),p=null}},createHref(E){return n(l,E)},createURL:j,encodeLocation(E){let N=j(E);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:y,replace:w,go(E){return d.go(E)}};return S}function A3(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),yt(a,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:sl(e);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function _0(e,n,a="/"){return M3(e,n,a,!1)}function M3(e,n,a,o,l){let c=typeof n=="string"?$s(n):n,d=Jr(c.pathname||"/",a);if(d==null)return null;let m=_3(e),p=null,h=G3(d);for(let b=0;p==null&&b<m.length;++b)p=H3(m[b],h,o);return p}function _3(e){let n=O0(e);return O3(n),n}function O0(e,n=[],a=[],o="",l=!1){let c=(d,m,p=l,h)=>{let b={relativePath:h===void 0?d.path||"":h,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(o)&&p)return;yt(b.relativePath.startsWith(o),`Absolute route path "${b.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(o.length)}let g=sr([o,b.relativePath]),y=a.concat(b);d.children&&d.children.length>0&&(yt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),O0(d.children,n,y,g,p)),!(d.path==null&&!d.index)&&n.push({path:g,score:B3(g,d.index),routesMeta:y})};return e.forEach((d,m)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))c(d,m);else for(let h of D0(d.path))c(d,m,!0,h)}),n}function D0(e){let n=e.split("/");if(n.length===0)return[];let[a,...o]=n,l=a.endsWith("?"),c=a.replace(/\?$/,"");if(o.length===0)return l?[c,""]:[c];let d=D0(o.join("/")),m=[];return m.push(...d.map(p=>p===""?c:[c,p].join("/"))),l&&m.push(...d),m.map(p=>e.startsWith("/")&&p===""?"/":p)}function O3(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:U3(n.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var D3=/^:[\w-]+$/,L3=3,z3=2,P3=1,I3=10,$3=-2,Jb=e=>e==="*";function B3(e,n){let a=e.split("/"),o=a.length;return a.some(Jb)&&(o+=$3),n&&(o+=z3),a.filter(l=>!Jb(l)).reduce((l,c)=>l+(D3.test(c)?L3:c===""?P3:I3),o)}function U3(e,n){return e.length===n.length&&e.slice(0,-1).every((o,l)=>o===n[l])?e[e.length-1]-n[n.length-1]:0}function H3(e,n,a=!1){let{routesMeta:o}=e,l={},c="/",d=[];for(let m=0;m<o.length;++m){let p=o[m],h=m===o.length-1,b=c==="/"?n:n.slice(c.length)||"/",g=Tu({path:p.relativePath,caseSensitive:p.caseSensitive,end:h},b),y=p.route;if(!g&&h&&a&&!o[o.length-1].route.index&&(g=Tu({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},b)),!g)return null;Object.assign(l,g.params),d.push({params:l,pathname:sr([c,g.pathname]),pathnameBase:q3(sr([c,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(c=sr([c,g.pathnameBase]))}return d}function Tu(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,o]=V3(e.path,e.caseSensitive,e.end),l=n.match(a);if(!l)return null;let c=l[0],d=c.replace(/(.)\/+$/,"$1"),m=l.slice(1);return{params:o.reduce((h,{paramName:b,isOptional:g},y)=>{if(b==="*"){let j=m[y]||"";d=c.slice(0,c.length-j.length).replace(/(.)\/+$/,"$1")}const w=m[y];return g&&!w?h[b]=void 0:h[b]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:c,pathnameBase:d,pattern:e}}function V3(e,n=!1,a=!0){Xn(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 o=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,p,h,b)=>{if(o.push({paramName:m,isOptional:p!=null}),p){let g=b.charAt(h+d.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),o]}function G3(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Xn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Jr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,o=e.charAt(a);return o&&o!=="/"?null:e.slice(a)||"/"}var F3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function W3(e,n="/"){let{pathname:a,search:o="",hash:l=""}=typeof e=="string"?$s(e):e,c;return a?(a=L0(a),a.startsWith("/")?c=ey(a.substring(1),"/"):c=ey(a,n)):c=n,{pathname:c,search:K3(o),hash:X3(l)}}function ey(e,n){let a=Ru(n).split("/");return e.split("/").forEach(l=>{l===".."?a.length>1&&a.pop():l!=="."&&a.push(l)}),a.length>1?a.join("/"):"/"}function op(e,n,a,o){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Y3(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function Mh(e){let n=Y3(e);return n.map((a,o)=>o===n.length-1?a.pathname:a.pathnameBase)}function Xu(e,n,a,o=!1){let l;typeof e=="string"?l=$s(e):(l={...e},yt(!l.pathname||!l.pathname.includes("?"),op("?","pathname","search",l)),yt(!l.pathname||!l.pathname.includes("#"),op("#","pathname","hash",l)),yt(!l.search||!l.search.includes("#"),op("#","search","hash",l)));let c=e===""||l.pathname==="",d=c?"/":l.pathname,m;if(d==null)m=a;else{let g=n.length-1;if(!o&&d.startsWith("..")){let y=d.split("/");for(;y[0]==="..";)y.shift(),g-=1;l.pathname=y.join("/")}m=g>=0?n[g]:"/"}let p=W3(l,m),h=d&&d!=="/"&&d.endsWith("/"),b=(c||d===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(h||b)&&(p.pathname+="/"),p}var L0=e=>e.replace(/\/\/+/g,"/"),sr=e=>L0(e.join("/")),Ru=e=>e.replace(/\/+$/,""),q3=e=>Ru(e).replace(/^\/*/,"/"),K3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,X3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Z3=class{constructor(e,n,a,o=!1){this.status=e,this.statusText=n||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Q3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function J3(e){let n=e.map(a=>a.route.path).filter(Boolean);return sr(n)||"/"}var z0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function P0(e,n){let a=e;if(typeof a!="string"||!F3.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,l=!1;if(z0)try{let c=new URL(window.location.href),d=a.startsWith("//")?new URL(c.protocol+a):new URL(a),m=Jr(d.pathname,n);d.origin===c.origin&&m!=null?a=m+d.search+d.hash:l=!0}catch{Xn(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:l,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var I0=["POST","PUT","PATCH","DELETE"];new Set(I0);var eE=["GET",...I0];new Set(eE);var Bs=f.createContext(null);Bs.displayName="DataRouter";var Zu=f.createContext(null);Zu.displayName="DataRouterState";var $0=f.createContext(!1);function tE(){return f.useContext($0)}var B0=f.createContext({isTransitioning:!1});B0.displayName="ViewTransition";var nE=f.createContext(new Map);nE.displayName="Fetchers";var rE=f.createContext(null);rE.displayName="Await";var Dn=f.createContext(null);Dn.displayName="Navigation";var bl=f.createContext(null);bl.displayName="Location";var cr=f.createContext({outlet:null,matches:[],isDataRoute:!1});cr.displayName="Route";var _h=f.createContext(null);_h.displayName="RouteError";var U0="REACT_ROUTER_ERROR",aE="REDIRECT",oE="ROUTE_ERROR_RESPONSE";function sE(e){if(e.startsWith(`${U0}:${aE}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function iE(e){if(e.startsWith(`${U0}:${oE}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Z3(n.status,n.statusText,n.data)}catch{}}function lE(e,{relative:n}={}){yt(Us(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=f.useContext(Dn),{hash:l,pathname:c,search:d}=yl(e,{relative:n}),m=c;return a!=="/"&&(m=c==="/"?a:sr([a,c])),o.createHref({pathname:m,search:d,hash:l})}function Us(){return f.useContext(bl)!=null}function Ln(){return yt(Us(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(bl).location}var H0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function V0(e){f.useContext(Dn).static||f.useLayoutEffect(e)}function Ro(){let{isDataRoute:e}=f.useContext(cr);return e?SE():cE()}function cE(){yt(Us(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(Bs),{basename:n,navigator:a}=f.useContext(Dn),{matches:o}=f.useContext(cr),{pathname:l}=Ln(),c=JSON.stringify(Mh(o)),d=f.useRef(!1);return V0(()=>{d.current=!0}),f.useCallback((p,h={})=>{if(Xn(d.current,H0),!d.current)return;if(typeof p=="number"){a.go(p);return}let b=Xu(p,JSON.parse(c),l,h.relative==="path");e==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:sr([n,b.pathname])),(h.replace?a.replace:a.push)(b,h.state,h)},[n,a,c,l,e])}var uE=f.createContext(null);function dE(e){let n=f.useContext(cr).outlet;return f.useMemo(()=>n&&f.createElement(uE.Provider,{value:e},n),[n,e])}function yl(e,{relative:n}={}){let{matches:a}=f.useContext(cr),{pathname:o}=Ln(),l=JSON.stringify(Mh(a));return f.useMemo(()=>Xu(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function fE(e,n){return G0(e,n)}function G0(e,n,a){var E;yt(Us(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=f.useContext(Dn),{matches:l}=f.useContext(cr),c=l[l.length-1],d=c?c.params:{},m=c?c.pathname:"/",p=c?c.pathnameBase:"/",h=c&&c.route;{let N=h&&h.path||"";W0(m,!h||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let b=Ln(),g;if(n){let N=typeof n=="string"?$s(n):n;yt(p==="/"||((E=N.pathname)==null?void 0:E.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${N.pathname}" was given in the \`location\` prop.`),g=N}else g=b;let y=g.pathname||"/",w=y;if(p!=="/"){let N=p.replace(/^\//,"").split("/");w="/"+y.replace(/^\//,"").split("/").slice(N.length).join("/")}let j=a&&a.state.matches.length?a.state.matches.map(N=>Object.assign(N,{route:a.manifest[N.route.id]||N.route})):_0(e,{pathname:w});Xn(h||j!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Xn(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=xE(j&&j.map(N=>Object.assign({},N,{params:Object.assign({},d,N.params),pathname:sr([p,o.encodeLocation?o.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?p:sr([p,o.encodeLocation?o.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),l,a);return n&&S?f.createElement(bl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},S):S}function mE(){let e=CE(),n=Q3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:o},c={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:c},"ErrorBoundary")," or"," ",f.createElement("code",{style:c},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},n),a?f.createElement("pre",{style:l},a):null,d)}var pE=f.createElement(mE,null),F0=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=iE(e.digest);a&&(e=a)}let n=e!==void 0?f.createElement(cr.Provider,{value:this.props.routeContext},f.createElement(_h.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(hE,{error:e},n):n}};F0.contextType=$0;var sp=new WeakMap;function hE({children:e,error:n}){let{basename:a}=f.useContext(Dn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=sE(n.digest);if(o){let l=sp.get(n);if(l)throw l;let c=P0(o.location,a);if(z0&&!sp.get(n))if(c.isExternal||o.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:o.replace}));throw sp.set(n,d),d}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function gE({routeContext:e,match:n,children:a}){let o=f.useContext(Bs);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(cr.Provider,{value:e},a)}function xE(e,n=[],a){let o=a==null?void 0:a.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let l=e,c=o==null?void 0:o.errors;if(c!=null){let b=l.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);yt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,b+1))}let d=!1,m=-1;if(a&&o){d=o.renderFallback;for(let b=0;b<l.length;b++){let g=l[b];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(m=b),g.route.id){let{loaderData:y,errors:w}=o,j=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||j){a.isStatic&&(d=!0),m>=0?l=l.slice(0,m+1):l=[l[0]];break}}}}let p=a==null?void 0:a.onError,h=o&&p?(b,g)=>{var y,w;p(b,{location:o.location,params:((w=(y=o.matches)==null?void 0:y[0])==null?void 0:w.params)??{},pattern:J3(o.matches),errorInfo:g})}:void 0;return l.reduceRight((b,g,y)=>{let w,j=!1,S=null,E=null;o&&(w=c&&g.route.id?c[g.route.id]:void 0,S=g.route.errorElement||pE,d&&(m<0&&y===0?(W0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,E=null):m===y&&(j=!0,E=g.route.hydrateFallbackElement||null)));let N=n.concat(l.slice(0,y+1)),k=()=>{let T;return w?T=S:j?T=E:g.route.Component?T=f.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=b,f.createElement(gE,{match:g,routeContext:{outlet:b,matches:N,isDataRoute:o!=null},children:T})};return o&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?f.createElement(F0,{location:o.location,revalidation:o.revalidation,component:S,error:w,children:k(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:h}):k()},null)}function Oh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vE(e){let n=f.useContext(Bs);return yt(n,Oh(e)),n}function bE(e){let n=f.useContext(Zu);return yt(n,Oh(e)),n}function yE(e){let n=f.useContext(cr);return yt(n,Oh(e)),n}function Dh(e){let n=yE(e),a=n.matches[n.matches.length-1];return yt(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function wE(){return Dh("useRouteId")}function CE(){var o;let e=f.useContext(_h),n=bE("useRouteError"),a=Dh("useRouteError");return e!==void 0?e:(o=n.errors)==null?void 0:o[a]}function SE(){let{router:e}=vE("useNavigate"),n=Dh("useNavigate"),a=f.useRef(!1);return V0(()=>{a.current=!0}),f.useCallback(async(l,c={})=>{Xn(a.current,H0),a.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:n,...c}))},[e,n])}var ty={};function W0(e,n,a){!n&&!ty[e]&&(ty[e]=!0,Xn(!1,a))}f.memo(jE);function jE({routes:e,manifest:n,future:a,state:o,isStatic:l,onError:c}){return G0(e,void 0,{manifest:n,state:o,isStatic:l,onError:c})}function Qr({to:e,replace:n,state:a,relative:o}){yt(Us(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=f.useContext(Dn);Xn(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:c}=f.useContext(cr),{pathname:d}=Ln(),m=Ro(),p=Xu(e,Mh(c),d,o==="path"),h=JSON.stringify(p);return f.useEffect(()=>{m(JSON.parse(h),{replace:n,state:a,relative:o})},[m,h,o,n,a]),null}function NE(e){return dE(e.context)}function rn(e){yt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function EE({basename:e="/",children:n=null,location:a,navigationType:o="POP",navigator:l,static:c=!1,useTransitions:d}){yt(!Us(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=e.replace(/^\/*/,"/"),p=f.useMemo(()=>({basename:m,navigator:l,static:c,useTransitions:d,future:{}}),[m,l,c,d]);typeof a=="string"&&(a=$s(a));let{pathname:h="/",search:b="",hash:g="",state:y=null,key:w="default",mask:j}=a,S=f.useMemo(()=>{let E=Jr(h,m);return E==null?null:{location:{pathname:E,search:b,hash:g,state:y,key:w,mask:j},navigationType:o}},[m,h,b,g,y,w,o,j]);return Xn(S!=null,`<Router basename="${m}"> is not able to match the URL "${h}${b}${g}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:f.createElement(Dn.Provider,{value:p},f.createElement(bl.Provider,{children:n,value:S}))}function ny({children:e,location:n}){return fE(Hp(e),n)}function Hp(e,n=[]){let a=[];return f.Children.forEach(e,(o,l)=>{if(!f.isValidElement(o))return;let c=[...n,l];if(o.type===f.Fragment){a.push.apply(a,Hp(o.props.children,c));return}yt(o.type===rn,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||c.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Hp(o.props.children,c)),a.push(d)}),a}var xu="get",vu="application/x-www-form-urlencoded";function Qu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function kE(e){return Qu(e)&&e.tagName.toLowerCase()==="button"}function TE(e){return Qu(e)&&e.tagName.toLowerCase()==="form"}function RE(e){return Qu(e)&&e.tagName.toLowerCase()==="input"}function AE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ME(e,n){return e.button===0&&(!n||n==="_self")&&!AE(e)}function Vp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,a)=>{let o=e[a];return n.concat(Array.isArray(o)?o.map(l=>[a,l]):[[a,o]])},[]))}function _E(e,n){let a=Vp(e);return n&&n.forEach((o,l)=>{a.has(l)||n.getAll(l).forEach(c=>{a.append(l,c)})}),a}var eu=null;function OE(){if(eu===null)try{new FormData(document.createElement("form"),0),eu=!1}catch{eu=!0}return eu}var DE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ip(e){return e!=null&&!DE.has(e)?(Xn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vu}"`),null):e}function LE(e,n){let a,o,l,c,d;if(TE(e)){let m=e.getAttribute("action");o=m?Jr(m,n):null,a=e.getAttribute("method")||xu,l=ip(e.getAttribute("enctype"))||vu,c=new FormData(e)}else if(kE(e)||RE(e)&&(e.type==="submit"||e.type==="image")){let m=e.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||m.getAttribute("action");if(o=p?Jr(p,n):null,a=e.getAttribute("formmethod")||m.getAttribute("method")||xu,l=ip(e.getAttribute("formenctype"))||ip(m.getAttribute("enctype"))||vu,c=new FormData(m,e),!OE()){let{name:h,type:b,value:g}=e;if(b==="image"){let y=h?`${h}.`:"";c.append(`${y}x`,"0"),c.append(`${y}y`,"0")}else h&&c.append(h,g)}}else{if(Qu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=xu,o=null,l=vu,d=e}return c&&l==="text/plain"&&(d=c,c=void 0),{action:o,method:a.toLowerCase(),encType:l,formData:c,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Lh(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Y0(e,n,a,o){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${o}`:l.pathname=`${l.pathname}.${o}`:l.pathname==="/"?l.pathname=`_root.${o}`:n&&Jr(l.pathname,n)==="/"?l.pathname=`${Ru(n)}/_root.${o}`:l.pathname=`${Ru(l.pathname)}.${o}`,l}async function zE(e,n){if(e.id in n)return n[e.id];try{let a=await import(e.module);return n[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function PE(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function IE(e,n,a){let o=await Promise.all(e.map(async l=>{let c=n.routes[l.route.id];if(c){let d=await zE(c,a);return d.links?d.links():[]}return[]}));return HE(o.flat(1).filter(PE).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function ry(e,n,a,o,l,c){let d=(p,h)=>a[h]?p.route.id!==a[h].route.id:!0,m=(p,h)=>{var b;return a[h].pathname!==p.pathname||((b=a[h].route.path)==null?void 0:b.endsWith("*"))&&a[h].params["*"]!==p.params["*"]};return c==="assets"?n.filter((p,h)=>d(p,h)||m(p,h)):c==="data"?n.filter((p,h)=>{var g;let b=o.routes[p.route.id];if(!b||!b.hasLoader)return!1;if(d(p,h)||m(p,h))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((g=a[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function $E(e,n,{includeHydrateFallback:a}={}){return BE(e.map(o=>{let l=n.routes[o.route.id];if(!l)return[];let c=[l.module];return l.clientActionModule&&(c=c.concat(l.clientActionModule)),l.clientLoaderModule&&(c=c.concat(l.clientLoaderModule)),a&&l.hydrateFallbackModule&&(c=c.concat(l.hydrateFallbackModule)),l.imports&&(c=c.concat(l.imports)),c}).flat(1))}function BE(e){return[...new Set(e)]}function UE(e){let n={},a=Object.keys(e).sort();for(let o of a)n[o]=e[o];return n}function HE(e,n){let a=new Set;return new Set(n),e.reduce((o,l)=>{let c=JSON.stringify(UE(l));return a.has(c)||(a.add(c),o.push({key:c,link:l})),o},[])}function zh(){let e=f.useContext(Bs);return Lh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function VE(){let e=f.useContext(Zu);return Lh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ph=f.createContext(void 0);Ph.displayName="FrameworkContext";function Ih(){let e=f.useContext(Ph);return Lh(e,"You must render this element inside a <HydratedRouter> element"),e}function GE(e,n){let a=f.useContext(Ph),[o,l]=f.useState(!1),[c,d]=f.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:h,onMouseLeave:b,onTouchStart:g}=n,y=f.useRef(null);f.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let S=N=>{N.forEach(k=>{d(k.isIntersecting)})},E=new IntersectionObserver(S,{threshold:.5});return y.current&&E.observe(y.current),()=>{E.disconnect()}}},[e]),f.useEffect(()=>{if(o){let S=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(S)}}},[o]);let w=()=>{l(!0)},j=()=>{l(!1),d(!1)};return a?e!=="intent"?[c,y,{}]:[c,y,{onFocus:Yi(m,w),onBlur:Yi(p,j),onMouseEnter:Yi(h,w),onMouseLeave:Yi(b,j),onTouchStart:Yi(g,w)}]:[!1,y,{}]}function Yi(e,n){return a=>{e&&e(a),a.defaultPrevented||n(a)}}function FE({page:e,...n}){let a=tE(),{router:o}=zh(),l=f.useMemo(()=>_0(o.routes,e,o.basename),[o.routes,e,o.basename]);return l?a?f.createElement(YE,{page:e,matches:l,...n}):f.createElement(qE,{page:e,matches:l,...n}):null}function WE(e){let{manifest:n,routeModules:a}=Ih(),[o,l]=f.useState([]);return f.useEffect(()=>{let c=!1;return IE(e,n,a).then(d=>{c||l(d)}),()=>{c=!0}},[e,n,a]),o}function YE({page:e,matches:n,...a}){let o=Ln(),{future:l}=Ih(),{basename:c}=zh(),d=f.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let m=Y0(e,c,l.unstable_trailingSlashAwareDataRequests,"rsc"),p=!1,h=[];for(let b of n)typeof b.route.shouldRevalidate=="function"?p=!0:h.push(b.route.id);return p&&h.length>0&&m.searchParams.set("_routes",h.join(",")),[m.pathname+m.search]},[c,l.unstable_trailingSlashAwareDataRequests,e,o,n]);return f.createElement(f.Fragment,null,d.map(m=>f.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...a})))}function qE({page:e,matches:n,...a}){let o=Ln(),{future:l,manifest:c,routeModules:d}=Ih(),{basename:m}=zh(),{loaderData:p,matches:h}=VE(),b=f.useMemo(()=>ry(e,n,h,c,o,"data"),[e,n,h,c,o]),g=f.useMemo(()=>ry(e,n,h,c,o,"assets"),[e,n,h,c,o]),y=f.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let S=new Set,E=!1;if(n.forEach(k=>{var A;let T=c.routes[k.route.id];!T||!T.hasLoader||(!b.some(O=>O.route.id===k.route.id)&&k.route.id in p&&((A=d[k.route.id])!=null&&A.shouldRevalidate)||T.hasClientLoader?E=!0:S.add(k.route.id))}),S.size===0)return[];let N=Y0(e,m,l.unstable_trailingSlashAwareDataRequests,"data");return E&&S.size>0&&N.searchParams.set("_routes",n.filter(k=>S.has(k.route.id)).map(k=>k.route.id).join(",")),[N.pathname+N.search]},[m,l.unstable_trailingSlashAwareDataRequests,p,o,c,b,n,e,d]),w=f.useMemo(()=>$E(g,c),[g,c]),j=WE(g);return f.createElement(f.Fragment,null,y.map(S=>f.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...a})),w.map(S=>f.createElement("link",{key:S,rel:"modulepreload",href:S,...a})),j.map(({key:S,link:E})=>f.createElement("link",{key:S,nonce:a.nonce,...E,crossOrigin:E.crossOrigin??a.crossOrigin})))}function KE(...e){return n=>{e.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var XE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{XE&&(window.__reactRouterVersion="7.15.1")}catch{}function ZE({basename:e,children:n,useTransitions:a,window:o}){let l=f.useRef();l.current==null&&(l.current=k3({window:o,v5Compat:!0}));let c=l.current,[d,m]=f.useState({action:c.action,location:c.location}),p=f.useCallback(h=>{a===!1?m(h):f.startTransition(()=>m(h))},[a]);return f.useLayoutEffect(()=>c.listen(p),[c,p]),f.createElement(EE,{basename:e,children:n,location:d.location,navigationType:d.action,navigator:c,useTransitions:a})}var q0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ft=f.forwardRef(function({onClick:n,discover:a="render",prefetch:o="none",relative:l,reloadDocument:c,replace:d,mask:m,state:p,target:h,to:b,preventScrollReset:g,viewTransition:y,defaultShouldRevalidate:w,...j},S){let{basename:E,navigator:N,useTransitions:k}=f.useContext(Dn),T=typeof b=="string"&&q0.test(b),A=P0(b,E);b=A.to;let O=lE(b,{relative:l}),M=Ln(),z=null;if(m){let se=Xu(m,[],M.mask?M.mask.pathname:"/",!0);E!=="/"&&(se.pathname=se.pathname==="/"?E:sr([E,se.pathname])),z=N.createHref(se)}let[B,K,U]=GE(o,j),q=e8(b,{replace:d,mask:m,state:p,target:h,preventScrollReset:g,relative:l,viewTransition:y,defaultShouldRevalidate:w,useTransitions:k});function ue(se){n&&n(se),se.defaultPrevented||q(se)}let pe=!(A.isExternal||c),xe=f.createElement("a",{...j,...U,href:(pe?z:void 0)||A.absoluteURL||O,onClick:pe?ue:n,ref:KE(S,K),target:h,"data-discover":!T&&a==="render"?"true":void 0});return B&&!T?f.createElement(f.Fragment,null,xe,f.createElement(FE,{page:O})):xe});Ft.displayName="Link";var Gp=f.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:o="",end:l=!1,style:c,to:d,viewTransition:m,children:p,...h},b){let g=yl(d,{relative:h.relative}),y=Ln(),w=f.useContext(Zu),{navigator:j,basename:S}=f.useContext(Dn),E=w!=null&&o8(g)&&m===!0,N=j.encodeLocation?j.encodeLocation(g).pathname:g.pathname,k=y.pathname,T=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;a||(k=k.toLowerCase(),T=T?T.toLowerCase():null,N=N.toLowerCase()),T&&S&&(T=Jr(T,S)||T);const A=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let O=k===N||!l&&k.startsWith(N)&&k.charAt(A)==="/",M=T!=null&&(T===N||!l&&T.startsWith(N)&&T.charAt(N.length)==="/"),z={isActive:O,isPending:M,isTransitioning:E},B=O?n:void 0,K;typeof o=="function"?K=o(z):K=[o,O?"active":null,M?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let U=typeof c=="function"?c(z):c;return f.createElement(Ft,{...h,"aria-current":B,className:K,ref:b,style:U,to:d,viewTransition:m},typeof p=="function"?p(z):p)});Gp.displayName="NavLink";var QE=f.forwardRef(({discover:e="render",fetcherKey:n,navigate:a,reloadDocument:o,replace:l,state:c,method:d=xu,action:m,onSubmit:p,relative:h,preventScrollReset:b,viewTransition:g,defaultShouldRevalidate:y,...w},j)=>{let{useTransitions:S}=f.useContext(Dn),E=r8(),N=a8(m,{relative:h}),k=d.toLowerCase()==="get"?"get":"post",T=typeof m=="string"&&q0.test(m),A=O=>{if(p&&p(O),O.defaultPrevented)return;O.preventDefault();let M=O.nativeEvent.submitter,z=(M==null?void 0:M.getAttribute("formmethod"))||d,B=()=>E(M||O.currentTarget,{fetcherKey:n,method:z,navigate:a,replace:l,state:c,relative:h,preventScrollReset:b,viewTransition:g,defaultShouldRevalidate:y});S&&a!==!1?f.startTransition(()=>B()):B()};return f.createElement("form",{ref:j,method:k,action:N,onSubmit:o?p:A,...w,"data-discover":!T&&e==="render"?"true":void 0})});QE.displayName="Form";function JE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function K0(e){let n=f.useContext(Bs);return yt(n,JE(e)),n}function e8(e,{target:n,replace:a,mask:o,state:l,preventScrollReset:c,relative:d,viewTransition:m,defaultShouldRevalidate:p,useTransitions:h}={}){let b=Ro(),g=Ln(),y=yl(e,{relative:d});return f.useCallback(w=>{if(ME(w,n)){w.preventDefault();let j=a!==void 0?a:sl(g)===sl(y),S=()=>b(e,{replace:j,mask:o,state:l,preventScrollReset:c,relative:d,viewTransition:m,defaultShouldRevalidate:p});h?f.startTransition(()=>S()):S()}},[g,b,y,a,o,l,n,e,c,d,m,p,h])}function Ju(e){Xn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=f.useRef(Vp(e)),a=f.useRef(!1),o=Ln(),l=f.useMemo(()=>_E(o.search,a.current?null:n.current),[o.search]),c=Ro(),d=f.useCallback((m,p)=>{const h=Vp(typeof m=="function"?m(new URLSearchParams(l)):m);a.current=!0,c("?"+h,p)},[c,l]);return[l,d]}var t8=0,n8=()=>`__${String(++t8)}__`;function r8(){let{router:e}=K0("useSubmit"),{basename:n}=f.useContext(Dn),a=wE(),o=e.fetch,l=e.navigate;return f.useCallback(async(c,d={})=>{let{action:m,method:p,encType:h,formData:b,body:g}=LE(c,n);if(d.navigate===!1){let y=d.fetcherKey||n8();await o(y,a,d.action||m,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:b,body:g,formMethod:d.method||p,formEncType:d.encType||h,flushSync:d.flushSync})}else await l(d.action||m,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:b,body:g,formMethod:d.method||p,formEncType:d.encType||h,replace:d.replace,state:d.state,fromRouteId:a,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,l,n,a])}function a8(e,{relative:n}={}){let{basename:a}=f.useContext(Dn),o=f.useContext(cr);yt(o,"useFormAction must be used inside a RouteContext");let[l]=o.matches.slice(-1),c={...yl(e||".",{relative:n})},d=Ln();if(e==null){c.search=d.search;let m=new URLSearchParams(c.search),p=m.getAll("index");if(p.some(b=>b==="")){m.delete("index"),p.filter(g=>g).forEach(g=>m.append("index",g));let b=m.toString();c.search=b?`?${b}`:""}}return(!e||e===".")&&l.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(c.pathname=c.pathname==="/"?a:sr([a,c.pathname])),sl(c)}function o8(e,{relative:n}={}){let a=f.useContext(B0);yt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=K0("useViewTransitionState"),l=yl(e,{relative:n});if(!a.isTransitioning)return!1;let c=Jr(a.currentLocation.pathname,o)||a.currentLocation.pathname,d=Jr(a.nextLocation.pathname,o)||a.nextLocation.pathname;return Tu(l.pathname,d)!=null||Tu(l.pathname,c)!=null}var Ao=M0();const X0=A0(Ao),Z0=[["path",{d:"M12.001 5.00003V19.002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19.002 12.002L4.99998 12.002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],$h=[["path",{d:"M7 4.5C5.34315 4.5 4 5.84315 4 7.5C4 8.06866 4.15822 8.60037 4.43304 9.0535C3.04727 9.31855 2 10.537 2 12C2 13.463 3.04727 14.6814 4.43304 14.9465M7 4.5C7 3.11929 8.11929 2 9.5 2C10.8807 2 12 3.11929 12 4.5V19.5C12 20.8807 10.8807 22 9.5 22C8.11929 22 7 20.8807 7 19.5C5.34315 19.5 4 18.1569 4 16.5C4 15.9313 4.15822 15.3996 4.43304 14.9465M7 4.5C7 5.31791 7.39278 6.04408 8 6.50018M4.43304 14.9465C4.78948 14.3588 5.34207 13.9032 6 13.6707",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 19.4999C18.6569 19.4999 20 18.1567 20 16.4999C20 15.9312 19.8418 15.3995 19.567 14.9464C20.9527 14.6813 22 13.4629 22 11.9999C22 10.5369 20.9527 9.31843 19.567 9.05338M17 19.4999C17 20.8806 15.8807 21.9999 14.5 21.9999C13.1193 21.9999 12 20.8806 12 19.4999L12 4.49988C12 3.11917 13.1193 1.99988 14.5 1.99988C15.8807 1.99988 17 3.11917 17 4.49988C18.6569 4.49988 20 5.84302 20 7.49988C20 8.06854 19.8418 8.60024 19.567 9.05338M17 19.4999C17 18.682 16.6072 17.9558 16 17.4997M19.567 9.05338C19.2105 9.64109 18.6579 10.0966 18 10.3292",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Bh=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Q0=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],s8=[["path",{d:"M16.4999 3.26621C17.3443 3.25421 20.1408 2.67328 20.7337 3.26621C21.3266 3.85913 20.7457 6.65559 20.7337 7.5M20.5059 3.49097L13.5021 10.4961",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3.26636 16.5001C3.25436 17.3445 2.67343 20.141 3.26636 20.7339C3.85928 21.3268 6.65574 20.7459 7.50015 20.7339M10.502 13.4976L3.49824 20.5027",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],J0=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Uh=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],ay=[["path",{d:"M5.82338 12L4.27922 10.4558C2.57359 8.75022 2.57359 5.98485 4.27922 4.27922C5.98485 2.57359 8.75022 2.57359 10.4558 4.27922L19.7208 13.5442C21.4264 15.2498 21.4264 18.0152 19.7208 19.7208C18.0152 21.4264 15.2498 21.4264 13.5442 19.7208L10.0698 16.2464C9.00379 15.1804 9.00379 13.4521 10.0698 12.386C11.1358 11.32 12.8642 11.32 13.9302 12.386L15.8604 14.3162",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Hh=[["path",{d:"M13 7H11C8.19108 7 6.78661 7 5.77772 7.67412C5.34096 7.96596 4.96596 8.34096 4.67412 8.77772C4 9.78661 4 11.1911 4 14C4 16.8089 4 18.2134 4.67412 19.2223C4.96596 19.659 5.34096 20.034 5.77772 20.3259C6.78661 21 8.19108 21 11 21H13C15.8089 21 17.2134 21 18.2223 20.3259C18.659 20.034 19.034 19.659 19.3259 19.2223C20 18.2134 20 16.8089 20 14C20 11.1911 20 9.78661 19.3259 8.77772C19.034 8.34096 18.659 7.96596 18.2223 7.67412C17.2134 7 15.8089 7 13 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4 14H2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M10 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M22 14H20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M15 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M9 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M12 7C12 5.11438 12 4.17157 11.4142 3.58579C10.8284 3 9.88562 3 8 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]],Zr=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],ed=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12.5L10.5 15L16 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],i8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V12L14 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Da=[["path",{d:"M15 9V15H9V9H15Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15 15H18C19.6569 15 21 16.3431 21 18C21 19.6569 19.6569 21 18 21C16.3431 21 15 19.6569 15 18V15Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9 15.002H6C4.34315 15.002 3 16.3451 3 18.002C3 19.6588 4.34315 21.002 6 21.002C7.65685 21.002 9 19.6588 9 18.002V15.002Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M15 9L15 6C15 4.34315 16.3431 3 18 3C19.6569 3 21 4.34315 21 6C21 7.65685 19.6569 9 18 9H15Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M9 9V6C9 4.34315 7.65685 3 6 3C4.34315 3 3 4.34315 3 6C3 7.65685 4.34315 9 6 9H9Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],l8=[["path",{d:"M8 13.5H16M8 8.5H12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M6.09881 19C4.7987 18.8721 3.82475 18.4816 3.17157 17.8284C2 16.6569 2 14.7712 2 11V10.5C2 6.72876 2 4.84315 3.17157 3.67157C4.34315 2.5 6.22876 2.5 10 2.5H14C17.7712 2.5 19.6569 2.5 20.8284 3.67157C22 4.84315 22 6.72876 22 10.5V11C22 14.7712 22 16.6569 20.8284 17.8284C19.6569 19 17.7712 19 14 19C13.4395 19.0125 12.9931 19.0551 12.5546 19.155C11.3562 19.4309 10.2465 20.0441 9.14987 20.5789C7.58729 21.3408 6.806 21.7218 6.31569 21.3651C5.37769 20.6665 6.29454 18.5019 6.5 17.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],e2=[["path",{d:"M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.5 12.5H15.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],t2=[["path",{d:"M9 15C9 12.1716 9 10.7574 9.87868 9.87868C10.7574 9 12.1716 9 15 9L16 9C18.8284 9 20.2426 9 21.1213 9.87868C22 10.7574 22 12.1716 22 15V16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15C12.1716 22 10.7574 22 9.87868 21.1213C9 20.2426 9 18.8284 9 16L9 15Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.9999 9C16.9975 6.04291 16.9528 4.51121 16.092 3.46243C15.9258 3.25989 15.7401 3.07418 15.5376 2.90796C14.4312 2 12.7875 2 9.5 2C6.21252 2 4.56878 2 3.46243 2.90796C3.25989 3.07417 3.07418 3.25989 2.90796 3.46243C2 4.56878 2 6.21252 2 9.5C2 12.7875 2 14.4312 2.90796 15.5376C3.07417 15.7401 3.25989 15.9258 3.46243 16.092C4.51121 16.9528 6.04291 16.9975 9 16.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],n2=[["path",{d:"M10.5 8.75V6.75C10.5 5.10626 10.5 4.28439 10.046 3.73121C9.96291 3.62995 9.87005 3.53709 9.76879 3.45398C9.21561 3 8.39374 3 6.75 3C5.10626 3 4.28439 3 3.73121 3.45398C3.62995 3.53709 3.53709 3.62995 3.45398 3.73121C3 4.28439 3 5.10626 3 6.75V8.75C3 10.3937 3 11.2156 3.45398 11.7688C3.53709 11.8701 3.62995 11.9629 3.73121 12.046C4.28439 12.5 5.10626 12.5 6.75 12.5C8.39374 12.5 9.21561 12.5 9.76879 12.046C9.87005 11.9629 9.96291 11.8701 10.046 11.7688C10.5 11.2156 10.5 10.3937 10.5 8.75Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.75 15.5H5.75C5.05222 15.5 4.70333 15.5 4.41943 15.5861C3.78023 15.78 3.28002 16.2802 3.08612 16.9194C3 17.2033 3 17.5522 3 18.25C3 18.9478 3 19.2967 3.08612 19.5806C3.28002 20.2198 3.78023 20.72 4.41943 20.9139C4.70333 21 5.05222 21 5.75 21H7.75C8.44778 21 8.79667 21 9.08057 20.9139C9.71977 20.72 10.22 20.2198 10.4139 19.5806C10.5 19.2967 10.5 18.9478 10.5 18.25C10.5 17.5522 10.5 17.2033 10.4139 16.9194C10.22 16.2802 9.71977 15.78 9.08057 15.5861C8.79667 15.5 8.44778 15.5 7.75 15.5Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 17.25V15.25C21 13.6063 21 12.7844 20.546 12.2312C20.4629 12.1299 20.3701 12.0371 20.2688 11.954C19.7156 11.5 18.8937 11.5 17.25 11.5C15.6063 11.5 14.7844 11.5 14.2312 11.954C14.1299 12.0371 14.0371 12.1299 13.954 12.2312C13.5 12.7844 13.5 13.6063 13.5 15.25V17.25C13.5 18.8937 13.5 19.7156 13.954 20.2688C14.0371 20.3701 14.1299 20.4629 14.2312 20.546C14.7844 21 15.6063 21 17.25 21C18.8937 21 19.7156 21 20.2688 20.546C20.3701 20.4629 20.4629 20.3701 20.546 20.2688C21 19.7156 21 18.8937 21 17.25Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M18.25 3H16.25C15.5522 3 15.2033 3 14.9194 3.08612C14.2802 3.28002 13.78 3.78023 13.5861 4.41943C13.5 4.70333 13.5 5.05222 13.5 5.75C13.5 6.44778 13.5 6.79667 13.5861 7.08057C13.78 7.71977 14.2802 8.21998 14.9194 8.41388C15.2033 8.5 15.5522 8.5 16.25 8.5H18.25C18.9478 8.5 19.2967 8.5 19.5806 8.41388C20.2198 8.21998 20.72 7.71977 20.9139 7.08057C21 6.79667 21 6.44778 21 5.75C21 5.05222 21 4.70333 20.9139 4.41943C20.72 3.78023 20.2198 3.28002 19.5806 3.08612C19.2967 3 18.9478 3 18.25 3Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],wl=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],td=[["path",{d:"M16.9504 12.1817C17.1981 12.814 16.5076 13.5726 15.1267 15.0899C13.6702 16.6902 12.9201 17.4904 12 17.5C11.0799 17.4904 10.3298 16.6902 8.87331 15.0899C7.49239 13.5726 6.80193 12.814 7.04964 12.1817C7.05868 12.1586 7.06851 12.1359 7.0791 12.1135C7.34928 11.542 8.24477 11.5029 10 11.5002V4.99998C10 4.53501 10 4.30253 10.0511 4.11179C10.1898 3.59414 10.5941 3.1898 11.1118 3.05111C11.3025 3 11.535 3 12 3C12.4649 3 12.6974 3 12.8882 3.05111C13.4058 3.1898 13.8102 3.59414 13.9489 4.11179C14 4.30253 14 4.53501 14 4.99998V11.5002C15.7552 11.5029 16.6507 11.542 16.9209 12.1135C16.9315 12.1359 16.9413 12.1586 16.9504 12.1817Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M5.00006 21H19.0001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],c8=[["path",{d:"M14.0737 3.88545C14.8189 3.07808 15.1915 2.6744 15.5874 2.43893C16.5427 1.87076 17.7191 1.85309 18.6904 2.39232C19.0929 2.6158 19.4769 3.00812 20.245 3.79276C21.0131 4.5774 21.3972 4.96972 21.6159 5.38093C22.1438 6.37312 22.1265 7.57479 21.5703 8.5507C21.3398 8.95516 20.9446 9.33578 20.1543 10.097L10.7506 19.1543C9.25288 20.5969 8.504 21.3182 7.56806 21.6837C6.63212 22.0493 5.6032 22.0224 3.54536 21.9686L3.26538 21.9613C2.63891 21.9449 2.32567 21.9367 2.14359 21.73C1.9615 21.5234 1.98636 21.2043 2.03608 20.5662L2.06308 20.2197C2.20301 18.4235 2.27297 17.5255 2.62371 16.7182C2.97444 15.9109 3.57944 15.2555 4.78943 13.9445L14.0737 3.88545Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 4L20 11",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14 22L22 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],il=[["path",{d:"M8 17H16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 13H12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5M20 10.6569V14C20 17.7712 20 19.6569 18.8284 20.8284C17.6569 22 15.7712 22 12 22C8.22876 22 6.34315 22 5.17157 20.8284C4 19.6569 4 17.7712 4 14V9.45584C4 6.21082 4 4.58831 4.88607 3.48933C5.06508 3.26731 5.26731 3.06508 5.48933 2.88607C6.58831 2 8.21082 2 11.4558 2C12.1614 2 12.5141 2 12.8372 2.11401C12.9044 2.13772 12.9702 2.165 13.0345 2.19575C13.3436 2.34355 13.593 2.593 14.0919 3.09188L18.8284 7.82843C19.4065 8.40649 19.6955 8.69552 19.8478 9.06306C20 9.4306 20 9.83935 20 10.6569Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],nd=[["path",{d:"M8 22V19C8 17.1144 8 16.1716 8.58579 15.5858C9.17157 15 10.1144 15 12 15C13.8856 15 14.8284 15 15.4142 15.5858C16 16.1716 16 17.1144 16 19V22",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10 7H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 11.8584C3 7.28199 3 4.99376 4.38674 3.54394C4.43797 3.49038 4.49038 3.43797 4.54394 3.38674C5.99376 2 8.28199 2 12.8584 2C13.943 2 14.4655 2.00376 14.9628 2.18936C15.4417 2.3681 15.8429 2.70239 16.6452 3.37099L18.8411 5.20092C19.9027 6.08561 20.4335 6.52795 20.7168 7.13266C21 7.73737 21 8.42833 21 9.81025V13C21 16.7497 21 18.6246 20.0451 19.9389C19.7367 20.3634 19.3634 20.7367 18.9389 21.0451C17.6246 22 15.7497 22 12 22C8.25027 22 6.3754 22 5.06107 21.0451C4.6366 20.7367 4.26331 20.3634 3.95491 19.9389C3 18.6246 3 16.7497 3 13V11.8584Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],u8=[["circle",{cx:"7.5",cy:"7.5",r:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 21C9.37246 15.775 14.2741 8.88406 21.4975 13.5424",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],d8=[["path",{d:"M5 21C9.20998 16.2487 13.9412 9.9475 21 14.6734",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 4.50012C17.4915 3.99442 18.7998 2.00012 19.5 2.00012M22 4.50012C21.5085 3.99442 20.2002 2.00012 19.5 2.00012M19.5 2.00012V10.0001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20.9999 13C20.998 17.147 20.9472 19.2703 19.6088 20.6088C18.2175 22 15.9783 22 11.5 22C7.02166 22 4.78249 22 3.39124 20.6088C2 19.2175 2 16.9783 2 12.5C2 8.02166 2 5.78249 3.39124 4.39124C4.78249 3 7.02166 3 11.5 3C11.6699 3 14 3.00008 14 3.00008",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}]],f8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 8.25H12M12.25 8.25C12.25 8.11193 12.1381 8 12 8C11.8619 8 11.75 8.11193 11.75 8.25C11.75 8.38807 11.8619 8.5 12 8.5C12.1381 8.5 12.25 8.38807 12.25 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],oy=[["path",{d:"M15.5 14.5C18.8137 14.5 21.5 11.8137 21.5 8.5C21.5 5.18629 18.8137 2.5 15.5 2.5C12.1863 2.5 9.5 5.18629 9.5 8.5C9.5 9.38041 9.68962 10.2165 10.0303 10.9697L2.5 18.5V21.5H5.5V19.5H7.5V17.5H9.5L13.0303 13.9697C13.7835 14.3104 14.6196 14.5 15.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.5 6.5L16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],rd=[["path",{d:"M9.14339 10.691L9.35031 10.4841C11.329 8.50532 14.5372 8.50532 16.5159 10.4841C18.4947 12.4628 18.4947 15.671 16.5159 17.6497L13.6497 20.5159C11.671 22.4947 8.46279 22.4947 6.48405 20.5159C4.50532 18.5372 4.50532 15.329 6.48405 13.3503L6.9484 12.886",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.0516 11.114L17.5159 10.6497C19.4947 8.67095 19.4947 5.46279 17.5159 3.48405C15.5372 1.50532 12.329 1.50532 10.3503 3.48405L7.48405 6.35031C5.50532 8.32904 5.50532 11.5372 7.48405 13.5159C9.46279 15.4947 12.671 15.4947 14.6497 13.5159L14.8566 13.309",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],r2=[["path",{d:"M12 3V6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 18V21",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 12L18 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6 12L3 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M18.3635 5.63672L16.2422 7.75804",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.75804 16.2422L5.63672 18.3635",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M18.3635 18.3635L16.2422 16.2422",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M7.75804 7.75804L5.63672 5.63672",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]],m8=[["path",{d:"M18 18C18 18.4644 18 18.6965 17.978 18.8918C17.7952 20.5145 16.5145 21.7952 14.8919 21.978C14.6965 22 14.4644 22 14 22H11C7.70017 22 6.05025 22 5.02513 20.9749C4 19.9498 4 18.2998 4 15L4.00001 8.99998C4.00001 5.70016 4.00003 4.05024 5.02514 3.02512C6.05027 2 7.70018 2 11 2H14C14.4644 2 14.6965 2 14.8919 2.02201C16.5145 2.20483 17.7952 3.48547 17.978 5.10816C18 5.30347 18 5.53565 18 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.07612 11.1183C8 11.3021 8 11.535 8 12.001C8 12.4669 8 12.6999 8.07612 12.8837C8.17761 13.1287 8.37229 13.3234 8.61732 13.4249C8.80109 13.501 9.03406 13.501 9.5 13.501H14.5C14.5002 15.2503 14.511 16.1299 15.0623 16.3858C15.0829 16.3954 15.1037 16.4042 15.1249 16.4124C15.7045 16.6353 16.3999 16.0139 17.7907 14.7711C19.2576 13.4602 19.9912 12.7851 20 11.957C19.9912 11.1289 19.2576 10.4538 17.7907 9.14301C16.3999 7.90018 15.7045 7.27876 15.1249 7.50171C15.1037 7.50985 15.0829 7.51869 15.0623 7.52822C14.5018 7.78844 14.5 8.69318 14.5 10.501H9.5C9.03406 10.501 8.80109 10.501 8.61732 10.5771C8.37229 10.6786 8.17761 10.8733 8.07612 11.1183Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],p8=[["path",{d:"M19.9264 22.2516V20.691C19.9264 20.288 20.0525 19.8966 20.2639 19.5531C21.7583 17.1245 22.2279 14.5196 21.9002 13.505C20.857 11.3418 17.3758 10.4907 15.76 10.2878L16.7966 5.12292C16.9705 4.30387 16.3513 3.47938 15.4135 3.28136C14.4758 3.08334 13.5746 3.58679 13.4007 4.40583L11.3462 14.0815L8.77462 12.4424C8.77462 12.4424 7.47969 11.406 6.44041 12.4424C5.40114 13.4788 6.44041 14.7701 6.44041 14.7701L10.3488 19.7776C10.6003 20.0997 10.7468 20.4908 10.7688 20.8984L10.8401 22.2177",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.867 4.36134C9.867 4.36134 10.1124 2.14335 9.867 1.90156M9.867 1.90156C9.54861 1.58797 7.32936 1.85194 7.32936 1.85194M9.867 1.90156L6.89808 4.84002M2.11005 7.08754C2.11005 7.08754 1.86463 9.30553 2.11005 9.54732M2.11005 9.54732C2.42845 9.86092 4.6477 9.59694 4.6477 9.59694M2.11005 9.54732L5.07898 6.60886",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Vh=[["path",{d:"M8.5 14.5H15.5M8.5 9.5H12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.1706 20.8905C18.3536 20.6125 21.6856 17.2332 21.9598 12.9909C22.0134 12.1607 22.0134 11.3009 21.9598 10.4707C21.6856 6.22838 18.3536 2.84913 14.1706 2.57107C12.7435 2.47621 11.2536 2.47641 9.8294 2.57107C5.64639 2.84913 2.31441 6.22838 2.04024 10.4707C1.98659 11.3009 1.98659 12.1607 2.04024 12.9909C2.1401 14.536 2.82343 15.9666 3.62791 17.1746C4.09501 18.0203 3.78674 19.0758 3.30021 19.9978C2.94941 20.6626 2.77401 20.995 2.91484 21.2351C3.05568 21.4752 3.37026 21.4829 3.99943 21.4982C5.24367 21.5285 6.08268 21.1757 6.74868 20.6846C7.1264 20.4061 7.31527 20.2668 7.44544 20.2508C7.5756 20.2348 7.83177 20.3403 8.34401 20.5513C8.8044 20.7409 9.33896 20.8579 9.8294 20.8905C11.2536 20.9852 12.7435 20.9854 14.1706 20.8905Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],h8=[["path",{d:"M19.9264 22.2502V20.6912C19.9264 20.2886 20.0525 19.8976 20.2639 19.5545C21.7583 17.1282 22.2279 14.5259 21.9002 13.5123C20.857 11.3512 17.3758 10.5009 15.76 10.2983L16.7966 5.13851C16.9705 4.32028 16.3513 3.4966 15.4135 3.29877C14.4758 3.10095 13.5746 3.6039 13.4007 4.42213L11.3462 14.0882L8.77462 12.4508C8.77462 12.4508 7.47969 11.4154 6.44041 12.4508C5.40114 13.4861 6.44041 14.7762 6.44041 14.7762L10.3488 19.7787C10.6003 20.1005 10.7468 20.4912 10.7688 20.8984L10.8401 22.2164",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M6.95693 2.2382C6.95693 2.2382 6.7053 4.50936 6.95693 4.75695M6.95693 4.75695C7.28338 5.07806 9.55878 4.80775 9.55878 4.80775M6.95693 4.75695L10.001 1.74805M5.04502 9.24998C5.04502 9.24998 5.29665 6.97882 5.04502 6.73124M5.04502 6.73124C4.71857 6.41012 2.44317 6.68043 2.44317 6.68043M5.04502 6.73124L2.00098 9.74014",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],g8=[["path",{d:"M15.5 18C15.5 19.933 13.933 21.5 12 21.5C10.067 21.5 8.5 19.933 8.5 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19.2311 18H4.76887C3.79195 18 3 17.208 3 16.2311C3 15.762 3.18636 15.3121 3.51809 14.9803L4.12132 14.3771C4.68393 13.8145 5 13.0514 5 12.2558V9.5C5 5.63401 8.13401 2.5 12 2.5C15.866 2.5 19 5.634 19 9.5V12.2558C19 13.0514 19.3161 13.8145 19.8787 14.3771L20.4819 14.9803C20.8136 15.3121 21 15.762 21 16.2311C21 17.208 20.208 18 19.2311 18Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Gh=[["path",{d:"M12 22C11.1818 22 10.4002 21.6698 8.83693 21.0095C4.94564 19.3657 3 18.5438 3 17.1613C3 16.7742 3 10.0645 3 7M12 22C12.8182 22 13.5998 21.6698 15.1631 21.0095C19.0544 19.3657 21 18.5438 21 17.1613V7M12 22L12 11.3548",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.32592 9.69138L5.40472 8.27785C3.80157 7.5021 3 7.11423 3 6.5C3 5.88577 3.80157 5.4979 5.40472 4.72215L8.32592 3.30862C10.1288 2.43621 11.0303 2 12 2C12.9697 2 13.8712 2.4362 15.6741 3.30862L18.5953 4.72215C20.1984 5.4979 21 5.88577 21 6.5C21 7.11423 20.1984 7.5021 18.5953 8.27785L15.6741 9.69138C13.8712 10.5638 12.9697 11 12 11C11.0303 11 10.1288 10.5638 8.32592 9.69138Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6 12L8 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M17 4L7 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],x8=[["path",{d:"M4 7C4 5.58579 4 4.87868 4.43934 4.43934C4.87868 4 5.58579 4 7 4C8.41421 4 9.12132 4 9.56066 4.43934C10 4.87868 10 5.58579 10 7V17C10 18.4142 10 19.1213 9.56066 19.5607C9.12132 20 8.41421 20 7 20C5.58579 20 4.87868 20 4.43934 19.5607C4 19.1213 4 18.4142 4 17V7Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 7C14 5.58579 14 4.87868 14.4393 4.43934C14.8787 4 15.5858 4 17 4C18.4142 4 19.1213 4 19.5607 4.43934C20 4.87868 20 5.58579 20 7V17C20 18.4142 20 19.1213 19.5607 19.5607C19.1213 20 18.4142 20 17 20C15.5858 20 14.8787 20 14.4393 19.5607C14 19.1213 14 18.4142 14 17V7Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],a2=[["path",{d:"M15.2141 5.98239L16.6158 4.58063C17.39 3.80646 18.6452 3.80646 19.4194 4.58063C20.1935 5.3548 20.1935 6.60998 19.4194 7.38415L18.0176 8.78591M15.2141 5.98239L6.98023 14.2163C5.93493 15.2616 5.41226 15.7842 5.05637 16.4211C4.70047 17.058 4.3424 18.5619 4 20C5.43809 19.6576 6.94199 19.2995 7.57889 18.9436C8.21579 18.5877 8.73844 18.0651 9.78375 17.0198L18.0176 8.78591M15.2141 5.98239L18.0176 8.78591",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11 20H17",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],v8=[["path",{d:"M18.8906 12.846C18.5371 14.189 16.8667 15.138 13.5257 17.0361C10.296 18.8709 8.6812 19.7884 7.37983 19.4196C6.8418 19.2671 6.35159 18.9776 5.95624 18.5787C5 17.6139 5 15.7426 5 12C5 8.2574 5 6.3861 5.95624 5.42132C6.35159 5.02245 6.8418 4.73288 7.37983 4.58042C8.6812 4.21165 10.296 5.12907 13.5257 6.96393C16.8667 8.86197 18.5371 9.811 18.8906 11.154C19.0365 11.7084 19.0365 12.2916 18.8906 12.846Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Au=[["path",{d:"M12 4V20M20 12H4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],or=[["path",{d:"M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],b8=[["path",{d:"M11.8013 6.48949L13.2869 5.00392C14.9596 3.3312 17.1495 2.63737 19.4671 2.52399C20.3686 2.47989 20.8193 2.45784 21.1807 2.81928C21.5422 3.18071 21.5201 3.63143 21.476 4.53289C21.3626 6.8505 20.6688 9.04042 18.9961 10.7131L17.5105 12.1987C16.2871 13.4221 15.9393 13.77 16.1961 15.097C16.4496 16.1107 16.6949 17.0923 15.9578 17.8294C15.0637 18.7235 14.2481 18.7235 13.354 17.8294L6.17058 10.646C5.27649 9.75188 5.27646 8.9363 6.17058 8.04219C6.90767 7.30509 7.88929 7.55044 8.90297 7.80389C10.23 8.06073 10.5779 7.71289 11.8013 6.48949Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 21.5L7.5 16.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M8.5 21.5L10.5 19.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M2.5 15.5L4.5 13.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M17.125 7H17M17.25 7C17.25 7.13807 17.1381 7.25 17 7.25C16.8619 7.25 16.75 7.13807 16.75 7C16.75 6.86193 16.8619 6.75 17 6.75C17.1381 6.75 17.25 6.86193 17.25 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],ad=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],y8=[["path",{d:"M18.7088 3.49534C16.8165 2.55382 14.5009 2 12 2C9.4991 2 7.1835 2.55382 5.29116 3.49534C4.36318 3.95706 3.89919 4.18792 3.4496 4.91378C3 5.63965 3 6.34248 3 7.74814V11.2371C3 16.9205 7.54236 20.0804 10.173 21.4338C10.9067 21.8113 11.2735 22 12 22C12.7265 22 13.0933 21.8113 13.8269 21.4338C16.4576 20.0804 21 16.9205 21 11.2371L21 7.74814C21 6.34249 21 5.63966 20.5504 4.91378C20.1008 4.18791 19.6368 3.95706 18.7088 3.49534Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10 10V8.5C10 7.39543 10.8954 6.5 12 6.5C13.1046 6.5 14 7.39543 14 8.5V10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14 10H10C9.17157 10 8.5 10.6716 8.5 11.5V13C8.5 13.8284 9.17157 14.5 10 14.5H14C14.8284 14.5 15.5 13.8284 15.5 13V11.5C15.5 10.6716 14.8284 10 14 10Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],w8=[["path",{d:"M21.0477 3.05293C18.8697 0.707363 2.48648 6.4532 2.50001 8.551C2.51535 10.9299 8.89809 11.6617 10.6672 12.1581C11.7311 12.4565 12.016 12.7625 12.2613 13.8781C13.3723 18.9305 13.9301 21.4435 15.2014 21.4996C17.2278 21.5892 23.1733 5.342 21.0477 3.05293Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.4999 12.5L14.9999 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],vo=[["path",{d:"M15.5 12C15.5 13.933 13.933 15.5 12 15.5C10.067 15.5 8.5 13.933 8.5 12C8.5 10.067 10.067 8.5 12 8.5C13.933 8.5 15.5 10.067 15.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M21.011 14.0965C21.5329 13.9558 21.7939 13.8854 21.8969 13.7508C22 13.6163 22 13.3998 22 12.9669V11.0332C22 10.6003 22 10.3838 21.8969 10.2493C21.7938 10.1147 21.5329 10.0443 21.011 9.90358C19.0606 9.37759 17.8399 7.33851 18.3433 5.40087C18.4817 4.86799 18.5509 4.60156 18.4848 4.44529C18.4187 4.28902 18.2291 4.18134 17.8497 3.96596L16.125 2.98673C15.7528 2.77539 15.5667 2.66972 15.3997 2.69222C15.2326 2.71472 15.0442 2.90273 14.6672 3.27873C13.208 4.73448 10.7936 4.73442 9.33434 3.27864C8.95743 2.90263 8.76898 2.71463 8.60193 2.69212C8.43489 2.66962 8.24877 2.77529 7.87653 2.98663L6.15184 3.96587C5.77253 4.18123 5.58287 4.28891 5.51678 4.44515C5.45068 4.6014 5.51987 4.86787 5.65825 5.4008C6.16137 7.3385 4.93972 9.37763 2.98902 9.9036C2.46712 10.0443 2.20617 10.1147 2.10308 10.2492C2 10.3838 2 10.6003 2 11.0332V12.9669C2 13.3998 2 13.6163 2.10308 13.7508C2.20615 13.8854 2.46711 13.9558 2.98902 14.0965C4.9394 14.6225 6.16008 16.6616 5.65672 18.5992C5.51829 19.1321 5.44907 19.3985 5.51516 19.5548C5.58126 19.7111 5.77092 19.8188 6.15025 20.0341L7.87495 21.0134C8.24721 21.2247 8.43334 21.3304 8.6004 21.3079C8.76746 21.2854 8.95588 21.0973 9.33271 20.7213C10.7927 19.2644 13.2088 19.2643 14.6689 20.7212C15.0457 21.0973 15.2341 21.2853 15.4012 21.3078C15.5682 21.3303 15.7544 21.2246 16.1266 21.0133L17.8513 20.034C18.2307 19.8187 18.4204 19.711 18.4864 19.5547C18.5525 19.3984 18.4833 19.132 18.3448 18.5991C17.8412 16.6616 19.0609 14.6226 21.011 14.0965Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],bu=[["path",{d:"M18.7088 3.49534C16.8165 2.55382 14.5009 2 12 2C9.4991 2 7.1835 2.55382 5.29116 3.49534C4.36318 3.95706 3.89919 4.18792 3.4496 4.91378C3 5.63965 3 6.34248 3 7.74814V11.2371C3 16.9205 7.54236 20.0804 10.173 21.4338C10.9067 21.8113 11.2735 22 12 22C12.7265 22 13.0933 21.8113 13.8269 21.4338C16.4576 20.0804 21 16.9205 21 11.2371L21 7.74814C21 6.34249 21 5.63966 20.5504 4.91378C20.1008 4.18791 19.6368 3.95706 18.7088 3.49534Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],C8=[["path",{d:"M15 2L15.5387 4.39157C15.9957 6.42015 17.5798 8.00431 19.6084 8.46127L22 9L19.6084 9.53873C17.5798 9.99569 15.9957 11.5798 15.5387 13.6084L15 16L14.4613 13.6084C14.0043 11.5798 12.4202 9.99569 10.3916 9.53873L8 9L10.3916 8.46127C12.4201 8.00431 14.0043 6.42015 14.4613 4.39158L15 2Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 12L7.38481 13.7083C7.71121 15.1572 8.84275 16.2888 10.2917 16.6152L12 17L10.2917 17.3848C8.84275 17.7112 7.71121 18.8427 7.38481 20.2917L7 22L6.61519 20.2917C6.28879 18.8427 5.15725 17.7112 3.70827 17.3848L2 17L3.70827 16.6152C5.15725 16.2888 6.28879 15.1573 6.61519 13.7083L7 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],S8=[["path",{d:"M5 14.5C5 14.5 6.5 14.5 8.5 18C8.5 18 14.0588 8.83333 19 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],j8=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],ll=[["path",{d:"M2.46433 9.34375C2.21579 9.34375 1.98899 9.14229 2.00041 8.87895C2.06733 7.33687 2.25481 6.33298 2.78008 5.53884C3.08228 5.08196 3.45765 4.68459 3.88923 4.36468C5.05575 3.5 6.70139 3.5 9.99266 3.5H14.0074C17.2986 3.5 18.9443 3.5 20.1108 4.36468C20.5424 4.68459 20.9177 5.08196 21.2199 5.53884C21.7452 6.33289 21.9327 7.33665 21.9996 8.87843C22.011 9.14208 21.7839 9.34375 21.5351 9.34375C20.1493 9.34375 19.0259 10.533 19.0259 12C19.0259 13.467 20.1493 14.6562 21.5351 14.6562C21.7839 14.6562 22.011 14.8579 21.9996 15.1216C21.9327 16.6634 21.7452 17.6671 21.2199 18.4612C20.9177 18.918 20.5424 19.3154 20.1108 19.6353C18.9443 20.5 17.2986 20.5 14.0074 20.5H9.99266C6.70139 20.5 5.05575 20.5 3.88923 19.6353C3.45765 19.3154 3.08228 18.918 2.78008 18.4612C2.25481 17.667 2.06733 16.6631 2.00041 15.1211C1.98899 14.8577 2.21579 14.6562 2.46433 14.6562C3.85012 14.6562 4.97352 13.467 4.97352 12C4.97352 10.533 3.85012 9.34375 2.46433 9.34375Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9 3.5L9 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Fp=[["path",{d:"M13 7C13 9.20914 11.2091 11 9 11C6.79086 11 5 9.20914 5 7C5 4.79086 6.79086 3 9 3C11.2091 3 13 4.79086 13 7Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M15 11C17.2091 11 19 9.20914 19 7C19 4.79086 17.2091 3 15 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 14H7C4.23858 14 2 16.2386 2 19C2 20.1046 2.89543 21 4 21H14C15.1046 21 16 20.1046 16 19C16 16.2386 13.7614 14 11 14Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M17 14C19.7614 14 22 16.2386 22 19C22 20.1046 21.1046 21 20 21H18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],N8=[["path",{d:"M17 8.5C17 5.73858 14.7614 3.5 12 3.5C9.23858 3.5 7 5.73858 7 8.5C7 11.2614 9.23858 13.5 12 13.5C14.7614 13.5 17 11.2614 17 8.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 20.5C19 16.634 15.866 13.5 12 13.5C8.13401 13.5 5 16.634 5 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],o2=25e3;async function Ae(e,n={}){const a=new Headers(n.headers);!a.has("Content-Type")&&n.body&&a.set("Content-Type","application/json");const o=typeof window<"u"?sessionStorage.getItem("nexus_impersonate_group"):null;o&&!a.has("X-Impersonate-Group")&&a.set("X-Impersonate-Group",o);const l=new AbortController,c=window.setTimeout(()=>l.abort(),o2);let d;try{d=await fetch(e,{...n,headers:a,credentials:"include",signal:l.signal})}catch(p){throw p instanceof Error&&p.name==="AbortError"?new Error("Request timed out. The API may still be starting or the bot is restarting — try again."):new Error(p instanceof Error?p.message:"Could not reach the API. Is the bot process running?")}finally{window.clearTimeout(c)}const m=await d.json().catch(()=>({}));if(!d.ok)throw new Error(m.error||`Request failed (${d.status})`);return m}function E8(e,n){return n!=="supportbot"?e:e.replace(/^(\s*Token:\s*)["'][^"']*["']/m,'$1"BOT_TOKEN"')}const Ee={me:()=>Ae("/api/auth/me"),logout:()=>Ae("/api/auth/logout",{method:"POST"}),health:()=>Ae("/api/health"),stats:()=>Ae("/api/stats"),getAlerts:()=>Ae("/api/alerts"),getGuildStatus:()=>Ae("/api/guild/status"),getGuildResources:(e=!1)=>Ae(`/api/guild/resources${e?"?refresh=1":""}`),leaveGuild:e=>Ae(`/api/guild/${e}/leave`,{method:"POST"}),listConfigs:()=>["supportbot","ticket-panel","commands","messages","supportbot-ai"],getConfigRaw:e=>Ae(`/api/configs/${e}`),saveConfigRaw:(e,n)=>Ae("/api/configs/raw",{method:"PUT",body:JSON.stringify({filename:e,content:n})}),getConfigJson:e=>Ae(`/api/configs/json/${e}`),updateConfigFields:e=>Ae("/api/configs/update-fields/multi",{method:"POST",body:JSON.stringify(e)}),checkForUpdates:()=>Ae("/api/system/update-check"),runUpdate:(e,n,a)=>Ae("/api/system/update",{method:"POST",body:JSON.stringify({repoId:e,version:n,url:a})}),reloadConfigs:e=>Ae("/api/system/reload-configs",{method:"POST",body:JSON.stringify(e?{file:e}:{})}),getLogsMeta:()=>Ae("/api/system/logs/meta"),getLogs:e=>{var o;const n=new URLSearchParams;(o=e.types)!=null&&o.length&&n.set("types",e.types.join(",")),e.cursor&&Object.keys(e.cursor).length>0&&n.set("cursor",JSON.stringify(e.cursor)),e.tail!=null&&n.set("tail",String(e.tail));const a=n.toString();return Ae(`/api/system/logs${a?`?${a}`:""}`)},listTranscripts:()=>Ae("/api/system/transcripts"),listOpenTickets:()=>Ae("/api/system/tickets/open"),getTicketMessages:e=>Ae(`/api/system/tickets/${encodeURIComponent(e)}/messages`),sendTicketReply:(e,n,a,o)=>Ae(`/api/system/tickets/${encodeURIComponent(e)}/reply`,{method:"POST",body:JSON.stringify({message:n,staffName:a,attachments:o})}),deleteTicketMessage:(e,n)=>Ae(`/api/system/tickets/${encodeURIComponent(e)}/messages/${encodeURIComponent(n)}`,{method:"DELETE"}),editTicketMessage:(e,n,a)=>Ae(`/api/system/tickets/${encodeURIComponent(e)}/messages/${encodeURIComponent(n)}`,{method:"PATCH",body:JSON.stringify({content:a})}),closeTicket:(e,n)=>Ae(`/api/system/tickets/${encodeURIComponent(e)}/close`,{method:"POST",body:JSON.stringify({reason:n})}),getTranscript:e=>Ae(`/api/system/transcripts/${e}`),getTranscriptSettings:()=>Ae("/api/system/transcript-settings"),updateTranscriptSettings:e=>Ae("/api/system/transcript-settings",{method:"PUT",body:JSON.stringify(e)}),deleteTranscript:e=>Ae(`/api/system/transcripts/${encodeURIComponent(e)}`,{method:"DELETE"}),purgeTranscripts:()=>Ae("/api/system/transcripts/purge",{method:"POST"}),getBranding:()=>Ae("/api/branding"),updateBranding:e=>Ae("/api/branding",{method:"PUT",body:JSON.stringify(e)}),uploadBrandingFavicon:e=>Ae("/api/branding/favicon",{method:"POST",body:JSON.stringify({dataUrl:e})}),removeBrandingFavicon:()=>Ae("/api/branding/favicon",{method:"DELETE"}),resetBranding:()=>Ae("/api/branding/reset",{method:"POST"}),getTranscriptTemplate:()=>Ae("/api/system/transcript-template"),saveTranscriptTemplate:e=>Ae("/api/system/transcript-template",{method:"PUT",body:JSON.stringify(e)}),previewTranscriptTemplate:async e=>{const n=new AbortController,a=window.setTimeout(()=>n.abort(),o2);try{const o=await fetch("/api/system/transcript-template/preview",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e),signal:n.signal});if(!o.ok)throw new Error(`Preview failed (${o.status})`);return await o.text()}finally{window.clearTimeout(a)}},getNotifications:()=>Ae("/api/notifications"),markNotificationsRead:e=>Ae("/api/notifications/read",{method:"POST",body:JSON.stringify({ids:e})}),dismissNotification:e=>Ae(`/api/notifications/${e}`,{method:"DELETE"}),listDashboardUsers:()=>Ae("/api/dashboard-users"),addDashboardUser:e=>Ae("/api/dashboard-users",{method:"POST",body:JSON.stringify(e)}),updateDashboardUser:(e,n)=>Ae(`/api/dashboard-users/${e}`,{method:"PATCH",body:JSON.stringify(n)}),removeDashboardUser:e=>Ae(`/api/dashboard-users/${e}`,{method:"DELETE"}),listGroups:()=>Ae("/api/dashboard-groups"),createGroup:e=>Ae("/api/dashboard-groups",{method:"POST",body:JSON.stringify(e)}),updateGroup:(e,n)=>Ae(`/api/dashboard-groups/${e}`,{method:"PUT",body:JSON.stringify(n)}),deleteGroup:e=>Ae(`/api/dashboard-groups/${e}`,{method:"DELETE"}),getAddonsCatalog:()=>Ae("/api/addons/catalog"),getAddonsInstalled:()=>Ae("/api/addons/installed"),listAddonConfigs:()=>Ae("/api/addons/configs"),installAddon:e=>Ae("/api/addons/install",{method:"POST",body:JSON.stringify({name:e})}),getAddonConfigJson:e=>Ae(`/api/addons/configs/json/${encodeURIComponent(e)}`),saveAddonConfig:(e,n)=>Ae("/api/addons/configs",{method:"PUT",body:JSON.stringify({filename:e,data:n})}),buildAddon:e=>Ae("/api/addons/build",{method:"POST",body:JSON.stringify(e)}),getSetupStatus:()=>Ae("/api/setup/status"),validateSetup:e=>Ae("/api/setup/validate",{method:"POST",body:JSON.stringify(e)}),resetDashboard:()=>Ae("/api/setup/reset",{method:"POST"}),completeSetup:e=>Ae("/api/setup/complete",{method:"POST",body:JSON.stringify(e)})};function Fh(e){const n=Math.floor(e/86400),a=Math.floor(e%86400/3600),o=Math.floor(e%3600/60);return n>0?`${n}d ${a}h`:a>0?`${a}h ${o}m`:`${o}m`}const s2=["supportbot","ticket-panel","commands","messages","supportbot-ai"],sy={owner:"Owner",admin:"Admin",moderator:"Moderator",editor:"Editor",viewer:"Viewer",custom:"Custom"},k8={owner:"Full access to everything",admin:"Full access including user management",moderator:"View dashboard, logs, transcripts, and configs",editor:"Edit configuration files",viewer:"View-only access",custom:"Permissions you configure below"};function qn(e,n){var l,c;if(!e)return!1;if(n==="overview")return e.overview;if(n==="tickets")return e.tickets??e.overview;if(n==="logs")return e.logs;if(n==="transcripts")return e.transcripts;if(n==="settings.view")return e.settings.view;if(n==="settings.update")return e.settings.update;if(n==="users.view")return e.users.view;if(n==="users.manage")return e.users.manage;const a=n.match(/^configs\.([a-z0-9-]+)\.view$/);if(a){const d=a[1];return!!((l=e.configs[d])!=null&&l.view)}const o=n.match(/^configs\.([a-z0-9-]+)\.edit$/);if(o){const d=o[1];return!!((c=e.configs[d])!=null&&c.edit)}return!1}function Mu(e,n){return qn(e,`configs.${n}.view`)}function i2(e,n){return qn(e,`configs.${n}.edit`)}function T8(e){return s2.some(n=>Mu(e,n))}function yu(e,n){return s2.reduce((a,o)=>(a[o]={view:e,edit:n},a),{})}function R8(){return{overview:!0,tickets:!0,logs:!0,transcripts:!0,settings:{view:!0,update:!0},configs:yu(!0,!0),users:{view:!0,manage:!0}}}function _a(e,n){switch(e){case"owner":case"admin":return R8();case"moderator":return{overview:!0,tickets:!0,logs:!0,transcripts:!0,settings:{view:!0,update:!1},configs:yu(!0,!1),users:{view:!1,manage:!1}};case"editor":return{overview:!0,tickets:!0,logs:!0,transcripts:!1,settings:{view:!0,update:!1},configs:yu(!0,!0),users:{view:!1,manage:!1}};case"viewer":return{overview:!0,tickets:!0,logs:!0,transcripts:!0,settings:{view:!0,update:!1},configs:yu(!0,!1),users:{view:!1,manage:!1}};case"custom":return n??_a("viewer");default:return _a("viewer")}}function l2(e){return e.globalName||e.username}function Wh(e){return qn(e,"overview")?"/":qn(e,"logs")?"/logs":T8(e)?"/configs?file=supportbot":qn(e,"transcripts")?"/transcripts":qn(e,"settings.view")?"/settings":qn(e,"users.view")?"/users":"/login"}const c2=f.createContext(null),tu="nexus_impersonate_group";function A8({children:e}){const[n,a]=f.useState(null),[o,l]=f.useState([]),[c,d]=f.useState(!0),[m,p]=f.useState(()=>typeof window<"u"?sessionStorage.getItem(tu):null),h=f.useCallback(async()=>{var O;try{const[M,z]=await Promise.all([Ee.me(),Ee.listGroups().catch(()=>({data:{groups:[]}}))]);return M.data?(a(M.data),(O=z.data)!=null&&O.groups&&l(z.data.groups),!0):(a(null),!1)}catch{return a(null),!1}},[]);f.useEffect(()=>{h().finally(()=>d(!1))},[h]);const b=f.useCallback(()=>{window.location.href="/api/auth/discord"},[]),g=f.useCallback(async()=>{try{typeof window<"u"&&sessionStorage.removeItem(tu),p(null),await Ee.logout()}finally{a(null)}},[]),y=f.useCallback(O=>{typeof window<"u"&&sessionStorage.setItem(tu,O),p(O)},[]),w=f.useCallback(()=>{typeof window<"u"&&sessionStorage.removeItem(tu),p(null)},[]),j=f.useMemo(()=>o.find(O=>O.id===m)||null,[o,m]),S=!!(m&&j),E=f.useMemo(()=>S&&j?j.permissions:(n==null?void 0:n.permissions)??null,[S,j,n]),N=f.useCallback(O=>qn(E,O),[E]),k=f.useCallback(O=>Mu(E,O),[E]),T=f.useCallback(O=>i2(E,O),[E]),A=f.useMemo(()=>({user:n,permissions:E,isAuthenticated:!!n,loading:c,availableGroups:o,isImpersonating:S,impersonatedGroup:j,impersonateGroup:y,stopImpersonation:w,loginWithDiscord:b,logout:g,refreshSession:h,hasPermission:N,canViewConfig:k,canEditConfig:T}),[n,E,c,o,S,j,y,w,b,g,h,N,k,T]);return s.jsx(c2.Provider,{value:A,children:e})}function Ut(){const e=f.useContext(c2);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const iy="supportbot-dashboard-favicon";function lp(e){e.pageTitle&&(document.title=e.pageTitle);let n=document.getElementById(iy);if(e.faviconUrl){const a=`${e.faviconUrl}${e.updatedAt?`?v=${e.updatedAt}`:""}`;n||(n=document.createElement("link"),n.id=iy,n.rel="icon",document.head.appendChild(n)),n.href=a}else n&&n.remove()}const cp={title:"SupportBot",pageTitle:"SupportBot Dashboard",hasFavicon:!1,faviconUrl:null,updatedAt:null},u2=f.createContext(null);function M8({children:e}){const[n,a]=f.useState(cp),[o,l]=f.useState(!0),c=f.useCallback(async()=>{try{const p=await Ee.getBranding();p.data&&(a(p.data),lp(p.data))}catch{a(cp),lp(cp)}finally{l(!1)}},[]);f.useEffect(()=>{c()},[c]);const d=f.useCallback(p=>{a(p),lp(p)},[]),m=f.useMemo(()=>({branding:n,loading:o,refreshBranding:c,setBrandingLocal:d}),[n,o,c,d]);return s.jsx(u2.Provider,{value:m,children:e})}function od(){const e=f.useContext(u2);if(!e)throw new Error("useBranding must be used within BrandingProvider");return e}const d2=f.createContext(null);function _8({children:e}){const[n,a]=f.useState(null),[o,l]=f.useState(!0),[c,d]=f.useState(""),m=f.useCallback(async()=>{try{const h=await Ee.stats();h.data?(a(h.data),d("")):h.error&&d(h.error)}catch(h){d(h instanceof Error?h.message:"Failed to load stats")}finally{l(!1)}},[]);f.useEffect(()=>{m();const h=setInterval(m,3e4);return()=>clearInterval(h)},[m]);const p=f.useMemo(()=>({stats:n,loading:o,error:c,refresh:m}),[n,o,c,m]);return s.jsx(d2.Provider,{value:p,children:e})}function sd(){const e=f.useContext(d2);if(!e)throw new Error("useBotStats must be used within BotStatsProvider");return e}function f2(){const e=Ln(),[n,a]=f.useState([]),[o,l]=f.useState(!0),c=f.useCallback(async()=>{try{const d=await Ee.listAddonConfigs();a(d.data??[])}catch{a([])}finally{l(!1)}},[]);return f.useEffect(()=>{c()},[c,e.pathname]),{files:n,loading:o,refresh:c}}const Wp="addon:";function el(e){return`${Wp}${e}`}function O8(e){return e?e.startsWith(Wp)?{type:"addon",file:e.slice(Wp.length)}:{type:"main",file:e}:null}function m2(e){return e.replace(/\.(yml|yaml|json)$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,n=>n.toUpperCase())}const D8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},p2=f.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:a,absoluteStrokeWidth:o=!1,className:l="",altIcon:c,showAlt:d=!1,icon:m,primaryColor:p,secondaryColor:h,disableSecondaryOpacity:b=!1,...g},y)=>{const w=a!==void 0?o?Number(a)*24/Number(n):a:void 0,j=w!==void 0?{strokeWidth:w,stroke:"currentColor"}:{},S={ref:y,...D8,width:n,height:n,color:p||e,className:l,...j,...g},N=[...d&&c?c:m].sort(([,k],[,T])=>{const A=k.opacity!==void 0;return T.opacity!==void 0?1:A?-1:0}).map(([k,T])=>{const A=T.opacity!==void 0,O=A&&!b?T.opacity:void 0,M=h?{...T.stroke!==void 0?{stroke:A?h:p||e}:{fill:A?h:p||e}}:{};return f.createElement(k,{...T,...j,...M,opacity:O,key:T.key})});return f.createElement("svg",S,N)});p2.displayName="HugeiconsIcon";function h2(e){var n,a,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(n=0;n<l;n++)e[n]&&(a=h2(e[n]))&&(o&&(o+=" "),o+=a)}else for(a in e)e[a]&&(o&&(o+=" "),o+=a);return o}function g2(){for(var e,n,a=0,o="",l=arguments.length;a<l;a++)(e=arguments[a])&&(n=h2(e))&&(o&&(o+=" "),o+=n);return o}const L8=(e,n)=>{const a=new Array(e.length+n.length);for(let o=0;o<e.length;o++)a[o]=e[o];for(let o=0;o<n.length;o++)a[e.length+o]=n[o];return a},z8=(e,n)=>({classGroupId:e,validator:n}),x2=(e=new Map,n=null,a)=>({nextPart:e,validators:n,classGroupId:a}),_u="-",ly=[],P8="arbitrary..",I8=e=>{const n=B8(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return $8(d);const m=d.split(_u),p=m[0]===""&&m.length>1?1:0;return v2(m,p,n)},getConflictingClassGroupIds:(d,m)=>{if(m){const p=o[d],h=a[d];return p?h?L8(h,p):p:h||ly}return a[d]||ly}}},v2=(e,n,a)=>{if(e.length-n===0)return a.classGroupId;const l=e[n],c=a.nextPart.get(l);if(c){const h=v2(e,n+1,c);if(h)return h}const d=a.validators;if(d===null)return;const m=n===0?e.join(_u):e.slice(n).join(_u),p=d.length;for(let h=0;h<p;h++){const b=d[h];if(b.validator(m))return b.classGroupId}},$8=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),a=n.indexOf(":"),o=n.slice(0,a);return o?P8+o:void 0})(),B8=e=>{const{theme:n,classGroups:a}=e;return U8(a,n)},U8=(e,n)=>{const a=x2();for(const o in e){const l=e[o];Yh(l,a,o,n)}return a},Yh=(e,n,a,o)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];H8(d,n,a,o)}},H8=(e,n,a,o)=>{if(typeof e=="string"){V8(e,n,a);return}if(typeof e=="function"){G8(e,n,a,o);return}F8(e,n,a,o)},V8=(e,n,a)=>{const o=e===""?n:b2(n,e);o.classGroupId=a},G8=(e,n,a,o)=>{if(W8(e)){Yh(e(o),n,a,o);return}n.validators===null&&(n.validators=[]),n.validators.push(z8(a,e))},F8=(e,n,a,o)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[m,p]=l[d];Yh(p,b2(n,m),a,o)}},b2=(e,n)=>{let a=e;const o=n.split(_u),l=o.length;for(let c=0;c<l;c++){const d=o[c];let m=a.nextPart.get(d);m||(m=x2(),a.nextPart.set(d,m)),a=m}return a},W8=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Y8=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,a=Object.create(null),o=Object.create(null);const l=(c,d)=>{a[c]=d,n++,n>e&&(n=0,o=a,a=Object.create(null))};return{get(c){let d=a[c];if(d!==void 0)return d;if((d=o[c])!==void 0)return l(c,d),d},set(c,d){c in a?a[c]=d:l(c,d)}}},Yp="!",cy=":",q8=[],uy=(e,n,a,o,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:a,maybePostfixModifierPosition:o,isExternal:l}),K8=e=>{const{prefix:n,experimentalParseClassName:a}=e;let o=l=>{const c=[];let d=0,m=0,p=0,h;const b=l.length;for(let S=0;S<b;S++){const E=l[S];if(d===0&&m===0){if(E===cy){c.push(l.slice(p,S)),p=S+1;continue}if(E==="/"){h=S;continue}}E==="["?d++:E==="]"?d--:E==="("?m++:E===")"&&m--}const g=c.length===0?l:l.slice(p);let y=g,w=!1;g.endsWith(Yp)?(y=g.slice(0,-1),w=!0):g.startsWith(Yp)&&(y=g.slice(1),w=!0);const j=h&&h>p?h-p:void 0;return uy(c,w,y,j)};if(n){const l=n+cy,c=o;o=d=>d.startsWith(l)?c(d.slice(l.length)):uy(q8,!1,d,void 0,!0)}if(a){const l=o;o=c=>a({className:c,parseClassName:l})}return o},X8=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((a,o)=>{n.set(a,1e6+o)}),a=>{const o=[];let l=[];for(let c=0;c<a.length;c++){const d=a[c],m=d[0]==="[",p=n.has(d);m||p?(l.length>0&&(l.sort(),o.push(...l),l=[]),o.push(d)):l.push(d)}return l.length>0&&(l.sort(),o.push(...l)),o}},Z8=e=>({cache:Y8(e.cacheSize),parseClassName:K8(e),sortModifiers:X8(e),postfixLookupClassGroupIds:Q8(e),...I8(e)}),Q8=e=>{const n=Object.create(null),a=e.postfixLookupClassGroups;if(a)for(let o=0;o<a.length;o++)n[a[o]]=!0;return n},J8=/\s+/,ek=(e,n)=>{const{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:c,postfixLookupClassGroupIds:d}=n,m=[],p=e.trim().split(J8);let h="";for(let b=p.length-1;b>=0;b-=1){const g=p[b],{isExternal:y,modifiers:w,hasImportantModifier:j,baseClassName:S,maybePostfixModifierPosition:E}=a(g);if(y){h=g+(h.length>0?" "+h:h);continue}let N=!!E,k;if(N){const z=S.substring(0,E);k=o(z);const B=k&&d[k]?o(S):void 0;B&&B!==k&&(k=B,N=!1)}else k=o(S);if(!k){if(!N){h=g+(h.length>0?" "+h:h);continue}if(k=o(S),!k){h=g+(h.length>0?" "+h:h);continue}N=!1}const T=w.length===0?"":w.length===1?w[0]:c(w).join(":"),A=j?T+Yp:T,O=A+k;if(m.indexOf(O)>-1)continue;m.push(O);const M=l(k,N);for(let z=0;z<M.length;++z){const B=M[z];m.push(A+B)}h=g+(h.length>0?" "+h:h)}return h},tk=(...e)=>{let n=0,a,o,l="";for(;n<e.length;)(a=e[n++])&&(o=y2(a))&&(l&&(l+=" "),l+=o);return l},y2=e=>{if(typeof e=="string")return e;let n,a="";for(let o=0;o<e.length;o++)e[o]&&(n=y2(e[o]))&&(a&&(a+=" "),a+=n);return a},nk=(e,...n)=>{let a,o,l,c;const d=p=>{const h=n.reduce((b,g)=>g(b),e());return a=Z8(h),o=a.cache.get,l=a.cache.set,c=m,m(p)},m=p=>{const h=o(p);if(h)return h;const b=ek(p,a);return l(p,b),b};return c=d,(...p)=>c(tk(...p))},rk=[],$t=e=>{const n=a=>a[e]||rk;return n.isThemeGetter=!0,n},w2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,C2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ak=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ok=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sk=/\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$/,ik=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ck=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Aa=e=>ak.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),br=e=>!!e&&Number.isInteger(Number(e)),up=e=>e.endsWith("%")&&He(e.slice(0,-1)),qr=e=>ok.test(e),S2=()=>!0,uk=e=>sk.test(e)&&!ik.test(e),qh=()=>!1,dk=e=>lk.test(e),fk=e=>ck.test(e),mk=e=>!Se(e)&&!je(e),pk=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),hk=e=>Ha(e,E2,qh),Se=e=>w2.test(e),po=e=>Ha(e,k2,uk),dy=e=>Ha(e,Sk,He),gk=e=>Ha(e,R2,S2),xk=e=>Ha(e,T2,qh),fy=e=>Ha(e,j2,qh),vk=e=>Ha(e,N2,fk),nu=e=>Ha(e,A2,dk),je=e=>C2.test(e),qi=e=>Mo(e,k2),bk=e=>Mo(e,T2),my=e=>Mo(e,j2),yk=e=>Mo(e,E2),wk=e=>Mo(e,N2),ru=e=>Mo(e,A2,!0),Ck=e=>Mo(e,R2,!0),Ha=(e,n,a)=>{const o=w2.exec(e);return o?o[1]?n(o[1]):a(o[2]):!1},Mo=(e,n,a=!1)=>{const o=C2.exec(e);return o?o[1]?n(o[1]):a:!1},j2=e=>e==="position"||e==="percentage",N2=e=>e==="image"||e==="url",E2=e=>e==="length"||e==="size"||e==="bg-size",k2=e=>e==="length",Sk=e=>e==="number",T2=e=>e==="family-name",R2=e=>e==="number"||e==="weight",A2=e=>e==="shadow",jk=()=>{const e=$t("color"),n=$t("font"),a=$t("text"),o=$t("font-weight"),l=$t("tracking"),c=$t("leading"),d=$t("breakpoint"),m=$t("container"),p=$t("spacing"),h=$t("radius"),b=$t("shadow"),g=$t("inset-shadow"),y=$t("text-shadow"),w=$t("drop-shadow"),j=$t("blur"),S=$t("perspective"),E=$t("aspect"),N=$t("ease"),k=$t("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...A(),je,Se],M=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],B=()=>[je,Se,p],K=()=>[Aa,"full","auto",...B()],U=()=>[br,"none","subgrid",je,Se],q=()=>["auto",{span:["full",br,je,Se]},br,je,Se],ue=()=>[br,"auto",je,Se],pe=()=>["auto","min","max","fr",je,Se],xe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...B()],I=()=>[Aa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],H=()=>[Aa,"screen","full","dvw","lvw","svw","min","max","fit",...B()],Z=()=>[Aa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],te=()=>[e,je,Se],_=()=>[...A(),my,fy,{position:[je,Se]}],D=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",yk,hk,{size:[je,Se]}],V=()=>[up,qi,po],F=()=>["","none","full",h,je,Se],oe=()=>["",He,qi,po],ae=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[He,up,my,fy],Y=()=>["","none",j,je,Se],le=()=>["none",He,je,Se],ye=()=>["none",He,je,Se],Te=()=>[He,je,Se],Le=()=>[Aa,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qr],breakpoint:[qr],color:[S2],container:[qr],"drop-shadow":[qr],ease:["in","out","in-out"],font:[mk],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qr],shadow:[qr],spacing:["px",He],text:[qr],"text-shadow":[qr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Aa,Se,je,E]}],container:["container"],"container-type":[{"@container":["","normal","size",je,Se]}],"container-named":[pk],columns:[{columns:[He,Se,je,m]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{"inset-s":K(),start:K()}],end:[{"inset-e":K(),end:K()}],"inset-bs":[{"inset-bs":K()}],"inset-be":[{"inset-be":K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[br,"auto",je,Se]}],basis:[{basis:[Aa,"full","auto",m,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Aa,"auto","initial","none",Se]}],grow:[{grow:["",He,je,Se]}],shrink:[{shrink:["",He,je,Se]}],order:[{order:[br,"first","last","none",je,Se]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...xe(),"normal"]}],"justify-items":[{"justify-items":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...xe()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":xe()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[m,"screen",...I()]}],"min-w":[{"min-w":[m,"screen","none",...I()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[d]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",a,qi,po]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ck,gk]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",up,Se]}],"font-family":[{font:[bk,xk,n]}],"font-features":[{"font-features":[Se]}],"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:[l,je,Se]}],"line-clamp":[{"line-clamp":[He,"none",je,dy]}],leading:[{leading:[c,...B()]}],"list-image":[{"list-image":["none",je,Se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,Se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:te()}],"text-color":[{text:te()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",je,po]}],"text-decoration-color":[{decoration:te()}],"underline-offset":[{"underline-offset":[He,"auto",je,Se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"tab-size":[{tab:[br,je,Se]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,Se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je,Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:D()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},br,je,Se],radial:["",je,Se],conic:[br,je,Se]},wk,vk]}],"bg-color":[{bg:te()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:te()}],"gradient-via":[{via:te()}],"gradient-to":[{to:te()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:te()}],"border-color-x":[{"border-x":te()}],"border-color-y":[{"border-y":te()}],"border-color-s":[{"border-s":te()}],"border-color-e":[{"border-e":te()}],"border-color-bs":[{"border-bs":te()}],"border-color-be":[{"border-be":te()}],"border-color-t":[{"border-t":te()}],"border-color-r":[{"border-r":te()}],"border-color-b":[{"border-b":te()}],"border-color-l":[{"border-l":te()}],"divide-color":[{divide:te()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,je,Se]}],"outline-w":[{outline:["",He,qi,po]}],"outline-color":[{outline:te()}],shadow:[{shadow:["","none",b,ru,nu]}],"shadow-color":[{shadow:te()}],"inset-shadow":[{"inset-shadow":["none",g,ru,nu]}],"inset-shadow-color":[{"inset-shadow":te()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:te()}],"ring-offset-w":[{"ring-offset":[He,po]}],"ring-offset-color":[{"ring-offset":te()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":te()}],"text-shadow":[{"text-shadow":["none",y,ru,nu]}],"text-shadow-color":[{"text-shadow":te()}],opacity:[{opacity:[He,je,Se]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":te()}],"mask-image-linear-to-color":[{"mask-linear-to":te()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":te()}],"mask-image-t-to-color":[{"mask-t-to":te()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":te()}],"mask-image-r-to-color":[{"mask-r-to":te()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":te()}],"mask-image-b-to-color":[{"mask-b-to":te()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":te()}],"mask-image-l-to-color":[{"mask-l-to":te()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":te()}],"mask-image-x-to-color":[{"mask-x-to":te()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":te()}],"mask-image-y-to-color":[{"mask-y-to":te()}],"mask-image-radial":[{"mask-radial":[je,Se]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":te()}],"mask-image-radial-to-color":[{"mask-radial-to":te()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":te()}],"mask-image-conic-to-color":[{"mask-conic-to":te()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:D()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Se]}],filter:[{filter:["","none",je,Se]}],blur:[{blur:Y()}],brightness:[{brightness:[He,je,Se]}],contrast:[{contrast:[He,je,Se]}],"drop-shadow":[{"drop-shadow":["","none",w,ru,nu]}],"drop-shadow-color":[{"drop-shadow":te()}],grayscale:[{grayscale:["",He,je,Se]}],"hue-rotate":[{"hue-rotate":[He,je,Se]}],invert:[{invert:["",He,je,Se]}],saturate:[{saturate:[He,je,Se]}],sepia:[{sepia:["",He,je,Se]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Se]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[He,je,Se]}],"backdrop-contrast":[{"backdrop-contrast":[He,je,Se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,je,Se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,je,Se]}],"backdrop-invert":[{"backdrop-invert":["",He,je,Se]}],"backdrop-opacity":[{"backdrop-opacity":[He,je,Se]}],"backdrop-saturate":[{"backdrop-saturate":[He,je,Se]}],"backdrop-sepia":[{"backdrop-sepia":["",He,je,Se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,Se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",je,Se]}],ease:[{ease:["linear","initial",N,je,Se]}],delay:[{delay:[He,je,Se]}],animate:[{animate:["none",k,je,Se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,je,Se]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:Te()}],"skew-x":[{"skew-x":Te()}],"skew-y":[{"skew-y":Te()}],transform:[{transform:[je,Se,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],zoom:[{zoom:[br,je,Se]}],accent:[{accent:te()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:te()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je,Se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":te()}],"scrollbar-track-color":[{"scrollbar-track":te()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",je,Se]}],fill:[{fill:["none",...te()]}],"stroke-w":[{stroke:[He,qi,po,dy]}],stroke:[{stroke:["none",...te()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Nk=nk(jk);function fe(...e){return Nk(g2(e))}function ge({icon:e,className:n,size:a=18,strokeWidth:o=1.75}){return s.jsx(p2,{icon:e,size:a,className:fe("shrink-0",n),strokeWidth:o})}function py(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function gt(...e){return n=>{let a=!1;const o=e.map(l=>{const c=py(l,n);return!a&&typeof c=="function"&&(a=!0),c});if(a)return()=>{for(let l=0;l<o.length;l++){const c=o[l];typeof c=="function"?c():py(e[l],null)}}}}function Ve(...e){return f.useCallback(gt(...e),e)}var Ek=Symbol.for("react.lazy"),Ou=Ah[" use ".trim().toString()];function kk(e){return typeof e=="object"&&e!==null&&"then"in e}function M2(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ek&&"_payload"in e&&kk(e._payload)}function _2(e){const n=Tk(e),a=f.forwardRef((o,l)=>{let{children:c,...d}=o;M2(c)&&typeof Ou=="function"&&(c=Ou(c._payload));const m=f.Children.toArray(c),p=m.find(Ak);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}var Hs=_2("Slot");function Tk(e){const n=f.forwardRef((a,o)=>{let{children:l,...c}=a;if(M2(l)&&typeof Ou=="function"&&(l=Ou(l._payload)),f.isValidElement(l)){const d=_k(l),m=Mk(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Rk=Symbol("radix.slottable");function Ak(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rk}function Mk(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function _k(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}const hy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gy=g2,Vs=(e,n)=>a=>{var o;if((n==null?void 0:n.variants)==null)return gy(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(h=>{const b=a==null?void 0:a[h],g=c==null?void 0:c[h];if(b===null)return null;const y=hy(b)||hy(g);return l[h][y]}),m=a&&Object.entries(a).reduce((h,b)=>{let[g,y]=b;return y===void 0||(h[g]=y),h},{}),p=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((h,b)=>{let{class:g,className:y,...w}=b;return Object.entries(w).every(j=>{let[S,E]=j;return Array.isArray(E)?E.includes({...c,...m}[S]):{...c,...m}[S]===E})?[...h,g,y]:h},[]);return gy(e,d,p,a==null?void 0:a.class,a==null?void 0:a.className)},Ok=Vs("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"}}),he=f.forwardRef(({className:e,variant:n,size:a,asChild:o=!1,...l},c)=>{const d=o?Hs:"button";return s.jsx(d,{className:fe(Ok({variant:n,size:a,className:e})),ref:c,...l})});he.displayName="Button";function Ce(e,n,{checkForDefaultPrevented:a=!0}={}){return function(l){if(e==null||e(l),a===!1||!l.defaultPrevented)return n==null?void 0:n(l)}}function Dk(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,Lk(l,...n)]}function Lk(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}var Pt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},zk=Ah[" useInsertionEffect ".trim().toString()]||Pt;function ea({prop:e,defaultProp:n,onChange:a=()=>{},caller:o}){const[l,c,d]=Pk({defaultProp:n,onChange:a}),m=e!==void 0,p=m?e:l;{const b=f.useRef(e!==void 0);f.useEffect(()=>{const g=b.current;g!==m&&console.warn(`${o} is changing from ${g?"controlled":"uncontrolled"} to ${m?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),b.current=m},[m,o])}const h=f.useCallback(b=>{var g;if(m){const y=Ik(b)?b(e):b;y!==e&&((g=d.current)==null||g.call(d,y))}else c(b)},[m,e,c,d]);return[p,h]}function Pk({defaultProp:e,onChange:n}){const[a,o]=f.useState(e),l=f.useRef(a),c=f.useRef(n);return zk(()=>{c.current=n},[n]),f.useEffect(()=>{var d;l.current!==a&&((d=c.current)==null||d.call(c,a),l.current=a)},[a,l]),[a,o,c]}function Ik(e){return typeof e=="function"}function $k(e){const n=Bk(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(Hk);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function Bk(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=Gk(l),m=Vk(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Uk=Symbol("radix.slottable");function Hk(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Uk}function Vk(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function Gk(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Fk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wk=Fk.reduce((e,n)=>{const a=$k(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function Yk(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,qk(l,...n)]}function qk(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function xy(e){const n=Kk(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(Zk);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function Kk(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=Jk(l),m=Qk(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Xk=Symbol("radix.slottable");function Zk(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xk}function Qk(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function Jk(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function Kh(e){const n=e+"CollectionProvider",[a,o]=Yk(n),[l,c]=a(n,{collectionRef:{current:null},itemMap:new Map}),d=S=>{const{scope:E,children:N}=S,k=me.useRef(null),T=me.useRef(new Map).current;return s.jsx(l,{scope:E,itemMap:T,collectionRef:k,children:N})};d.displayName=n;const m=e+"CollectionSlot",p=xy(m),h=me.forwardRef((S,E)=>{const{scope:N,children:k}=S,T=c(m,N),A=Ve(E,T.collectionRef);return s.jsx(p,{ref:A,children:k})});h.displayName=m;const b=e+"CollectionItemSlot",g="data-radix-collection-item",y=xy(b),w=me.forwardRef((S,E)=>{const{scope:N,children:k,...T}=S,A=me.useRef(null),O=Ve(E,A),M=c(b,N);return me.useEffect(()=>(M.itemMap.set(A,{ref:A,...T}),()=>void M.itemMap.delete(A))),s.jsx(y,{[g]:"",ref:O,children:k})});w.displayName=b;function j(S){const E=c(e+"CollectionConsumer",S);return me.useCallback(()=>{const k=E.collectionRef.current;if(!k)return[];const T=Array.from(k.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((M,z)=>T.indexOf(M.ref.current)-T.indexOf(z.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:d,Slot:h,ItemSlot:w},j,o]}function e6(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,t6(l,...n)]}function t6(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}var n6=f.createContext(void 0);function Cl(e){const n=f.useContext(n6);return e||n||"ltr"}function r6(e){const n=a6(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(s6);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function a6(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=l6(l),m=i6(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var o6=Symbol("radix.slottable");function s6(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===o6}function i6(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function l6(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var c6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],O2=c6.reduce((e,n)=>{const a=r6(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function u6(e,n){e&&Ao.flushSync(()=>e.dispatchEvent(n))}function Wt(e){const n=f.useRef(e);return f.useEffect(()=>{n.current=e}),f.useMemo(()=>(...a)=>{var o;return(o=n.current)==null?void 0:o.call(n,...a)},[])}function d6(e,n=globalThis==null?void 0:globalThis.document){const a=Wt(e);f.useEffect(()=>{const o=l=>{l.key==="Escape"&&a(l)};return n.addEventListener("keydown",o,{capture:!0}),()=>n.removeEventListener("keydown",o,{capture:!0})},[a,n])}var f6="DismissableLayer",qp="dismissableLayer.update",m6="dismissableLayer.pointerDownOutside",p6="dismissableLayer.focusOutside",vy,D2=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gs=f.forwardRef((e,n)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,onDismiss:m,...p}=e,h=f.useContext(D2),[b,g]=f.useState(null),y=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=f.useState({}),j=Ve(n,z=>g(z)),S=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(E),k=b?S.indexOf(b):-1,T=h.layersWithOutsidePointerEventsDisabled.size>0,A=k>=N,O=x6(z=>{const B=z.target,K=[...h.branches].some(U=>U.contains(B));!A||K||(l==null||l(z),d==null||d(z),z.defaultPrevented||m==null||m())},y),M=v6(z=>{const B=z.target;[...h.branches].some(U=>U.contains(B))||(c==null||c(z),d==null||d(z),z.defaultPrevented||m==null||m())},y);return d6(z=>{k===h.layers.size-1&&(o==null||o(z),!z.defaultPrevented&&m&&(z.preventDefault(),m()))},y),f.useEffect(()=>{if(b)return a&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(vy=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(b)),h.layers.add(b),by(),()=>{a&&h.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=vy)}},[b,y,a,h]),f.useEffect(()=>()=>{b&&(h.layers.delete(b),h.layersWithOutsidePointerEventsDisabled.delete(b),by())},[b,h]),f.useEffect(()=>{const z=()=>w({});return document.addEventListener(qp,z),()=>document.removeEventListener(qp,z)},[]),s.jsx(O2.div,{...p,ref:j,style:{pointerEvents:T?A?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,O.onPointerDownCapture)})});Gs.displayName=f6;var h6="DismissableLayerBranch",g6=f.forwardRef((e,n)=>{const a=f.useContext(D2),o=f.useRef(null),l=Ve(n,o);return f.useEffect(()=>{const c=o.current;if(c)return a.branches.add(c),()=>{a.branches.delete(c)}},[a.branches]),s.jsx(O2.div,{...e,ref:l})});g6.displayName=h6;function x6(e,n=globalThis==null?void 0:globalThis.document){const a=Wt(e),o=f.useRef(!1),l=f.useRef(()=>{});return f.useEffect(()=>{const c=m=>{if(m.target&&!o.current){let p=function(){L2(m6,a,h,{discrete:!0})};const h={originalEvent:m};m.pointerType==="touch"?(n.removeEventListener("click",l.current),l.current=p,n.addEventListener("click",l.current,{once:!0})):p()}else n.removeEventListener("click",l.current);o.current=!1},d=window.setTimeout(()=>{n.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),n.removeEventListener("pointerdown",c),n.removeEventListener("click",l.current)}},[n,a]),{onPointerDownCapture:()=>o.current=!0}}function v6(e,n=globalThis==null?void 0:globalThis.document){const a=Wt(e),o=f.useRef(!1);return f.useEffect(()=>{const l=c=>{c.target&&!o.current&&L2(p6,a,{originalEvent:c},{discrete:!1})};return n.addEventListener("focusin",l),()=>n.removeEventListener("focusin",l)},[n,a]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function by(){const e=new CustomEvent(qp);document.dispatchEvent(e)}function L2(e,n,a,{discrete:o}){const l=a.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});n&&l.addEventListener(e,n,{once:!0}),o?u6(l,c):l.dispatchEvent(c)}var dp=0;function id(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yy()),document.body.insertAdjacentElement("beforeend",e[1]??yy()),dp++,()=>{dp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),dp--}},[])}function yy(){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}function b6(e){const n=y6(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(C6);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function y6(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=j6(l),m=S6(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var w6=Symbol("radix.slottable");function C6(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===w6}function S6(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function j6(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var N6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],E6=N6.reduce((e,n)=>{const a=b6(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),fp="focusScope.autoFocusOnMount",mp="focusScope.autoFocusOnUnmount",wy={bubbles:!1,cancelable:!0},k6="FocusScope",Sl=f.forwardRef((e,n)=>{const{loop:a=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:c,...d}=e,[m,p]=f.useState(null),h=Wt(l),b=Wt(c),g=f.useRef(null),y=Ve(n,S=>p(S)),w=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(o){let S=function(T){if(w.paused||!m)return;const A=T.target;m.contains(A)?g.current=A:Ma(g.current,{select:!0})},E=function(T){if(w.paused||!m)return;const A=T.relatedTarget;A!==null&&(m.contains(A)||Ma(g.current,{select:!0}))},N=function(T){if(document.activeElement===document.body)for(const O of T)O.removedNodes.length>0&&Ma(m)};document.addEventListener("focusin",S),document.addEventListener("focusout",E);const k=new MutationObserver(N);return m&&k.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",E),k.disconnect()}}},[o,m,w.paused]),f.useEffect(()=>{if(m){Sy.add(w);const S=document.activeElement;if(!m.contains(S)){const N=new CustomEvent(fp,wy);m.addEventListener(fp,h),m.dispatchEvent(N),N.defaultPrevented||(T6(O6(z2(m)),{select:!0}),document.activeElement===S&&Ma(m))}return()=>{m.removeEventListener(fp,h),setTimeout(()=>{const N=new CustomEvent(mp,wy);m.addEventListener(mp,b),m.dispatchEvent(N),N.defaultPrevented||Ma(S??document.body,{select:!0}),m.removeEventListener(mp,b),Sy.remove(w)},0)}}},[m,h,b,w]);const j=f.useCallback(S=>{if(!a&&!o||w.paused)return;const E=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(E&&N){const k=S.currentTarget,[T,A]=R6(k);T&&A?!S.shiftKey&&N===A?(S.preventDefault(),a&&Ma(T,{select:!0})):S.shiftKey&&N===T&&(S.preventDefault(),a&&Ma(A,{select:!0})):N===k&&S.preventDefault()}},[a,o,w.paused]);return s.jsx(E6.div,{tabIndex:-1,...d,ref:y,onKeyDown:j})});Sl.displayName=k6;function T6(e,{select:n=!1}={}){const a=document.activeElement;for(const o of e)if(Ma(o,{select:n}),document.activeElement!==a)return}function R6(e){const n=z2(e),a=Cy(n,e),o=Cy(n.reverse(),e);return[a,o]}function z2(e){const n=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)n.push(a.currentNode);return n}function Cy(e,n){for(const a of e)if(!A6(a,{upTo:n}))return a}function A6(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function M6(e){return e instanceof HTMLInputElement&&"select"in e}function Ma(e,{select:n=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&M6(e)&&n&&e.select()}}var Sy=_6();function _6(){let e=[];return{add(n){const a=e[0];n!==a&&(a==null||a.pause()),e=jy(e,n),e.unshift(n)},remove(n){var a;e=jy(e,n),(a=e[0])==null||a.resume()}}}function jy(e,n){const a=[...e],o=a.indexOf(n);return o!==-1&&a.splice(o,1),a}function O6(e){return e.filter(n=>n.tagName!=="A")}var D6=Ah[" useId ".trim().toString()]||(()=>{}),L6=0;function Yt(e){const[n,a]=f.useState(D6());return Pt(()=>{a(o=>o??String(L6++))},[e]),n?`radix-${n}`:""}const z6=["top","right","bottom","left"],La=Math.min,_n=Math.max,Du=Math.round,au=Math.floor,Nr=e=>({x:e,y:e}),P6={left:"right",right:"left",bottom:"top",top:"bottom"};function Kp(e,n,a){return _n(e,La(n,a))}function ta(e,n){return typeof e=="function"?e(n):e}function na(e){return e.split("-")[0]}function Fs(e){return e.split("-")[1]}function Xh(e){return e==="x"?"y":"x"}function Zh(e){return e==="y"?"height":"width"}function Sr(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function Qh(e){return Xh(Sr(e))}function I6(e,n,a){a===void 0&&(a=!1);const o=Fs(e),l=Qh(e),c=Zh(l);let d=l==="x"?o===(a?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[c]>n.floating[c]&&(d=Lu(d)),[d,Lu(d)]}function $6(e){const n=Lu(e);return[Xp(e),n,Xp(n)]}function Xp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ny=["left","right"],Ey=["right","left"],B6=["top","bottom"],U6=["bottom","top"];function H6(e,n,a){switch(e){case"top":case"bottom":return a?n?Ey:Ny:n?Ny:Ey;case"left":case"right":return n?B6:U6;default:return[]}}function V6(e,n,a,o){const l=Fs(e);let c=H6(na(e),a==="start",o);return l&&(c=c.map(d=>d+"-"+l),n&&(c=c.concat(c.map(Xp)))),c}function Lu(e){const n=na(e);return P6[n]+e.slice(n.length)}function G6(e){return{top:0,right:0,bottom:0,left:0,...e}}function P2(e){return typeof e!="number"?G6(e):{top:e,right:e,bottom:e,left:e}}function zu(e){const{x:n,y:a,width:o,height:l}=e;return{width:o,height:l,top:a,left:n,right:n+o,bottom:a+l,x:n,y:a}}function ky(e,n,a){let{reference:o,floating:l}=e;const c=Sr(n),d=Qh(n),m=Zh(d),p=na(n),h=c==="y",b=o.x+o.width/2-l.width/2,g=o.y+o.height/2-l.height/2,y=o[m]/2-l[m]/2;let w;switch(p){case"top":w={x:b,y:o.y-l.height};break;case"bottom":w={x:b,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:g};break;case"left":w={x:o.x-l.width,y:g};break;default:w={x:o.x,y:o.y}}switch(Fs(n)){case"start":w[d]-=y*(a&&h?-1:1);break;case"end":w[d]+=y*(a&&h?-1:1);break}return w}async function F6(e,n){var a;n===void 0&&(n={});const{x:o,y:l,platform:c,rects:d,elements:m,strategy:p}=e,{boundary:h="clippingAncestors",rootBoundary:b="viewport",elementContext:g="floating",altBoundary:y=!1,padding:w=0}=ta(n,e),j=P2(w),E=m[y?g==="floating"?"reference":"floating":g],N=zu(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(E)))==null||a?E:E.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(m.floating)),boundary:h,rootBoundary:b,strategy:p})),k=g==="floating"?{x:o,y:l,width:d.floating.width,height:d.floating.height}:d.reference,T=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m.floating)),A=await(c.isElement==null?void 0:c.isElement(T))?await(c.getScale==null?void 0:c.getScale(T))||{x:1,y:1}:{x:1,y:1},O=zu(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:k,offsetParent:T,strategy:p}):k);return{top:(N.top-O.top+j.top)/A.y,bottom:(O.bottom-N.bottom+j.bottom)/A.y,left:(N.left-O.left+j.left)/A.x,right:(O.right-N.right+j.right)/A.x}}const W6=50,Y6=async(e,n,a)=>{const{placement:o="bottom",strategy:l="absolute",middleware:c=[],platform:d}=a,m=d.detectOverflow?d:{...d,detectOverflow:F6},p=await(d.isRTL==null?void 0:d.isRTL(n));let h=await d.getElementRects({reference:e,floating:n,strategy:l}),{x:b,y:g}=ky(h,o,p),y=o,w=0;const j={};for(let S=0;S<c.length;S++){const E=c[S];if(!E)continue;const{name:N,fn:k}=E,{x:T,y:A,data:O,reset:M}=await k({x:b,y:g,initialPlacement:o,placement:y,strategy:l,middlewareData:j,rects:h,platform:m,elements:{reference:e,floating:n}});b=T??b,g=A??g,j[N]={...j[N],...O},M&&w<W6&&(w++,typeof M=="object"&&(M.placement&&(y=M.placement),M.rects&&(h=M.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:l}):M.rects),{x:b,y:g}=ky(h,y,p)),S=-1)}return{x:b,y:g,placement:y,strategy:l,middlewareData:j}},q6=e=>({name:"arrow",options:e,async fn(n){const{x:a,y:o,placement:l,rects:c,platform:d,elements:m,middlewareData:p}=n,{element:h,padding:b=0}=ta(e,n)||{};if(h==null)return{};const g=P2(b),y={x:a,y:o},w=Qh(l),j=Zh(w),S=await d.getDimensions(h),E=w==="y",N=E?"top":"left",k=E?"bottom":"right",T=E?"clientHeight":"clientWidth",A=c.reference[j]+c.reference[w]-y[w]-c.floating[j],O=y[w]-c.reference[w],M=await(d.getOffsetParent==null?void 0:d.getOffsetParent(h));let z=M?M[T]:0;(!z||!await(d.isElement==null?void 0:d.isElement(M)))&&(z=m.floating[T]||c.floating[j]);const B=A/2-O/2,K=z/2-S[j]/2-1,U=La(g[N],K),q=La(g[k],K),ue=U,pe=z-S[j]-q,xe=z/2-S[j]/2+B,se=Kp(ue,xe,pe),L=!p.arrow&&Fs(l)!=null&&xe!==se&&c.reference[j]/2-(xe<ue?U:q)-S[j]/2<0,I=L?xe<ue?xe-ue:xe-pe:0;return{[w]:y[w]+I,data:{[w]:se,centerOffset:xe-se-I,...L&&{alignmentOffset:I}},reset:L}}}),K6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var a,o;const{placement:l,middlewareData:c,rects:d,initialPlacement:m,platform:p,elements:h}=n,{mainAxis:b=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:S=!0,...E}=ta(e,n);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const N=na(l),k=Sr(m),T=na(m)===m,A=await(p.isRTL==null?void 0:p.isRTL(h.floating)),O=y||(T||!S?[Lu(m)]:$6(m)),M=j!=="none";!y&&M&&O.push(...V6(m,S,j,A));const z=[m,...O],B=await p.detectOverflow(n,E),K=[];let U=((o=c.flip)==null?void 0:o.overflows)||[];if(b&&K.push(B[N]),g){const xe=I6(l,d,A);K.push(B[xe[0]],B[xe[1]])}if(U=[...U,{placement:l,overflows:K}],!K.every(xe=>xe<=0)){var q,ue;const xe=(((q=c.flip)==null?void 0:q.index)||0)+1,se=z[xe];if(se&&(!(g==="alignment"?k!==Sr(se):!1)||U.every(H=>Sr(H.placement)===k?H.overflows[0]>0:!0)))return{data:{index:xe,overflows:U},reset:{placement:se}};let L=(ue=U.filter(I=>I.overflows[0]<=0).sort((I,H)=>I.overflows[1]-H.overflows[1])[0])==null?void 0:ue.placement;if(!L)switch(w){case"bestFit":{var pe;const I=(pe=U.filter(H=>{if(M){const Z=Sr(H.placement);return Z===k||Z==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Z=>Z>0).reduce((Z,te)=>Z+te,0)]).sort((H,Z)=>H[1]-Z[1])[0])==null?void 0:pe[0];I&&(L=I);break}case"initialPlacement":L=m;break}if(l!==L)return{reset:{placement:L}}}return{}}}};function Ty(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Ry(e){return z6.some(n=>e[n]>=0)}const X6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:a,platform:o}=n,{strategy:l="referenceHidden",...c}=ta(e,n);switch(l){case"referenceHidden":{const d=await o.detectOverflow(n,{...c,elementContext:"reference"}),m=Ty(d,a.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Ry(m)}}}case"escaped":{const d=await o.detectOverflow(n,{...c,altBoundary:!0}),m=Ty(d,a.floating);return{data:{escapedOffsets:m,escaped:Ry(m)}}}default:return{}}}}},I2=new Set(["left","top"]);async function Z6(e,n){const{placement:a,platform:o,elements:l}=e,c=await(o.isRTL==null?void 0:o.isRTL(l.floating)),d=na(a),m=Fs(a),p=Sr(a)==="y",h=I2.has(d)?-1:1,b=c&&p?-1:1,g=ta(n,e);let{mainAxis:y,crossAxis:w,alignmentAxis:j}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return m&&typeof j=="number"&&(w=m==="end"?j*-1:j),p?{x:w*b,y:y*h}:{x:y*h,y:w*b}}const Q6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var a,o;const{x:l,y:c,placement:d,middlewareData:m}=n,p=await Z6(n,e);return d===((a=m.offset)==null?void 0:a.placement)&&(o=m.arrow)!=null&&o.alignmentOffset?{}:{x:l+p.x,y:c+p.y,data:{...p,placement:d}}}}},J6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:a,y:o,placement:l,platform:c}=n,{mainAxis:d=!0,crossAxis:m=!1,limiter:p={fn:N=>{let{x:k,y:T}=N;return{x:k,y:T}}},...h}=ta(e,n),b={x:a,y:o},g=await c.detectOverflow(n,h),y=Sr(na(l)),w=Xh(y);let j=b[w],S=b[y];if(d){const N=w==="y"?"top":"left",k=w==="y"?"bottom":"right",T=j+g[N],A=j-g[k];j=Kp(T,j,A)}if(m){const N=y==="y"?"top":"left",k=y==="y"?"bottom":"right",T=S+g[N],A=S-g[k];S=Kp(T,S,A)}const E=p.fn({...n,[w]:j,[y]:S});return{...E,data:{x:E.x-a,y:E.y-o,enabled:{[w]:d,[y]:m}}}}}},e9=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:a,y:o,placement:l,rects:c,middlewareData:d}=n,{offset:m=0,mainAxis:p=!0,crossAxis:h=!0}=ta(e,n),b={x:a,y:o},g=Sr(l),y=Xh(g);let w=b[y],j=b[g];const S=ta(m,n),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(p){const T=y==="y"?"height":"width",A=c.reference[y]-c.floating[T]+E.mainAxis,O=c.reference[y]+c.reference[T]-E.mainAxis;w<A?w=A:w>O&&(w=O)}if(h){var N,k;const T=y==="y"?"width":"height",A=I2.has(na(l)),O=c.reference[g]-c.floating[T]+(A&&((N=d.offset)==null?void 0:N[g])||0)+(A?0:E.crossAxis),M=c.reference[g]+c.reference[T]+(A?0:((k=d.offset)==null?void 0:k[g])||0)-(A?E.crossAxis:0);j<O?j=O:j>M&&(j=M)}return{[y]:w,[g]:j}}}},t9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var a,o;const{placement:l,rects:c,platform:d,elements:m}=n,{apply:p=()=>{},...h}=ta(e,n),b=await d.detectOverflow(n,h),g=na(l),y=Fs(l),w=Sr(l)==="y",{width:j,height:S}=c.floating;let E,N;g==="top"||g==="bottom"?(E=g,N=y===(await(d.isRTL==null?void 0:d.isRTL(m.floating))?"start":"end")?"left":"right"):(N=g,E=y==="end"?"top":"bottom");const k=S-b.top-b.bottom,T=j-b.left-b.right,A=La(S-b[E],k),O=La(j-b[N],T),M=!n.middlewareData.shift;let z=A,B=O;if((a=n.middlewareData.shift)!=null&&a.enabled.x&&(B=T),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(z=k),M&&!y){const U=_n(b.left,0),q=_n(b.right,0),ue=_n(b.top,0),pe=_n(b.bottom,0);w?B=j-2*(U!==0||q!==0?U+q:_n(b.left,b.right)):z=S-2*(ue!==0||pe!==0?ue+pe:_n(b.top,b.bottom))}await p({...n,availableWidth:B,availableHeight:z});const K=await d.getDimensions(m.floating);return j!==K.width||S!==K.height?{reset:{rects:!0}}:{}}}};function ld(){return typeof window<"u"}function Ws(e){return $2(e)?(e.nodeName||"").toLowerCase():"#document"}function On(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Er(e){var n;return(n=($2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function $2(e){return ld()?e instanceof Node||e instanceof On(e).Node:!1}function ir(e){return ld()?e instanceof Element||e instanceof On(e).Element:!1}function ra(e){return ld()?e instanceof HTMLElement||e instanceof On(e).HTMLElement:!1}function Ay(e){return!ld()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof On(e).ShadowRoot}function jl(e){const{overflow:n,overflowX:a,overflowY:o,display:l}=lr(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+a)&&l!=="inline"&&l!=="contents"}function n9(e){return/^(table|td|th)$/.test(Ws(e))}function cd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const r9=/transform|translate|scale|rotate|perspective|filter/,a9=/paint|layout|strict|content/,ho=e=>!!e&&e!=="none";let pp;function Jh(e){const n=ir(e)?lr(e):e;return ho(n.transform)||ho(n.translate)||ho(n.scale)||ho(n.rotate)||ho(n.perspective)||!eg()&&(ho(n.backdropFilter)||ho(n.filter))||r9.test(n.willChange||"")||a9.test(n.contain||"")}function o9(e){let n=za(e);for(;ra(n)&&!Ds(n);){if(Jh(n))return n;if(cd(n))return null;n=za(n)}return null}function eg(){return pp==null&&(pp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pp}function Ds(e){return/^(html|body|#document)$/.test(Ws(e))}function lr(e){return On(e).getComputedStyle(e)}function ud(e){return ir(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function za(e){if(Ws(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Ay(e)&&e.host||Er(e);return Ay(n)?n.host:n}function B2(e){const n=za(e);return Ds(n)?e.ownerDocument?e.ownerDocument.body:e.body:ra(n)&&jl(n)?n:B2(n)}function cl(e,n,a){var o;n===void 0&&(n=[]),a===void 0&&(a=!0);const l=B2(e),c=l===((o=e.ownerDocument)==null?void 0:o.body),d=On(l);if(c){const m=Zp(d);return n.concat(d,d.visualViewport||[],jl(l)?l:[],m&&a?cl(m):[])}else return n.concat(l,cl(l,[],a))}function Zp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function U2(e){const n=lr(e);let a=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const l=ra(e),c=l?e.offsetWidth:a,d=l?e.offsetHeight:o,m=Du(a)!==c||Du(o)!==d;return m&&(a=c,o=d),{width:a,height:o,$:m}}function tg(e){return ir(e)?e:e.contextElement}function As(e){const n=tg(e);if(!ra(n))return Nr(1);const a=n.getBoundingClientRect(),{width:o,height:l,$:c}=U2(n);let d=(c?Du(a.width):a.width)/o,m=(c?Du(a.height):a.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!m||!Number.isFinite(m))&&(m=1),{x:d,y:m}}const s9=Nr(0);function H2(e){const n=On(e);return!eg()||!n.visualViewport?s9:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function i9(e,n,a){return n===void 0&&(n=!1),!a||n&&a!==On(e)?!1:n}function bo(e,n,a,o){n===void 0&&(n=!1),a===void 0&&(a=!1);const l=e.getBoundingClientRect(),c=tg(e);let d=Nr(1);n&&(o?ir(o)&&(d=As(o)):d=As(e));const m=i9(c,a,o)?H2(c):Nr(0);let p=(l.left+m.x)/d.x,h=(l.top+m.y)/d.y,b=l.width/d.x,g=l.height/d.y;if(c){const y=On(c),w=o&&ir(o)?On(o):o;let j=y,S=Zp(j);for(;S&&o&&w!==j;){const E=As(S),N=S.getBoundingClientRect(),k=lr(S),T=N.left+(S.clientLeft+parseFloat(k.paddingLeft))*E.x,A=N.top+(S.clientTop+parseFloat(k.paddingTop))*E.y;p*=E.x,h*=E.y,b*=E.x,g*=E.y,p+=T,h+=A,j=On(S),S=Zp(j)}}return zu({width:b,height:g,x:p,y:h})}function dd(e,n){const a=ud(e).scrollLeft;return n?n.left+a:bo(Er(e)).left+a}function V2(e,n){const a=e.getBoundingClientRect(),o=a.left+n.scrollLeft-dd(e,a),l=a.top+n.scrollTop;return{x:o,y:l}}function l9(e){let{elements:n,rect:a,offsetParent:o,strategy:l}=e;const c=l==="fixed",d=Er(o),m=n?cd(n.floating):!1;if(o===d||m&&c)return a;let p={scrollLeft:0,scrollTop:0},h=Nr(1);const b=Nr(0),g=ra(o);if((g||!g&&!c)&&((Ws(o)!=="body"||jl(d))&&(p=ud(o)),g)){const w=bo(o);h=As(o),b.x=w.x+o.clientLeft,b.y=w.y+o.clientTop}const y=d&&!g&&!c?V2(d,p):Nr(0);return{width:a.width*h.x,height:a.height*h.y,x:a.x*h.x-p.scrollLeft*h.x+b.x+y.x,y:a.y*h.y-p.scrollTop*h.y+b.y+y.y}}function c9(e){return Array.from(e.getClientRects())}function u9(e){const n=Er(e),a=ud(e),o=e.ownerDocument.body,l=_n(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),c=_n(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let d=-a.scrollLeft+dd(e);const m=-a.scrollTop;return lr(o).direction==="rtl"&&(d+=_n(n.clientWidth,o.clientWidth)-l),{width:l,height:c,x:d,y:m}}const My=25;function d9(e,n){const a=On(e),o=Er(e),l=a.visualViewport;let c=o.clientWidth,d=o.clientHeight,m=0,p=0;if(l){c=l.width,d=l.height;const b=eg();(!b||b&&n==="fixed")&&(m=l.offsetLeft,p=l.offsetTop)}const h=dd(o);if(h<=0){const b=o.ownerDocument,g=b.body,y=getComputedStyle(g),w=b.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,j=Math.abs(o.clientWidth-g.clientWidth-w);j<=My&&(c-=j)}else h<=My&&(c+=h);return{width:c,height:d,x:m,y:p}}function f9(e,n){const a=bo(e,!0,n==="fixed"),o=a.top+e.clientTop,l=a.left+e.clientLeft,c=ra(e)?As(e):Nr(1),d=e.clientWidth*c.x,m=e.clientHeight*c.y,p=l*c.x,h=o*c.y;return{width:d,height:m,x:p,y:h}}function _y(e,n,a){let o;if(n==="viewport")o=d9(e,a);else if(n==="document")o=u9(Er(e));else if(ir(n))o=f9(n,a);else{const l=H2(e);o={x:n.x-l.x,y:n.y-l.y,width:n.width,height:n.height}}return zu(o)}function G2(e,n){const a=za(e);return a===n||!ir(a)||Ds(a)?!1:lr(a).position==="fixed"||G2(a,n)}function m9(e,n){const a=n.get(e);if(a)return a;let o=cl(e,[],!1).filter(m=>ir(m)&&Ws(m)!=="body"),l=null;const c=lr(e).position==="fixed";let d=c?za(e):e;for(;ir(d)&&!Ds(d);){const m=lr(d),p=Jh(d);!p&&m.position==="fixed"&&(l=null),(c?!p&&!l:!p&&m.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||jl(d)&&!p&&G2(e,d))?o=o.filter(b=>b!==d):l=m,d=za(d)}return n.set(e,o),o}function p9(e){let{element:n,boundary:a,rootBoundary:o,strategy:l}=e;const d=[...a==="clippingAncestors"?cd(n)?[]:m9(n,this._c):[].concat(a),o],m=_y(n,d[0],l);let p=m.top,h=m.right,b=m.bottom,g=m.left;for(let y=1;y<d.length;y++){const w=_y(n,d[y],l);p=_n(w.top,p),h=La(w.right,h),b=La(w.bottom,b),g=_n(w.left,g)}return{width:h-g,height:b-p,x:g,y:p}}function h9(e){const{width:n,height:a}=U2(e);return{width:n,height:a}}function g9(e,n,a){const o=ra(n),l=Er(n),c=a==="fixed",d=bo(e,!0,c,n);let m={scrollLeft:0,scrollTop:0};const p=Nr(0);function h(){p.x=dd(l)}if(o||!o&&!c)if((Ws(n)!=="body"||jl(l))&&(m=ud(n)),o){const w=bo(n,!0,c,n);p.x=w.x+n.clientLeft,p.y=w.y+n.clientTop}else l&&h();c&&!o&&l&&h();const b=l&&!o&&!c?V2(l,m):Nr(0),g=d.left+m.scrollLeft-p.x-b.x,y=d.top+m.scrollTop-p.y-b.y;return{x:g,y,width:d.width,height:d.height}}function hp(e){return lr(e).position==="static"}function Oy(e,n){if(!ra(e)||lr(e).position==="fixed")return null;if(n)return n(e);let a=e.offsetParent;return Er(e)===a&&(a=a.ownerDocument.body),a}function F2(e,n){const a=On(e);if(cd(e))return a;if(!ra(e)){let l=za(e);for(;l&&!Ds(l);){if(ir(l)&&!hp(l))return l;l=za(l)}return a}let o=Oy(e,n);for(;o&&n9(o)&&hp(o);)o=Oy(o,n);return o&&Ds(o)&&hp(o)&&!Jh(o)?a:o||o9(e)||a}const x9=async function(e){const n=this.getOffsetParent||F2,a=this.getDimensions,o=await a(e.floating);return{reference:g9(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function v9(e){return lr(e).direction==="rtl"}const b9={convertOffsetParentRelativeRectToViewportRelativeRect:l9,getDocumentElement:Er,getClippingRect:p9,getOffsetParent:F2,getElementRects:x9,getClientRects:c9,getDimensions:h9,getScale:As,isElement:ir,isRTL:v9};function W2(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function y9(e,n){let a=null,o;const l=Er(e);function c(){var m;clearTimeout(o),(m=a)==null||m.disconnect(),a=null}function d(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),c();const h=e.getBoundingClientRect(),{left:b,top:g,width:y,height:w}=h;if(m||n(),!y||!w)return;const j=au(g),S=au(l.clientWidth-(b+y)),E=au(l.clientHeight-(g+w)),N=au(b),T={rootMargin:-j+"px "+-S+"px "+-E+"px "+-N+"px",threshold:_n(0,La(1,p))||1};let A=!0;function O(M){const z=M[0].intersectionRatio;if(z!==p){if(!A)return d();z?d(!1,z):o=setTimeout(()=>{d(!1,1e-7)},1e3)}z===1&&!W2(h,e.getBoundingClientRect())&&d(),A=!1}try{a=new IntersectionObserver(O,{...T,root:l.ownerDocument})}catch{a=new IntersectionObserver(O,T)}a.observe(e)}return d(!0),c}function w9(e,n,a,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,h=tg(e),b=l||c?[...h?cl(h):[],...n?cl(n):[]]:[];b.forEach(N=>{l&&N.addEventListener("scroll",a,{passive:!0}),c&&N.addEventListener("resize",a)});const g=h&&m?y9(h,a):null;let y=-1,w=null;d&&(w=new ResizeObserver(N=>{let[k]=N;k&&k.target===h&&w&&n&&(w.unobserve(n),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=w)==null||T.observe(n)})),a()}),h&&!p&&w.observe(h),n&&w.observe(n));let j,S=p?bo(e):null;p&&E();function E(){const N=bo(e);S&&!W2(S,N)&&a(),S=N,j=requestAnimationFrame(E)}return a(),()=>{var N;b.forEach(k=>{l&&k.removeEventListener("scroll",a),c&&k.removeEventListener("resize",a)}),g==null||g(),(N=w)==null||N.disconnect(),w=null,p&&cancelAnimationFrame(j)}}const C9=Q6,S9=J6,j9=K6,N9=t9,E9=X6,Dy=q6,k9=e9,T9=(e,n,a)=>{const o=new Map,l={platform:b9,...a},c={...l.platform,_c:o};return Y6(e,n,{...l,platform:c})};var R9=typeof document<"u",A9=function(){},wu=R9?f.useLayoutEffect:A9;function Pu(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let a,o,l;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==n.length)return!1;for(o=a;o--!==0;)if(!Pu(e[o],n[o]))return!1;return!0}if(l=Object.keys(e),a=l.length,a!==Object.keys(n).length)return!1;for(o=a;o--!==0;)if(!{}.hasOwnProperty.call(n,l[o]))return!1;for(o=a;o--!==0;){const c=l[o];if(!(c==="_owner"&&e.$$typeof)&&!Pu(e[c],n[c]))return!1}return!0}return e!==e&&n!==n}function Y2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ly(e,n){const a=Y2(e);return Math.round(n*a)/a}function gp(e){const n=f.useRef(e);return wu(()=>{n.current=e}),n}function M9(e){e===void 0&&(e={});const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:l,elements:{reference:c,floating:d}={},transform:m=!0,whileElementsMounted:p,open:h}=e,[b,g]=f.useState({x:0,y:0,strategy:a,placement:n,middlewareData:{},isPositioned:!1}),[y,w]=f.useState(o);Pu(y,o)||w(o);const[j,S]=f.useState(null),[E,N]=f.useState(null),k=f.useCallback(H=>{H!==M.current&&(M.current=H,S(H))},[]),T=f.useCallback(H=>{H!==z.current&&(z.current=H,N(H))},[]),A=c||j,O=d||E,M=f.useRef(null),z=f.useRef(null),B=f.useRef(b),K=p!=null,U=gp(p),q=gp(l),ue=gp(h),pe=f.useCallback(()=>{if(!M.current||!z.current)return;const H={placement:n,strategy:a,middleware:y};q.current&&(H.platform=q.current),T9(M.current,z.current,H).then(Z=>{const te={...Z,isPositioned:ue.current!==!1};xe.current&&!Pu(B.current,te)&&(B.current=te,Ao.flushSync(()=>{g(te)}))})},[y,n,a,q,ue]);wu(()=>{h===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,g(H=>({...H,isPositioned:!1})))},[h]);const xe=f.useRef(!1);wu(()=>(xe.current=!0,()=>{xe.current=!1}),[]),wu(()=>{if(A&&(M.current=A),O&&(z.current=O),A&&O){if(U.current)return U.current(A,O,pe);pe()}},[A,O,pe,U,K]);const se=f.useMemo(()=>({reference:M,floating:z,setReference:k,setFloating:T}),[k,T]),L=f.useMemo(()=>({reference:A,floating:O}),[A,O]),I=f.useMemo(()=>{const H={position:a,left:0,top:0};if(!L.floating)return H;const Z=Ly(L.floating,b.x),te=Ly(L.floating,b.y);return m?{...H,transform:"translate("+Z+"px, "+te+"px)",...Y2(L.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Z,top:te}},[a,m,L.floating,b.x,b.y]);return f.useMemo(()=>({...b,update:pe,refs:se,elements:L,floatingStyles:I}),[b,pe,se,L,I])}const _9=e=>{function n(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:o,padding:l}=typeof e=="function"?e(a):e;return o&&n(o)?o.current!=null?Dy({element:o.current,padding:l}).fn(a):{}:o?Dy({element:o,padding:l}).fn(a):{}}}},O9=(e,n)=>{const a=C9(e);return{name:a.name,fn:a.fn,options:[e,n]}},D9=(e,n)=>{const a=S9(e);return{name:a.name,fn:a.fn,options:[e,n]}},L9=(e,n)=>({fn:k9(e).fn,options:[e,n]}),z9=(e,n)=>{const a=j9(e);return{name:a.name,fn:a.fn,options:[e,n]}},P9=(e,n)=>{const a=N9(e);return{name:a.name,fn:a.fn,options:[e,n]}},I9=(e,n)=>{const a=E9(e);return{name:a.name,fn:a.fn,options:[e,n]}},$9=(e,n)=>{const a=_9(e);return{name:a.name,fn:a.fn,options:[e,n]}};function B9(e){const n=U9(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(V9);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function U9(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=F9(l),m=G9(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var H9=Symbol("radix.slottable");function V9(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===H9}function G9(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function F9(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var W9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Y9=W9.reduce((e,n)=>{const a=B9(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),q9="Arrow",q2=f.forwardRef((e,n)=>{const{children:a,width:o=10,height:l=5,...c}=e;return s.jsx(Y9.svg,{...c,ref:n,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});q2.displayName=q9;var K9=q2;function X9(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,Z9(l,...n)]}function Z9(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function Q9(e){const n=J9(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(tT);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function J9(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=rT(l),m=nT(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var eT=Symbol("radix.slottable");function tT(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eT}function nT(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function rT(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var aT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],K2=aT.reduce((e,n)=>{const a=Q9(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function X2(e){const[n,a]=f.useState(void 0);return Pt(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const c=l[0];let d,m;if("borderBoxSize"in c){const p=c.borderBoxSize,h=Array.isArray(p)?p[0]:p;d=h.inlineSize,m=h.blockSize}else d=e.offsetWidth,m=e.offsetHeight;a({width:d,height:m})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else a(void 0)},[e]),n}var ng="Popper",[Z2,Va]=X9(ng),[oT,Q2]=Z2(ng),J2=e=>{const{__scopePopper:n,children:a}=e,[o,l]=f.useState(null);return s.jsx(oT,{scope:n,anchor:o,onAnchorChange:l,children:a})};J2.displayName=ng;var ew="PopperAnchor",tw=f.forwardRef((e,n)=>{const{__scopePopper:a,virtualRef:o,...l}=e,c=Q2(ew,a),d=f.useRef(null),m=Ve(n,d),p=f.useRef(null);return f.useEffect(()=>{const h=p.current;p.current=(o==null?void 0:o.current)||d.current,h!==p.current&&c.onAnchorChange(p.current)}),o?null:s.jsx(K2.div,{...l,ref:m})});tw.displayName=ew;var rg="PopperContent",[sT,iT]=Z2(rg),nw=f.forwardRef((e,n)=>{var ae,be,ve,Y,le,ye;const{__scopePopper:a,side:o="bottom",sideOffset:l=0,align:c="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:h=[],collisionPadding:b=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:w="optimized",onPlaced:j,...S}=e,E=Q2(rg,a),[N,k]=f.useState(null),T=Ve(n,Te=>k(Te)),[A,O]=f.useState(null),M=X2(A),z=(M==null?void 0:M.width)??0,B=(M==null?void 0:M.height)??0,K=o+(c!=="center"?"-"+c:""),U=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},q=Array.isArray(h)?h:[h],ue=q.length>0,pe={padding:U,boundary:q.filter(cT),altBoundary:ue},{refs:xe,floatingStyles:se,placement:L,isPositioned:I,middlewareData:H}=M9({strategy:"fixed",placement:K,whileElementsMounted:(...Te)=>w9(...Te,{animationFrame:w==="always"}),elements:{reference:E.anchor},middleware:[O9({mainAxis:l+B,alignmentAxis:d}),p&&D9({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?L9():void 0,...pe}),p&&z9({...pe}),P9({...pe,apply:({elements:Te,rects:Le,availableWidth:rt,availableHeight:ht})=>{const{width:Mt,height:Tr}=Le.reference,_t=Te.floating.style;_t.setProperty("--radix-popper-available-width",`${rt}px`),_t.setProperty("--radix-popper-available-height",`${ht}px`),_t.setProperty("--radix-popper-anchor-width",`${Mt}px`),_t.setProperty("--radix-popper-anchor-height",`${Tr}px`)}}),A&&$9({element:A,padding:m}),uT({arrowWidth:z,arrowHeight:B}),y&&I9({strategy:"referenceHidden",...pe})]}),[Z,te]=ow(L),_=Wt(j);Pt(()=>{I&&(_==null||_())},[I,_]);const D=(ae=H.arrow)==null?void 0:ae.x,G=(be=H.arrow)==null?void 0:be.y,V=((ve=H.arrow)==null?void 0:ve.centerOffset)!==0,[F,oe]=f.useState();return Pt(()=>{N&&oe(window.getComputedStyle(N).zIndex)},[N]),s.jsx("div",{ref:xe.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:I?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:F,"--radix-popper-transform-origin":[(Y=H.transformOrigin)==null?void 0:Y.x,(le=H.transformOrigin)==null?void 0:le.y].join(" "),...((ye=H.hide)==null?void 0:ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(sT,{scope:a,placedSide:Z,onArrowChange:O,arrowX:D,arrowY:G,shouldHideArrow:V,children:s.jsx(K2.div,{"data-side":Z,"data-align":te,...S,ref:T,style:{...S.style,animation:I?void 0:"none"}})})})});nw.displayName=rg;var rw="PopperArrow",lT={top:"bottom",right:"left",bottom:"top",left:"right"},aw=f.forwardRef(function(n,a){const{__scopePopper:o,...l}=n,c=iT(rw,o),d=lT[c.placedSide];return s.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:s.jsx(K9,{...l,ref:a,style:{...l.style,display:"block"}})})});aw.displayName=rw;function cT(e){return e!==null}var uT=e=>({name:"transformOrigin",options:e,fn(n){var E,N,k;const{placement:a,rects:o,middlewareData:l}=n,d=((E=l.arrow)==null?void 0:E.centerOffset)!==0,m=d?0:e.arrowWidth,p=d?0:e.arrowHeight,[h,b]=ow(a),g={start:"0%",center:"50%",end:"100%"}[b],y=(((N=l.arrow)==null?void 0:N.x)??0)+m/2,w=(((k=l.arrow)==null?void 0:k.y)??0)+p/2;let j="",S="";return h==="bottom"?(j=d?g:`${y}px`,S=`${-p}px`):h==="top"?(j=d?g:`${y}px`,S=`${o.floating.height+p}px`):h==="right"?(j=`${-p}px`,S=d?g:`${w}px`):h==="left"&&(j=`${o.floating.width+p}px`,S=d?g:`${w}px`),{data:{x:j,y:S}}}});function ow(e){const[n,a="center"]=e.split("-");return[n,a]}var fd=J2,Nl=tw,md=nw,pd=aw;function dT(e){const n=fT(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(pT);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function fT(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=gT(l),m=hT(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var mT=Symbol("radix.slottable");function pT(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mT}function hT(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function gT(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var xT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vT=xT.reduce((e,n)=>{const a=dT(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),bT="Portal",Ys=f.forwardRef((e,n)=>{var m;const{container:a,...o}=e,[l,c]=f.useState(!1);Pt(()=>c(!0),[]);const d=a||l&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return d?X0.createPortal(s.jsx(vT.div,{...o,ref:n}),d):null});Ys.displayName=bT;function yT(e,n){return f.useReducer((a,o)=>n[a][o]??a,e)}var sn=e=>{const{present:n,children:a}=e,o=wT(n),l=typeof a=="function"?a({present:o.isPresent}):f.Children.only(a),c=Ve(o.ref,CT(l));return typeof a=="function"||o.isPresent?f.cloneElement(l,{ref:c}):null};sn.displayName="Presence";function wT(e){const[n,a]=f.useState(),o=f.useRef(null),l=f.useRef(e),c=f.useRef("none"),d=e?"mounted":"unmounted",[m,p]=yT(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const h=ou(o.current);c.current=m==="mounted"?h:"none"},[m]),Pt(()=>{const h=o.current,b=l.current;if(b!==e){const y=c.current,w=ou(h);e?p("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?p("UNMOUNT"):p(b&&y!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,p]),Pt(()=>{if(n){let h;const b=n.ownerDocument.defaultView??window,g=w=>{const S=ou(o.current).includes(CSS.escape(w.animationName));if(w.target===n&&S&&(p("ANIMATION_END"),!l.current)){const E=n.style.animationFillMode;n.style.animationFillMode="forwards",h=b.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=E)})}},y=w=>{w.target===n&&(c.current=ou(o.current))};return n.addEventListener("animationstart",y),n.addEventListener("animationcancel",g),n.addEventListener("animationend",g),()=>{b.clearTimeout(h),n.removeEventListener("animationstart",y),n.removeEventListener("animationcancel",g),n.removeEventListener("animationend",g)}}else p("ANIMATION_END")},[n,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:f.useCallback(h=>{o.current=h?getComputedStyle(h):null,a(h)},[])}}function ou(e){return(e==null?void 0:e.animationName)||"none"}function CT(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function sw(e){const n=ST(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(NT);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function ST(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=kT(l),m=ET(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var jT=Symbol("radix.slottable");function NT(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jT}function ET(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function kT(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var TT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],El=TT.reduce((e,n)=>{const a=sw(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function RT(e,n){e&&Ao.flushSync(()=>e.dispatchEvent(n))}function AT(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,MT(l,...n)]}function MT(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function _T(e){const n=OT(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(LT);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function OT(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=PT(l),m=zT(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var DT=Symbol("radix.slottable");function LT(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DT}function zT(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function PT(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var IT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],iw=IT.reduce((e,n)=>{const a=_T(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),xp="rovingFocusGroup.onEntryFocus",$T={bubbles:!1,cancelable:!0},kl="RovingFocusGroup",[Qp,lw,BT]=Kh(kl),[UT,hd]=AT(kl,[BT]),[HT,VT]=UT(kl),cw=f.forwardRef((e,n)=>s.jsx(Qp.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Qp.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(GT,{...e,ref:n})})}));cw.displayName=kl;var GT=f.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:a,orientation:o,loop:l=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:h,preventScrollOnEntryFocus:b=!1,...g}=e,y=f.useRef(null),w=Ve(n,y),j=Cl(c),[S,E]=ea({prop:d,defaultProp:m??null,onChange:p,caller:kl}),[N,k]=f.useState(!1),T=Wt(h),A=lw(a),O=f.useRef(!1),[M,z]=f.useState(0);return f.useEffect(()=>{const B=y.current;if(B)return B.addEventListener(xp,T),()=>B.removeEventListener(xp,T)},[T]),s.jsx(HT,{scope:a,orientation:o,dir:j,loop:l,currentTabStopId:S,onItemFocus:f.useCallback(B=>E(B),[E]),onItemShiftTab:f.useCallback(()=>k(!0),[]),onFocusableItemAdd:f.useCallback(()=>z(B=>B+1),[]),onFocusableItemRemove:f.useCallback(()=>z(B=>B-1),[]),children:s.jsx(iw.div,{tabIndex:N||M===0?-1:0,"data-orientation":o,...g,ref:w,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{O.current=!0}),onFocus:Ce(e.onFocus,B=>{const K=!O.current;if(B.target===B.currentTarget&&K&&!N){const U=new CustomEvent(xp,$T);if(B.currentTarget.dispatchEvent(U),!U.defaultPrevented){const q=A().filter(L=>L.focusable),ue=q.find(L=>L.active),pe=q.find(L=>L.id===S),se=[ue,pe,...q].filter(Boolean).map(L=>L.ref.current);fw(se,b)}}O.current=!1}),onBlur:Ce(e.onBlur,()=>k(!1))})})}),uw="RovingFocusGroupItem",dw=f.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:a,focusable:o=!0,active:l=!1,tabStopId:c,children:d,...m}=e,p=Yt(),h=c||p,b=VT(uw,a),g=b.currentTabStopId===h,y=lw(a),{onFocusableItemAdd:w,onFocusableItemRemove:j,currentTabStopId:S}=b;return f.useEffect(()=>{if(o)return w(),()=>j()},[o,w,j]),s.jsx(Qp.ItemSlot,{scope:a,id:h,focusable:o,active:l,children:s.jsx(iw.span,{tabIndex:g?0:-1,"data-orientation":b.orientation,...m,ref:n,onMouseDown:Ce(e.onMouseDown,E=>{o?b.onItemFocus(h):E.preventDefault()}),onFocus:Ce(e.onFocus,()=>b.onItemFocus(h)),onKeyDown:Ce(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){b.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const N=YT(E,b.orientation,b.dir);if(N!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let T=y().filter(A=>A.focusable).map(A=>A.ref.current);if(N==="last")T.reverse();else if(N==="prev"||N==="next"){N==="prev"&&T.reverse();const A=T.indexOf(E.currentTarget);T=b.loop?qT(T,A+1):T.slice(A+1)}setTimeout(()=>fw(T))}}),children:typeof d=="function"?d({isCurrentTabStop:g,hasTabStop:S!=null}):d})})});dw.displayName=uw;var FT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WT(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function YT(e,n,a){const o=WT(e.key,a);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return FT[o]}function fw(e,n=!1){const a=document.activeElement;for(const o of e)if(o===a||(o.focus({preventScroll:n}),document.activeElement!==a))return}function qT(e,n){return e.map((a,o)=>e[(n+o)%e.length])}var mw=cw,pw=dw,KT=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Cs=new WeakMap,su=new WeakMap,iu={},vp=0,hw=function(e){return e&&(e.host||hw(e.parentNode))},XT=function(e,n){return n.map(function(a){if(e.contains(a))return a;var o=hw(a);return o&&e.contains(o)?o:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},ZT=function(e,n,a,o){var l=XT(n,Array.isArray(e)?e:[e]);iu[a]||(iu[a]=new WeakMap);var c=iu[a],d=[],m=new Set,p=new Set(l),h=function(g){!g||m.has(g)||(m.add(g),h(g.parentNode))};l.forEach(h);var b=function(g){!g||p.has(g)||Array.prototype.forEach.call(g.children,function(y){if(m.has(y))b(y);else try{var w=y.getAttribute(o),j=w!==null&&w!=="false",S=(Cs.get(y)||0)+1,E=(c.get(y)||0)+1;Cs.set(y,S),c.set(y,E),d.push(y),S===1&&j&&su.set(y,!0),E===1&&y.setAttribute(a,"true"),j||y.setAttribute(o,"true")}catch(N){console.error("aria-hidden: cannot operate on ",y,N)}})};return b(n),m.clear(),vp++,function(){d.forEach(function(g){var y=Cs.get(g)-1,w=c.get(g)-1;Cs.set(g,y),c.set(g,w),y||(su.has(g)||g.removeAttribute(o),su.delete(g)),w||g.removeAttribute(a)}),vp--,vp||(Cs=new WeakMap,Cs=new WeakMap,su=new WeakMap,iu={})}},gd=function(e,n,a){a===void 0&&(a="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),l=KT(e);return l?(o.push.apply(o,Array.from(l.querySelectorAll("[aria-live], script"))),ZT(o,l,a,"aria-hidden")):function(){return null}},Cr=function(){return Cr=Object.assign||function(n){for(var a,o=1,l=arguments.length;o<l;o++){a=arguments[o];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(n[c]=a[c])}return n},Cr.apply(this,arguments)};function gw(e,n){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(e);l<o.length;l++)n.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(a[o[l]]=e[o[l]]);return a}function QT(e,n,a){if(a||arguments.length===2)for(var o=0,l=n.length,c;o<l;o++)(c||!(o in n))&&(c||(c=Array.prototype.slice.call(n,0,o)),c[o]=n[o]);return e.concat(c||Array.prototype.slice.call(n))}var Cu="right-scroll-bar-position",Su="width-before-scroll-bar",JT="with-scroll-bars-hidden",e7="--removed-body-scroll-bar-size";function bp(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function t7(e,n){var a=f.useState(function(){return{value:e,callback:n,facade:{get current(){return a.value},set current(o){var l=a.value;l!==o&&(a.value=o,a.callback(o,l))}}}})[0];return a.callback=n,a.facade}var n7=typeof window<"u"?f.useLayoutEffect:f.useEffect,zy=new WeakMap;function r7(e,n){var a=t7(null,function(o){return e.forEach(function(l){return bp(l,o)})});return n7(function(){var o=zy.get(a);if(o){var l=new Set(o),c=new Set(e),d=a.current;l.forEach(function(m){c.has(m)||bp(m,null)}),c.forEach(function(m){l.has(m)||bp(m,d)})}zy.set(a,e)},[e]),a}function a7(e){return e}function o7(e,n){n===void 0&&(n=a7);var a=[],o=!1,l={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(c){var d=n(c,o);return a.push(d),function(){a=a.filter(function(m){return m!==d})}},assignSyncMedium:function(c){for(o=!0;a.length;){var d=a;a=[],d.forEach(c)}a={push:function(m){return c(m)},filter:function(){return a}}},assignMedium:function(c){o=!0;var d=[];if(a.length){var m=a;a=[],m.forEach(c),d=a}var p=function(){var b=d;d=[],b.forEach(c)},h=function(){return Promise.resolve().then(p)};h(),a={push:function(b){d.push(b),h()},filter:function(b){return d=d.filter(b),a}}}};return l}function s7(e){e===void 0&&(e={});var n=o7(null);return n.options=Cr({async:!0,ssr:!1},e),n}var xw=function(e){var n=e.sideCar,a=gw(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return f.createElement(o,Cr({},a))};xw.isSideCarExport=!0;function i7(e,n){return e.useMedium(n),xw}var vw=s7(),yp=function(){},xd=f.forwardRef(function(e,n){var a=f.useRef(null),o=f.useState({onScrollCapture:yp,onWheelCapture:yp,onTouchMoveCapture:yp}),l=o[0],c=o[1],d=e.forwardProps,m=e.children,p=e.className,h=e.removeScrollBar,b=e.enabled,g=e.shards,y=e.sideCar,w=e.noRelative,j=e.noIsolation,S=e.inert,E=e.allowPinchZoom,N=e.as,k=N===void 0?"div":N,T=e.gapMode,A=gw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=y,M=r7([a,n]),z=Cr(Cr({},A),l);return f.createElement(f.Fragment,null,b&&f.createElement(O,{sideCar:vw,removeScrollBar:h,shards:g,noRelative:w,noIsolation:j,inert:S,setCallbacks:c,allowPinchZoom:!!E,lockRef:a,gapMode:T}),d?f.cloneElement(f.Children.only(m),Cr(Cr({},z),{ref:M})):f.createElement(k,Cr({},z,{className:p,ref:M}),m))});xd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xd.classNames={fullWidth:Su,zeroRight:Cu};var l7=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function c7(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=l7();return n&&e.setAttribute("nonce",n),e}function u7(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function d7(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var f7=function(){var e=0,n=null;return{add:function(a){e==0&&(n=c7())&&(u7(n,a),d7(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},m7=function(){var e=f7();return function(n,a){f.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&a])}},bw=function(){var e=m7(),n=function(a){var o=a.styles,l=a.dynamic;return e(o,l),null};return n},p7={left:0,top:0,right:0,gap:0},wp=function(e){return parseInt(e||"",10)||0},h7=function(e){var n=window.getComputedStyle(document.body),a=n[e==="padding"?"paddingLeft":"marginLeft"],o=n[e==="padding"?"paddingTop":"marginTop"],l=n[e==="padding"?"paddingRight":"marginRight"];return[wp(a),wp(o),wp(l)]},g7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return p7;var n=h7(e),a=document.documentElement.clientWidth,o=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,o-a+n[2]-n[0])}},x7=bw(),Ms="data-scroll-locked",v7=function(e,n,a,o){var l=e.left,c=e.top,d=e.right,m=e.gap;return a===void 0&&(a="margin"),`
.`.concat(JT,` {
overflow: hidden `).concat(o,`;
padding-right: `).concat(m,"px ").concat(o,`;
}
body[`).concat(Ms,`] {
overflow: hidden `).concat(o,`;
overscroll-behavior: contain;
`).concat([n&&"position: relative ".concat(o,";"),a==="margin"&&`
padding-left: `.concat(l,`px;
padding-top: `).concat(c,`px;
padding-right: `).concat(d,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(m,"px ").concat(o,`;
`),a==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";")].filter(Boolean).join(""),`
}
.`).concat(Cu,` {
right: `).concat(m,"px ").concat(o,`;
}
.`).concat(Su,` {
margin-right: `).concat(m,"px ").concat(o,`;
}
.`).concat(Cu," .").concat(Cu,` {
right: 0 `).concat(o,`;
}
.`).concat(Su," .").concat(Su,` {
margin-right: 0 `).concat(o,`;
}
body[`).concat(Ms,`] {
`).concat(e7,": ").concat(m,`px;
}
`)},Py=function(){var e=parseInt(document.body.getAttribute(Ms)||"0",10);return isFinite(e)?e:0},b7=function(){f.useEffect(function(){return document.body.setAttribute(Ms,(Py()+1).toString()),function(){var e=Py()-1;e<=0?document.body.removeAttribute(Ms):document.body.setAttribute(Ms,e.toString())}},[])},y7=function(e){var n=e.noRelative,a=e.noImportant,o=e.gapMode,l=o===void 0?"margin":o;b7();var c=f.useMemo(function(){return g7(l)},[l]);return f.createElement(x7,{styles:v7(c,!n,l,a?"":"!important")})},Jp=!1;if(typeof window<"u")try{var lu=Object.defineProperty({},"passive",{get:function(){return Jp=!0,!0}});window.addEventListener("test",lu,lu),window.removeEventListener("test",lu,lu)}catch{Jp=!1}var Ss=Jp?{passive:!1}:!1,w7=function(e){return e.tagName==="TEXTAREA"},yw=function(e,n){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[n]!=="hidden"&&!(a.overflowY===a.overflowX&&!w7(e)&&a[n]==="visible")},C7=function(e){return yw(e,"overflowY")},S7=function(e){return yw(e,"overflowX")},Iy=function(e,n){var a=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var l=ww(e,o);if(l){var c=Cw(e,o),d=c[1],m=c[2];if(d>m)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},j7=function(e){var n=e.scrollTop,a=e.scrollHeight,o=e.clientHeight;return[n,a,o]},N7=function(e){var n=e.scrollLeft,a=e.scrollWidth,o=e.clientWidth;return[n,a,o]},ww=function(e,n){return e==="v"?C7(n):S7(n)},Cw=function(e,n){return e==="v"?j7(n):N7(n)},E7=function(e,n){return e==="h"&&n==="rtl"?-1:1},k7=function(e,n,a,o,l){var c=E7(e,window.getComputedStyle(n).direction),d=c*o,m=a.target,p=n.contains(m),h=!1,b=d>0,g=0,y=0;do{if(!m)break;var w=Cw(e,m),j=w[0],S=w[1],E=w[2],N=S-E-c*j;(j||N)&&ww(e,m)&&(g+=N,y+=j);var k=m.parentNode;m=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!p&&m!==document.body||p&&(n.contains(m)||n===m));return(b&&Math.abs(g)<1||!b&&Math.abs(y)<1)&&(h=!0),h},cu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$y=function(e){return[e.deltaX,e.deltaY]},By=function(e){return e&&"current"in e?e.current:e},T7=function(e,n){return e[0]===n[0]&&e[1]===n[1]},R7=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},A7=0,js=[];function M7(e){var n=f.useRef([]),a=f.useRef([0,0]),o=f.useRef(),l=f.useState(A7++)[0],c=f.useState(bw)[0],d=f.useRef(e);f.useEffect(function(){d.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var S=QT([e.lockRef.current],(e.shards||[]).map(By),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var m=f.useCallback(function(S,E){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var N=cu(S),k=a.current,T="deltaX"in S?S.deltaX:k[0]-N[0],A="deltaY"in S?S.deltaY:k[1]-N[1],O,M=S.target,z=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in S&&z==="h"&&M.type==="range")return!1;var B=window.getSelection(),K=B&&B.anchorNode,U=K?K===M||K.contains(M):!1;if(U)return!1;var q=Iy(z,M);if(!q)return!0;if(q?O=z:(O=z==="v"?"h":"v",q=Iy(z,M)),!q)return!1;if(!o.current&&"changedTouches"in S&&(T||A)&&(o.current=O),!O)return!0;var ue=o.current||O;return k7(ue,E,S,ue==="h"?T:A)},[]),p=f.useCallback(function(S){var E=S;if(!(!js.length||js[js.length-1]!==c)){var N="deltaY"in E?$y(E):cu(E),k=n.current.filter(function(O){return O.name===E.type&&(O.target===E.target||E.target===O.shadowParent)&&T7(O.delta,N)})[0];if(k&&k.should){E.cancelable&&E.preventDefault();return}if(!k){var T=(d.current.shards||[]).map(By).filter(Boolean).filter(function(O){return O.contains(E.target)}),A=T.length>0?m(E,T[0]):!d.current.noIsolation;A&&E.cancelable&&E.preventDefault()}}},[]),h=f.useCallback(function(S,E,N,k){var T={name:S,delta:E,target:N,should:k,shadowParent:_7(N)};n.current.push(T),setTimeout(function(){n.current=n.current.filter(function(A){return A!==T})},1)},[]),b=f.useCallback(function(S){a.current=cu(S),o.current=void 0},[]),g=f.useCallback(function(S){h(S.type,$y(S),S.target,m(S,e.lockRef.current))},[]),y=f.useCallback(function(S){h(S.type,cu(S),S.target,m(S,e.lockRef.current))},[]);f.useEffect(function(){return js.push(c),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",p,Ss),document.addEventListener("touchmove",p,Ss),document.addEventListener("touchstart",b,Ss),function(){js=js.filter(function(S){return S!==c}),document.removeEventListener("wheel",p,Ss),document.removeEventListener("touchmove",p,Ss),document.removeEventListener("touchstart",b,Ss)}},[]);var w=e.removeScrollBar,j=e.inert;return f.createElement(f.Fragment,null,j?f.createElement(c,{styles:R7(l)}):null,w?f.createElement(y7,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _7(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const O7=i7(vw,M7);var Tl=f.forwardRef(function(e,n){return f.createElement(xd,Cr({},e,{ref:n,sideCar:O7}))});Tl.classNames=xd.classNames;var eh=["Enter"," "],D7=["ArrowDown","PageUp","Home"],Sw=["ArrowUp","PageDown","End"],L7=[...D7,...Sw],z7={ltr:[...eh,"ArrowRight"],rtl:[...eh,"ArrowLeft"]},P7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Rl="Menu",[ul,I7,$7]=Kh(Rl),[_o,jw]=e6(Rl,[$7,Va,hd]),vd=Va(),Nw=hd(),[B7,Oo]=_o(Rl),[U7,Al]=_o(Rl),Ew=e=>{const{__scopeMenu:n,open:a=!1,children:o,dir:l,onOpenChange:c,modal:d=!0}=e,m=vd(n),[p,h]=f.useState(null),b=f.useRef(!1),g=Wt(c),y=Cl(l);return f.useEffect(()=>{const w=()=>{b.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>b.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(fd,{...m,children:s.jsx(B7,{scope:n,open:a,onOpenChange:g,content:p,onContentChange:h,children:s.jsx(U7,{scope:n,onClose:f.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:b,dir:y,modal:d,children:o})})})};Ew.displayName=Rl;var H7="MenuAnchor",ag=f.forwardRef((e,n)=>{const{__scopeMenu:a,...o}=e,l=vd(a);return s.jsx(Nl,{...l,...o,ref:n})});ag.displayName=H7;var og="MenuPortal",[V7,kw]=_o(og,{forceMount:void 0}),Tw=e=>{const{__scopeMenu:n,forceMount:a,children:o,container:l}=e,c=Oo(og,n);return s.jsx(V7,{scope:n,forceMount:a,children:s.jsx(sn,{present:a||c.open,children:s.jsx(Ys,{asChild:!0,container:l,children:o})})})};Tw.displayName=og;var Kn="MenuContent",[G7,sg]=_o(Kn),Rw=f.forwardRef((e,n)=>{const a=kw(Kn,e.__scopeMenu),{forceMount:o=a.forceMount,...l}=e,c=Oo(Kn,e.__scopeMenu),d=Al(Kn,e.__scopeMenu);return s.jsx(ul.Provider,{scope:e.__scopeMenu,children:s.jsx(sn,{present:o||c.open,children:s.jsx(ul.Slot,{scope:e.__scopeMenu,children:d.modal?s.jsx(F7,{...l,ref:n}):s.jsx(W7,{...l,ref:n})})})})}),F7=f.forwardRef((e,n)=>{const a=Oo(Kn,e.__scopeMenu),o=f.useRef(null),l=Ve(n,o);return f.useEffect(()=>{const c=o.current;if(c)return gd(c)},[]),s.jsx(ig,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),W7=f.forwardRef((e,n)=>{const a=Oo(Kn,e.__scopeMenu);return s.jsx(ig,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})}),Y7=sw("MenuContent.ScrollLock"),ig=f.forwardRef((e,n)=>{const{__scopeMenu:a,loop:o=!1,trapFocus:l,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:m,onEntryFocus:p,onEscapeKeyDown:h,onPointerDownOutside:b,onFocusOutside:g,onInteractOutside:y,onDismiss:w,disableOutsideScroll:j,...S}=e,E=Oo(Kn,a),N=Al(Kn,a),k=vd(a),T=Nw(a),A=I7(a),[O,M]=f.useState(null),z=f.useRef(null),B=Ve(n,z,E.onContentChange),K=f.useRef(0),U=f.useRef(""),q=f.useRef(0),ue=f.useRef(null),pe=f.useRef("right"),xe=f.useRef(0),se=j?Tl:f.Fragment,L=j?{as:Y7,allowPinchZoom:!0}:void 0,I=Z=>{var ae,be;const te=U.current+Z,_=A().filter(ve=>!ve.disabled),D=document.activeElement,G=(ae=_.find(ve=>ve.ref.current===D))==null?void 0:ae.textValue,V=_.map(ve=>ve.textValue),F=oR(V,te,G),oe=(be=_.find(ve=>ve.textValue===F))==null?void 0:be.ref.current;(function ve(Y){U.current=Y,window.clearTimeout(K.current),Y!==""&&(K.current=window.setTimeout(()=>ve(""),1e3))})(te),oe&&setTimeout(()=>oe.focus())};f.useEffect(()=>()=>window.clearTimeout(K.current),[]),id();const H=f.useCallback(Z=>{var _,D;return pe.current===((_=ue.current)==null?void 0:_.side)&&iR(Z,(D=ue.current)==null?void 0:D.area)},[]);return s.jsx(G7,{scope:a,searchRef:U,onItemEnter:f.useCallback(Z=>{H(Z)&&Z.preventDefault()},[H]),onItemLeave:f.useCallback(Z=>{var te;H(Z)||((te=z.current)==null||te.focus(),M(null))},[H]),onTriggerLeave:f.useCallback(Z=>{H(Z)&&Z.preventDefault()},[H]),pointerGraceTimerRef:q,onPointerGraceIntentChange:f.useCallback(Z=>{ue.current=Z},[]),children:s.jsx(se,{...L,children:s.jsx(Sl,{asChild:!0,trapped:l,onMountAutoFocus:Ce(c,Z=>{var te;Z.preventDefault(),(te=z.current)==null||te.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:s.jsx(Gs,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:h,onPointerDownOutside:b,onFocusOutside:g,onInteractOutside:y,onDismiss:w,children:s.jsx(mw,{asChild:!0,...T,dir:N.dir,orientation:"vertical",loop:o,currentTabStopId:O,onCurrentTabStopIdChange:M,onEntryFocus:Ce(p,Z=>{N.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(md,{role:"menu","aria-orientation":"vertical","data-state":Fw(E.open),"data-radix-menu-content":"",dir:N.dir,...k,...S,ref:B,style:{outline:"none",...S.style},onKeyDown:Ce(S.onKeyDown,Z=>{const _=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,D=Z.ctrlKey||Z.altKey||Z.metaKey,G=Z.key.length===1;_&&(Z.key==="Tab"&&Z.preventDefault(),!D&&G&&I(Z.key));const V=z.current;if(Z.target!==V||!L7.includes(Z.key))return;Z.preventDefault();const oe=A().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);Sw.includes(Z.key)&&oe.reverse(),rR(oe)}),onBlur:Ce(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(K.current),U.current="")}),onPointerMove:Ce(e.onPointerMove,dl(Z=>{const te=Z.target,_=xe.current!==Z.clientX;if(Z.currentTarget.contains(te)&&_){const D=Z.clientX>xe.current?"right":"left";pe.current=D,xe.current=Z.clientX}}))})})})})})})});Rw.displayName=Kn;var q7="MenuGroup",lg=f.forwardRef((e,n)=>{const{__scopeMenu:a,...o}=e;return s.jsx(El.div,{role:"group",...o,ref:n})});lg.displayName=q7;var K7="MenuLabel",Aw=f.forwardRef((e,n)=>{const{__scopeMenu:a,...o}=e;return s.jsx(El.div,{...o,ref:n})});Aw.displayName=K7;var Iu="MenuItem",Uy="menu.itemSelect",bd=f.forwardRef((e,n)=>{const{disabled:a=!1,onSelect:o,...l}=e,c=f.useRef(null),d=Al(Iu,e.__scopeMenu),m=sg(Iu,e.__scopeMenu),p=Ve(n,c),h=f.useRef(!1),b=()=>{const g=c.current;if(!a&&g){const y=new CustomEvent(Uy,{bubbles:!0,cancelable:!0});g.addEventListener(Uy,w=>o==null?void 0:o(w),{once:!0}),RT(g,y),y.defaultPrevented?h.current=!1:d.onClose()}};return s.jsx(Mw,{...l,ref:p,disabled:a,onClick:Ce(e.onClick,b),onPointerDown:g=>{var y;(y=e.onPointerDown)==null||y.call(e,g),h.current=!0},onPointerUp:Ce(e.onPointerUp,g=>{var y;h.current||(y=g.currentTarget)==null||y.click()}),onKeyDown:Ce(e.onKeyDown,g=>{const y=m.searchRef.current!=="";a||y&&g.key===" "||eh.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});bd.displayName=Iu;var Mw=f.forwardRef((e,n)=>{const{__scopeMenu:a,disabled:o=!1,textValue:l,...c}=e,d=sg(Iu,a),m=Nw(a),p=f.useRef(null),h=Ve(n,p),[b,g]=f.useState(!1),[y,w]=f.useState("");return f.useEffect(()=>{const j=p.current;j&&w((j.textContent??"").trim())},[c.children]),s.jsx(ul.ItemSlot,{scope:a,disabled:o,textValue:l??y,children:s.jsx(pw,{asChild:!0,...m,focusable:!o,children:s.jsx(El.div,{role:"menuitem","data-highlighted":b?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...c,ref:h,onPointerMove:Ce(e.onPointerMove,dl(j=>{o?d.onItemLeave(j):(d.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,dl(j=>d.onItemLeave(j))),onFocus:Ce(e.onFocus,()=>g(!0)),onBlur:Ce(e.onBlur,()=>g(!1))})})})}),X7="MenuCheckboxItem",_w=f.forwardRef((e,n)=>{const{checked:a=!1,onCheckedChange:o,...l}=e;return s.jsx(Pw,{scope:e.__scopeMenu,checked:a,children:s.jsx(bd,{role:"menuitemcheckbox","aria-checked":$u(a)?"mixed":a,...l,ref:n,"data-state":ug(a),onSelect:Ce(l.onSelect,()=>o==null?void 0:o($u(a)?!0:!a),{checkForDefaultPrevented:!1})})})});_w.displayName=X7;var Ow="MenuRadioGroup",[Z7,Q7]=_o(Ow,{value:void 0,onValueChange:()=>{}}),Dw=f.forwardRef((e,n)=>{const{value:a,onValueChange:o,...l}=e,c=Wt(o);return s.jsx(Z7,{scope:e.__scopeMenu,value:a,onValueChange:c,children:s.jsx(lg,{...l,ref:n})})});Dw.displayName=Ow;var Lw="MenuRadioItem",zw=f.forwardRef((e,n)=>{const{value:a,...o}=e,l=Q7(Lw,e.__scopeMenu),c=a===l.value;return s.jsx(Pw,{scope:e.__scopeMenu,checked:c,children:s.jsx(bd,{role:"menuitemradio","aria-checked":c,...o,ref:n,"data-state":ug(c),onSelect:Ce(o.onSelect,()=>{var d;return(d=l.onValueChange)==null?void 0:d.call(l,a)},{checkForDefaultPrevented:!1})})})});zw.displayName=Lw;var cg="MenuItemIndicator",[Pw,J7]=_o(cg,{checked:!1}),Iw=f.forwardRef((e,n)=>{const{__scopeMenu:a,forceMount:o,...l}=e,c=J7(cg,a);return s.jsx(sn,{present:o||$u(c.checked)||c.checked===!0,children:s.jsx(El.span,{...l,ref:n,"data-state":ug(c.checked)})})});Iw.displayName=cg;var eR="MenuSeparator",$w=f.forwardRef((e,n)=>{const{__scopeMenu:a,...o}=e;return s.jsx(El.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});$w.displayName=eR;var tR="MenuArrow",Bw=f.forwardRef((e,n)=>{const{__scopeMenu:a,...o}=e,l=vd(a);return s.jsx(pd,{...l,...o,ref:n})});Bw.displayName=tR;var nR="MenuSub",[GB,Uw]=_o(nR),Zi="MenuSubTrigger",Hw=f.forwardRef((e,n)=>{const a=Oo(Zi,e.__scopeMenu),o=Al(Zi,e.__scopeMenu),l=Uw(Zi,e.__scopeMenu),c=sg(Zi,e.__scopeMenu),d=f.useRef(null),{pointerGraceTimerRef:m,onPointerGraceIntentChange:p}=c,h={__scopeMenu:e.__scopeMenu},b=f.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return f.useEffect(()=>b,[b]),f.useEffect(()=>{const g=m.current;return()=>{window.clearTimeout(g),p(null)}},[m,p]),s.jsx(ag,{asChild:!0,...h,children:s.jsx(Mw,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":l.contentId,"data-state":Fw(a.open),...e,ref:gt(n,l.onTriggerChange),onClick:g=>{var y;(y=e.onClick)==null||y.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,dl(g=>{c.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!a.open&&!d.current&&(c.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{a.onOpenChange(!0),b()},100))})),onPointerLeave:Ce(e.onPointerLeave,dl(g=>{var w,j;b();const y=(w=a.content)==null?void 0:w.getBoundingClientRect();if(y){const S=(j=a.content)==null?void 0:j.dataset.side,E=S==="right",N=E?-5:5,k=y[E?"left":"right"],T=y[E?"right":"left"];c.onPointerGraceIntentChange({area:[{x:g.clientX+N,y:g.clientY},{x:k,y:y.top},{x:T,y:y.top},{x:T,y:y.bottom},{x:k,y:y.bottom}],side:S}),window.clearTimeout(m.current),m.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(g),g.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,g=>{var w;const y=c.searchRef.current!=="";e.disabled||y&&g.key===" "||z7[o.dir].includes(g.key)&&(a.onOpenChange(!0),(w=a.content)==null||w.focus(),g.preventDefault())})})})});Hw.displayName=Zi;var Vw="MenuSubContent",Gw=f.forwardRef((e,n)=>{const a=kw(Kn,e.__scopeMenu),{forceMount:o=a.forceMount,...l}=e,c=Oo(Kn,e.__scopeMenu),d=Al(Kn,e.__scopeMenu),m=Uw(Vw,e.__scopeMenu),p=f.useRef(null),h=Ve(n,p);return s.jsx(ul.Provider,{scope:e.__scopeMenu,children:s.jsx(sn,{present:o||c.open,children:s.jsx(ul.Slot,{scope:e.__scopeMenu,children:s.jsx(ig,{id:m.contentId,"aria-labelledby":m.triggerId,...l,ref:h,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:b=>{var g;d.isUsingKeyboardRef.current&&((g=p.current)==null||g.focus()),b.preventDefault()},onCloseAutoFocus:b=>b.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,b=>{b.target!==m.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,b=>{d.onClose(),b.preventDefault()}),onKeyDown:Ce(e.onKeyDown,b=>{var w;const g=b.currentTarget.contains(b.target),y=P7[d.dir].includes(b.key);g&&y&&(c.onOpenChange(!1),(w=m.trigger)==null||w.focus(),b.preventDefault())})})})})})});Gw.displayName=Vw;function Fw(e){return e?"open":"closed"}function $u(e){return e==="indeterminate"}function ug(e){return $u(e)?"indeterminate":e?"checked":"unchecked"}function rR(e){const n=document.activeElement;for(const a of e)if(a===n||(a.focus(),document.activeElement!==n))return}function aR(e,n){return e.map((a,o)=>e[(n+o)%e.length])}function oR(e,n,a){const l=n.length>1&&Array.from(n).every(h=>h===n[0])?n[0]:n,c=a?e.indexOf(a):-1;let d=aR(e,Math.max(c,0));l.length===1&&(d=d.filter(h=>h!==a));const p=d.find(h=>h.toLowerCase().startsWith(l.toLowerCase()));return p!==a?p:void 0}function sR(e,n){const{x:a,y:o}=e;let l=!1;for(let c=0,d=n.length-1;c<n.length;d=c++){const m=n[c],p=n[d],h=m.x,b=m.y,g=p.x,y=p.y;b>o!=y>o&&a<(g-h)*(o-b)/(y-b)+h&&(l=!l)}return l}function iR(e,n){if(!n)return!1;const a={x:e.clientX,y:e.clientY};return sR(a,n)}function dl(e){return n=>n.pointerType==="mouse"?e(n):void 0}var lR=Ew,cR=ag,uR=Tw,dR=Rw,fR=lg,mR=Aw,pR=bd,hR=_w,gR=Dw,xR=zw,vR=Iw,bR=$w,yR=Bw,wR=Hw,CR=Gw,yd="DropdownMenu",[SR]=Dk(yd,[jw]),un=jw(),[jR,Ww]=SR(yd),Yw=e=>{const{__scopeDropdownMenu:n,children:a,dir:o,open:l,defaultOpen:c,onOpenChange:d,modal:m=!0}=e,p=un(n),h=f.useRef(null),[b,g]=ea({prop:l,defaultProp:c??!1,onChange:d,caller:yd});return s.jsx(jR,{scope:n,triggerId:Yt(),triggerRef:h,contentId:Yt(),open:b,onOpenChange:g,onOpenToggle:f.useCallback(()=>g(y=>!y),[g]),modal:m,children:s.jsx(lR,{...p,open:b,onOpenChange:g,dir:o,modal:m,children:a})})};Yw.displayName=yd;var qw="DropdownMenuTrigger",Kw=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,disabled:o=!1,...l}=e,c=Ww(qw,a),d=un(a);return s.jsx(cR,{asChild:!0,...d,children:s.jsx(Wk.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...l,ref:gt(n,c.triggerRef),onPointerDown:Ce(e.onPointerDown,m=>{!o&&m.button===0&&m.ctrlKey===!1&&(c.onOpenToggle(),c.open||m.preventDefault())}),onKeyDown:Ce(e.onKeyDown,m=>{o||(["Enter"," "].includes(m.key)&&c.onOpenToggle(),m.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})});Kw.displayName=qw;var NR="DropdownMenuPortal",Xw=e=>{const{__scopeDropdownMenu:n,...a}=e,o=un(n);return s.jsx(uR,{...o,...a})};Xw.displayName=NR;var Zw="DropdownMenuContent",Qw=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=Ww(Zw,a),c=un(a),d=f.useRef(!1);return s.jsx(dR,{id:l.contentId,"aria-labelledby":l.triggerId,...c,...o,ref:n,onCloseAutoFocus:Ce(e.onCloseAutoFocus,m=>{var p;d.current||(p=l.triggerRef.current)==null||p.focus(),d.current=!1,m.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,m=>{const p=m.detail.originalEvent,h=p.button===0&&p.ctrlKey===!0,b=p.button===2||h;(!l.modal||b)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Qw.displayName=Zw;var ER="DropdownMenuGroup",kR=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(fR,{...l,...o,ref:n})});kR.displayName=ER;var TR="DropdownMenuLabel",Jw=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(mR,{...l,...o,ref:n})});Jw.displayName=TR;var RR="DropdownMenuItem",eC=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(pR,{...l,...o,ref:n})});eC.displayName=RR;var AR="DropdownMenuCheckboxItem",tC=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(hR,{...l,...o,ref:n})});tC.displayName=AR;var MR="DropdownMenuRadioGroup",_R=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(gR,{...l,...o,ref:n})});_R.displayName=MR;var OR="DropdownMenuRadioItem",nC=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(xR,{...l,...o,ref:n})});nC.displayName=OR;var DR="DropdownMenuItemIndicator",rC=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(vR,{...l,...o,ref:n})});rC.displayName=DR;var LR="DropdownMenuSeparator",aC=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(bR,{...l,...o,ref:n})});aC.displayName=LR;var zR="DropdownMenuArrow",PR=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(yR,{...l,...o,ref:n})});PR.displayName=zR;var IR="DropdownMenuSubTrigger",oC=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(wR,{...l,...o,ref:n})});oC.displayName=IR;var $R="DropdownMenuSubContent",sC=f.forwardRef((e,n)=>{const{__scopeDropdownMenu:a,...o}=e,l=un(a);return s.jsx(CR,{...l,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sC.displayName=$R;var BR=Yw,UR=Kw,HR=Xw,iC=Qw,lC=Jw,cC=eC,uC=tC,dC=nC,fC=rC,mC=aC,pC=oC,hC=sC;/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gC=(...e)=>e.filter((n,a,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===a).join(" ").trim();/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,o)=>o?o.toUpperCase():a.toLowerCase());/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hy=e=>{const n=GR(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Cp={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"};/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FR=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},WR=f.createContext({}),YR=()=>f.useContext(WR),qR=f.forwardRef(({color:e,size:n,strokeWidth:a,absoluteStrokeWidth:o,className:l="",children:c,iconNode:d,...m},p)=>{const{size:h=24,strokeWidth:b=2,absoluteStrokeWidth:g=!1,color:y="currentColor",className:w=""}=YR()??{},j=o??g?Number(a??b)*24/Number(n??h):a??b;return f.createElement("svg",{ref:p,...Cp,width:n??h??Cp.width,height:n??h??Cp.height,stroke:e??y,strokeWidth:j,className:gC("lucide",w,l),...!c&&!FR(m)&&{"aria-hidden":"true"},...m},[...d.map(([S,E])=>f.createElement(S,E)),...Array.isArray(c)?c:[c]])});/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aa=(e,n)=>{const a=f.forwardRef(({className:o,...l},c)=>f.createElement(qR,{ref:c,iconNode:n,className:gC(`lucide-${VR(Hy(e))}`,`lucide-${e}`,o),...l}));return a.displayName=Hy(e),a};/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xC=aa("check",KR);/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const XR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vC=aa("chevron-down",XR);/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ZR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],QR=aa("chevron-right",ZR);/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const JR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],eA=aa("chevron-up",JR);/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Vy=aa("circle-check",tA);/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],rA=aa("circle",nA);/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],oA=aa("panel-left",aA);/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],iA=aa("search",sA);/**
* @license lucide-react v1.16.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bC=aa("x",lA),dg=BR,fg=UR,cA=f.forwardRef(({className:e,inset:n,children:a,...o},l)=>s.jsxs(pC,{ref:l,className:fe("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[a,s.jsx(QR,{className:"ml-auto"})]}));cA.displayName=pC.displayName;const uA=f.forwardRef(({className:e,...n},a)=>s.jsx(hC,{ref:a,className:fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n}));uA.displayName=hC.displayName;const wd=f.forwardRef(({className:e,sideOffset:n=4,...a},o)=>s.jsx(HR,{children:s.jsx(iC,{ref:o,sideOffset:n,className:fe("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...a})}));wd.displayName=iC.displayName;const fl=f.forwardRef(({className:e,inset:n,...a},o)=>s.jsx(cC,{ref:o,className:fe("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...a}));fl.displayName=cC.displayName;const dA=f.forwardRef(({className:e,children:n,checked:a,...o},l)=>s.jsxs(uC,{ref:l,className:fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(fC,{children:s.jsx(xC,{className:"h-4 w-4"})})}),n]}));dA.displayName=uC.displayName;const fA=f.forwardRef(({className:e,children:n,...a},o)=>s.jsxs(dC,{ref:o,className:fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(fC,{children:s.jsx(rA,{className:"h-2 w-2 fill-current"})})}),n]}));fA.displayName=dC.displayName;const mg=f.forwardRef(({className:e,inset:n,...a},o)=>s.jsx(lC,{ref:o,className:fe("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...a}));mg.displayName=lC.displayName;const ml=f.forwardRef(({className:e,...n},a)=>s.jsx(mC,{ref:a,className:fe("-mx-1 my-1 h-px bg-muted",e),...n}));ml.displayName=mC.displayName;const Sp=768;function mA(){const[e,n]=f.useState(void 0);return f.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Sp-1}px)`),o=()=>{n(window.innerWidth<Sp)};return a.addEventListener("change",o),n(window.innerWidth<Sp),()=>a.removeEventListener("change",o)},[]),!!e}const Ie=f.forwardRef(({className:e,type:n,...a},o)=>s.jsx("input",{type:n,className:fe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...a}));Ie.displayName="Input";var pA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zn=pA.reduce((e,n)=>{const a=_2(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),hA="Separator",Gy="horizontal",gA=["horizontal","vertical"],yC=f.forwardRef((e,n)=>{const{decorative:a,orientation:o=Gy,...l}=e,c=xA(o)?o:Gy,m=a?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};return s.jsx(zn.div,{"data-orientation":c,...m,...l,ref:n})});yC.displayName=hA;function xA(e){return gA.includes(e)}var wC=yC;const CC=f.forwardRef(({className:e,orientation:n="horizontal",decorative:a=!0,...o},l)=>s.jsx(wC,{ref:l,decorative:a,orientation:n,className:fe("shrink-0 bg-border",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));CC.displayName=wC.displayName;function vA(e,n){const a=f.createContext(n),o=c=>{const{children:d,...m}=c,p=f.useMemo(()=>m,Object.values(m));return s.jsx(a.Provider,{value:p,children:d})};o.displayName=e+"Provider";function l(c){const d=f.useContext(a);if(d)return d;if(n!==void 0)return n;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[o,l]}function bA(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,yA(l,...n)]}function yA(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function SC(e){const n=wA(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(SA);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function wA(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=NA(l),m=jA(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var CA=Symbol("radix.slottable");function SA(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CA}function jA(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function NA(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var EA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ml=EA.reduce((e,n)=>{const a=SC(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),Cd="Dialog",[jC]=bA(Cd),[kA,ur]=jC(Cd),NC=e=>{const{__scopeDialog:n,children:a,open:o,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,m=f.useRef(null),p=f.useRef(null),[h,b]=ea({prop:o,defaultProp:l??!1,onChange:c,caller:Cd});return s.jsx(kA,{scope:n,triggerRef:m,contentRef:p,contentId:Yt(),titleId:Yt(),descriptionId:Yt(),open:h,onOpenChange:b,onOpenToggle:f.useCallback(()=>b(g=>!g),[b]),modal:d,children:a})};NC.displayName=Cd;var EC="DialogTrigger",kC=f.forwardRef((e,n)=>{const{__scopeDialog:a,...o}=e,l=ur(EC,a),c=Ve(n,l.triggerRef);return s.jsx(Ml.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":gg(l.open),...o,ref:c,onClick:Ce(e.onClick,l.onOpenToggle)})});kC.displayName=EC;var pg="DialogPortal",[TA,TC]=jC(pg,{forceMount:void 0}),RC=e=>{const{__scopeDialog:n,forceMount:a,children:o,container:l}=e,c=ur(pg,n);return s.jsx(TA,{scope:n,forceMount:a,children:f.Children.map(o,d=>s.jsx(sn,{present:a||c.open,children:s.jsx(Ys,{asChild:!0,container:l,children:d})}))})};RC.displayName=pg;var Bu="DialogOverlay",AC=f.forwardRef((e,n)=>{const a=TC(Bu,e.__scopeDialog),{forceMount:o=a.forceMount,...l}=e,c=ur(Bu,e.__scopeDialog);return c.modal?s.jsx(sn,{present:o||c.open,children:s.jsx(AA,{...l,ref:n})}):null});AC.displayName=Bu;var RA=SC("DialogOverlay.RemoveScroll"),AA=f.forwardRef((e,n)=>{const{__scopeDialog:a,...o}=e,l=ur(Bu,a);return s.jsx(Tl,{as:RA,allowPinchZoom:!0,shards:[l.contentRef],children:s.jsx(Ml.div,{"data-state":gg(l.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),yo="DialogContent",MC=f.forwardRef((e,n)=>{const a=TC(yo,e.__scopeDialog),{forceMount:o=a.forceMount,...l}=e,c=ur(yo,e.__scopeDialog);return s.jsx(sn,{present:o||c.open,children:c.modal?s.jsx(MA,{...l,ref:n}):s.jsx(_A,{...l,ref:n})})});MC.displayName=yo;var MA=f.forwardRef((e,n)=>{const a=ur(yo,e.__scopeDialog),o=f.useRef(null),l=Ve(n,a.contentRef,o);return f.useEffect(()=>{const c=o.current;if(c)return gd(c)},[]),s.jsx(_C,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,c=>{var d;c.preventDefault(),(d=a.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&c.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,c=>c.preventDefault())})}),_A=f.forwardRef((e,n)=>{const a=ur(yo,e.__scopeDialog),o=f.useRef(!1),l=f.useRef(!1);return s.jsx(_C,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var d,m;(d=e.onCloseAutoFocus)==null||d.call(e,c),c.defaultPrevented||(o.current||(m=a.triggerRef.current)==null||m.focus(),c.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:c=>{var p,h;(p=e.onInteractOutside)==null||p.call(e,c),c.defaultPrevented||(o.current=!0,c.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=c.target;((h=a.triggerRef.current)==null?void 0:h.contains(d))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&l.current&&c.preventDefault()}})}),_C=f.forwardRef((e,n)=>{const{__scopeDialog:a,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:c,...d}=e,m=ur(yo,a),p=f.useRef(null),h=Ve(n,p);return id(),s.jsxs(s.Fragment,{children:[s.jsx(Sl,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:c,children:s.jsx(Gs,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":gg(m.open),...d,ref:h,onDismiss:()=>m.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(OA,{titleId:m.titleId}),s.jsx(LA,{contentRef:p,descriptionId:m.descriptionId})]})]})}),hg="DialogTitle",OC=f.forwardRef((e,n)=>{const{__scopeDialog:a,...o}=e,l=ur(hg,a);return s.jsx(Ml.h2,{id:l.titleId,...o,ref:n})});OC.displayName=hg;var DC="DialogDescription",LC=f.forwardRef((e,n)=>{const{__scopeDialog:a,...o}=e,l=ur(DC,a);return s.jsx(Ml.p,{id:l.descriptionId,...o,ref:n})});LC.displayName=DC;var zC="DialogClose",PC=f.forwardRef((e,n)=>{const{__scopeDialog:a,...o}=e,l=ur(zC,a);return s.jsx(Ml.button,{type:"button",...o,ref:n,onClick:Ce(e.onClick,()=>l.onOpenChange(!1))})});PC.displayName=zC;function gg(e){return e?"open":"closed"}var IC="DialogTitleWarning",[FB,$C]=vA(IC,{contentName:yo,titleName:hg,docsSlug:"dialog"}),OA=({titleId:e})=>{const n=$C(IC),a=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},DA="DialogDescriptionWarning",LA=({contentRef:e,descriptionId:n})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$C(DA).contentName}}.`;return f.useEffect(()=>{var c;const l=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");n&&l&&(document.getElementById(n)||console.warn(o))},[o,e,n]),null},xg=NC,zA=kC,vg=RC,_l=AC,Ol=MC,Sd=OC,jd=LC,BC=PC;const UC=xg,PA=vg,HC=f.forwardRef(({className:e,...n},a)=>s.jsx(_l,{className:fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:a}));HC.displayName=_l.displayName;const IA=Vs("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),bg=f.forwardRef(({side:e="right",className:n,children:a,...o},l)=>s.jsxs(PA,{children:[s.jsx(HC,{}),s.jsxs(Ol,{ref:l,className:fe(IA({side:e}),n),...o,children:[s.jsxs(BC,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(bC,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));bg.displayName=Ol.displayName;const yg=({className:e,...n})=>s.jsx("div",{className:fe("flex flex-col space-y-2 text-center sm:text-left",e),...n});yg.displayName="SheetHeader";const wg=f.forwardRef(({className:e,...n},a)=>s.jsx(Sd,{ref:a,className:fe("text-lg font-semibold text-foreground",e),...n}));wg.displayName=Sd.displayName;const Cg=f.forwardRef(({className:e,...n},a)=>s.jsx(jd,{ref:a,className:fe("text-sm text-muted-foreground",e),...n}));Cg.displayName=jd.displayName;function Be({className:e,...n}){return s.jsx("div",{className:fe("animate-pulse rounded-md bg-primary/10",e),...n})}function $A(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,BA(l,...n)]}function BA(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function UA(e){const n=HA(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(GA);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function HA(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=WA(l),m=FA(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var VC=Symbol("radix.slottable");function VA(e){const n=({children:a})=>s.jsx(s.Fragment,{children:a});return n.displayName=`${e}.Slottable`,n.__radixId=VC,n}function GA(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VC}function FA(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function WA(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var YA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qA=YA.reduce((e,n)=>{const a=UA(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function KA(e){const n=XA(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(QA);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function XA(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=eM(l),m=JA(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var ZA=Symbol("radix.slottable");function QA(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZA}function JA(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function eM(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var tM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nM=tM.reduce((e,n)=>{const a=KA(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),GC=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"}),rM="VisuallyHidden",FC=f.forwardRef((e,n)=>s.jsx(nM.span,{...e,ref:n,style:{...GC,...e.style}}));FC.displayName=rM;var aM=FC,[Nd]=$A("Tooltip",[Va]),Ed=Va(),WC="TooltipProvider",oM=700,th="tooltip.open",[sM,Sg]=Nd(WC),YC=e=>{const{__scopeTooltip:n,delayDuration:a=oM,skipDelayDuration:o=300,disableHoverableContent:l=!1,children:c}=e,d=f.useRef(!0),m=f.useRef(!1),p=f.useRef(0);return f.useEffect(()=>{const h=p.current;return()=>window.clearTimeout(h)},[]),s.jsx(sM,{scope:n,isOpenDelayedRef:d,delayDuration:a,onOpen:f.useCallback(()=>{window.clearTimeout(p.current),d.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>d.current=!0,o)},[o]),isPointerInTransitRef:m,onPointerInTransitChange:f.useCallback(h=>{m.current=h},[]),disableHoverableContent:l,children:c})};YC.displayName=WC;var pl="Tooltip",[iM,Dl]=Nd(pl),qC=e=>{const{__scopeTooltip:n,children:a,open:o,defaultOpen:l,onOpenChange:c,disableHoverableContent:d,delayDuration:m}=e,p=Sg(pl,e.__scopeTooltip),h=Ed(n),[b,g]=f.useState(null),y=Yt(),w=f.useRef(0),j=d??p.disableHoverableContent,S=m??p.delayDuration,E=f.useRef(!1),[N,k]=ea({prop:o,defaultProp:l??!1,onChange:z=>{z?(p.onOpen(),document.dispatchEvent(new CustomEvent(th))):p.onClose(),c==null||c(z)},caller:pl}),T=f.useMemo(()=>N?E.current?"delayed-open":"instant-open":"closed",[N]),A=f.useCallback(()=>{window.clearTimeout(w.current),w.current=0,E.current=!1,k(!0)},[k]),O=f.useCallback(()=>{window.clearTimeout(w.current),w.current=0,k(!1)},[k]),M=f.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{E.current=!0,k(!0),w.current=0},S)},[S,k]);return f.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),s.jsx(fd,{...h,children:s.jsx(iM,{scope:n,contentId:y,open:N,stateAttribute:T,trigger:b,onTriggerChange:g,onTriggerEnter:f.useCallback(()=>{p.isOpenDelayedRef.current?M():A()},[p.isOpenDelayedRef,M,A]),onTriggerLeave:f.useCallback(()=>{j?O():(window.clearTimeout(w.current),w.current=0)},[O,j]),onOpen:A,onClose:O,disableHoverableContent:j,children:a})})};qC.displayName=pl;var nh="TooltipTrigger",KC=f.forwardRef((e,n)=>{const{__scopeTooltip:a,...o}=e,l=Dl(nh,a),c=Sg(nh,a),d=Ed(a),m=f.useRef(null),p=Ve(n,m,l.onTriggerChange),h=f.useRef(!1),b=f.useRef(!1),g=f.useCallback(()=>h.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),s.jsx(Nl,{asChild:!0,...d,children:s.jsx(qA.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...o,ref:p,onPointerMove:Ce(e.onPointerMove,y=>{y.pointerType!=="touch"&&!b.current&&!c.isPointerInTransitRef.current&&(l.onTriggerEnter(),b.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{l.onTriggerLeave(),b.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{l.open&&l.onClose(),h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ce(e.onFocus,()=>{h.current||l.onOpen()}),onBlur:Ce(e.onBlur,l.onClose),onClick:Ce(e.onClick,l.onClose)})})});KC.displayName=nh;var jg="TooltipPortal",[lM,cM]=Nd(jg,{forceMount:void 0}),XC=e=>{const{__scopeTooltip:n,forceMount:a,children:o,container:l}=e,c=Dl(jg,n);return s.jsx(lM,{scope:n,forceMount:a,children:s.jsx(sn,{present:a||c.open,children:s.jsx(Ys,{asChild:!0,container:l,children:o})})})};XC.displayName=jg;var Ls="TooltipContent",ZC=f.forwardRef((e,n)=>{const a=cM(Ls,e.__scopeTooltip),{forceMount:o=a.forceMount,side:l="top",...c}=e,d=Dl(Ls,e.__scopeTooltip);return s.jsx(sn,{present:o||d.open,children:d.disableHoverableContent?s.jsx(QC,{side:l,...c,ref:n}):s.jsx(uM,{side:l,...c,ref:n})})}),uM=f.forwardRef((e,n)=>{const a=Dl(Ls,e.__scopeTooltip),o=Sg(Ls,e.__scopeTooltip),l=f.useRef(null),c=Ve(n,l),[d,m]=f.useState(null),{trigger:p,onClose:h}=a,b=l.current,{onPointerInTransitChange:g}=o,y=f.useCallback(()=>{m(null),g(!1)},[g]),w=f.useCallback((j,S)=>{const E=j.currentTarget,N={x:j.clientX,y:j.clientY},k=hM(N,E.getBoundingClientRect()),T=gM(N,k),A=xM(S.getBoundingClientRect()),O=bM([...T,...A]);m(O),g(!0)},[g]);return f.useEffect(()=>()=>y(),[y]),f.useEffect(()=>{if(p&&b){const j=E=>w(E,b),S=E=>w(E,p);return p.addEventListener("pointerleave",j),b.addEventListener("pointerleave",S),()=>{p.removeEventListener("pointerleave",j),b.removeEventListener("pointerleave",S)}}},[p,b,w,y]),f.useEffect(()=>{if(d){const j=S=>{const E=S.target,N={x:S.clientX,y:S.clientY},k=(p==null?void 0:p.contains(E))||(b==null?void 0:b.contains(E)),T=!vM(N,d);k?y():T&&(y(),h())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[p,b,d,h,y]),s.jsx(QC,{...e,ref:c})}),[dM,fM]=Nd(pl,{isInside:!1}),mM=VA("TooltipContent"),QC=f.forwardRef((e,n)=>{const{__scopeTooltip:a,children:o,"aria-label":l,onEscapeKeyDown:c,onPointerDownOutside:d,...m}=e,p=Dl(Ls,a),h=Ed(a),{onClose:b}=p;return f.useEffect(()=>(document.addEventListener(th,b),()=>document.removeEventListener(th,b)),[b]),f.useEffect(()=>{if(p.trigger){const g=y=>{const w=y.target;w!=null&&w.contains(p.trigger)&&b()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[p.trigger,b]),s.jsx(Gs,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:g=>g.preventDefault(),onDismiss:b,children:s.jsxs(md,{"data-state":p.stateAttribute,...h,...m,ref:n,style:{...m.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(mM,{children:o}),s.jsx(dM,{scope:a,isInside:!0,children:s.jsx(aM,{id:p.contentId,role:"tooltip",children:l||o})})]})})});ZC.displayName=Ls;var JC="TooltipArrow",pM=f.forwardRef((e,n)=>{const{__scopeTooltip:a,...o}=e,l=Ed(a);return fM(JC,a).isInside?null:s.jsx(pd,{...l,...o,ref:n})});pM.displayName=JC;function hM(e,n){const a=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),l=Math.abs(n.right-e.x),c=Math.abs(n.left-e.x);switch(Math.min(a,o,l,c)){case c:return"left";case l:return"right";case a:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function gM(e,n,a=5){const o=[];switch(n){case"top":o.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":o.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":o.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":o.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return o}function xM(e){const{top:n,right:a,bottom:o,left:l}=e;return[{x:l,y:n},{x:a,y:n},{x:a,y:o},{x:l,y:o}]}function vM(e,n){const{x:a,y:o}=e;let l=!1;for(let c=0,d=n.length-1;c<n.length;d=c++){const m=n[c],p=n[d],h=m.x,b=m.y,g=p.x,y=p.y;b>o!=y>o&&a<(g-h)*(o-b)/(y-b)+h&&(l=!l)}return l}function bM(e){const n=e.slice();return n.sort((a,o)=>a.x<o.x?-1:a.x>o.x?1:a.y<o.y?-1:a.y>o.y?1:0),yM(n)}function yM(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o<e.length;o++){const l=e[o];for(;n.length>=2;){const c=n[n.length-1],d=n[n.length-2];if((c.x-d.x)*(l.y-d.y)>=(c.y-d.y)*(l.x-d.x))n.pop();else break}n.push(l)}n.pop();const a=[];for(let o=e.length-1;o>=0;o--){const l=e[o];for(;a.length>=2;){const c=a[a.length-1],d=a[a.length-2];if((c.x-d.x)*(l.y-d.y)>=(c.y-d.y)*(l.x-d.x))a.pop();else break}a.push(l)}return a.pop(),n.length===1&&a.length===1&&n[0].x===a[0].x&&n[0].y===a[0].y?n:n.concat(a)}var wM=YC,CM=qC,SM=KC,jM=XC,eS=ZC;const tS=wM,NM=CM,EM=SM,nS=f.forwardRef(({className:e,sideOffset:n=4,...a},o)=>s.jsx(jM,{children:s.jsx(eS,{ref:o,sideOffset:n,className:fe("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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 origin-[--radix-tooltip-content-transform-origin]",e),...a})}));nS.displayName=eS.displayName;const kM="sidebar_state",TM=3600*24*7,RM="16rem",AM="18rem",MM="3rem",_M="b",rS=f.createContext(null);function kd(){const e=f.useContext(rS);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const aS=f.forwardRef(({defaultOpen:e=!0,open:n,onOpenChange:a,className:o,style:l,children:c,...d},m)=>{const p=mA(),[h,b]=f.useState(!1),[g,y]=f.useState(e),w=n??g,j=f.useCallback(k=>{const T=typeof k=="function"?k(w):k;a?a(T):y(T),document.cookie=`${kM}=${T}; path=/; max-age=${TM}`},[a,w]),S=f.useCallback(()=>p?b(k=>!k):j(k=>!k),[p,j,b]);f.useEffect(()=>{const k=T=>{T.key===_M&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),S())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[S]);const E=w?"expanded":"collapsed",N=f.useMemo(()=>({state:E,open:w,setOpen:j,isMobile:p,openMobile:h,setOpenMobile:b,toggleSidebar:S}),[E,w,j,p,h,b,S]);return s.jsx(rS.Provider,{value:N,children:s.jsx(tS,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":RM,"--sidebar-width-icon":MM,...l},className:fe("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:m,...d,children:c})})})});aS.displayName="SidebarProvider";const oS=f.forwardRef(({side:e="left",variant:n="sidebar",collapsible:a="offcanvas",className:o,children:l,...c},d)=>{const{isMobile:m,state:p,openMobile:h,setOpenMobile:b}=kd();return a==="none"?s.jsx("div",{className:fe("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:d,...c,children:l}):m?s.jsx(UC,{open:h,onOpenChange:b,...c,children:s.jsxs(bg,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":AM},side:e,children:[s.jsxs(yg,{className:"sr-only",children:[s.jsx(wg,{children:"Sidebar"}),s.jsx(Cg,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:l})]})}):s.jsxs("div",{ref:d,className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":p==="collapsed"?a:"","data-variant":n,"data-side":e,children:[s.jsx("div",{className:fe("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:fe("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...c,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:l})})]})});oS.displayName="Sidebar";const sS=f.forwardRef(({className:e,onClick:n,...a},o)=>{const{toggleSidebar:l}=kd();return s.jsxs(he,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:fe("h-7 w-7",e),onClick:c=>{n==null||n(c),l()},...a,children:[s.jsx(oA,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});sS.displayName="SidebarTrigger";const iS=f.forwardRef(({className:e,...n},a)=>{const{toggleSidebar:o}=kd();return s.jsx("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:fe("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...n})});iS.displayName="SidebarRail";const lS=f.forwardRef(({className:e,...n},a)=>s.jsx("main",{ref:a,className:fe("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...n}));lS.displayName="SidebarInset";const OM=f.forwardRef(({className:e,...n},a)=>s.jsx(Ie,{ref:a,"data-sidebar":"input",className:fe("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...n}));OM.displayName="SidebarInput";const cS=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"header",className:fe("flex flex-col gap-2 p-2",e),...n}));cS.displayName="SidebarHeader";const DM=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"footer",className:fe("flex flex-col gap-2 p-2",e),...n}));DM.displayName="SidebarFooter";const LM=f.forwardRef(({className:e,...n},a)=>s.jsx(CC,{ref:a,"data-sidebar":"separator",className:fe("mx-2 w-auto bg-sidebar-border",e),...n}));LM.displayName="SidebarSeparator";const uS=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"content",className:fe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n}));uS.displayName="SidebarContent";const rh=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"group",className:fe("relative flex w-full min-w-0 flex-col p-2",e),...n}));rh.displayName="SidebarGroup";const dS=f.forwardRef(({className:e,asChild:n=!1,...a},o)=>{const l=n?Hs:"div";return s.jsx(l,{ref:o,"data-sidebar":"group-label",className:fe("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a})});dS.displayName="SidebarGroupLabel";const zM=f.forwardRef(({className:e,asChild:n=!1,...a},o)=>{const l=n?Hs:"button";return s.jsx(l,{ref:o,"data-sidebar":"group-action",className:fe("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...a})});zM.displayName="SidebarGroupAction";const ah=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"group-content",className:fe("w-full text-sm",e),...n}));ah.displayName="SidebarGroupContent";const oh=f.forwardRef(({className:e,...n},a)=>s.jsx("ul",{ref:a,"data-sidebar":"menu",className:fe("flex w-full min-w-0 flex-col gap-1",e),...n}));oh.displayName="SidebarMenu";const sh=f.forwardRef(({className:e,...n},a)=>s.jsx("li",{ref:a,"data-sidebar":"menu-item",className:fe("group/menu-item relative",e),...n}));sh.displayName="SidebarMenuItem";const PM=Vs("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),ih=f.forwardRef(({asChild:e=!1,isActive:n=!1,variant:a="default",size:o="default",tooltip:l,className:c,...d},m)=>{const p=e?Hs:"button",{isMobile:h,state:b}=kd(),g=s.jsx(p,{ref:m,"data-sidebar":"menu-button","data-size":o,"data-active":n,className:fe(PM({variant:a,size:o}),c),...d});return l?(typeof l=="string"&&(l={children:l}),s.jsxs(NM,{children:[s.jsx(EM,{asChild:!0,children:g}),s.jsx(nS,{side:"right",align:"center",hidden:b!=="collapsed"||h,...l})]})):g});ih.displayName="SidebarMenuButton";const IM=f.forwardRef(({className:e,asChild:n=!1,showOnHover:a=!1,...o},l)=>{const c=n?Hs:"button";return s.jsx(c,{ref:l,"data-sidebar":"menu-action",className:fe("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...o})});IM.displayName="SidebarMenuAction";const $M=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"menu-badge",className:fe("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...n}));$M.displayName="SidebarMenuBadge";const BM=f.forwardRef(({className:e,showIcon:n=!1,...a},o)=>{const l=f.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:o,"data-sidebar":"menu-skeleton",className:fe("flex h-8 items-center gap-2 rounded-md px-2",e),...a,children:[n&&s.jsx(Be,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(Be,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":l}})]})});BM.displayName="SidebarMenuSkeleton";const UM=f.forwardRef(({className:e,...n},a)=>s.jsx("ul",{ref:a,"data-sidebar":"menu-sub",className:fe("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...n}));UM.displayName="SidebarMenuSub";const HM=f.forwardRef(({...e},n)=>s.jsx("li",{ref:n,...e}));HM.displayName="SidebarMenuSubItem";const VM=f.forwardRef(({asChild:e=!1,size:n="md",isActive:a,className:o,...l},c)=>{const d=e?Hs:"a";return s.jsx(d,{ref:c,"data-sidebar":"menu-sub-button","data-size":n,"data-active":a,className:fe("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...l})});VM.displayName="SidebarMenuSubButton";const GM=[],FM=[{label:"Overview",items:[{title:"Dashboard",url:"/",icon:n2,end:!0,permission:"overview"},{title:"Console",url:"/logs",icon:e2,permission:"logs"}]},{label:"Access & Logs",items:[{title:"Users",url:"/users",icon:Fp,permission:"users.view"},{title:"Groups",url:"/groups",icon:bu,permission:"users.view"},{title:"Tickets",url:"/tickets",icon:ll,permission:"overview"},{title:"Transcripts",url:"/transcripts",icon:il,permission:"transcripts"}]},{label:"Configuration",items:[{title:"Bot Settings",url:"/configs?file=supportbot",icon:Hh},{title:"Ticket Panel",url:"/configs?file=ticket-panel",icon:ll},{title:"AI Assistant",url:"/configs?file=supportbot-ai",icon:$h},{title:"Messages",url:"/configs?file=messages",icon:Vh},{title:"Staff Roles",url:"/configs?file=supportbot&tab=Roles",icon:Fp},{title:"Commands",url:"/configs?file=commands",icon:Da}]},{label:"System",items:[{title:"Addons",url:"/addons",icon:Gh,permission:"settings.view"},{title:"Addon Builder",url:"/addons/builder",icon:Da,permission:"settings.update"},{title:"Dashboard Settings",url:"/settings",icon:vo,permission:"settings.view"}]}];function Fy(e){return new URL(e,"http://x").searchParams.get("file")}function WM(){const{branding:e}=od(),{permissions:n}=Ut(),{stats:a}=sd(),{files:o}=f2(),[l]=Ju(),c=l.get("file"),d=Mu(n,"supportbot")&&o.length>0?{label:"Addons",items:o.map(g=>({title:m2(g),url:`/configs?file=${el(g)}`,icon:Gh,end:!1}))}:null,m=GM.filter(g=>!g.permission||qn(n,g.permission)),p=FM.map(g=>({...g,items:g.items.filter(y=>{if(y.permission)return qn(n,y.permission);const w=Fy(y.url);return w&&y.url.includes("/configs")?Mu(n,w):!0})})).filter(g=>g.items.length>0),h=d?[...p,d]:p,b=a?`${a.servers} server${a.servers===1?"":"s"}`:"Your server";return s.jsxs(oS,{collapsible:"icon",className:"border-r border-sidebar-border",children:[s.jsxs(cS,{className:"gap-3 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 px-1",children:[e.hasFavicon&&e.faviconUrl?s.jsx("img",{src:`${e.faviconUrl}${e.updatedAt?`?v=${e.updatedAt}`:""}`,alt:"",className:"size-7 shrink-0 rounded-md object-contain"}):null,s.jsx("span",{className:"truncate text-lg font-bold tracking-tight",children:e.title})]}),s.jsxs(dg,{children:[s.jsx(fg,{asChild:!0,children:s.jsxs(he,{variant:"outline",className:"h-10 w-full justify-between border-border bg-secondary/40 px-3 font-normal hover:bg-secondary/60",children:[s.jsxs("span",{className:"flex items-center gap-2 truncate",children:[s.jsx(ge,{icon:Au,size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"truncate",children:b})]}),s.jsx(ge,{icon:Q0,size:16,className:"text-muted-foreground"})]})}),s.jsxs(wd,{className:"w-[--radix-dropdown-menu-trigger-width]",children:[s.jsx(fl,{disabled:!0,children:"Connected via API"}),a?s.jsxs(fl,{disabled:!0,children:[a.users.toLocaleString()," members tracked"]}):null]})]})]}),s.jsxs(uS,{className:"px-2",children:[s.jsx(rh,{children:s.jsx(ah,{children:s.jsx(oh,{children:m.map(g=>s.jsx(sh,{children:s.jsx(ih,{asChild:!0,tooltip:g.title,children:s.jsxs(Gp,{to:g.url,end:g.end,className:({isActive:y})=>fe(y&&"bg-sidebar-accent font-medium"),children:[s.jsx(ge,{icon:g.icon,size:18}),s.jsx("span",{children:g.title})]})})},g.title))})})}),h.map(g=>s.jsxs(rh,{children:[s.jsx(dS,{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/80",children:g.label}),s.jsx(ah,{children:s.jsx(oh,{children:g.items.map(y=>{const w=Fy(y.url),j=!!w&&c===w&&y.url.includes("/configs");return s.jsx(sh,{children:s.jsx(ih,{asChild:!0,tooltip:y.title,children:s.jsxs(Gp,{to:y.url,end:y.end,className:({isActive:S})=>fe((S||j)&&"bg-sidebar-accent font-medium"),children:[s.jsx(ge,{icon:y.icon,size:18}),s.jsx("span",{children:y.title})]})})},`${g.label}-${y.title}`)})})})]},g.label))]}),s.jsx(iS,{})]})}var Wy=1,YM=.9,qM=.8,KM=.17,jp=.1,Np=.999,XM=.9999,ZM=.99,QM=/[\\\/_+.#"@\[\(\{&]/,JM=/[\\\/_+.#"@\[\(\{&]/g,e_=/[\s-]/,fS=/[\s-]/g;function lh(e,n,a,o,l,c,d){if(c===n.length)return l===e.length?Wy:ZM;var m=`${l},${c}`;if(d[m]!==void 0)return d[m];for(var p=o.charAt(c),h=a.indexOf(p,l),b=0,g,y,w,j;h>=0;)g=lh(e,n,a,o,h+1,c+1,d),g>b&&(h===l?g*=Wy:QM.test(e.charAt(h-1))?(g*=qM,w=e.slice(l,h-1).match(JM),w&&l>0&&(g*=Math.pow(Np,w.length))):e_.test(e.charAt(h-1))?(g*=YM,j=e.slice(l,h-1).match(fS),j&&l>0&&(g*=Math.pow(Np,j.length))):(g*=KM,l>0&&(g*=Math.pow(Np,h-l))),e.charAt(h)!==n.charAt(c)&&(g*=XM)),(g<jp&&a.charAt(h-1)===o.charAt(c+1)||o.charAt(c+1)===o.charAt(c)&&a.charAt(h-1)!==o.charAt(c))&&(y=lh(e,n,a,o,h+1,c+2,d),y*jp>g&&(g=y*jp)),g>b&&(b=g),h=a.indexOf(p,h+1);return d[m]=b,b}function Yy(e){return e.toLowerCase().replace(fS," ")}function t_(e,n,a){return e=a&&a.length>0?`${e+" "+a.join(" ")}`:e,lh(e,n,Yy(e),Yy(n),0,0,{})}var Ki='[cmdk-group=""]',Ep='[cmdk-group-items=""]',n_='[cmdk-group-heading=""]',mS='[cmdk-item=""]',qy=`${mS}:not([aria-disabled="true"])`,ch="cmdk-item-select",Es="data-value",r_=(e,n,a)=>t_(e,n,a),pS=f.createContext(void 0),Ll=()=>f.useContext(pS),hS=f.createContext(void 0),Ng=()=>f.useContext(hS),gS=f.createContext(void 0),xS=f.forwardRef((e,n)=>{let a=ks(()=>{var D,G;return{search:"",value:(G=(D=e.value)!=null?D:e.defaultValue)!=null?G:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=ks(()=>new Set),l=ks(()=>new Map),c=ks(()=>new Map),d=ks(()=>new Set),m=vS(e),{label:p,children:h,value:b,onValueChange:g,filter:y,shouldFilter:w,loop:j,disablePointerSelection:S=!1,vimBindings:E=!0,...N}=e,k=Yt(),T=Yt(),A=Yt(),O=f.useRef(null),M=p_();wo(()=>{if(b!==void 0){let D=b.trim();a.current.value=D,z.emit()}},[b]),wo(()=>{M(6,pe)},[]);let z=f.useMemo(()=>({subscribe:D=>(d.current.add(D),()=>d.current.delete(D)),snapshot:()=>a.current,setState:(D,G,V)=>{var F,oe,ae,be;if(!Object.is(a.current[D],G)){if(a.current[D]=G,D==="search")ue(),U(),M(1,q);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ve=document.getElementById(A);ve?ve.focus():(F=document.getElementById(k))==null||F.focus()}if(M(7,()=>{var ve;a.current.selectedItemId=(ve=xe())==null?void 0:ve.id,z.emit()}),V||M(5,pe),((oe=m.current)==null?void 0:oe.value)!==void 0){let ve=G??"";(be=(ae=m.current).onValueChange)==null||be.call(ae,ve);return}}z.emit()}},emit:()=>{d.current.forEach(D=>D())}}),[]),B=f.useMemo(()=>({value:(D,G,V)=>{var F;G!==((F=c.current.get(D))==null?void 0:F.value)&&(c.current.set(D,{value:G,keywords:V}),a.current.filtered.items.set(D,K(G,V)),M(2,()=>{U(),z.emit()}))},item:(D,G)=>(o.current.add(D),G&&(l.current.has(G)?l.current.get(G).add(D):l.current.set(G,new Set([D]))),M(3,()=>{ue(),U(),a.current.value||q(),z.emit()}),()=>{c.current.delete(D),o.current.delete(D),a.current.filtered.items.delete(D);let V=xe();M(4,()=>{ue(),(V==null?void 0:V.getAttribute("id"))===D&&q(),z.emit()})}),group:D=>(l.current.has(D)||l.current.set(D,new Set),()=>{c.current.delete(D),l.current.delete(D)}),filter:()=>m.current.shouldFilter,label:p||e["aria-label"],getDisablePointerSelection:()=>m.current.disablePointerSelection,listId:k,inputId:A,labelId:T,listInnerRef:O}),[]);function K(D,G){var V,F;let oe=(F=(V=m.current)==null?void 0:V.filter)!=null?F:r_;return D?oe(D,a.current.search,G):0}function U(){if(!a.current.search||m.current.shouldFilter===!1)return;let D=a.current.filtered.items,G=[];a.current.filtered.groups.forEach(F=>{let oe=l.current.get(F),ae=0;oe.forEach(be=>{let ve=D.get(be);ae=Math.max(ve,ae)}),G.push([F,ae])});let V=O.current;se().sort((F,oe)=>{var ae,be;let ve=F.getAttribute("id"),Y=oe.getAttribute("id");return((ae=D.get(Y))!=null?ae:0)-((be=D.get(ve))!=null?be:0)}).forEach(F=>{let oe=F.closest(Ep);oe?oe.appendChild(F.parentElement===oe?F:F.closest(`${Ep} > *`)):V.appendChild(F.parentElement===V?F:F.closest(`${Ep} > *`))}),G.sort((F,oe)=>oe[1]-F[1]).forEach(F=>{var oe;let ae=(oe=O.current)==null?void 0:oe.querySelector(`${Ki}[${Es}="${encodeURIComponent(F[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function q(){let D=se().find(V=>V.getAttribute("aria-disabled")!=="true"),G=D==null?void 0:D.getAttribute(Es);z.setState("value",G||void 0)}function ue(){var D,G,V,F;if(!a.current.search||m.current.shouldFilter===!1){a.current.filtered.count=o.current.size;return}a.current.filtered.groups=new Set;let oe=0;for(let ae of o.current){let be=(G=(D=c.current.get(ae))==null?void 0:D.value)!=null?G:"",ve=(F=(V=c.current.get(ae))==null?void 0:V.keywords)!=null?F:[],Y=K(be,ve);a.current.filtered.items.set(ae,Y),Y>0&&oe++}for(let[ae,be]of l.current)for(let ve of be)if(a.current.filtered.items.get(ve)>0){a.current.filtered.groups.add(ae);break}a.current.filtered.count=oe}function pe(){var D,G,V;let F=xe();F&&(((D=F.parentElement)==null?void 0:D.firstChild)===F&&((V=(G=F.closest(Ki))==null?void 0:G.querySelector(n_))==null||V.scrollIntoView({block:"nearest"})),F.scrollIntoView({block:"nearest"}))}function xe(){var D;return(D=O.current)==null?void 0:D.querySelector(`${mS}[aria-selected="true"]`)}function se(){var D;return Array.from(((D=O.current)==null?void 0:D.querySelectorAll(qy))||[])}function L(D){let G=se()[D];G&&z.setState("value",G.getAttribute(Es))}function I(D){var G;let V=xe(),F=se(),oe=F.findIndex(be=>be===V),ae=F[oe+D];(G=m.current)!=null&&G.loop&&(ae=oe+D<0?F[F.length-1]:oe+D===F.length?F[0]:F[oe+D]),ae&&z.setState("value",ae.getAttribute(Es))}function H(D){let G=xe(),V=G==null?void 0:G.closest(Ki),F;for(;V&&!F;)V=D>0?f_(V,Ki):m_(V,Ki),F=V==null?void 0:V.querySelector(qy);F?z.setState("value",F.getAttribute(Es)):I(D)}let Z=()=>L(se().length-1),te=D=>{D.preventDefault(),D.metaKey?Z():D.altKey?H(1):I(1)},_=D=>{D.preventDefault(),D.metaKey?L(0):D.altKey?H(-1):I(-1)};return f.createElement(zn.div,{ref:n,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:D=>{var G;(G=N.onKeyDown)==null||G.call(N,D);let V=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||V))switch(D.key){case"n":case"j":{E&&D.ctrlKey&&te(D);break}case"ArrowDown":{te(D);break}case"p":case"k":{E&&D.ctrlKey&&_(D);break}case"ArrowUp":{_(D);break}case"Home":{D.preventDefault(),L(0);break}case"End":{D.preventDefault(),Z();break}case"Enter":{D.preventDefault();let F=xe();if(F){let oe=new Event(ch);F.dispatchEvent(oe)}}}}},f.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:g_},p),Td(e,D=>f.createElement(hS.Provider,{value:z},f.createElement(pS.Provider,{value:B},D))))}),a_=f.forwardRef((e,n)=>{var a,o;let l=Yt(),c=f.useRef(null),d=f.useContext(gS),m=Ll(),p=vS(e),h=(o=(a=p.current)==null?void 0:a.forceMount)!=null?o:d==null?void 0:d.forceMount;wo(()=>{if(!h)return m.item(l,d==null?void 0:d.id)},[h]);let b=bS(l,c,[e.value,e.children,c],e.keywords),g=Ng(),y=Pa(M=>M.value&&M.value===b.current),w=Pa(M=>h||m.filter()===!1?!0:M.search?M.filtered.items.get(l)>0:!0);f.useEffect(()=>{let M=c.current;if(!(!M||e.disabled))return M.addEventListener(ch,j),()=>M.removeEventListener(ch,j)},[w,e.onSelect,e.disabled]);function j(){var M,z;S(),(z=(M=p.current).onSelect)==null||z.call(M,b.current)}function S(){g.setState("value",b.current,!0)}if(!w)return null;let{disabled:E,value:N,onSelect:k,forceMount:T,keywords:A,...O}=e;return f.createElement(zn.div,{ref:gt(c,n),...O,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!y,"data-disabled":!!E,"data-selected":!!y,onPointerMove:E||m.getDisablePointerSelection()?void 0:S,onClick:E?void 0:j},e.children)}),o_=f.forwardRef((e,n)=>{let{heading:a,children:o,forceMount:l,...c}=e,d=Yt(),m=f.useRef(null),p=f.useRef(null),h=Yt(),b=Ll(),g=Pa(w=>l||b.filter()===!1?!0:w.search?w.filtered.groups.has(d):!0);wo(()=>b.group(d),[]),bS(d,m,[e.value,e.heading,p]);let y=f.useMemo(()=>({id:d,forceMount:l}),[l]);return f.createElement(zn.div,{ref:gt(m,n),...c,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},a&&f.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:h},a),Td(e,w=>f.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?h:void 0},f.createElement(gS.Provider,{value:y},w))))}),s_=f.forwardRef((e,n)=>{let{alwaysRender:a,...o}=e,l=f.useRef(null),c=Pa(d=>!d.search);return!a&&!c?null:f.createElement(zn.div,{ref:gt(l,n),...o,"cmdk-separator":"",role:"separator"})}),i_=f.forwardRef((e,n)=>{let{onValueChange:a,...o}=e,l=e.value!=null,c=Ng(),d=Pa(h=>h.search),m=Pa(h=>h.selectedItemId),p=Ll();return f.useEffect(()=>{e.value!=null&&c.setState("search",e.value)},[e.value]),f.createElement(zn.input,{ref:n,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":m,id:p.inputId,type:"text",value:l?e.value:d,onChange:h=>{l||c.setState("search",h.target.value),a==null||a(h.target.value)}})}),l_=f.forwardRef((e,n)=>{let{children:a,label:o="Suggestions",...l}=e,c=f.useRef(null),d=f.useRef(null),m=Pa(h=>h.selectedItemId),p=Ll();return f.useEffect(()=>{if(d.current&&c.current){let h=d.current,b=c.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;b.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return y.observe(h),()=>{cancelAnimationFrame(g),y.unobserve(h)}}},[]),f.createElement(zn.div,{ref:gt(c,n),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":m,"aria-label":o,id:p.listId},Td(e,h=>f.createElement("div",{ref:gt(d,p.listInnerRef),"cmdk-list-sizer":""},h)))}),c_=f.forwardRef((e,n)=>{let{open:a,onOpenChange:o,overlayClassName:l,contentClassName:c,container:d,...m}=e;return f.createElement(xg,{open:a,onOpenChange:o},f.createElement(vg,{container:d},f.createElement(_l,{"cmdk-overlay":"",className:l}),f.createElement(Ol,{"aria-label":e.label,"cmdk-dialog":"",className:c},f.createElement(xS,{ref:n,...m}))))}),u_=f.forwardRef((e,n)=>Pa(a=>a.filtered.count===0)?f.createElement(zn.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),d_=f.forwardRef((e,n)=>{let{progress:a,children:o,label:l="Loading...",...c}=e;return f.createElement(zn.div,{ref:n,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Td(e,d=>f.createElement("div",{"aria-hidden":!0},d)))}),Cn=Object.assign(xS,{List:l_,Item:a_,Input:i_,Group:o_,Separator:s_,Dialog:c_,Empty:u_,Loading:d_});function f_(e,n){let a=e.nextElementSibling;for(;a;){if(a.matches(n))return a;a=a.nextElementSibling}}function m_(e,n){let a=e.previousElementSibling;for(;a;){if(a.matches(n))return a;a=a.previousElementSibling}}function vS(e){let n=f.useRef(e);return wo(()=>{n.current=e}),n}var wo=typeof window>"u"?f.useEffect:f.useLayoutEffect;function ks(e){let n=f.useRef();return n.current===void 0&&(n.current=e()),n}function Pa(e){let n=Ng(),a=()=>e(n.snapshot());return f.useSyncExternalStore(n.subscribe,a,a)}function bS(e,n,a,o=[]){let l=f.useRef(),c=Ll();return wo(()=>{var d;let m=(()=>{var h;for(let b of a){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(h=b.current.textContent)==null?void 0:h.trim():l.current}})(),p=o.map(h=>h.trim());c.value(e,m,p),(d=n.current)==null||d.setAttribute(Es,m),l.current=m}),l}var p_=()=>{let[e,n]=f.useState(),a=ks(()=>new Map);return wo(()=>{a.current.forEach(o=>o()),a.current=new Map},[e]),(o,l)=>{a.current.set(o,l),n({})}};function h_(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Td({asChild:e,children:n},a){return e&&f.isValidElement(n)?f.cloneElement(h_(n),{ref:n.ref},a(n.props.children)):a(n)}var g_={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const zl=xg,x_=zA,v_=vg,yS=f.forwardRef(({className:e,...n},a)=>s.jsx(_l,{ref:a,className:fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));yS.displayName=_l.displayName;const qs=f.forwardRef(({className:e,children:n,...a},o)=>s.jsxs(v_,{children:[s.jsx(yS,{}),s.jsxs(Ol,{ref:o,className:fe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[n,s.jsxs(BC,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[s.jsx(bC,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));qs.displayName=Ol.displayName;const Ks=({className:e,...n})=>s.jsx("div",{className:fe("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});Ks.displayName="DialogHeader";const Pl=({className:e,...n})=>s.jsx("div",{className:fe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});Pl.displayName="DialogFooter";const Xs=f.forwardRef(({className:e,...n},a)=>s.jsx(Sd,{ref:a,className:fe("text-lg font-semibold leading-none tracking-tight",e),...n}));Xs.displayName=Sd.displayName;const Zs=f.forwardRef(({className:e,...n},a)=>s.jsx(jd,{ref:a,className:fe("text-sm text-muted-foreground",e),...n}));Zs.displayName=jd.displayName;const wS=f.forwardRef(({className:e,...n},a)=>s.jsx(Cn,{ref:a,className:fe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n}));wS.displayName=Cn.displayName;const b_=f.forwardRef(({className:e,...n},a)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(iA,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Cn.Input,{ref:a,className:fe("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]}));b_.displayName=Cn.Input.displayName;const CS=f.forwardRef(({className:e,...n},a)=>s.jsx(Cn.List,{ref:a,className:fe("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n}));CS.displayName=Cn.List.displayName;const SS=f.forwardRef((e,n)=>s.jsx(Cn.Empty,{ref:n,className:"py-6 text-center text-sm",...e}));SS.displayName=Cn.Empty.displayName;const jS=f.forwardRef(({className:e,...n},a)=>s.jsx(Cn.Group,{ref:a,className:fe("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n}));jS.displayName=Cn.Group.displayName;const y_=f.forwardRef(({className:e,...n},a)=>s.jsx(Cn.Separator,{ref:a,className:fe("-mx-1 h-px bg-border",e),...n}));y_.displayName=Cn.Separator.displayName;const NS=f.forwardRef(({className:e,...n},a)=>s.jsx(Cn.Item,{ref:a,className:fe("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...n}));NS.displayName=Cn.Item.displayName;const w_=[{title:"Info command",fields:[{path:"Info.Title",label:"Title",type:"text"},{path:"Info.Description",label:"Description",type:"textarea"},{path:"Info.Button",label:"Button label",type:"text"},{path:"Info.URL",label:"Button URL",type:"text"},{path:"Info.Colour",label:"Colour",type:"color"}]},{title:"Welcome message",fields:[{path:"Welcome.Enabled",label:"Enabled",type:"boolean"},{path:"Welcome.LayoutStyle",label:"Layout style",type:"select",options:[{value:"modern",label:"Modern (components)"},{value:"classic",label:"Classic embed"}]},{path:"Welcome.Embed.Colour",label:"Embed colour",type:"color"},{path:"Welcome.Embed.Title",label:"Embed title",type:"text"},{path:"Welcome.Embed.Message",label:"Embed message",type:"textarea"}]},{title:"Leave message",fields:[{path:"Leave.Enabled",label:"Enabled",type:"boolean"},{path:"Leave.Embed.Colour",label:"Embed colour",type:"color"},{path:"Leave.Embed.Title",label:"Embed title",type:"text"},{path:"Leave.Embed.Message",label:"Embed message",type:"textarea"}]}],C_=[{value:"Playing",label:"Playing"},{value:"Watching",label:"Watching"},{value:"Listening",label:"Listening"},{value:"Competing",label:"Competing"},{value:"Streaming",label:"Streaming"}],S_=[{value:"Channel",label:"Channel"},{value:"Forum",label:"Forum"}],j_=[{value:"channels",label:"Channels"},{value:"threads",label:"Threads"}],N_=[{value:"description",label:"Channel description"},{value:"embed",label:"Embed"}],Ns=[{value:"1",label:"Blurple"},{value:"2",label:"Grey"},{value:"3",label:"Green"},{value:"4",label:"Red"}],E_=[{title:"General",fields:[{path:"General.Name",label:"Bot name",type:"text"},{path:"General.Token",label:"Bot token",type:"secret",description:"Masked in the dashboard. Your real token is preserved on save."},{path:"General.GuildId",label:"Server (guild) ID",type:"discordId",description:"Right-click your Discord server icon → Copy Server ID. The bot should only stay in this server.",placeholder:"Discord server snowflake ID"},{path:"General.Addons.Enabled",label:"Addons enabled",type:"boolean"}]},{title:"Activity",fields:[{path:"Activity.Status",label:"Status text",type:"text"},{path:"Activity.Type",label:"Activity type",type:"select",options:C_},{path:"Activity.StreamingURL",label:"Streaming URL",type:"text",description:"Required when type is Streaming."}]},{title:"Embeds",fields:[{path:"Embed.Colours.General",label:"General colour",type:"color"},{path:"Embed.Colours.Success",label:"Success colour",type:"color"},{path:"Embed.Colours.Error",label:"Error colour",type:"color"},{path:"Embed.Colours.Warn",label:"Warn colour",type:"color"},{path:"Embed.Footer",label:"Footer text",type:"text"}]},{title:"Roles",fields:[{path:"Roles.AutoRole.Enabled",label:"Auto role enabled",type:"boolean"},{path:"Roles.AutoRole.Role",label:"Auto role",type:"discordRole"},{path:"Roles.StaffMember.Staff",label:"Staff role",type:"discordRole"},{path:"Roles.StaffMember.Admin",label:"Admin role",type:"discordRole"},{path:"Roles.StaffMember.Moderator",label:"Moderator role",type:"discordRole"},{path:"Roles.Mod.AllowSupportStaff",label:"Allow support staff /mod",type:"boolean"}]},{title:"Welcome & leave",fields:[{path:"Welcome.Enabled",label:"Welcome enabled",type:"boolean"},{path:"Welcome.Channel",label:"Welcome channel",type:"discordChannel"},{path:"Leave.Enabled",label:"Leave enabled",type:"boolean"},{path:"Leave.Channel",label:"Leave channel",type:"discordChannel"}]},{title:"Suggestions",fields:[{path:"Suggestions.Mode",label:"Mode",type:"select",options:S_},{path:"Suggestions.Channel",label:"Suggestions channel",type:"discordChannel"},{path:"Suggestions.ForumChannel",label:"Forum channel",type:"discordChannel"},{path:"Suggestions.UpvoteEmoji",label:"Upvote emoji",type:"emoji"},{path:"Suggestions.DownvoteEmoji",label:"Downvote emoji",type:"emoji"},{path:"Suggestions.OwnSuggestion",label:"Own suggestion votes",type:"boolean"},{path:"Suggestions.ShowUsers",label:"Show users",type:"boolean"},{path:"Suggestions.UpvoteTitle",label:"Upvote button title",type:"text"},{path:"Suggestions.DownvoteTitle",label:"Downvote button title",type:"text"},{path:"Suggestions.Threads.Enabled",label:"Suggestion threads",type:"boolean"},{path:"Suggestions.Threads.Title",label:"Thread title",type:"text"},{path:"Suggestions.Threads.Reason",label:"Thread reason",type:"text"},{path:"Suggestions.Buttons.Upvote",label:"Upvote button style",type:"select",options:Ns},{path:"Suggestions.Buttons.Downvote",label:"Downvote button style",type:"select",options:Ns},{path:"Suggestions.Buttons.RemoveVote",label:"Remove vote button style",type:"select",options:Ns},{path:"Suggestions.Buttons.RemoveVote_Title",label:"Remove vote title",type:"text"},{path:"Suggestions.Tags.Created",label:"Tag: created",type:"text"},{path:"Suggestions.Tags.Considering",label:"Tag: considering",type:"text"},{path:"Suggestions.Tags.Solved",label:"Tag: solved",type:"text"},{path:"Suggestions.Tags.Denied",label:"Tag: denied",type:"text"}]},{title:"Tickets",fields:[{path:"Ticket.TicketType",label:"Ticket type",type:"select",options:j_},{path:"Ticket.UserManagement.DMOnAdd",label:"DM when added to ticket",type:"boolean"},{path:"Ticket.UserManagement.DMOnRemove",label:"DM when removed from ticket",type:"boolean"},{path:"Ticket.UserManagement.DMTranscript",label:"DM transcript on close",type:"boolean"},{path:"Ticket.TicketHome",label:"Ticket home channel",type:"discordChannel"},{path:"Ticket.TicketChannelsCategory",label:"Ticket category",type:"discordCategory"},{path:"Ticket.TicketChannelsCategory2",label:"Overflow ticket category",type:"discordCategory",description:"Used when the first category is full."},{path:"Ticket.TicketArchiveCategory",label:"Archive category",type:"discordCategory"},{path:"Ticket.Channel",label:"Channel prefix",type:"text"},{path:"Ticket.TicketSubject",label:"Ticket subject display",type:"select",options:N_},{path:"Ticket.Timeout",label:"Close timeout (minutes)",type:"number"},{path:"Ticket.TicketsPerUser",label:"Tickets per user",type:"number"},{path:"Ticket.TicketReason",label:"Require reason",type:"boolean"},{path:"Ticket.Close.StaffOnly",label:"Close staff only",type:"boolean"},{path:"Ticket.Invites.StaffOnly",label:"Ticket invites staff only",type:"boolean"},{path:"Ticket.ClaimTickets.Enabled",label:"Claim tickets",type:"boolean"},{path:"Ticket.ClaimTickets.Channel",label:"Claim log channel",type:"discordChannel"},{path:"Ticket.ClaimTickets.ClaimAcceptTime",label:"Claim accept time (ms)",type:"number"},{path:"Ticket.ClaimTickets.ButtonTitle",label:"Claim button title",type:"text"},{path:"Ticket.ClaimTickets.ButtonEmoji",label:"Claim button emoji",type:"emoji"},{path:"Ticket.ClaimTickets.Button",label:"Claim button style",type:"select",options:Ns},{path:"Ticket.ReviewSystem.Enabled",label:"Review system",type:"boolean"},{path:"Ticket.ReviewSystem.Channel",label:"Review channel",type:"discordChannel"},{path:"Ticket.ReviewSystem.UseModal",label:"Review uses modal",type:"boolean"},{path:"Ticket.Log.TicketDataLog",label:"Ticket data log channel",type:"discordChannel"},{path:"Ticket.Log.TickeDataTitle",label:"Ticket data log title",type:"text"},{path:"Ticket.Log.TicketBlacklistLog",label:"Blacklist log channel",type:"discordChannel"},{path:"Ticket.AIMode.Enabled",label:"AI mode in tickets",type:"boolean"},{path:"Ticket.AIMode.ThreadName",label:"AI thread name",type:"text"},{path:"Ticket.AIMode.WelcomeMessage",label:"AI welcome message",type:"textarea"},{path:"Ticket.DepartmentSystem.Enabled",label:"Departments enabled",type:"boolean"},{path:"Ticket.DepartmentSystem.Placeholder",label:"Department placeholder",type:"text"},{path:"Ticket.DepartmentSystem.DefaultDepartment",label:"Default department key",type:"text"},{path:"Ticket.PrioritySystem.Enabled",label:"Priority system",type:"boolean"},{path:"Ticket.PrioritySystem.DefaultPriority",label:"Default priority",type:"text"},{path:"Ticket.PrioritySystem.AllowUsersToChooseOnOpen",label:"User picks priority on open",type:"boolean"},{path:"Ticket.Questions.Enabled",label:"Ticket questions",type:"boolean"},{path:"Ticket.Questions.List",label:"Default questions",type:"stringList"}]},{title:"Voice tickets",fields:[{path:"VoiceTickets.Name",label:"VC name format",type:"text"},{path:"VoiceTickets.Category",label:"VC category",type:"discordCategory"}]},{title:"Logging",fields:[{path:"MessageDelete.Channel",label:"Message delete log channel",type:"discordChannel"},{path:"MessageDelete.Colour",label:"Message delete embed colour",type:"color"},{path:"MessageUpdate.Channel",label:"Message update log channel",type:"discordChannel"},{path:"MessageUpdate.Colour",label:"Message update embed colour",type:"color"},{path:"Translate.TranslateLog",label:"Translate log channel",type:"discordChannel"}]},{title:"Buttons & menus",description:"Ticket panel and control button labels and styles.",fields:[{path:"Buttons.General.Delete",label:"Delete emoji",type:"emoji"},{path:"Buttons.General.DeleteStyle",label:"Delete button style",type:"select",options:Ns},{path:"Buttons.Voice.TicketDeleteText",label:"Voice delete label",type:"text"},{path:"Buttons.Tickets.ClaimEmoji",label:"Ticket claim emoji",type:"emoji"},{path:"Buttons.Tickets.ClaimStyle",label:"Ticket claim style",type:"select",options:Ns},{path:"SelectMenus.Tickets.PanelEmoji",label:"Panel menu emoji",type:"emoji"},{path:"SelectMenus.Tickets.CloseEmoji",label:"Close menu emoji",type:"emoji"}]}],k_=[{value:"openai",label:"OpenAI"},{value:"groq",label:"Groq"},{value:"claude",label:"Claude"}],T_=[{value:"text",label:"Plain text"},{value:"embed",label:"Embed"},{value:"components_v2",label:"Components v2"}],R_=[{value:"channel",label:"Per channel"},{value:"guild",label:"Per server"}],A_=[{title:"General",fields:[{path:"Enabled",label:"AI enabled",type:"boolean"},{path:"General.Provider",label:"Provider",type:"select",options:k_},{path:"General.Model",label:"Model",type:"text"},{path:"General.Model_API_Key",label:"API key",type:"secret",placeholder:"MODEL_API_KEY"},{path:"General.Tokens",label:"Max tokens",type:"number"},{path:"General.Temperature",label:"Temperature",type:"number"},{path:"General.Name",label:"Display name",type:"text"},{path:"General.PastebinAPI_Key",label:"Pastebin API key",type:"secret",placeholder:"PASTEBIN_API_KEY"},{path:"General.PastebinAPI_URL",label:"Pastebin API URL",type:"text"}]},{title:"Style & channel",fields:[{path:"Style.MessageType",label:"Message type",type:"select",options:T_},{path:"Features.SuggestTickets",label:"Suggest tickets",type:"boolean"},{path:"Channels.AIChannel",label:"AI channel ID",type:"discordId"},{path:"Embed.Color",label:"Embed colour",type:"color"},{path:"Embed.Footer",label:"Embed footer",type:"text"}]},{title:"Memory",fields:[{path:"Memory.Enabled",label:"Memory enabled",type:"boolean"},{path:"Memory.StoreFacts",label:"Store facts",type:"boolean"},{path:"Memory.StoreSummaries",label:"Store summaries",type:"boolean"},{path:"Memory.MaxRecentMessages",label:"Max recent messages",type:"number"},{path:"Memory.Scope",label:"Memory scope",type:"select",options:R_}]},{title:"Custom instructions",fields:[{path:"CustomInstructions",label:"Instruction lines",type:"stringList",description:"One instruction per line sent to the AI."}]},{title:"Messages",fields:[{path:"Messages.ErrorResponse",label:"Error response",type:"text"},{path:"Messages.AIError",label:"AI error",type:"text"},{path:"Messages.AIDisabled",label:"AI disabled",type:"text"},{path:"Messages.MessageTooLong",label:"Message too long",type:"text"},{path:"Messages.SuggestTicketText",label:"Suggest ticket text",type:"text"},{path:"Messages.SuggestTicketReaction",label:"Suggest ticket emoji",type:"emoji"}]}],M_=[{value:"1",label:"Blurple"},{value:"2",label:"Grey"},{value:"3",label:"Green"},{value:"4",label:"Red"}],__=[{value:"1",label:"Style 1"},{value:"2",label:"Style 2"},{value:"3",label:"Style 3"},{value:"4",label:"Style 4 (classic embed)"}],O_=[{title:"Panel",fields:[{path:"Panel",label:"Panel enabled",type:"boolean"}]},{title:"Embed style",fields:[{path:"Style.Title",label:"Title",type:"text"},{path:"Style.Description",label:"Description",type:"textarea"},{path:"Style.Image",label:"Image URL",type:"text"},{path:"Style.Color",label:"Embed colour",type:"color"},{path:"Style.Layout",label:"Layout",type:"select",options:__}]},{title:"Create button",fields:[{path:"Button.Text",label:"Button text",type:"text"},{path:"Button.Emoji",label:"Button emoji",type:"emoji"},{path:"Button.Color",label:"Button style",type:"select",options:M_},{path:"Button.CustomId",label:"Custom ID",type:"text"}]},{title:"Department menu",fields:[{path:"DepartmentMenu.CustomId",label:"Custom ID",type:"text"},{path:"DepartmentMenu.Placeholder",label:"Placeholder",type:"text"},{path:"DepartmentMenu.DefaultDescription",label:"Default description",type:"text"},{path:"DepartmentMenu.DefaultEmoji",label:"Default emoji",type:"emoji"}]},{title:"Panel settings",fields:[{path:"Settings.Image",label:"Show image",type:"boolean"},{path:"Settings.TopTitle",label:"Top title",type:"boolean"},{path:"Settings.TopDivider",label:"Top divider",type:"boolean"},{path:"Settings.BottomTitle",label:"Bottom title",type:"boolean"},{path:"Settings.BottomDivider",label:"Bottom divider",type:"boolean"}]},{title:"Messages",description:"Bot messages when using the ticket panel command.",fields:[{path:"Messages.NotConfigured",label:"Not configured",type:"textarea"},{path:"Messages.InvalidChannel",label:"Invalid channel",type:"textarea"},{path:"Messages.PanelSent",label:"Panel sent",type:"text"},{path:"Messages.PanelSentWithDepartments",label:"Panel sent (departments)",type:"text"},{path:"Messages.SendError",label:"Send error",type:"text"}]}],uh={supportbot:E_,"ticket-panel":O_,commands:"commands",messages:w_,"supportbot-ai":A_};function D_(e){return e in uh?uh[e]:null}const Ts=[{id:"tickets",title:"Ticket panel",description:"Create and manage support tickets with departments, priorities, and AI assistance.",icon:ll,href:"/configs?file=ticket-panel",category:"tickets"},{id:"supportbot",title:"Core bot settings",description:"General bot options, activity status, embed colours, roles, and welcome messages.",icon:vo,href:"/configs?file=supportbot",category:"server"},{id:"transcripts",title:"Ticket transcripts",description:"Browse and preview HTML transcripts saved when tickets are closed.",icon:il,href:"/transcripts",category:"tickets"},{id:"suggestions",title:"Suggestions",description:"Configure suggestion channels, voting emojis, and forum thread behaviour.",icon:Vh,href:"/configs?file=messages",category:"community"},{id:"ai",title:"AI assistant",description:"SupportBot AI mode settings for in-ticket conversational help.",icon:$h,href:"/configs?file=supportbot-ai",category:"community"},{id:"commands",title:"Commands",description:"Enable or disable slash commands and customise command permissions.",icon:Da,href:"/configs?file=commands",category:"server"}],L_=[{id:"all",label:"All modules"},{id:"tickets",label:"Tickets"},{id:"community",label:"Community"},{id:"server",label:"Server"}],z_={supportbot:"Bot config","ticket-panel":"Ticket panel",commands:"Commands",messages:"Messages","supportbot-ai":"AI assistant"},P_=[{key:"Help",label:"Help",description:"List all slash commands"},{key:"Info",label:"Info",description:"Server information"},{key:"TicketPanel",label:"Ticket panel",description:"Create ticket panel"},{key:"OpenTicket",label:"Open ticket",description:"Open a support ticket"},{key:"CloseTicket",label:"Close ticket",description:"Close a ticket"},{key:"TicketManage",label:"Manage ticket",description:"Manage an existing ticket"},{key:"Suggestion",label:"Suggestion",description:"Submit a suggestion"},{key:"Embed",label:"Embed",description:"Send an embed message"},{key:"Translate",label:"Translate",description:"Translate text"},{key:"Ping",label:"Ping",description:"Check bot latency"},{key:"AI",label:"AI",description:"AI assistant command"},{key:"Settings",label:"Settings command",description:"Bot settings via Discord"},{key:"Mod",label:"Moderation",description:"Moderation tools"}];function I_(e,n,a){const o=z_[e];for(const l of n)for(const c of l.fields)a.push({id:`setting:${e}:${c.path}`,title:c.label,subtitle:`${o} · ${l.title}`,href:`/configs?file=${e}`,category:"setting",icon:$_(e),keywords:[c.path,c.label,l.title,o,e,c.description??"",c.type].map(d=>d.toLowerCase())})}function $_(e){switch(e){case"supportbot":return vo;case"ticket-panel":return ll;case"messages":return Vh;case"supportbot-ai":return $h;case"commands":return Da;default:return vo}}function B_(){const e=[{id:"page:dashboard",title:"Dashboard",subtitle:"Overview and module status",href:"/",category:"page",icon:n2,keywords:["home","overview","stats"]},{id:"page:logs",title:"Logs",subtitle:"Live bot console output",href:"/logs",category:"page",icon:e2,keywords:["console","output","errors","warn"]},{id:"page:settings",title:"Settings",subtitle:"Updates and maintenance",href:"/settings",category:"page",icon:vo,keywords:["update","version","software"]},{id:"page:transcripts",title:"Transcripts",subtitle:"Closed ticket transcripts",href:"/transcripts",category:"page",icon:il,keywords:["tickets","archive","html"]}];for(const n of Ts)e.push({id:`module:${n.id}`,title:n.title,subtitle:n.description,href:n.href,category:"module",icon:n.icon,keywords:[n.id,n.title,n.description,n.category].map(a=>a.toLowerCase())});for(const[n,a]of Object.entries(uh))a!=="commands"&&I_(n,a,e);for(const n of P_)e.push({id:`command:${n.key}`,title:n.label,subtitle:`Command · ${n.description}`,href:"/configs?file=commands",category:"command",icon:Da,keywords:[n.key,n.label,n.description,"slash","commands"].map(a=>a.toLowerCase())});return e.push({id:"setting:commands:all",title:"Slash commands",subtitle:"Commands · Enable and configure all commands",href:"/configs?file=commands",category:"setting",icon:Da,keywords:["commands","slash","enable","permissions"]}),e}const U_=B_(),H_={page:"Pages",module:"Modules",setting:"Settings",command:"Commands"};function V_(e,n=12){const a=e.trim().toLowerCase();return a?U_.map(l=>{let c=0;const d=l.title.toLowerCase(),m=(l.subtitle??"").toLowerCase();d===a?c+=100:d.startsWith(a)?c+=40:d.includes(a)&&(c+=20),m.includes(a)&&(c+=10);for(const p of l.keywords)p===a?c+=15:p.startsWith(a)?c+=8:p.includes(a)&&(c+=4);return{item:l,score:c}}).filter(l=>l.score>0).sort((l,c)=>c.score-l.score).slice(0,n).map(l=>l.item):[]}function G_(e){const n=[],a=["page","module","setting","command"];for(const o of a){const l=e.filter(c=>c.category===o);l.length&&n.push({category:o,label:H_[o],items:l})}return n}function F_({className:e}){const n=Ro(),[a,o]=f.useState(""),[l,c]=f.useState(!1),d=f.useRef(null),m=f.useRef(null),p=f.useRef(null),[h,b]=f.useState(null),g=f.useMemo(()=>V_(a,14),[a]),y=f.useMemo(()=>G_(g),[g]),w=l&&a.trim().length>0,j=()=>{const E=p.current;if(!E)return;const N=E.getBoundingClientRect();b({top:N.bottom+6,left:N.left,width:N.width})};f.useLayoutEffect(()=>{if(!w){b(null);return}return j(),window.addEventListener("resize",j),window.addEventListener("scroll",j,!0),()=>{window.removeEventListener("resize",j),window.removeEventListener("scroll",j,!0)}},[w,a]),f.useEffect(()=>{function E(N){var T,A;const k=N.target;(T=d.current)!=null&&T.contains(k)||(A=m.current)!=null&&A.contains(k)||c(!1)}return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]),f.useEffect(()=>{function E(N){var k;N.key==="k"&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),(k=p.current)==null||k.focus(),c(!0))}return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[]);function S(E){var N;n(E.href),o(""),c(!1),(N=p.current)==null||N.blur()}return s.jsxs("div",{ref:d,className:fe("relative w-full max-w-sm",e),children:[s.jsx(ge,{icon:ad,size:16,className:"pointer-events-none absolute left-3 top-1/2 z-10 -translate-y-1/2 text-muted-foreground"}),s.jsx(Ie,{ref:p,value:a,onChange:E=>{o(E.target.value),c(!0)},onFocus:()=>c(!0),onKeyDown:E=>{var N;E.key==="Escape"&&(c(!1),o(""),(N=p.current)==null||N.blur())},placeholder:"Search modules, configs…",className:"h-9 border-border bg-secondary/50 pl-9",role:"combobox","aria-expanded":w,"aria-controls":"dashboard-search-results","aria-autocomplete":"list"}),s.jsxs("kbd",{className:"pointer-events-none absolute right-2 top-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100 sm:flex",children:[s.jsx("span",{className:"text-xs",children:"⌘"}),"K"]}),w&&h?Ao.createPortal(s.jsx("div",{ref:m,id:"dashboard-search-results",className:"overflow-hidden rounded-xl border border-border bg-popover shadow-lg shadow-black/20",style:{position:"fixed",top:h.top,left:h.left,width:h.width,zIndex:9999},role:"listbox",children:s.jsx(wS,{shouldFilter:!1,className:"bg-transparent",children:s.jsx(CS,{className:"max-h-[min(360px,50vh)]",children:g.length===0?s.jsxs(SS,{className:"py-8 text-muted-foreground",children:["No results for “",a.trim(),"”"]}):y.map(E=>s.jsx(jS,{heading:E.label,children:E.items.map(N=>s.jsxs(NS,{value:N.id,onSelect:()=>S(N),className:"cursor-pointer gap-3 rounded-lg py-2.5 aria-selected:bg-accent",children:[N.icon?s.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(ge,{icon:N.icon,size:16})}):null,s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate font-medium",children:N.title}),N.subtitle?s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:N.subtitle}):null]})]},N.id))},E.category))})})}),document.body):null]})}function W_(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d);m.displayName=c+"Context";const p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,Y_(l,...n)]}function Y_(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}var kp={exports:{}},Tp={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ky;function q_(){if(Ky)return Tp;Ky=1;var e=Ku();function n(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var a=typeof Object.is=="function"?Object.is:n,o=e.useState,l=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function m(g,y){var w=y(),j=o({inst:{value:w,getSnapshot:y}}),S=j[0].inst,E=j[1];return c(function(){S.value=w,S.getSnapshot=y,p(S)&&E({inst:S})},[g,w,y]),l(function(){return p(S)&&E({inst:S}),g(function(){p(S)&&E({inst:S})})},[g]),d(w),w}function p(g){var y=g.getSnapshot;g=g.value;try{var w=y();return!a(g,w)}catch{return!0}}function h(g,y){return y()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:m;return Tp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b,Tp}var Xy;function K_(){return Xy||(Xy=1,kp.exports=q_()),kp.exports}var X_=K_();function Z_(){return X_.useSyncExternalStore(Q_,()=>!0,()=>!1)}function Q_(){return()=>{}}var Eg="Avatar",[J_]=W_(Eg),[eO,ES]=J_(Eg),kS=f.forwardRef((e,n)=>{const{__scopeAvatar:a,...o}=e,[l,c]=f.useState("idle");return s.jsx(eO,{scope:a,imageLoadingStatus:l,onImageLoadingStatusChange:c,children:s.jsx(zn.span,{...o,ref:n})})});kS.displayName=Eg;var TS="AvatarImage",RS=f.forwardRef((e,n)=>{const{__scopeAvatar:a,src:o,onLoadingStatusChange:l=()=>{},...c}=e,d=ES(TS,a),m=tO(o,c),p=Wt(h=>{l(h),d.onImageLoadingStatusChange(h)});return Pt(()=>{m!=="idle"&&p(m)},[m,p]),m==="loaded"?s.jsx(zn.img,{...c,ref:n,src:o}):null});RS.displayName=TS;var AS="AvatarFallback",MS=f.forwardRef((e,n)=>{const{__scopeAvatar:a,delayMs:o,...l}=e,c=ES(AS,a),[d,m]=f.useState(o===void 0);return f.useEffect(()=>{if(o!==void 0){const p=window.setTimeout(()=>m(!0),o);return()=>window.clearTimeout(p)}},[o]),d&&c.imageLoadingStatus!=="loaded"?s.jsx(zn.span,{...l,ref:n}):null});MS.displayName=AS;function Zy(e,n){return e?n?(e.src!==n&&(e.src=n),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function tO(e,{referrerPolicy:n,crossOrigin:a}){const o=Z_(),l=f.useRef(null),c=o?(l.current||(l.current=new window.Image),l.current):null,[d,m]=f.useState(()=>Zy(c,e));return Pt(()=>{m(Zy(c,e))},[c,e]),Pt(()=>{const p=g=>()=>{m(g)};if(!c)return;const h=p("loaded"),b=p("error");return c.addEventListener("load",h),c.addEventListener("error",b),n&&(c.referrerPolicy=n),typeof a=="string"&&(c.crossOrigin=a),()=>{c.removeEventListener("load",h),c.removeEventListener("error",b)}},[c,a,n]),d}var _S=kS,OS=RS,DS=MS;const Ia=f.forwardRef(({className:e,...n},a)=>s.jsx(_S,{ref:a,className:fe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...n}));Ia.displayName=_S.displayName;const Co=f.forwardRef(({className:e,...n},a)=>s.jsx(OS,{ref:a,className:fe("aspect-square h-full w-full",e),...n}));Co.displayName=OS.displayName;const $a=f.forwardRef(({className:e,...n},a)=>s.jsx(DS,{ref:a,className:fe("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...n}));$a.displayName=DS.displayName;const LS=f.createContext(null);function nO({children:e}){const[n,a]=f.useState([]),[o,l]=f.useState(0),[c,d]=f.useState(!0),m=f.useCallback(async()=>{try{const g=await Ee.getNotifications();g.data&&(a(g.data.items),l(g.data.unreadCount))}catch{}finally{d(!1)}},[]),p=f.useCallback(async()=>{var g;try{const y=await Ee.markNotificationsRead("all");a(w=>w.map(j=>({...j,read:!0}))),l(((g=y.data)==null?void 0:g.unreadCount)??0)}catch{}},[]),h=f.useCallback(async g=>{var y;try{const w=await Ee.dismissNotification(g);a(j=>j.filter(S=>S.id!==g)),l(((y=w.data)==null?void 0:y.unreadCount)??0)}catch{}},[]);f.useEffect(()=>{m();const g=setInterval(m,3e4);return()=>clearInterval(g)},[m]);const b=f.useMemo(()=>({items:n,unreadCount:o,loading:c,refresh:m,markAllRead:p,dismiss:h}),[n,o,c,m,p,h]);return s.jsx(LS.Provider,{value:b,children:e})}function rO(){const e=f.useContext(LS);if(!e)throw new Error("useNotifications must be used within NotificationsProvider");return e}const aO=Vs("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function An({className:e,variant:n,...a}){return s.jsx("div",{className:fe(aO({variant:n}),e),...a})}function oO(e){const n=sO(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(lO);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function sO(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=uO(l),m=cO(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var iO=Symbol("radix.slottable");function lO(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iO}function cO(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function uO(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var dO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Il=dO.reduce((e,n)=>{const a=oO(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function fO(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,mO(l,...n)]}function mO(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function dh(e,[n,a]){return Math.min(a,Math.max(n,e))}function pO(e,n){return f.useReducer((a,o)=>n[a][o]??a,e)}var kg="ScrollArea",[zS]=fO(kg),[hO,Zn]=zS(kg),PS=f.forwardRef((e,n)=>{const{__scopeScrollArea:a,type:o="hover",dir:l,scrollHideDelay:c=600,...d}=e,[m,p]=f.useState(null),[h,b]=f.useState(null),[g,y]=f.useState(null),[w,j]=f.useState(null),[S,E]=f.useState(null),[N,k]=f.useState(0),[T,A]=f.useState(0),[O,M]=f.useState(!1),[z,B]=f.useState(!1),K=Ve(n,q=>p(q)),U=Cl(l);return s.jsx(hO,{scope:a,type:o,dir:U,scrollHideDelay:c,scrollArea:m,viewport:h,onViewportChange:b,content:g,onContentChange:y,scrollbarX:w,onScrollbarXChange:j,scrollbarXEnabled:O,onScrollbarXEnabledChange:M,scrollbarY:S,onScrollbarYChange:E,scrollbarYEnabled:z,onScrollbarYEnabledChange:B,onCornerWidthChange:k,onCornerHeightChange:A,children:s.jsx(Il.div,{dir:U,...d,ref:K,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});PS.displayName=kg;var IS="ScrollAreaViewport",$S=f.forwardRef((e,n)=>{const{__scopeScrollArea:a,children:o,nonce:l,...c}=e,d=Zn(IS,a),m=f.useRef(null),p=Ve(n,m,d.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),s.jsx(Il.div,{"data-radix-scroll-area-viewport":"",...c,ref:p,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});$S.displayName=IS;var kr="ScrollAreaScrollbar",Tg=f.forwardRef((e,n)=>{const{forceMount:a,...o}=e,l=Zn(kr,e.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:d}=l,m=e.orientation==="horizontal";return f.useEffect(()=>(m?c(!0):d(!0),()=>{m?c(!1):d(!1)}),[m,c,d]),l.type==="hover"?s.jsx(gO,{...o,ref:n,forceMount:a}):l.type==="scroll"?s.jsx(xO,{...o,ref:n,forceMount:a}):l.type==="auto"?s.jsx(BS,{...o,ref:n,forceMount:a}):l.type==="always"?s.jsx(Rg,{...o,ref:n}):null});Tg.displayName=kr;var gO=f.forwardRef((e,n)=>{const{forceMount:a,...o}=e,l=Zn(kr,e.__scopeScrollArea),[c,d]=f.useState(!1);return f.useEffect(()=>{const m=l.scrollArea;let p=0;if(m){const h=()=>{window.clearTimeout(p),d(!0)},b=()=>{p=window.setTimeout(()=>d(!1),l.scrollHideDelay)};return m.addEventListener("pointerenter",h),m.addEventListener("pointerleave",b),()=>{window.clearTimeout(p),m.removeEventListener("pointerenter",h),m.removeEventListener("pointerleave",b)}}},[l.scrollArea,l.scrollHideDelay]),s.jsx(sn,{present:a||c,children:s.jsx(BS,{"data-state":c?"visible":"hidden",...o,ref:n})})}),xO=f.forwardRef((e,n)=>{const{forceMount:a,...o}=e,l=Zn(kr,e.__scopeScrollArea),c=e.orientation==="horizontal",d=Ad(()=>p("SCROLL_END"),100),[m,p]=pO("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return f.useEffect(()=>{if(m==="idle"){const h=window.setTimeout(()=>p("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(h)}},[m,l.scrollHideDelay,p]),f.useEffect(()=>{const h=l.viewport,b=c?"scrollLeft":"scrollTop";if(h){let g=h[b];const y=()=>{const w=h[b];g!==w&&(p("SCROLL"),d()),g=w};return h.addEventListener("scroll",y),()=>h.removeEventListener("scroll",y)}},[l.viewport,c,p,d]),s.jsx(sn,{present:a||m!=="hidden",children:s.jsx(Rg,{"data-state":m==="hidden"?"hidden":"visible",...o,ref:n,onPointerEnter:Ce(e.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>p("POINTER_LEAVE"))})})}),BS=f.forwardRef((e,n)=>{const a=Zn(kr,e.__scopeScrollArea),{forceMount:o,...l}=e,[c,d]=f.useState(!1),m=e.orientation==="horizontal",p=Ad(()=>{if(a.viewport){const h=a.viewport.offsetWidth<a.viewport.scrollWidth,b=a.viewport.offsetHeight<a.viewport.scrollHeight;d(m?h:b)}},10);return zs(a.viewport,p),zs(a.content,p),s.jsx(sn,{present:o||c,children:s.jsx(Rg,{"data-state":c?"visible":"hidden",...l,ref:n})})}),Rg=f.forwardRef((e,n)=>{const{orientation:a="vertical",...o}=e,l=Zn(kr,e.__scopeScrollArea),c=f.useRef(null),d=f.useRef(0),[m,p]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=FS(m.viewport,m.content),b={...o,sizes:m,onSizesChange:p,hasThumb:h>0&&h<1,onThumbChange:y=>c.current=y,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:y=>d.current=y};function g(y,w){return SO(y,d.current,m,w)}return a==="horizontal"?s.jsx(vO,{...b,ref:n,onThumbPositionChange:()=>{if(l.viewport&&c.current){const y=l.viewport.scrollLeft,w=Qy(y,m,l.dir);c.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollLeft=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollLeft=g(y,l.dir))}}):a==="vertical"?s.jsx(bO,{...b,ref:n,onThumbPositionChange:()=>{if(l.viewport&&c.current){const y=l.viewport.scrollTop,w=Qy(y,m);c.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollTop=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollTop=g(y))}}):null}),vO=f.forwardRef((e,n)=>{const{sizes:a,onSizesChange:o,...l}=e,c=Zn(kr,e.__scopeScrollArea),[d,m]=f.useState(),p=f.useRef(null),h=Ve(n,p,c.onScrollbarXChange);return f.useEffect(()=>{p.current&&m(getComputedStyle(p.current))},[p]),s.jsx(HS,{"data-orientation":"horizontal",...l,ref:h,sizes:a,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Rd(a)+"px",...e.style},onThumbPointerDown:b=>e.onThumbPointerDown(b.x),onDragScroll:b=>e.onDragScroll(b.x),onWheelScroll:(b,g)=>{if(c.viewport){const y=c.viewport.scrollLeft+b.deltaX;e.onWheelScroll(y),YS(y,g)&&b.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&o({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:Hu(d.paddingLeft),paddingEnd:Hu(d.paddingRight)}})}})}),bO=f.forwardRef((e,n)=>{const{sizes:a,onSizesChange:o,...l}=e,c=Zn(kr,e.__scopeScrollArea),[d,m]=f.useState(),p=f.useRef(null),h=Ve(n,p,c.onScrollbarYChange);return f.useEffect(()=>{p.current&&m(getComputedStyle(p.current))},[p]),s.jsx(HS,{"data-orientation":"vertical",...l,ref:h,sizes:a,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Rd(a)+"px",...e.style},onThumbPointerDown:b=>e.onThumbPointerDown(b.y),onDragScroll:b=>e.onDragScroll(b.y),onWheelScroll:(b,g)=>{if(c.viewport){const y=c.viewport.scrollTop+b.deltaY;e.onWheelScroll(y),YS(y,g)&&b.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&o({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:Hu(d.paddingTop),paddingEnd:Hu(d.paddingBottom)}})}})}),[yO,US]=zS(kr),HS=f.forwardRef((e,n)=>{const{__scopeScrollArea:a,sizes:o,hasThumb:l,onThumbChange:c,onThumbPointerUp:d,onThumbPointerDown:m,onThumbPositionChange:p,onDragScroll:h,onWheelScroll:b,onResize:g,...y}=e,w=Zn(kr,a),[j,S]=f.useState(null),E=Ve(n,K=>S(K)),N=f.useRef(null),k=f.useRef(""),T=w.viewport,A=o.content-o.viewport,O=Wt(b),M=Wt(p),z=Ad(g,10);function B(K){if(N.current){const U=K.clientX-N.current.left,q=K.clientY-N.current.top;h({x:U,y:q})}}return f.useEffect(()=>{const K=U=>{const q=U.target;(j==null?void 0:j.contains(q))&&O(U,A)};return document.addEventListener("wheel",K,{passive:!1}),()=>document.removeEventListener("wheel",K,{passive:!1})},[T,j,A,O]),f.useEffect(M,[o,M]),zs(j,z),zs(w.content,z),s.jsx(yO,{scope:a,scrollbar:j,hasThumb:l,onThumbChange:Wt(c),onThumbPointerUp:Wt(d),onThumbPositionChange:M,onThumbPointerDown:Wt(m),children:s.jsx(Il.div,{...y,ref:E,style:{position:"absolute",...y.style},onPointerDown:Ce(e.onPointerDown,K=>{K.button===0&&(K.target.setPointerCapture(K.pointerId),N.current=j.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",w.viewport&&(w.viewport.style.scrollBehavior="auto"),B(K))}),onPointerMove:Ce(e.onPointerMove,B),onPointerUp:Ce(e.onPointerUp,K=>{const U=K.target;U.hasPointerCapture(K.pointerId)&&U.releasePointerCapture(K.pointerId),document.body.style.webkitUserSelect=k.current,w.viewport&&(w.viewport.style.scrollBehavior=""),N.current=null})})})}),Uu="ScrollAreaThumb",VS=f.forwardRef((e,n)=>{const{forceMount:a,...o}=e,l=US(Uu,e.__scopeScrollArea);return s.jsx(sn,{present:a||l.hasThumb,children:s.jsx(wO,{ref:n,...o})})}),wO=f.forwardRef((e,n)=>{const{__scopeScrollArea:a,style:o,...l}=e,c=Zn(Uu,a),d=US(Uu,a),{onThumbPositionChange:m}=d,p=Ve(n,g=>d.onThumbChange(g)),h=f.useRef(void 0),b=Ad(()=>{h.current&&(h.current(),h.current=void 0)},100);return f.useEffect(()=>{const g=c.viewport;if(g){const y=()=>{if(b(),!h.current){const w=jO(g,m);h.current=w,m()}};return m(),g.addEventListener("scroll",y),()=>g.removeEventListener("scroll",y)}},[c.viewport,b,m]),s.jsx(Il.div,{"data-state":d.hasThumb?"visible":"hidden",...l,ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:Ce(e.onPointerDownCapture,g=>{const w=g.target.getBoundingClientRect(),j=g.clientX-w.left,S=g.clientY-w.top;d.onThumbPointerDown({x:j,y:S})}),onPointerUp:Ce(e.onPointerUp,d.onThumbPointerUp)})});VS.displayName=Uu;var Ag="ScrollAreaCorner",GS=f.forwardRef((e,n)=>{const a=Zn(Ag,e.__scopeScrollArea),o=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&o?s.jsx(CO,{...e,ref:n}):null});GS.displayName=Ag;var CO=f.forwardRef((e,n)=>{const{__scopeScrollArea:a,...o}=e,l=Zn(Ag,a),[c,d]=f.useState(0),[m,p]=f.useState(0),h=!!(c&&m);return zs(l.scrollbarX,()=>{var g;const b=((g=l.scrollbarX)==null?void 0:g.offsetHeight)||0;l.onCornerHeightChange(b),p(b)}),zs(l.scrollbarY,()=>{var g;const b=((g=l.scrollbarY)==null?void 0:g.offsetWidth)||0;l.onCornerWidthChange(b),d(b)}),h?s.jsx(Il.div,{...o,ref:n,style:{width:c,height:m,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Hu(e){return e?parseInt(e,10):0}function FS(e,n){const a=e/n;return isNaN(a)?0:a}function Rd(e){const n=FS(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-a)*n;return Math.max(o,18)}function SO(e,n,a,o="ltr"){const l=Rd(a),c=l/2,d=n||c,m=l-d,p=a.scrollbar.paddingStart+d,h=a.scrollbar.size-a.scrollbar.paddingEnd-m,b=a.content-a.viewport,g=o==="ltr"?[0,b]:[b*-1,0];return WS([p,h],g)(e)}function Qy(e,n,a="ltr"){const o=Rd(n),l=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,c=n.scrollbar.size-l,d=n.content-n.viewport,m=c-o,p=a==="ltr"?[0,d]:[d*-1,0],h=dh(e,p);return WS([0,d],[0,m])(h)}function WS(e,n){return a=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const o=(n[1]-n[0])/(e[1]-e[0]);return n[0]+o*(a-e[0])}}function YS(e,n){return e>0&&e<n}var jO=(e,n=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},o=0;return(function l(){const c={left:e.scrollLeft,top:e.scrollTop},d=a.left!==c.left,m=a.top!==c.top;(d||m)&&n(),a=c,o=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(o)};function Ad(e,n){const a=Wt(e),o=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(o.current),[]),f.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(a,n)},[a,n])}function zs(e,n){const a=Wt(n);Pt(()=>{let o=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(a)});return l.observe(e),()=>{window.cancelAnimationFrame(o),l.unobserve(e)}}},[e,a])}var qS=PS,NO=$S,EO=GS;const $l=f.forwardRef(({className:e,children:n,...a},o)=>s.jsxs(qS,{ref:o,className:fe("relative overflow-hidden",e),...a,children:[s.jsx(NO,{className:"h-full w-full rounded-[inherit]",children:n}),s.jsx(KS,{}),s.jsx(EO,{})]}));$l.displayName=qS.displayName;const KS=f.forwardRef(({className:e,orientation:n="vertical",...a},o)=>s.jsx(Tg,{ref:o,orientation:n,className:fe("flex touch-none select-none transition-colors",n==="vertical"&&"h-full w-2 border-l border-l-transparent p-px",n==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-px",e),...a,children:s.jsx(VS,{className:"relative flex-1 rounded-full bg-[hsl(240_4%_32%)] transition-colors hover:bg-[hsl(240_4%_44%)]"})}));KS.displayName=Tg.displayName;function kO(e){const n=Math.floor((Date.now()-e)/1e3);if(n<60)return"Just now";const a=Math.floor(n/60);if(a<60)return`${a}m ago`;const o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function TO(e){switch(e){case"error":return"bg-destructive";case"update":return"bg-amber-500";case"bot":return"bg-emerald-500";default:return"bg-primary"}}function RO(){const e=Ro(),{items:n,unreadCount:a,loading:o,markAllRead:l,dismiss:c,refresh:d}=rO(),[m,p]=f.useState(!1),h=g=>{p(g),g&&(d(),a>0&&l())},b=g=>{p(!1),g.href&&e(g.href)};return s.jsxs(dg,{open:m,onOpenChange:h,children:[s.jsx(fg,{asChild:!0,children:s.jsxs(he,{variant:"ghost",size:"icon",className:"relative size-9 text-muted-foreground","aria-label":"Notifications",children:[s.jsx(ge,{icon:g8,size:18}),a>0&&s.jsx(An,{className:"absolute -right-0.5 -top-0.5 flex size-4 min-w-4 items-center justify-center rounded-full bg-destructive p-0 text-[10px] text-destructive-foreground",children:a>9?"9+":a})]})}),s.jsxs(wd,{align:"end",className:"w-80 p-0",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[s.jsx(mg,{className:"p-0 text-sm font-semibold",children:"Notifications"}),n.length>0&&s.jsx(he,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:()=>void l(),children:"Mark all read"})]}),s.jsx(ml,{className:"m-0"}),s.jsx($l,{className:"max-h-[min(360px,50vh)]",children:o&&n.length===0?s.jsx("p",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Loading…"}):n.length===0?s.jsx("p",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No notifications yet. Bot restarts and update checks will appear here."}):s.jsx("ul",{className:"py-1",children:n.map(g=>s.jsxs("li",{className:fe("group flex gap-2 border-b border-border/40 px-3 py-2.5 last:border-0",!g.read&&"bg-primary/5"),children:[s.jsx("span",{className:fe("mt-1.5 size-2 shrink-0 rounded-full",TO(g.type))}),s.jsxs("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:()=>b(g),children:[s.jsx("p",{className:"text-sm font-medium leading-tight",children:g.title}),s.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-2",children:g.message}),s.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground/80",children:kO(g.createdAt)})]}),s.jsx(he,{variant:"ghost",size:"icon",className:"size-7 shrink-0 opacity-0 group-hover:opacity-100","aria-label":"Dismiss",onClick:y=>{y.stopPropagation(),c(g.id)},children:s.jsx(ge,{icon:Zr,size:14})})]},g.id))})}),s.jsx(ml,{className:"m-0"}),s.jsx("div",{className:"p-2",children:s.jsx(he,{variant:"ghost",size:"sm",className:"w-full text-xs",asChild:!0,children:s.jsx(Ft,{to:"/settings",onClick:()=>p(!1),children:"Open settings (updates)"})})})]})]})}function AO(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,MO(l,...n)]}function MO(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function XS(e){const n=_O(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(DO);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function _O(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=zO(l),m=LO(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var OO=Symbol("radix.slottable");function DO(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OO}function LO(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function zO(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var PO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pn=PO.reduce((e,n)=>{const a=XS(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function ZS(e){const n=f.useRef({value:e,previous:e});return f.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var IO=[" ","Enter","ArrowUp","ArrowDown"],$O=[" ","Enter"],So="Select",[Md,_d,BO]=Kh(So),[Qs]=AO(So,[BO,Va]),Od=Va(),[UO,Ga]=Qs(So),[HO,VO]=Qs(So),QS=e=>{const{__scopeSelect:n,children:a,open:o,defaultOpen:l,onOpenChange:c,value:d,defaultValue:m,onValueChange:p,dir:h,name:b,autoComplete:g,disabled:y,required:w,form:j}=e,S=Od(n),[E,N]=f.useState(null),[k,T]=f.useState(null),[A,O]=f.useState(!1),M=Cl(h),[z,B]=ea({prop:o,defaultProp:l??!1,onChange:c,caller:So}),[K,U]=ea({prop:d,defaultProp:m,onChange:p,caller:So}),q=f.useRef(null),ue=E?j||!!E.closest("form"):!0,[pe,xe]=f.useState(new Set),se=Array.from(pe).map(L=>L.props.value).join(";");return s.jsx(fd,{...S,children:s.jsxs(UO,{required:w,scope:n,trigger:E,onTriggerChange:N,valueNode:k,onValueNodeChange:T,valueNodeHasChildren:A,onValueNodeHasChildrenChange:O,contentId:Yt(),value:K,onValueChange:U,open:z,onOpenChange:B,dir:M,triggerPointerDownPosRef:q,disabled:y,children:[s.jsx(Md.Provider,{scope:n,children:s.jsx(HO,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(L=>{xe(I=>new Set(I).add(L))},[]),onNativeOptionRemove:f.useCallback(L=>{xe(I=>{const H=new Set(I);return H.delete(L),H})},[]),children:a})}),ue?s.jsxs(Cj,{"aria-hidden":!0,required:w,tabIndex:-1,name:b,autoComplete:g,value:K,onChange:L=>U(L.target.value),disabled:y,form:j,children:[K===void 0?s.jsx("option",{value:""}):null,Array.from(pe)]},se):null]})})};QS.displayName=So;var JS="SelectTrigger",ej=f.forwardRef((e,n)=>{const{__scopeSelect:a,disabled:o=!1,...l}=e,c=Od(a),d=Ga(JS,a),m=d.disabled||o,p=Ve(n,d.onTriggerChange),h=_d(a),b=f.useRef("touch"),[g,y,w]=jj(S=>{const E=h().filter(T=>!T.disabled),N=E.find(T=>T.value===d.value),k=Nj(E,S,N);k!==void 0&&d.onValueChange(k.value)}),j=S=>{m||(d.onOpenChange(!0),w()),S&&(d.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return s.jsx(Nl,{asChild:!0,...c,children:s.jsx(Pn.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":Sj(d.value)?"":void 0,...l,ref:p,onClick:Ce(l.onClick,S=>{S.currentTarget.focus(),b.current!=="mouse"&&j(S)}),onPointerDown:Ce(l.onPointerDown,S=>{b.current=S.pointerType;const E=S.target;E.hasPointerCapture(S.pointerId)&&E.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(j(S),S.preventDefault())}),onKeyDown:Ce(l.onKeyDown,S=>{const E=g.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&y(S.key),!(E&&S.key===" ")&&IO.includes(S.key)&&(j(),S.preventDefault())})})})});ej.displayName=JS;var tj="SelectValue",nj=f.forwardRef((e,n)=>{const{__scopeSelect:a,className:o,style:l,children:c,placeholder:d="",...m}=e,p=Ga(tj,a),{onValueNodeHasChildrenChange:h}=p,b=c!==void 0,g=Ve(n,p.onValueNodeChange);return Pt(()=>{h(b)},[h,b]),s.jsx(Pn.span,{...m,ref:g,style:{pointerEvents:"none"},children:Sj(p.value)?s.jsx(s.Fragment,{children:d}):c})});nj.displayName=tj;var GO="SelectIcon",rj=f.forwardRef((e,n)=>{const{__scopeSelect:a,children:o,...l}=e;return s.jsx(Pn.span,{"aria-hidden":!0,...l,ref:n,children:o||"▼"})});rj.displayName=GO;var FO="SelectPortal",aj=e=>s.jsx(Ys,{asChild:!0,...e});aj.displayName=FO;var jo="SelectContent",oj=f.forwardRef((e,n)=>{const a=Ga(jo,e.__scopeSelect),[o,l]=f.useState();if(Pt(()=>{l(new DocumentFragment)},[]),!a.open){const c=o;return c?Ao.createPortal(s.jsx(sj,{scope:e.__scopeSelect,children:s.jsx(Md.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),c):null}return s.jsx(ij,{...e,ref:n})});oj.displayName=jo;var ar=10,[sj,Fa]=Qs(jo),WO="SelectContentImpl",YO=XS("SelectContent.RemoveScroll"),ij=f.forwardRef((e,n)=>{const{__scopeSelect:a,position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,side:m,sideOffset:p,align:h,alignOffset:b,arrowPadding:g,collisionBoundary:y,collisionPadding:w,sticky:j,hideWhenDetached:S,avoidCollisions:E,...N}=e,k=Ga(jo,a),[T,A]=f.useState(null),[O,M]=f.useState(null),z=Ve(n,ae=>A(ae)),[B,K]=f.useState(null),[U,q]=f.useState(null),ue=_d(a),[pe,xe]=f.useState(!1),se=f.useRef(!1);f.useEffect(()=>{if(T)return gd(T)},[T]),id();const L=f.useCallback(ae=>{const[be,...ve]=ue().map(ye=>ye.ref.current),[Y]=ve.slice(-1),le=document.activeElement;for(const ye of ae)if(ye===le||(ye==null||ye.scrollIntoView({block:"nearest"}),ye===be&&O&&(O.scrollTop=0),ye===Y&&O&&(O.scrollTop=O.scrollHeight),ye==null||ye.focus(),document.activeElement!==le))return},[ue,O]),I=f.useCallback(()=>L([B,T]),[L,B,T]);f.useEffect(()=>{pe&&I()},[pe,I]);const{onOpenChange:H,triggerPointerDownPosRef:Z}=k;f.useEffect(()=>{if(T){let ae={x:0,y:0};const be=Y=>{var le,ye;ae={x:Math.abs(Math.round(Y.pageX)-(((le=Z.current)==null?void 0:le.x)??0)),y:Math.abs(Math.round(Y.pageY)-(((ye=Z.current)==null?void 0:ye.y)??0))}},ve=Y=>{ae.x<=10&&ae.y<=10?Y.preventDefault():T.contains(Y.target)||H(!1),document.removeEventListener("pointermove",be),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",ve,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",ve,{capture:!0})}}},[T,H,Z]),f.useEffect(()=>{const ae=()=>H(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[H]);const[te,_]=jj(ae=>{const be=ue().filter(le=>!le.disabled),ve=be.find(le=>le.ref.current===document.activeElement),Y=Nj(be,ae,ve);Y&&setTimeout(()=>Y.ref.current.focus())}),D=f.useCallback((ae,be,ve)=>{const Y=!se.current&&!ve;(k.value!==void 0&&k.value===be||Y)&&(K(ae),Y&&(se.current=!0))},[k.value]),G=f.useCallback(()=>T==null?void 0:T.focus(),[T]),V=f.useCallback((ae,be,ve)=>{const Y=!se.current&&!ve;(k.value!==void 0&&k.value===be||Y)&&q(ae)},[k.value]),F=o==="popper"?fh:lj,oe=F===fh?{side:m,sideOffset:p,align:h,alignOffset:b,arrowPadding:g,collisionBoundary:y,collisionPadding:w,sticky:j,hideWhenDetached:S,avoidCollisions:E}:{};return s.jsx(sj,{scope:a,content:T,viewport:O,onViewportChange:M,itemRefCallback:D,selectedItem:B,onItemLeave:G,itemTextRefCallback:V,focusSelectedItem:I,selectedItemText:U,position:o,isPositioned:pe,searchRef:te,children:s.jsx(Tl,{as:YO,allowPinchZoom:!0,children:s.jsx(Sl,{asChild:!0,trapped:k.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ce(l,ae=>{var be;(be=k.trigger)==null||be.focus({preventScroll:!0}),ae.preventDefault()}),children:s.jsx(Gs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:s.jsx(F,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:ae=>ae.preventDefault(),...N,...oe,onPlaced:()=>xe(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Ce(N.onKeyDown,ae=>{const be=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!be&&ae.key.length===1&&_(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let Y=ue().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const le=ae.target,ye=Y.indexOf(le);Y=Y.slice(ye+1)}setTimeout(()=>L(Y)),ae.preventDefault()}})})})})})})});ij.displayName=WO;var qO="SelectItemAlignedPosition",lj=f.forwardRef((e,n)=>{const{__scopeSelect:a,onPlaced:o,...l}=e,c=Ga(jo,a),d=Fa(jo,a),[m,p]=f.useState(null),[h,b]=f.useState(null),g=Ve(n,z=>b(z)),y=_d(a),w=f.useRef(!1),j=f.useRef(!0),{viewport:S,selectedItem:E,selectedItemText:N,focusSelectedItem:k}=d,T=f.useCallback(()=>{if(c.trigger&&c.valueNode&&m&&h&&S&&E&&N){const z=c.trigger.getBoundingClientRect(),B=h.getBoundingClientRect(),K=c.valueNode.getBoundingClientRect(),U=N.getBoundingClientRect();if(c.dir!=="rtl"){const le=U.left-B.left,ye=K.left-le,Te=z.left-ye,Le=z.width+Te,rt=Math.max(Le,B.width),ht=window.innerWidth-ar,Mt=dh(ye,[ar,Math.max(ar,ht-rt)]);m.style.minWidth=Le+"px",m.style.left=Mt+"px"}else{const le=B.right-U.right,ye=window.innerWidth-K.right-le,Te=window.innerWidth-z.right-ye,Le=z.width+Te,rt=Math.max(Le,B.width),ht=window.innerWidth-ar,Mt=dh(ye,[ar,Math.max(ar,ht-rt)]);m.style.minWidth=Le+"px",m.style.right=Mt+"px"}const q=y(),ue=window.innerHeight-ar*2,pe=S.scrollHeight,xe=window.getComputedStyle(h),se=parseInt(xe.borderTopWidth,10),L=parseInt(xe.paddingTop,10),I=parseInt(xe.borderBottomWidth,10),H=parseInt(xe.paddingBottom,10),Z=se+L+pe+H+I,te=Math.min(E.offsetHeight*5,Z),_=window.getComputedStyle(S),D=parseInt(_.paddingTop,10),G=parseInt(_.paddingBottom,10),V=z.top+z.height/2-ar,F=ue-V,oe=E.offsetHeight/2,ae=E.offsetTop+oe,be=se+L+ae,ve=Z-be;if(be<=V){const le=q.length>0&&E===q[q.length-1].ref.current;m.style.bottom="0px";const ye=h.clientHeight-S.offsetTop-S.offsetHeight,Te=Math.max(F,oe+(le?G:0)+ye+I),Le=be+Te;m.style.height=Le+"px"}else{const le=q.length>0&&E===q[0].ref.current;m.style.top="0px";const Te=Math.max(V,se+S.offsetTop+(le?D:0)+oe)+ve;m.style.height=Te+"px",S.scrollTop=be-V+S.offsetTop}m.style.margin=`${ar}px 0`,m.style.minHeight=te+"px",m.style.maxHeight=ue+"px",o==null||o(),requestAnimationFrame(()=>w.current=!0)}},[y,c.trigger,c.valueNode,m,h,S,E,N,c.dir,o]);Pt(()=>T(),[T]);const[A,O]=f.useState();Pt(()=>{h&&O(window.getComputedStyle(h).zIndex)},[h]);const M=f.useCallback(z=>{z&&j.current===!0&&(T(),k==null||k(),j.current=!1)},[T,k]);return s.jsx(XO,{scope:a,contentWrapper:m,shouldExpandOnScrollRef:w,onScrollButtonChange:M,children:s.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:s.jsx(Pn.div,{...l,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});lj.displayName=qO;var KO="SelectPopperPosition",fh=f.forwardRef((e,n)=>{const{__scopeSelect:a,align:o="start",collisionPadding:l=ar,...c}=e,d=Od(a);return s.jsx(md,{...d,...c,ref:n,align:o,collisionPadding:l,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});fh.displayName=KO;var[XO,Mg]=Qs(jo,{}),mh="SelectViewport",cj=f.forwardRef((e,n)=>{const{__scopeSelect:a,nonce:o,...l}=e,c=Fa(mh,a),d=Mg(mh,a),m=Ve(n,c.onViewportChange),p=f.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),s.jsx(Md.Slot,{scope:a,children:s.jsx(Pn.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ce(l.onScroll,h=>{const b=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:y}=d;if(y!=null&&y.current&&g){const w=Math.abs(p.current-b.scrollTop);if(w>0){const j=window.innerHeight-ar*2,S=parseFloat(g.style.minHeight),E=parseFloat(g.style.height),N=Math.max(S,E);if(N<j){const k=N+w,T=Math.min(j,k),A=k-T;g.style.height=T+"px",g.style.bottom==="0px"&&(b.scrollTop=A>0?A:0,g.style.justifyContent="flex-end")}}}p.current=b.scrollTop})})})]})});cj.displayName=mh;var uj="SelectGroup",[ZO,QO]=Qs(uj),JO=f.forwardRef((e,n)=>{const{__scopeSelect:a,...o}=e,l=Yt();return s.jsx(ZO,{scope:a,id:l,children:s.jsx(Pn.div,{role:"group","aria-labelledby":l,...o,ref:n})})});JO.displayName=uj;var dj="SelectLabel",fj=f.forwardRef((e,n)=>{const{__scopeSelect:a,...o}=e,l=QO(dj,a);return s.jsx(Pn.div,{id:l.id,...o,ref:n})});fj.displayName=dj;var Vu="SelectItem",[eD,mj]=Qs(Vu),pj=f.forwardRef((e,n)=>{const{__scopeSelect:a,value:o,disabled:l=!1,textValue:c,...d}=e,m=Ga(Vu,a),p=Fa(Vu,a),h=m.value===o,[b,g]=f.useState(c??""),[y,w]=f.useState(!1),j=Ve(n,k=>{var T;return(T=p.itemRefCallback)==null?void 0:T.call(p,k,o,l)}),S=Yt(),E=f.useRef("touch"),N=()=>{l||(m.onValueChange(o),m.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(eD,{scope:a,value:o,disabled:l,textId:S,isSelected:h,onItemTextChange:f.useCallback(k=>{g(T=>T||((k==null?void 0:k.textContent)??"").trim())},[]),children:s.jsx(Md.ItemSlot,{scope:a,value:o,disabled:l,textValue:b,children:s.jsx(Pn.div,{role:"option","aria-labelledby":S,"data-highlighted":y?"":void 0,"aria-selected":h&&y,"data-state":h?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:j,onFocus:Ce(d.onFocus,()=>w(!0)),onBlur:Ce(d.onBlur,()=>w(!1)),onClick:Ce(d.onClick,()=>{E.current!=="mouse"&&N()}),onPointerUp:Ce(d.onPointerUp,()=>{E.current==="mouse"&&N()}),onPointerDown:Ce(d.onPointerDown,k=>{E.current=k.pointerType}),onPointerMove:Ce(d.onPointerMove,k=>{var T;E.current=k.pointerType,l?(T=p.onItemLeave)==null||T.call(p):E.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(d.onPointerLeave,k=>{var T;k.currentTarget===document.activeElement&&((T=p.onItemLeave)==null||T.call(p))}),onKeyDown:Ce(d.onKeyDown,k=>{var A;((A=p.searchRef)==null?void 0:A.current)!==""&&k.key===" "||($O.includes(k.key)&&N(),k.key===" "&&k.preventDefault())})})})})});pj.displayName=Vu;var Qi="SelectItemText",hj=f.forwardRef((e,n)=>{const{__scopeSelect:a,className:o,style:l,...c}=e,d=Ga(Qi,a),m=Fa(Qi,a),p=mj(Qi,a),h=VO(Qi,a),[b,g]=f.useState(null),y=Ve(n,N=>g(N),p.onItemTextChange,N=>{var k;return(k=m.itemTextRefCallback)==null?void 0:k.call(m,N,p.value,p.disabled)}),w=b==null?void 0:b.textContent,j=f.useMemo(()=>s.jsx("option",{value:p.value,disabled:p.disabled,children:w},p.value),[p.disabled,p.value,w]),{onNativeOptionAdd:S,onNativeOptionRemove:E}=h;return Pt(()=>(S(j),()=>E(j)),[S,E,j]),s.jsxs(s.Fragment,{children:[s.jsx(Pn.span,{id:p.textId,...c,ref:y}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Ao.createPortal(c.children,d.valueNode):null]})});hj.displayName=Qi;var gj="SelectItemIndicator",xj=f.forwardRef((e,n)=>{const{__scopeSelect:a,...o}=e;return mj(gj,a).isSelected?s.jsx(Pn.span,{"aria-hidden":!0,...o,ref:n}):null});xj.displayName=gj;var ph="SelectScrollUpButton",vj=f.forwardRef((e,n)=>{const a=Fa(ph,e.__scopeSelect),o=Mg(ph,e.__scopeSelect),[l,c]=f.useState(!1),d=Ve(n,o.onScrollButtonChange);return Pt(()=>{if(a.viewport&&a.isPositioned){let m=function(){const h=p.scrollTop>0;c(h)};const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?s.jsx(yj,{...e,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null});vj.displayName=ph;var hh="SelectScrollDownButton",bj=f.forwardRef((e,n)=>{const a=Fa(hh,e.__scopeSelect),o=Mg(hh,e.__scopeSelect),[l,c]=f.useState(!1),d=Ve(n,o.onScrollButtonChange);return Pt(()=>{if(a.viewport&&a.isPositioned){let m=function(){const h=p.scrollHeight-p.clientHeight,b=Math.ceil(p.scrollTop)<h;c(b)};const p=a.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[a.viewport,a.isPositioned]),l?s.jsx(yj,{...e,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=a;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null});bj.displayName=hh;var yj=f.forwardRef((e,n)=>{const{__scopeSelect:a,onAutoScroll:o,...l}=e,c=Fa("SelectScrollButton",a),d=f.useRef(null),m=_d(a),p=f.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return f.useEffect(()=>()=>p(),[p]),Pt(()=>{var b;const h=m().find(g=>g.ref.current===document.activeElement);(b=h==null?void 0:h.ref.current)==null||b.scrollIntoView({block:"nearest"})},[m]),s.jsx(Pn.div,{"aria-hidden":!0,...l,ref:n,style:{flexShrink:0,...l.style},onPointerDown:Ce(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(o,50))}),onPointerMove:Ce(l.onPointerMove,()=>{var h;(h=c.onItemLeave)==null||h.call(c),d.current===null&&(d.current=window.setInterval(o,50))}),onPointerLeave:Ce(l.onPointerLeave,()=>{p()})})}),tD="SelectSeparator",wj=f.forwardRef((e,n)=>{const{__scopeSelect:a,...o}=e;return s.jsx(Pn.div,{"aria-hidden":!0,...o,ref:n})});wj.displayName=tD;var gh="SelectArrow",nD=f.forwardRef((e,n)=>{const{__scopeSelect:a,...o}=e,l=Od(a),c=Ga(gh,a),d=Fa(gh,a);return c.open&&d.position==="popper"?s.jsx(pd,{...l,...o,ref:n}):null});nD.displayName=gh;var rD="SelectBubbleInput",Cj=f.forwardRef(({__scopeSelect:e,value:n,...a},o)=>{const l=f.useRef(null),c=Ve(o,l),d=ZS(n);return f.useEffect(()=>{const m=l.current;if(!m)return;const p=window.HTMLSelectElement.prototype,b=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==n&&b){const g=new Event("change",{bubbles:!0});b.call(m,n),m.dispatchEvent(g)}},[d,n]),s.jsx(Pn.select,{...a,style:{...GC,...a.style},ref:c,defaultValue:n})});Cj.displayName=rD;function Sj(e){return e===""||e===void 0}function jj(e){const n=Wt(e),a=f.useRef(""),o=f.useRef(0),l=f.useCallback(d=>{const m=a.current+d;n(m),(function p(h){a.current=h,window.clearTimeout(o.current),h!==""&&(o.current=window.setTimeout(()=>p(""),1e3))})(m)},[n]),c=f.useCallback(()=>{a.current="",window.clearTimeout(o.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(o.current),[]),[a,l,c]}function Nj(e,n,a){const l=n.length>1&&Array.from(n).every(h=>h===n[0])?n[0]:n,c=a?e.indexOf(a):-1;let d=aD(e,Math.max(c,0));l.length===1&&(d=d.filter(h=>h!==a));const p=d.find(h=>h.textValue.toLowerCase().startsWith(l.toLowerCase()));return p!==a?p:void 0}function aD(e,n){return e.map((a,o)=>e[(n+o)%e.length])}var oD=QS,Ej=ej,sD=nj,iD=rj,lD=aj,kj=oj,cD=cj,Tj=fj,Rj=pj,uD=hj,dD=xj,Aj=vj,Mj=bj,_j=wj;const No=oD,Eo=sD,Ba=f.forwardRef(({className:e,children:n,...a},o)=>s.jsxs(Ej,{ref:o,className:fe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[n,s.jsx(iD,{asChild:!0,children:s.jsx(vC,{className:"h-4 w-4 opacity-50"})})]}));Ba.displayName=Ej.displayName;const Oj=f.forwardRef(({className:e,...n},a)=>s.jsx(Aj,{ref:a,className:fe("flex cursor-default items-center justify-center py-1",e),...n,children:s.jsx(eA,{className:"h-4 w-4"})}));Oj.displayName=Aj.displayName;const Dj=f.forwardRef(({className:e,...n},a)=>s.jsx(Mj,{ref:a,className:fe("flex cursor-default items-center justify-center py-1",e),...n,children:s.jsx(vC,{className:"h-4 w-4"})}));Dj.displayName=Mj.displayName;const Ua=f.forwardRef(({className:e,children:n,position:a="popper",...o},l)=>s.jsx(lD,{children:s.jsxs(kj,{ref:l,className:fe("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...o,children:[s.jsx(Oj,{}),s.jsx(cD,{className:fe("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),s.jsx(Dj,{})]})}));Ua.displayName=kj.displayName;const fD=f.forwardRef(({className:e,...n},a)=>s.jsx(Tj,{ref:a,className:fe("px-2 py-1.5 text-sm font-semibold",e),...n}));fD.displayName=Tj.displayName;const an=f.forwardRef(({className:e,children:n,...a},o)=>s.jsxs(Rj,{ref:o,className:fe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[s.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(dD,{children:s.jsx(xC,{className:"h-4 w-4"})})}),s.jsx(uD,{children:n})]}));an.displayName=Rj.displayName;const mD=f.forwardRef(({className:e,...n},a)=>s.jsx(_j,{ref:a,className:fe("-mx-1 my-1 h-px bg-muted",e),...n}));mD.displayName=_j.displayName;function pD(){const{stats:e}=sd(),{user:n,logout:a,availableGroups:o,isImpersonating:l,impersonatedGroup:c,impersonateGroup:d,stopImpersonation:m,hasPermission:p}=Ut();n!=null&&n.isOwner||p("users.manage");const h=(e==null?void 0:e.bot.username)??"SupportBot",b=n?l2(n):h,g=(n==null?void 0:n.avatar)??(e==null?void 0:e.bot.avatar),y=e==null?void 0:e.bot.inviteUrl,w=new Intl.DateTimeFormat("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"}).format(new Date);return s.jsxs(s.Fragment,{children:[l&&c&&s.jsxs("div",{className:"relative z-50 flex items-center justify-between gap-3 bg-gradient-to-r from-amber-500/10 via-amber-500/15 to-amber-500/10 border-b border-amber-500/30 px-4 py-2 text-xs backdrop-blur-md shadow-sm",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-amber-500/20 text-amber-300 text-[11px] font-bold tracking-wide uppercase border border-amber-500/30",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-amber-400 animate-pulse"}),"Preview Mode"]}),s.jsxs("div",{className:"flex items-center gap-2 text-foreground font-medium",children:[s.jsx("span",{className:"text-muted-foreground",children:"Viewing dashboard as:"}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-md bg-secondary/80 border border-border/80",children:[s.jsx("span",{className:"size-2 rounded-full shrink-0 shadow-sm",style:{backgroundColor:c.color||"#10B981"}}),s.jsx("span",{className:"font-semibold text-xs text-foreground",children:c.name})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[o.length>1&&s.jsxs(No,{value:c.id,onValueChange:j=>d(j),children:[s.jsx(Ba,{className:"h-7 text-xs bg-background/80 border-amber-500/30 text-amber-200 focus:ring-amber-500/40 w-[160px]",children:s.jsx(Eo,{})}),s.jsx(Ua,{className:"border-border bg-card",children:o.map(j=>s.jsx(an,{value:j.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-2 rounded-full shrink-0",style:{backgroundColor:j.color||"#10B981"}}),s.jsx("span",{children:j.name})]})},j.id))})]}),s.jsx(he,{size:"sm",variant:"outline",className:"h-7 px-3 text-xs bg-card border-amber-500/40 text-amber-300 hover:bg-amber-500/20 hover:text-white transition-all shadow-sm",onClick:m,children:"Exit Preview Mode"})]})]}),s.jsxs("header",{className:"relative z-40 flex h-14 shrink-0 items-center gap-3 border-b border-border bg-card px-4 md:px-6",children:[s.jsx(sS,{className:"-ml-1 text-muted-foreground hover:text-foreground md:hidden"}),s.jsx("p",{className:"hidden shrink-0 text-sm font-medium text-muted-foreground lg:block",children:w}),s.jsx(F_,{className:"min-w-0 flex-1"}),s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[y?s.jsx(he,{variant:"ghost",size:"icon",className:"hidden size-9 text-muted-foreground sm:inline-flex",asChild:!0,children:s.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer","aria-label":"Invite bot to a server",title:"Invite bot to a server",children:s.jsx(ge,{icon:Au,size:18})})}):s.jsx(he,{variant:"ghost",size:"icon",className:"hidden size-9 text-muted-foreground sm:inline-flex",disabled:!0,"aria-label":"Invite bot to a server",title:"Invite link available when the bot is online",children:s.jsx(ge,{icon:Au,size:18})}),s.jsx(RO,{}),s.jsxs(dg,{children:[s.jsx(fg,{asChild:!0,children:s.jsxs(he,{variant:"ghost",className:"h-9 gap-2 rounded-full px-2 hover:bg-secondary",children:[s.jsxs(Ia,{className:"size-7",children:[s.jsx(Co,{src:g,alt:b}),s.jsx($a,{className:"bg-primary/20 text-xs text-primary",children:b.slice(0,2).toUpperCase()})]}),s.jsx("span",{className:"hidden max-w-[100px] truncate text-sm font-medium sm:inline",children:b}),s.jsx(ge,{icon:Q0,size:16,className:"text-muted-foreground"})]})}),s.jsxs(wd,{align:"end",className:"w-56",children:[s.jsx(mg,{children:"Account"}),s.jsx(ml,{}),n?s.jsxs(fl,{disabled:!0,className:"text-xs text-muted-foreground",children:[n.username,n.id?` · ${n.id}`:""]}):null,s.jsx(ml,{}),s.jsx(fl,{onClick:()=>{a()},children:"Sign out"})]})]})]})]})]})}const Jy={error:0,warning:1,info:2};function hD(e){return[...e].sort((n,a)=>{const o=Jy[n.severity]??9,l=Jy[a.severity]??9;return o!==l?o-l:n.title.localeCompare(a.title)})}function gD(e){const n=new Set;return e.filter(a=>n.has(a.id)?!1:(n.add(a.id),!0))}class xD{constructor(){$b(this,"clientProviders",new Map)}register(n){return this.clientProviders.set(n.id,n),this}unregister(n){this.clientProviders.delete(n)}async evaluateClientProviders(){const n=[];for(const a of this.clientProviders.values()){const o=await a.evaluate();Array.isArray(o)&&o.length&&n.push(...o)}return n}async loadAll(){const[n,a]=await Promise.all([Ee.getAlerts().catch(()=>({data:[]})),this.evaluateClientProviders()]),o=n.data??[];return hD(gD([...o,...a]))}}const vD=new xD,bD={error:{border:"border-destructive/40",bg:"bg-destructive/10",icon:"text-destructive",title:"text-destructive"},warning:{border:"border-amber-500/40",bg:"bg-amber-500/10",icon:"text-amber-500",title:"text-amber-200"},info:{border:"border-sky-500/40",bg:"bg-sky-500/10",icon:"text-sky-400",title:"text-sky-100"}},yD=Vs("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),We=f.forwardRef(({className:e,variant:n,...a},o)=>s.jsx("div",{ref:o,role:"alert",className:fe(yD({variant:n}),e),...a}));We.displayName="Alert";const Lj=f.forwardRef(({className:e,...n},a)=>s.jsx("h5",{ref:a,className:fe("mb-1 font-medium leading-none tracking-tight",e),...n}));Lj.displayName="AlertTitle";const Ye=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("text-sm [&_p]:leading-relaxed",e),...n}));Ye.displayName="AlertDescription";function wD(e){return e==="info"?f8:Bh}function CD({alert:e,context:n}){var d,m,p;const a=bD[e.severity],o=((d=e.meta)==null?void 0:d.extraGuilds)??[],l=(m=e.meta)==null?void 0:m.status,c=(p=e.meta)==null?void 0:p.progress;return s.jsxs(We,{variant:"destructive",className:`${a.border} ${a.bg} text-foreground`,children:[s.jsx(ge,{icon:wD(e.severity),size:18,className:a.icon}),s.jsx(Lj,{className:a.title,children:e.title}),s.jsxs(Ye,{className:"space-y-3 text-sm text-muted-foreground",children:[s.jsx("p",{children:e.message}),e.category==="guild"&&l==="missing_config"?s.jsxs("p",{children:["Open"," ",s.jsx(Ft,{to:"/configs?file=supportbot",className:"font-medium text-primary underline-offset-4 hover:underline",children:"Bot config"})," ","and set ",s.jsx("strong",{className:"text-foreground",children:"Server (guild) ID"})," ","(enable Developer Mode in Discord, then right-click your server → Copy Server ID)."]}):null,e.category==="modules"&&c?s.jsxs("p",{className:"text-xs",children:["Progress: ",s.jsx("span",{className:"text-foreground",children:c})]}):null,o.length>0?s.jsx("ul",{className:"space-y-2",children:o.map(h=>s.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border bg-background/40 px-3 py-2",children:[s.jsxs("span",{children:[s.jsx("span",{className:"font-medium text-foreground",children:h.name}),s.jsx("span",{className:"ml-2 font-mono text-xs",children:h.id})]}),n.canLeaveGuild?s.jsxs(he,{type:"button",size:"sm",variant:"outline",disabled:n.leavingGuildId===h.id,onClick:()=>void n.onLeaveGuild(h.id),children:[s.jsx(ge,{icon:m8,size:14,className:"mr-1.5"}),n.leavingGuildId===h.id?"Leaving…":"Leave server"]}):null]},h.id))}):null,n.actionError?s.jsx("p",{className:"text-destructive",children:n.actionError}):null,s.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[e.action?s.jsx(he,{asChild:!0,size:"sm",variant:"secondary",children:s.jsx(Ft,{to:e.action.href,children:e.action.label})}):null,e.category==="guild"?s.jsx("p",{className:"text-xs",children:"The dashboard stays online while you fix this. Some features may be limited until setup is complete."}):null]})]})]})}const SD=15e3;function jD(){const{hasPermission:e}=Ut(),n=e("settings.update"),[a,o]=f.useState([]),[l,c]=f.useState(null),[d,m]=f.useState(""),p=f.useCallback(async()=>{try{const g=await vD.loadAll();o(g),m("")}catch{}},[]);f.useEffect(()=>{p();const g=window.setInterval(()=>void p(),SD);return()=>window.clearInterval(g)},[p]);async function h(g){if(n){c(g),m("");try{await Ee.leaveGuild(g),await p()}catch(y){m(y instanceof Error?y.message:"Could not leave server")}finally{c(null)}}}if(a.length===0)return null;const b={canLeaveGuild:n,onLeaveGuild:h,leavingGuildId:l,actionError:d};return s.jsx("div",{className:"space-y-3",children:a.map(g=>s.jsx(CD,{alert:g,context:b},g.id))})}function ND(){return s.jsx(_8,{children:s.jsx(nO,{children:s.jsxs(aS,{children:[s.jsx(WM,{}),s.jsxs(lS,{className:"min-h-svh bg-background",children:[s.jsx(pD,{}),s.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4 md:p-6 lg:p-8",children:[s.jsx(jD,{}),s.jsx(NE,{})]})]})]})})})}const zj=f.createContext(null);function ED({children:e}){const[n,a]=f.useState(null),[o,l]=f.useState(!0),[c,d]=f.useState(""),m=f.useCallback(async()=>{d("");try{const h=await Ee.getSetupStatus();a(h.data??null)}catch(h){d(h instanceof Error?h.message:"Could not load setup status"),a(null)}},[]);f.useEffect(()=>{m().finally(()=>l(!1))},[m]);const p=f.useMemo(()=>({status:n,loading:o,error:c,complete:!!(n!=null&&n.complete),refresh:m}),[n,o,c,m]);return s.jsx(zj.Provider,{value:p,children:e})}function Pj(){const e=f.useContext(zj);if(!e)throw new Error("useSetup must be used within SetupProvider");return e}var kD="Label",Ij=f.forwardRef((e,n)=>s.jsx(zn.label,{...e,ref:n,onMouseDown:a=>{var l;a.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));Ij.displayName=kD;var $j=Ij;const TD=Vs("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ze=f.forwardRef(({className:e,...n},a)=>s.jsx($j,{ref:a,className:fe(TD(),e),...n}));ze.displayName=$j.displayName;function RD(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,AD(l,...n)]}function AD(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function MD(e){const n=_D(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(DD);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function _D(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=zD(l),m=LD(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var OD=Symbol("radix.slottable");function DD(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OD}function LD(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function zD(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var PD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Bj=PD.reduce((e,n)=>{const a=MD(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),Dd="Switch",[ID]=RD(Dd),[$D,BD]=ID(Dd),Uj=f.forwardRef((e,n)=>{const{__scopeSwitch:a,name:o,checked:l,defaultChecked:c,required:d,disabled:m,value:p="on",onCheckedChange:h,form:b,...g}=e,[y,w]=f.useState(null),j=Ve(n,T=>w(T)),S=f.useRef(!1),E=y?b||!!y.closest("form"):!0,[N,k]=ea({prop:l,defaultProp:c??!1,onChange:h,caller:Dd});return s.jsxs($D,{scope:a,checked:N,disabled:m,children:[s.jsx(Bj.button,{type:"button",role:"switch","aria-checked":N,"aria-required":d,"data-state":Fj(N),"data-disabled":m?"":void 0,disabled:m,value:p,...g,ref:j,onClick:Ce(e.onClick,T=>{k(A=>!A),E&&(S.current=T.isPropagationStopped(),S.current||T.stopPropagation())})}),E&&s.jsx(Gj,{control:y,bubbles:!S.current,name:o,value:p,checked:N,required:d,disabled:m,form:b,style:{transform:"translateX(-100%)"}})]})});Uj.displayName=Dd;var Hj="SwitchThumb",Vj=f.forwardRef((e,n)=>{const{__scopeSwitch:a,...o}=e,l=BD(Hj,a);return s.jsx(Bj.span,{"data-state":Fj(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:n})});Vj.displayName=Hj;var UD="SwitchBubbleInput",Gj=f.forwardRef(({__scopeSwitch:e,control:n,checked:a,bubbles:o=!0,...l},c)=>{const d=f.useRef(null),m=Ve(d,c),p=ZS(a),h=X2(n);return f.useEffect(()=>{const b=d.current;if(!b)return;const g=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(g,"checked").set;if(p!==a&&w){const j=new Event("click",{bubbles:o});w.call(b,a),b.dispatchEvent(j)}},[p,a,o]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...l,tabIndex:-1,ref:m,style:{...l.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Gj.displayName=UD;function Fj(e){return e?"checked":"unchecked"}var Wj=Uj,HD=Vj;const At=f.forwardRef(({className:e,...n},a)=>s.jsx(Wj,{className:fe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...n,ref:a,children:s.jsx(HD,{className:fe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));At.displayName=Wj.displayName;const Ld=f.forwardRef(({className:e,...n},a)=>s.jsx("textarea",{className:fe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...n}));Ld.displayName="Textarea";function zd(){return(zd=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e}).apply(this,arguments)}function Yj(e,n){if(e==null)return{};var a,o,l={},c=Object.keys(e);for(o=0;o<c.length;o++)n.indexOf(a=c[o])>=0||(l[a]=e[a]);return l}function tl(e){var n=f.useRef(e),a=f.useRef(function(o){n.current&&n.current(o)});return n.current=e,a.current}var hl=function(e,n,a){return n===void 0&&(n=0),a===void 0&&(a=1),e>a?a:e<n?n:e},nl=function(e){return"touches"in e},xh=function(e){return e&&e.ownerDocument.defaultView||self},e0=function(e,n,a){var o=e.getBoundingClientRect(),l=nl(n)?(function(c,d){for(var m=0;m<c.length;m++)if(c[m].identifier===d)return c[m];return c[0]})(n.touches,a):n;return{left:hl((l.pageX-(o.left+xh(e).pageXOffset))/o.width),top:hl((l.pageY-(o.top+xh(e).pageYOffset))/o.height)}},t0=function(e){!nl(e)&&e.preventDefault()},qj=me.memo(function(e){var n=e.onMove,a=e.onKey,o=e.onEnd,l=Yj(e,["onMove","onKey","onEnd"]),c=f.useRef(null),d=tl(n),m=tl(a),p=tl(o),h=f.useRef(null),b=f.useRef(!1),g=f.useMemo(function(){var E=function(T){t0(T),(nl(T)?T.touches.length>0:T.buttons>0)&&c.current?d(e0(c.current,T,h.current)):(k(!1),p())},N=function(){k(!1),p()};function k(T){var A=b.current,O=xh(c.current),M=T?O.addEventListener:O.removeEventListener;M(A?"touchmove":"mousemove",E),M(A?"touchend":"mouseup",N)}return[function(T){var A=T.nativeEvent,O=c.current;if(O&&(t0(A),!(function(z,B){return B&&!nl(z)})(A,b.current)&&O)){if(nl(A)){b.current=!0;var M=A.changedTouches||[];M.length&&(h.current=M[0].identifier)}O.focus(),d(e0(O,A,h.current)),k(!0)}},function(T){var A=T.which||T.keyCode;A<37||A>40||(T.preventDefault(),m({left:A===39?.05:A===37?-.05:0,top:A===40?.05:A===38?-.05:0}))},function(T){var A=T.which||T.keyCode;A>=37&&A<=40&&p()},k]},[m,d,p]),y=g[0],w=g[1],j=g[2],S=g[3];return f.useEffect(function(){return S},[S]),me.createElement("div",zd({},l,{onTouchStart:y,onMouseDown:y,className:"react-colorful__interactive",ref:c,onKeyDown:w,onKeyUp:j,tabIndex:0,role:"slider"}))}),_g=function(e){return e.filter(Boolean).join(" ")},Kj=function(e){var n=e.color,a=e.left,o=e.top,l=o===void 0?.5:o,c=_g(["react-colorful__pointer",e.className]);return me.createElement("div",{className:c,style:{top:100*l+"%",left:100*a+"%"}},me.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:n}}))},on=function(e,n,a){return n===void 0&&(n=0),a===void 0&&(a=Math.pow(10,n)),Math.round(a*e)/a},VD=function(e){return qD(vh(e))},vh=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?on(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?on(parseInt(e.substring(6,8),16)/255,2):1}},GD=function(e){return YD(WD(e))},FD=function(e){var n=e.s,a=e.v,o=e.a,l=(200-n)*a/100;return{h:on(e.h),s:on(l>0&&l<200?n*a/100/(l<=100?l:200-l)*100:0),l:on(l/2),a:on(o,2)}},bh=function(e){var n=FD(e);return"hsl("+n.h+", "+n.s+"%, "+n.l+"%)"},WD=function(e){var n=e.h,a=e.s,o=e.v,l=e.a;n=n/360*6,a/=100,o/=100;var c=Math.floor(n),d=o*(1-a),m=o*(1-(n-c)*a),p=o*(1-(1-n+c)*a),h=c%6;return{r:on(255*[o,m,d,d,p,o][h]),g:on(255*[p,o,o,m,d,d][h]),b:on(255*[d,d,p,o,o,m][h]),a:on(l,2)}},uu=function(e){var n=e.toString(16);return n.length<2?"0"+n:n},YD=function(e){var n=e.r,a=e.g,o=e.b,l=e.a,c=l<1?uu(on(255*l)):"";return"#"+uu(n)+uu(a)+uu(o)+c},qD=function(e){var n=e.r,a=e.g,o=e.b,l=e.a,c=Math.max(n,a,o),d=c-Math.min(n,a,o),m=d?c===n?(a-o)/d:c===a?2+(o-n)/d:4+(n-a)/d:0;return{h:on(60*(m<0?m+6:m)),s:on(c?d/c*100:0),v:on(c/255*100),a:l}},KD=me.memo(function(e){var n=e.hue,a=e.onChange,o=e.onChangeEnd,l=_g(["react-colorful__hue",e.className]);return me.createElement("div",{className:l},me.createElement(qj,{onMove:function(c){a({h:360*c.left})},onKey:function(c){a({h:hl(n+360*c.left,0,360)})},onEnd:o,"aria-label":"Hue","aria-valuenow":on(n),"aria-valuemax":"360","aria-valuemin":"0"},me.createElement(Kj,{className:"react-colorful__hue-pointer",left:n/360,color:bh({h:n,s:100,v:100,a:1})})))}),XD=me.memo(function(e){var n=e.hsva,a=e.onChange,o=e.onChangeEnd,l={backgroundColor:bh({h:n.h,s:100,v:100,a:1})};return me.createElement("div",{className:"react-colorful__saturation",style:l},me.createElement(qj,{onMove:function(c){a({s:100*c.left,v:100-100*c.top})},onKey:function(c){a({s:hl(n.s+100*c.left,0,100),v:hl(n.v-100*c.top,0,100)})},onEnd:o,"aria-label":"Color","aria-valuetext":"Saturation "+on(n.s)+"%, Brightness "+on(n.v)+"%"},me.createElement(Kj,{className:"react-colorful__saturation-pointer",top:1-n.v/100,left:n.s/100,color:bh(n)})))}),Xj=function(e,n){if(e===n)return!0;for(var a in e)if(e[a]!==n[a])return!1;return!0},ZD=function(e,n){return e.toLowerCase()===n.toLowerCase()||Xj(vh(e),vh(n))};function QD(e,n,a,o){var l=tl(a),c=tl(o),d=f.useState(function(){return e.toHsva(n)}),m=d[0],p=d[1],h=f.useRef({color:n,hsva:m}),b=f.useRef(!1);f.useEffect(function(){if(!e.equal(n,h.current.color)){var w=e.toHsva(n);h.current={hsva:w,color:n},p(w),b.current=!1}},[n,e]),f.useEffect(function(){var w;Xj(m,h.current.hsva)||e.equal(w=e.fromHsva(m),h.current.color)||(h.current={hsva:m,color:w},l(w),b.current=!0)},[m,e,l]);var g=f.useCallback(function(w){p(function(j){return Object.assign({},j,w)})},[]),y=f.useCallback(function(){b.current&&(b.current=!1,c(h.current.color))},[c]);return[m,g,y]}var JD=typeof window<"u"?f.useLayoutEffect:f.useEffect,eL=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},n0=new Map,tL=function(e){JD(function(){var n=e.current?e.current.ownerDocument:document;if(n!==void 0&&!n0.has(n)){var a=n.createElement("style");a.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,n0.set(n,a);var o=eL();o&&a.setAttribute("nonce",o),n.head.appendChild(a)}},[])},nL=function(e){var n=e.className,a=e.colorModel,o=e.color,l=o===void 0?a.defaultColor:o,c=e.onChange,d=e.onChangeEnd,m=Yj(e,["className","colorModel","color","onChange","onChangeEnd"]),p=f.useRef(null);tL(p);var h=QD(a,l,c,d),b=h[0],g=h[1],y=h[2],w=_g(["react-colorful",n]);return me.createElement("div",zd({},m,{ref:p,className:w}),me.createElement(XD,{hsva:b,onChange:g,onChangeEnd:y}),me.createElement(KD,{hue:b.h,onChange:g,onChangeEnd:y,className:"react-colorful__last-control"}))},rL={defaultColor:"000",toHsva:VD,fromHsva:function(e){return GD({h:e.h,s:e.s,v:e.v,a:1})},equal:ZD},aL=function(e){return me.createElement(nL,zd({},e,{colorModel:rL}))};function jr(e,n="#000000"){let a=String(e??"").trim();if(!a)return n;a.startsWith("#")||(a=`#${a}`);const o=a.slice(1);return/^[0-9a-fA-F]{3}$/.test(o)?`#${o.split("").map(l=>l+l).join("").toLowerCase()}`:/^[0-9a-fA-F]{6}$/.test(o)?`#${o.toLowerCase()}`:n}function yh(e){const n=String(e??"").trim();return/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(n)||/^[0-9a-fA-F]{6}$/.test(n)}function oL(e){const n=f.useRef(null);return f.useEffect(()=>{e&&(typeof e=="function"?e(n.current):e.current=n.current)}),n}function sL(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,iL(l,...n)]}function iL(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function Zj(e){const n=lL(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find(uL);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function lL(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=fL(l),m=dL(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var cL=Symbol("radix.slottable");function uL(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cL}function dL(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function fL(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var mL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qj=mL.reduce((e,n)=>{const a=Zj(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),Pd="Popover",[Jj]=sL(Pd,[Va]),Bl=Va(),[pL,Wa]=Jj(Pd),e5=e=>{const{__scopePopover:n,children:a,open:o,defaultOpen:l,onOpenChange:c,modal:d=!1}=e,m=Bl(n),p=f.useRef(null),[h,b]=f.useState(!1),[g,y]=ea({prop:o,defaultProp:l??!1,onChange:c,caller:Pd});return s.jsx(fd,{...m,children:s.jsx(pL,{scope:n,contentId:Yt(),triggerRef:p,open:g,onOpenChange:y,onOpenToggle:f.useCallback(()=>y(w=>!w),[y]),hasCustomAnchor:h,onCustomAnchorAdd:f.useCallback(()=>b(!0),[]),onCustomAnchorRemove:f.useCallback(()=>b(!1),[]),modal:d,children:a})})};e5.displayName=Pd;var t5="PopoverAnchor",hL=f.forwardRef((e,n)=>{const{__scopePopover:a,...o}=e,l=Wa(t5,a),c=Bl(a),{onCustomAnchorAdd:d,onCustomAnchorRemove:m}=l;return f.useEffect(()=>(d(),()=>m()),[d,m]),s.jsx(Nl,{...c,...o,ref:n})});hL.displayName=t5;var n5="PopoverTrigger",r5=f.forwardRef((e,n)=>{const{__scopePopover:a,...o}=e,l=Wa(n5,a),c=Bl(a),d=Ve(n,l.triggerRef),m=s.jsx(Qj.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":l5(l.open),...o,ref:d,onClick:Ce(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?m:s.jsx(Nl,{asChild:!0,...c,children:m})});r5.displayName=n5;var Og="PopoverPortal",[gL,xL]=Jj(Og,{forceMount:void 0}),a5=e=>{const{__scopePopover:n,forceMount:a,children:o,container:l}=e,c=Wa(Og,n);return s.jsx(gL,{scope:n,forceMount:a,children:s.jsx(sn,{present:a||c.open,children:s.jsx(Ys,{asChild:!0,container:l,children:o})})})};a5.displayName=Og;var Ps="PopoverContent",o5=f.forwardRef((e,n)=>{const a=xL(Ps,e.__scopePopover),{forceMount:o=a.forceMount,...l}=e,c=Wa(Ps,e.__scopePopover);return s.jsx(sn,{present:o||c.open,children:c.modal?s.jsx(bL,{...l,ref:n}):s.jsx(yL,{...l,ref:n})})});o5.displayName=Ps;var vL=Zj("PopoverContent.RemoveScroll"),bL=f.forwardRef((e,n)=>{const a=Wa(Ps,e.__scopePopover),o=f.useRef(null),l=Ve(n,o),c=f.useRef(!1);return f.useEffect(()=>{const d=o.current;if(d)return gd(d)},[]),s.jsx(Tl,{as:vL,allowPinchZoom:!0,children:s.jsx(s5,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,d=>{var m;d.preventDefault(),c.current||(m=a.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,d=>{const m=d.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,h=m.button===2||p;c.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})}),yL=f.forwardRef((e,n)=>{const a=Wa(Ps,e.__scopePopover),o=f.useRef(!1),l=f.useRef(!1);return s.jsx(s5,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var d,m;(d=e.onCloseAutoFocus)==null||d.call(e,c),c.defaultPrevented||(o.current||(m=a.triggerRef.current)==null||m.focus(),c.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:c=>{var p,h;(p=e.onInteractOutside)==null||p.call(e,c),c.defaultPrevented||(o.current=!0,c.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=c.target;((h=a.triggerRef.current)==null?void 0:h.contains(d))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&l.current&&c.preventDefault()}})}),s5=f.forwardRef((e,n)=>{const{__scopePopover:a,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:b,...g}=e,y=Wa(Ps,a),w=Bl(a);return id(),s.jsx(Sl,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:c,children:s.jsx(Gs,{asChild:!0,disableOutsidePointerEvents:d,onInteractOutside:b,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),children:s.jsx(md,{"data-state":l5(y.open),role:"dialog",id:y.contentId,...w,...g,ref:n,style:{...g.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)"}})})})}),i5="PopoverClose",wL=f.forwardRef((e,n)=>{const{__scopePopover:a,...o}=e,l=Wa(i5,a);return s.jsx(Qj.button,{type:"button",...o,ref:n,onClick:Ce(e.onClick,()=>l.onOpenChange(!1))})});wL.displayName=i5;var CL="PopoverArrow",SL=f.forwardRef((e,n)=>{const{__scopePopover:a,...o}=e,l=Bl(a);return s.jsx(pd,{...l,...o,ref:n})});SL.displayName=CL;function l5(e){return e?"open":"closed"}var jL=e5,NL=r5,EL=a5,c5=o5;const kL=jL,TL=NL,u5=f.forwardRef(({className:e,align:n="center",sideOffset:a=4,...o},l)=>s.jsx(EL,{children:s.jsx(c5,{ref:l,align:n,sideOffset:a,className:fe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md 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 origin-[--radix-popover-content-transform-origin]",e),...o})}));u5.displayName=c5.displayName;const Id=f.forwardRef(({disabled:e,value:n,onChange:a,onBlur:o,name:l,className:c,size:d,...m},p)=>{const h=oL(p),[b,g]=f.useState(!1),[y,w]=f.useState(""),j=f.useMemo(()=>jr(n,"#ffffff"),[n]),S=b&&y?y:j;function E(N){yh(N)&&a(jr(N)),w("")}return s.jsxs(kL,{open:b,onOpenChange:N=>{N||E(y||j),g(N)},children:[s.jsx(TL,{asChild:!0,disabled:e,onBlur:o,children:s.jsx(he,{...m,type:"button",className:fe("size-10 shrink-0 overflow-hidden rounded-md border border-border p-0 shadow-sm",c),name:l,onClick:()=>g(!0),size:d??"icon",style:{backgroundColor:j},variant:"outline","aria-label":"Pick colour",children:s.jsx("span",{className:"sr-only",children:j})})}),s.jsxs(u5,{className:"w-auto border-border bg-card p-3",align:"start",children:[s.jsx(aL,{className:"color-picker-swatch",color:j,onChange:N=>{w(""),a(jr(N))}}),s.jsx(Ie,{ref:h,maxLength:7,value:S,onChange:N=>{const k=N.currentTarget.value;w(k),yh(k)&&a(jr(k))},onBlur:()=>E(y||j),onKeyDown:N=>{N.key==="Enter"&&(E(y||j),g(!1))},className:"mt-3 border-border bg-secondary/30 font-mono text-sm uppercase",placeholder:"#000000"})]})]})});Id.displayName="ColorPicker";function RL({value:e,onChange:n,placeholder:a="Add item…"}){const o=Array.isArray(e)?e:[];return s.jsxs("div",{className:"space-y-2",children:[o.map((l,c)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ie,{value:l,onChange:d=>{const m=[...o];m[c]=d.target.value,n(m)},placeholder:a,className:"border-border bg-secondary/30"}),s.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 text-destructive hover:bg-destructive/10",onClick:()=>n(o.filter((d,m)=>m!==c)),children:s.jsx(ge,{icon:wl,size:16})})]},c)),s.jsxs(he,{type:"button",variant:"outline",size:"sm",className:"w-full border-dashed border-border",onClick:()=>n([...o,""]),children:[s.jsx(ge,{icon:Au,size:16,className:"mr-2"}),"Add line"]})]})}const gl="system",Dg=[{id:"Inter",label:"Inter"},{id:"Roboto",label:"Roboto"},{id:"Open Sans",label:"Open Sans"},{id:"Lato",label:"Lato"},{id:"Montserrat",label:"Montserrat"},{id:"Poppins",label:"Poppins"},{id:"Nunito",label:"Nunito"},{id:"Raleway",label:"Raleway"},{id:"Work Sans",label:"Work Sans"},{id:"Source Sans 3",label:"Source Sans 3"},{id:"DM Sans",label:"DM Sans"},{id:"Manrope",label:"Manrope"},{id:"Outfit",label:"Outfit"},{id:"Rubik",label:"Rubik"},{id:"Ubuntu",label:"Ubuntu"},{id:"Fira Sans",label:"Fira Sans"},{id:"PT Sans",label:"PT Sans"},{id:"Noto Sans",label:"Noto Sans"},{id:"Oswald",label:"Oswald"},{id:"Merriweather",label:"Merriweather"},{id:"Playfair Display",label:"Playfair Display"},{id:"Libre Baskerville",label:"Libre Baskerville"},{id:"JetBrains Mono",label:"JetBrains Mono"},{id:"Fira Code",label:"Fira Code"}],r0=new Set(Dg.map(e=>e.id));function AL(e){return`https://fonts.googleapis.com/css2?${e.map(a=>`family=${encodeURIComponent(a).replace(/%20/g,"+")}:wght@400;600;700;800`).join("&")}&display=swap`}function ML(){const e="supportbot-google-fonts";if(document.getElementById(e))return;const n=document.createElement("link");n.id=e,n.rel="stylesheet",n.href=AL(Dg.map(a=>a.id)),document.head.appendChild(n)}function d5(e){var l;if(!e||typeof e!="string")return"Inter";const n=e.trim();if(n===gl)return gl;if(!n.includes(","))return r0.has(n)?n:"Inter";const a=n.match(/^["']?([^"',]+)["']?/),o=(l=a==null?void 0:a[1])==null?void 0:l.trim();return o&&r0.has(o)?o:"Inter"}function Rp(e){return e===gl?'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif':`"${e}", ui-sans-serif, system-ui, sans-serif`}function _L({field:e,value:n,onChange:a,readOnly:o}){const l=e.path.replace(/\./g,"-"),c=d5(n);return f.useEffect(()=>{ML()},[]),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,s.jsxs(No,{value:c,disabled:o,onValueChange:a,children:[s.jsx(Ba,{id:l,className:"border-border bg-secondary/30",style:{fontFamily:Rp(c)},children:s.jsx(Eo,{placeholder:"Choose a font…"})}),s.jsxs(Ua,{className:"max-h-[min(320px,50vh)]",children:[s.jsx(an,{value:gl,style:{fontFamily:Rp(gl)},children:"System default"}),Dg.map(d=>s.jsx(an,{value:d.id,style:{fontFamily:Rp(d.id)},children:d.label},d.id))]})]})]})}function OL({id:e,label:n,description:a,kind:o,value:l,onChange:c,readOnly:d}){const[m,p]=f.useState(null),[h,b]=f.useState(""),[g,y]=f.useState(!0);f.useEffect(()=>{let E=!1;return y(!0),Ee.getGuildResources().then(N=>{E||N.data&&(p(N.data),b(""))}).catch(N=>{E||b(N instanceof Error?N.message:"Could not load server list")}).finally(()=>{E||y(!1)}),()=>{E=!0}},[]);const w=f.useMemo(()=>m?o==="role"?m.roles:o==="category"?m.categories:m.channels:[],[m,o]),j=String(l??""),S=w.find(E=>E.id===j);return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:e,children:n}),a?s.jsx("p",{className:"text-xs text-muted-foreground",children:a}):null,m?s.jsxs(No,{value:S?j:"",disabled:d||g,onValueChange:E=>c(E),children:[s.jsx(Ba,{id:e,className:"border-border bg-secondary/30",children:s.jsx(Eo,{placeholder:g?"Loading…":`Select ${o} from ${m.guildName}…`})}),s.jsx(Ua,{className:"max-h-64",children:w.map(E=>s.jsxs(an,{value:E.id,children:[E.name,s.jsx("span",{className:"ml-2 font-mono text-xs text-muted-foreground",children:E.id})]},E.id))})]}):null,s.jsx(Ie,{value:j,disabled:d,onChange:E=>c(E.target.value),placeholder:o==="role"?"Role ID (ROLE_ID)":o==="category"?"Category ID":"Channel ID",className:"border-border bg-secondary/30 font-mono text-sm"}),h?s.jsx("p",{className:"text-xs text-amber-500",children:h}):null,!h&&!m&&!g?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Set General.GuildId and invite the bot to pick from a list."}):null]})}function DL(e,n=[]){let a=[];function o(c,d){const m=f.createContext(d),p=a.length;a=[...a,d];const h=g=>{var N;const{scope:y,children:w,...j}=g,S=((N=y==null?void 0:y[e])==null?void 0:N[p])||m,E=f.useMemo(()=>j,Object.values(j));return s.jsx(S.Provider,{value:E,children:w})};h.displayName=c+"Provider";function b(g,y){var S;const w=((S=y==null?void 0:y[e])==null?void 0:S[p])||m,j=f.useContext(w);if(j)return j;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[h,b]}const l=()=>{const c=a.map(d=>f.createContext(d));return function(m){const p=(m==null?void 0:m[e])||c;return f.useMemo(()=>({[`__scope${e}`]:{...m,[e]:p}}),[m,p])}};return l.scopeName=e,[o,LL(l,...n)]}function LL(...e){const n=e[0];if(e.length===1)return n;const a=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const d=o.reduce((m,{useScope:p,scopeName:h})=>{const g=p(c)[`__scope${h}`];return{...m,...g}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return a.scopeName=n.scopeName,a}function zL(e){const n=PL(e),a=f.forwardRef((o,l)=>{const{children:c,...d}=o,m=f.Children.toArray(c),p=m.find($L);if(p){const h=p.props.children,b=m.map(g=>g===p?f.Children.count(h)>1?f.Children.only(null):f.isValidElement(h)?h.props.children:null:g);return s.jsx(n,{...d,ref:l,children:f.isValidElement(h)?f.cloneElement(h,void 0,b):null})}return s.jsx(n,{...d,ref:l,children:c})});return a.displayName=`${e}.Slot`,a}function PL(e){const n=f.forwardRef((a,o)=>{const{children:l,...c}=a;if(f.isValidElement(l)){const d=UL(l),m=BL(c,l.props);return l.type!==f.Fragment&&(m.ref=o?gt(o,d):d),f.cloneElement(l,m)}return f.Children.count(l)>1?f.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var IL=Symbol("radix.slottable");function $L(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===IL}function BL(e,n){const a={...n};for(const o in n){const l=e[o],c=n[o];/^on[A-Z]/.test(o)?l&&c?a[o]=(...m)=>{const p=c(...m);return l(...m),p}:l&&(a[o]=l):o==="style"?a[o]={...l,...c}:o==="className"&&(a[o]=[l,c].filter(Boolean).join(" "))}return{...e,...a}}function UL(e){var o,l;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var HL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$d=HL.reduce((e,n)=>{const a=zL(`Primitive.${n}`),o=f.forwardRef((l,c)=>{const{asChild:d,...m}=l,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:c})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{}),Bd="Tabs",[VL]=DL(Bd,[hd]),f5=hd(),[GL,Lg]=VL(Bd),m5=f.forwardRef((e,n)=>{const{__scopeTabs:a,value:o,onValueChange:l,defaultValue:c,orientation:d="horizontal",dir:m,activationMode:p="automatic",...h}=e,b=Cl(m),[g,y]=ea({prop:o,onChange:l,defaultProp:c??"",caller:Bd});return s.jsx(GL,{scope:a,baseId:Yt(),value:g,onValueChange:y,orientation:d,dir:b,activationMode:p,children:s.jsx($d.div,{dir:b,"data-orientation":d,...h,ref:n})})});m5.displayName=Bd;var p5="TabsList",h5=f.forwardRef((e,n)=>{const{__scopeTabs:a,loop:o=!0,...l}=e,c=Lg(p5,a),d=f5(a);return s.jsx(mw,{asChild:!0,...d,orientation:c.orientation,dir:c.dir,loop:o,children:s.jsx($d.div,{role:"tablist","aria-orientation":c.orientation,...l,ref:n})})});h5.displayName=p5;var g5="TabsTrigger",x5=f.forwardRef((e,n)=>{const{__scopeTabs:a,value:o,disabled:l=!1,...c}=e,d=Lg(g5,a),m=f5(a),p=y5(d.baseId,o),h=w5(d.baseId,o),b=o===d.value;return s.jsx(pw,{asChild:!0,...m,focusable:!l,active:b,children:s.jsx($d.button,{type:"button",role:"tab","aria-selected":b,"aria-controls":h,"data-state":b?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:p,...c,ref:n,onMouseDown:Ce(e.onMouseDown,g=>{!l&&g.button===0&&g.ctrlKey===!1?d.onValueChange(o):g.preventDefault()}),onKeyDown:Ce(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&d.onValueChange(o)}),onFocus:Ce(e.onFocus,()=>{const g=d.activationMode!=="manual";!b&&!l&&g&&d.onValueChange(o)})})})});x5.displayName=g5;var v5="TabsContent",b5=f.forwardRef((e,n)=>{const{__scopeTabs:a,value:o,forceMount:l,children:c,...d}=e,m=Lg(v5,a),p=y5(m.baseId,o),h=w5(m.baseId,o),b=o===m.value,g=f.useRef(b);return f.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),s.jsx(sn,{present:l||b,children:({present:y})=>s.jsx($d.div,{"data-state":b?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":p,hidden:!y,id:h,tabIndex:0,...d,ref:n,style:{...e.style,animationDuration:g.current?"0s":void 0},children:y&&c})})});b5.displayName=v5;function y5(e,n){return`${e}-trigger-${n}`}function w5(e,n){return`${e}-content-${n}`}var FL=m5,C5=h5,S5=x5,j5=b5;const N5=FL,zg=f.forwardRef(({className:e,...n},a)=>s.jsx(C5,{ref:a,className:fe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...n}));zg.displayName=C5.displayName;const xo=f.forwardRef(({className:e,...n},a)=>s.jsx(S5,{ref:a,className:fe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...n}));xo.displayName=S5.displayName;const wh=f.forwardRef(({className:e,...n},a)=>s.jsx(j5,{ref:a,className:fe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n}));wh.displayName=j5.displayName;function du(e){if(typeof e!="string"||!e)throw new Error("expected a non-empty string, got: "+e)}function Ap(e){if(typeof e!="number")throw new Error("expected a number, got: "+e)}const WL=1,YL=1,Do="emoji",Is="keyvalue",Pg="favorites",qL="tokens",E5="tokens",KL="unicode",k5="count",XL="group",ZL="order",T5="group-order",Ch="eTag",Gu="url",a0="skinTone",Js="readonly",Ig="readwrite",R5="skinUnicodes",QL="skinUnicodes",JL="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",ez="en";function tz(e,n){const a=new Set,o=[];for(const l of e){const c=n(l);a.has(c)||(a.add(c),o.push(l))}return o}function o0(e){return tz(e,n=>n.unicode)}function nz(e){function n(a,o,l){const c=o?e.createObjectStore(a,{keyPath:o}):e.createObjectStore(a);if(l)for(const[d,[m,p]]of Object.entries(l))c.createIndex(d,m,{multiEntry:p});return c}n(Is),n(Do,KL,{[E5]:[qL,!0],[T5]:[[XL,ZL]],[R5]:[QL,!0]}),n(Pg,void 0,{[k5]:[""]})}const Sh={},ju={},Fu={};function A5(e,n,a){a.onerror=()=>n(a.error),a.onblocked=()=>n(new Error("IDB blocked")),a.onsuccess=()=>e(a.result)}async function rz(e){const n=await new Promise((a,o)=>{const l=indexedDB.open(e,WL);Sh[e]=l,l.onupgradeneeded=c=>{c.oldVersion<YL&&nz(l.result)},A5(a,o,l)});return n.onclose=()=>$g(e),n}function az(e){return ju[e]||(ju[e]=rz(e)),ju[e]}function oa(e,n,a,o){return new Promise((l,c)=>{const d=e.transaction(n,a,{durability:"relaxed"}),m=typeof n=="string"?d.objectStore(n):n.map(h=>d.objectStore(h));let p;o(m,d,h=>{p=h}),d.oncomplete=()=>l(p),d.onerror=()=>c(d.error)})}function $g(e){const n=Sh[e],a=n&&n.result;if(a){a.close();const o=Fu[e];if(o)for(const l of o)l()}delete Sh[e],delete ju[e],delete Fu[e]}function oz(e){return new Promise((n,a)=>{$g(e);const o=indexedDB.deleteDatabase(e);A5(n,a,o)})}function sz(e,n){let a=Fu[e];a||(a=Fu[e]=[]),a.push(n)}const iz=new Set([":D","XD",":'D","O:)",":X",":P",";P","XP",":L",":Z",":j","8D","XO","8)",":B",":O",":S",":'o","Dx","X(","D:",":C",">0)",":3","</3","<3","\\M/",":E","8#"]);function _s(e){return e.split(/[\s_]+/).map(n=>!n.match(/\w/)||iz.has(n)?n.toLowerCase():n.replace(/[)(:,]/g,"").replace(/’/g,"'").toLowerCase()).filter(Boolean)}const lz=2;function M5(e){return e.filter(Boolean).map(n=>n.toLowerCase()).filter(n=>n.length>=lz)}function cz(e){return e.map(({annotation:a,emoticon:o,group:l,order:c,shortcodes:d,skins:m,tags:p,emoji:h,version:b})=>{const g=[...new Set(M5([...(d||[]).map(_s).flat(),...(p||[]).map(_s).flat(),..._s(a),o]))].sort(),y={annotation:a,group:l,order:c,tags:p,tokens:g,unicode:h,version:b};if(o&&(y.emoticon=o),d&&(y.shortcodes=d),m){y.skinTones=[],y.skinUnicodes=[],y.skinVersions=[];for(const{tone:w,emoji:j,version:S}of m)y.skinTones.push(w),y.skinUnicodes.push(j),y.skinVersions.push(S)}return y})}function _5(e,n,a,o){e[n](a).onsuccess=l=>o&&o(l.target.result)}function ko(e,n,a){_5(e,"get",n,a)}function O5(e,n,a){_5(e,"getAll",n,a)}function Bg(e){e.commit&&e.commit()}function uz(e,n){let a=e[0];for(let o=1;o<e.length;o++){const l=e[o];n(a)>n(l)&&(a=l)}return a}function D5(e,n){const a=uz(e,l=>l.length),o=[];for(const l of a)e.some(c=>c.findIndex(d=>n(d)===n(l))===-1)||o.push(l);return o}async function dz(e){return!await Ug(e,Is,Gu)}async function fz(e,n,a){const[o,l]=await Promise.all([Ch,Gu].map(c=>Ug(e,Is,c)));return o===a&&l===n}async function mz(e,n){return oa(e,Do,Js,(o,l,c)=>{let d;const m=()=>{o.getAll(d&&IDBKeyRange.lowerBound(d,!0),50).onsuccess=p=>{const h=p.target.result;for(const b of h)if(d=b.unicode,n(b))return c(b);if(h.length<50)return c();m()}};m()})}async function L5(e,n,a,o){try{const l=cz(n);await oa(e,[Do,Is],Ig,([c,d],m)=>{let p,h,b=0;function g(){++b===2&&y()}function y(){if(!(p===o&&h===a)){c.clear();for(const w of l)c.put(w);d.put(o,Ch),d.put(a,Gu),Bg(m)}}ko(d,Ch,w=>{p=w,g()}),ko(d,Gu,w=>{h=w,g()})})}finally{}}async function pz(e,n){return oa(e,Do,Js,(a,o,l)=>{const c=IDBKeyRange.bound([n,0],[n+1,0],!1,!0);O5(a.index(T5),c,l)})}async function z5(e,n){const a=M5(_s(n));return a.length?oa(e,Do,Js,(o,l,c)=>{const d=[],m=()=>{d.length===a.length&&p()},p=()=>{const h=D5(d,b=>b.unicode);c(h.sort((b,g)=>b.order<g.order?-1:1))};for(let h=0;h<a.length;h++){const b=a[h],g=h===a.length-1?IDBKeyRange.bound(b,b+"￿",!1,!0):IDBKeyRange.only(b);O5(o.index(E5),g,y=>{d.push(y),m()})}}):[]}async function hz(e,n){const a=await z5(e,n);return a.length?a.filter(o=>(o.shortcodes||[]).map(c=>c.toLowerCase()).includes(n.toLowerCase()))[0]||null:await mz(e,l=>(l.shortcodes||[]).includes(n.toLowerCase()))||null}async function gz(e,n){return oa(e,Do,Js,(a,o,l)=>ko(a,n,c=>{if(c)return l(c);ko(a.index(R5),n,d=>l(d||null))}))}function Ug(e,n,a){return oa(e,n,Js,(o,l,c)=>ko(o,a,c))}function xz(e,n,a,o){return oa(e,n,Ig,(l,c)=>{l.put(o,a),Bg(c)})}function vz(e,n){return oa(e,Pg,Ig,(a,o)=>ko(a,n,l=>{a.put((l||0)+1,n),Bg(o)}))}function bz(e,n,a){return a===0?[]:oa(e,[Pg,Do],Js,([o,l],c,d)=>{const m=[];o.index(k5).openCursor(void 0,"prev").onsuccess=p=>{const h=p.target.result;if(!h)return d(m);function b(w){if(m.push(w),m.length===a)return d(m);h.continue()}const g=h.primaryKey,y=n.byName(g);if(y)return b(y);ko(l,g,w=>{if(w)return b(w);h.continue()})}})}const fu="";function yz(e,n){const a=new Map;for(const l of e){const c=n(l);for(const d of c){let m=a;for(let h=0;h<d.length;h++){const b=d.charAt(h);let g=m.get(b);g||(g=new Map,m.set(b,g)),m=g}let p=m.get(fu);p||(p=[],m.set(fu,p)),p.push(l)}}return(l,c)=>{let d=a;for(let h=0;h<l.length;h++){const b=l.charAt(h),g=d.get(b);if(g)d=g;else return[]}if(c)return d.get(fu)||[];const m=[],p=[d];for(;p.length;){const b=[...p.shift().entries()].sort((g,y)=>g[0]<y[0]?-1:1);for(const[g,y]of b)g===fu?m.push(...y):p.push(y)}return m}}const wz=["name","url"];function Cz(e){const n=e&&Array.isArray(e),a=n&&e.length&&(!e[0]||wz.some(o=>!(o in e[0])));if(!n||a)throw new Error("Custom emojis are in the wrong format")}function s0(e){Cz(e);const n=(y,w)=>y.name.toLowerCase()<w.name.toLowerCase()?-1:1,a=e.sort(n),l=yz(e,y=>{const w=new Set;if(y.shortcodes)for(const j of y.shortcodes)for(const S of _s(j))w.add(S);return w}),c=y=>l(y,!0),d=y=>l(y,!1),m=y=>{const w=_s(y),j=w.map((S,E)=>(E<w.length-1?c:d)(S));return D5(j,S=>S.name).sort(n)},p=new Map,h=new Map;for(const y of e){h.set(y.name.toLowerCase(),y);for(const w of y.shortcodes||[])p.set(w.toLowerCase(),y)}return{all:a,search:m,byShortcode:y=>p.get(y.toLowerCase()),byName:y=>h.get(y.toLowerCase())}}const Sz=typeof wrappedJSObject<"u";function Xi(e){if(!e)return e;if(Sz&&(e=structuredClone(e)),delete e.tokens,e.skinTones){const n=e.skinTones.length;e.skins=Array(n);for(let a=0;a<n;a++)e.skins[a]={tone:e.skinTones[a],unicode:e.skinUnicodes[a],version:e.skinVersions[a]};delete e.skinTones,delete e.skinUnicodes,delete e.skinVersions}return e}function P5(e){e||console.warn("emoji-picker-element is more efficient if the dataSource server exposes an ETag header.")}const jz=["annotation","emoji","group","order","version"];function Nz(e){if(!e||!Array.isArray(e)||!e[0]||typeof e[0]!="object"||jz.some(n=>!(n in e[0])))throw new Error("Emoji data is in the wrong format")}function I5(e,n){if(Math.floor(e.status/100)!==2)throw new Error("Failed to fetch: "+n+": "+e.status)}async function Ez(e){const n=await fetch(e,{method:"HEAD"});I5(n,e);const a=n.headers.get("etag");return P5(a),a}async function jh(e){const n=await fetch(e);I5(n,e);const a=n.headers.get("etag");P5(a);const o=await n.json();return Nz(o),[a,o]}function kz(e){for(var n="",a=new Uint8Array(e),o=a.byteLength,l=-1;++l<o;)n+=String.fromCharCode(a[l]);return n}function Tz(e){for(var n=e.length,a=new ArrayBuffer(n),o=new Uint8Array(a),l=-1;++l<n;)o[l]=e.charCodeAt(l);return a}async function $5(e){const n=JSON.stringify(e);let a=Tz(n);const o=await crypto.subtle.digest("SHA-1",a),l=kz(o);return btoa(l)}async function Rz(e,n){let a,o=await Ez(n);if(!o){const l=await jh(n);o=l[0],a=l[1],o||(o=await $5(a))}await fz(e,n,o)||(a||(a=(await jh(n))[1]),await L5(e,a,n,o))}async function Az(e,n){let[a,o]=await jh(n);a||(a=await $5(o)),await L5(e,o,n,a)}async function Mz(e,n){try{await Rz(e,n)}catch(a){if(a.name!=="InvalidStateError")throw a}}class _z{constructor({dataSource:n=JL,locale:a=ez,customEmoji:o=[]}={}){this.dataSource=n,this.locale=a,this._dbName=`emoji-picker-element-${this.locale}`,this._db=void 0,this._lazyUpdate=void 0,this._custom=s0(o),this._clear=this._clear.bind(this),this._ready=this._init()}async _init(){const n=this._db=await az(this._dbName);sz(this._dbName,this._clear);const a=this.dataSource;await dz(n)?await Az(n,a):this._lazyUpdate=Mz(n,a)}async ready(){const n=async()=>(this._ready||(this._ready=this._init()),this._ready);await n(),this._db||await n()}async getEmojiByGroup(n){return Ap(n),await this.ready(),o0(await pz(this._db,n)).map(Xi)}async getEmojiBySearchQuery(n){du(n),await this.ready();const a=this._custom.search(n),o=o0(await z5(this._db,n)).map(Xi);return[...a,...o]}async getEmojiByShortcode(n){du(n),await this.ready();const a=this._custom.byShortcode(n);return a||Xi(await hz(this._db,n))}async getEmojiByUnicodeOrName(n){du(n),await this.ready();const a=this._custom.byName(n);return a||Xi(await gz(this._db,n))}async getPreferredSkinTone(){return await this.ready(),await Ug(this._db,Is,a0)||0}async setPreferredSkinTone(n){return Ap(n),await this.ready(),xz(this._db,Is,a0,n)}async incrementFavoriteEmojiCount(n){return du(n),await this.ready(),vz(this._db,n)}async getTopFavoriteEmoji(n){return Ap(n),await this.ready(),(await bz(this._db,this._custom,n)).map(Xi)}set customEmoji(n){this._custom=s0(n)}get customEmoji(){return this._custom.all}async _shutdown(){await this.ready();try{await this._lazyUpdate}catch{}}_clear(){this._db=this._ready=this._lazyUpdate=void 0}async close(){await this._shutdown(),await $g(this._dbName)}async delete(){await this._shutdown(),await oz(this._dbName)}}const Nh=[[-1,"✨","custom"],[0,"😀","smileys-emotion"],[1,"👋","people-body"],[3,"🐱","animals-nature"],[4,"🍎","food-drink"],[5,"🏠️","travel-places"],[6,"⚽","activities"],[7,"📝","objects"],[8,"⛔️","symbols"],[9,"🏁","flags"]].map(([e,n,a])=>({id:e,emoji:n,name:a})),Mp=Nh.slice(1),Oz=2,i0=6,B5=typeof requestIdleCallback=="function"?requestIdleCallback:setTimeout;function l0(e){return e.unicode.includes("‍")}const Dz={"🫪":17,"🫩":16,"🫨":15.1,"🫠":14,"🥲":13.1,"🥻":12.1,"🥰":11,"🤩":5,"👱‍♀️":4,"🤣":3,"👁️‍🗨️":2,"😀":1,"😐️":.7,"😃":.6},Lz=1e3,zz="🖐️",Pz=8,Iz=["😊","😒","❤️","👍️","😍","😂","😭","☺️","😔","😩","😏","💕","🙌","😘"],U5='"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',$z=(e,n)=>e<n?-1:e>n?1:0,c0=(e,n)=>{const a=document.createElement("canvas");a.width=a.height=1;const o=a.getContext("2d",{willReadFrequently:!0});return o.textBaseline="top",o.font=`100px ${U5}`,o.fillStyle=n,o.scale(.01,.01),o.fillText(e,0,0),o.getImageData(0,0,1,1).data},Bz=(e,n)=>{const a=[...e].join(","),o=[...n].join(",");return a===o&&!a.startsWith("0,0,0,")};function Uz(e){const n=c0(e,"#000"),a=c0(e,"#fff");return n&&a&&Bz(n,a)}function Hz(){const e=Object.entries(Dz);try{for(const[n,a]of e)if(Uz(n))return a}catch{}finally{}return e[0][1]}let _p;const Op=()=>(_p||(_p=new Promise(e=>B5(()=>e(Hz())))),_p),Eh=new Map,Vz="️",Gz="\uD83C",Fz="‍",Wz=127995,Yz=57339;function qz(e,n){if(n===0)return e;const a=e.indexOf(Fz);return a!==-1?e.substring(0,a)+String.fromCodePoint(Wz+n-1)+e.substring(a):(e.endsWith(Vz)&&(e=e.substring(0,e.length-1)),e+Gz+String.fromCodePoint(Yz+n-1))}function yr(e){e.preventDefault(),e.stopPropagation()}function Dp(e,n,a){return n+=e?-1:1,n<0?n=a.length-1:n>=a.length&&(n=0),n}function H5(e,n){const a=new Set,o=[];for(const l of e){const c=n(l);a.has(c)||(a.add(c),o.push(l))}return o}function Kz(e,n){const a=o=>{const l={};for(const c of o)typeof c.tone=="number"&&c.version<=n&&(l[c.tone]=c.unicode);return l};return e.map(({unicode:o,skins:l,shortcodes:c,url:d,name:m,category:p,annotation:h})=>({unicode:o,name:m,shortcodes:c,url:d,category:p,annotation:h,id:o||m,skins:l&&a(l)}))}const Nu=requestAnimationFrame;let Xz=typeof ResizeObserver=="function";function Zz(e,n,a){let o;Xz?(o=new ResizeObserver(a),o.observe(e)):Nu(a),n.addEventListener("abort",()=>{o&&o.disconnect()})}function u0(e){{const n=document.createRange();return n.selectNode(e.firstChild),n.getBoundingClientRect().width}}const Qz="😀";let Lp,go;function d0(e,n,a){const o=u0(n);if(!o){if(!go){go=a.cloneNode(!0);const l=getComputedStyle(a);for(const c of["font-family","line-height","width","height","font-size","display","align-items","justify-content"])go.style.setProperty(c,l.getPropertyValue(c),"important")}try{return document.body.appendChild(go),go.firstChild.nodeValue=e,u0(go)}finally{go.remove()}}return o}function Jz(e,n,a){let o=!0;for(const l of e){const c=a(l);if(!c)continue;typeof Lp>"u"&&(Lp=d0(Qz,n,n));const m=d0(l.unicode,c,n)/1.8<Lp;Eh.set(l.unicode,m),m||(o=!1)}return o}function eP(e){return H5(e,n=>n)}function tP(e){e&&(e.scrollTop=0)}function rl(e,n,a){let o=e.get(n);return o||(o=a(),e.set(n,o)),o}function f0(e){return""+e}function nP(e){const n=document.createElement("template");return n.innerHTML=e,n}const rP=new WeakMap,aP=new WeakMap,oP=Symbol("un-keyed"),sP="replaceChildren"in Element.prototype;function iP(e,n){sP?e.replaceChildren(...n):(e.innerHTML="",e.append(...n))}function lP(e,n){let a=e.firstChild,o=0;for(;a;){if(n[o]!==a)return!0;a=a.nextSibling,o++}return o!==n.length}function cP(e,n){const{targetNode:a}=n;let{targetParentNode:o}=n,l=!1;o?l=lP(o,e):(l=!0,n.targetNode=void 0,n.targetParentNode=o=a.parentNode),l&&iP(o,e)}function uP(e,n){for(const a of n){const{targetNode:o,currentExpression:l,binding:{expressionIndex:c,attributeName:d,attributeValuePre:m,attributeValuePost:p}}=a,h=e[c];if(l!==h)if(a.currentExpression=h,d)if(h===null)o.removeAttribute(d);else{const b=m+f0(h)+p;o.setAttribute(d,b)}else{let b;Array.isArray(h)?cP(h,a):h instanceof Element?(b=h,o.replaceWith(b)):o.nodeValue=f0(h),b&&(a.targetNode=b)}}}function dP(e){let n="",a=!1,o=!1,l=-1;const c=new Map,d=[];let m=0;for(let h=0,b=e.length;h<b;h++){const g=e[h];if(n+=g.slice(m),h===b-1)break;for(let k=0;k<g.length;k++)switch(g.charAt(k)){case"<":{g.charAt(k+1)==="/"?d.pop():(a=!0,d.push(++l));break}case">":{a=!1,o=!1;break}case"=":{o=!0;break}}const y=d[d.length-1],w=rl(c,y,()=>[]);let j,S,E;if(o){const k=/(\S+)="?([^"=]*)$/.exec(g);j=k[1],S=k[2];const T=/^([^">]*)("?)/.exec(e[h+1]);E=T[1],n=n.slice(0,-1*k[0].length),m=T[0].length}else m=0;const N={attributeName:j,attributeValuePre:S,attributeValuePost:E,expressionIndex:h};w.push(N),!a&&!o&&(n+=" ")}return{template:nP(n),elementsToBindings:c}}function m0(e,n,a){for(let o=0;o<e.length;o++){const l=e[o],c=l.attributeName?n:n.firstChild,d={binding:l,targetNode:c,targetParentNode:void 0,currentExpression:void 0};a.push(d)}}function fP(e,n){const a=[];let o;if(n.size===1&&(o=n.get(0)))m0(o,e,a);else{const l=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let c=e,d=-1;do{const m=n.get(++d);m&&m0(m,c,a)}while(c=l.nextNode())}return a}function mP(e){const{template:n,elementsToBindings:a}=rl(rP,e,()=>dP(e)),o=n.cloneNode(!0).content.firstElementChild,l=fP(o,a);return function(d){return uP(d,l),o}}function pP(e){const n=rl(aP,e,()=>new Map);let a=oP;function o(c,...d){const m=rl(n,c,()=>new Map);return rl(m,a,()=>mP(c))(d)}function l(c,d,m){return c.map((p,h)=>{const b=a;a=m(p);try{return d(p,h)}finally{a=b}})}return{map:l,html:o}}function hP(e,n,a,o,l,c,d,m,p){const{labelWithSkin:h,titleForEmoji:b,unicodeWithSkin:g}=a,{html:y,map:w}=pP(n);function j(k,T,A){return w(k,(O,M)=>y`<button role="${T?"option":"menuitem"}" aria-selected="${T?M===n.activeSearchItem:null}" aria-label="${h(O,n.currentSkinTone)}" title="${b(O)}" class="${"emoji"+(T&&M===n.activeSearchItem?" active":"")+(O.unicode?"":" custom-emoji")}" id="${`${A}-${O.id}`}" style="${O.unicode?null:`--custom-emoji-background: url(${JSON.stringify(O.url)})`}">${O.unicode?g(O,n.currentSkinTone):""}</button>`,O=>`${A}-${O.id}`)}const E=y`<section data-ref="rootElement" class="picker" aria-label="${n.i18n.regionLabel}" style="${n.pickerStyle||""}"><div class="pad-top"></div><div class="search-row"><div class="search-wrapper"><input id="search" class="search" type="search" role="combobox" enterkeyhint="search" placeholder="${n.i18n.searchLabel}" autocapitalize="none" autocomplete="off" spellcheck="true" aria-expanded="${!!(n.searchMode&&n.currentEmojis.length)}" aria-controls="search-results" aria-describedby="search-description" aria-autocomplete="list" aria-activedescendant="${n.activeSearchItemId?`emo-${n.activeSearchItemId}`:null}" data-ref="searchElement" data-on-input="onSearchInput" data-on-keydown="onSearchKeydown"><label class="sr-only" for="search">${n.i18n.searchLabel}</label> <span id="search-description" class="sr-only">${n.i18n.searchDescription}</span></div><div class="skintone-button-wrapper ${n.skinTonePickerExpandedAfterAnimation?"expanded":""}"><button id="skintone-button" class="emoji ${n.skinTonePickerExpanded?"hide-focus":""}" aria-label="${n.skinToneButtonLabel}" title="${n.skinToneButtonLabel}" aria-describedby="skintone-description" aria-haspopup="listbox" aria-expanded="${n.skinTonePickerExpanded}" aria-controls="skintone-list" data-on-click="onClickSkinToneButton">${n.skinToneButtonText||""}</button></div><span id="skintone-description" class="sr-only">${n.i18n.skinToneDescription}</span><div data-ref="skinToneDropdown" id="skintone-list" class="skintone-list hide-focus ${n.skinTonePickerExpanded?"":"hidden no-animate"}" style="transform:translateY(${n.skinTonePickerExpanded?0:"calc(-1 * var(--num-skintones) * var(--total-emoji-size))"})" role="listbox" aria-label="${n.i18n.skinTonesLabel}" aria-activedescendant="skintone-${n.activeSkinTone}" aria-hidden="${!n.skinTonePickerExpanded}" tabIndex="-1" data-on-focusout="onSkinToneOptionsFocusOut" data-on-click="onSkinToneOptionsClick" data-on-keydown="onSkinToneOptionsKeydown" data-on-keyup="onSkinToneOptionsKeyup">${w(n.skinTones,(k,T)=>y`<div id="skintone-${T}" class="emoji ${T===n.activeSkinTone?"active":""}" aria-selected="${T===n.activeSkinTone}" role="option" title="${n.i18n.skinTones[T]}" aria-label="${n.i18n.skinTones[T]}">${k}</div>`,k=>k)}</div></div><div class="nav" role="tablist" style="grid-template-columns:repeat(${n.groups.length},1fr)" aria-label="${n.i18n.categoriesLabel}" data-on-keydown="onNavKeydown" data-on-click="onNavClick">${w(n.groups,k=>y`<button role="tab" class="nav-button" aria-controls="tab-${k.id}" aria-label="${n.i18n.categories[k.name]}" aria-selected="${!n.searchMode&&n.currentGroup.id===k.id}" title="${n.i18n.categories[k.name]}" data-group-id="${k.id}"><div class="nav-emoji emoji">${k.emoji}</div></button>`,k=>k.id)}</div><div class="indicator-wrapper"><div class="indicator" style="transform:translateX(${(n.isRtl?-1:1)*n.currentGroupIndex*100}%)"></div></div><div class="message ${n.message?"":"gone"}" role="alert" aria-live="polite">${n.message||""}</div><div data-ref="tabpanelElement" class="tabpanel ${!n.databaseLoaded||n.message?"gone":""}" role="${n.searchMode?"region":"tabpanel"}" aria-label="${n.searchMode?n.i18n.searchResultsLabel:n.i18n.categories[n.currentGroup.name]}" id="${n.searchMode?null:`tab-${n.currentGroup.id}`}" tabIndex="0" data-on-click="onEmojiClick"><div data-action="calculateEmojiGridStyle">${w(n.currentEmojisWithCategories,(k,T)=>y`<div><div id="menu-label-${T}" class="category ${n.currentEmojisWithCategories.length===1&&n.currentEmojisWithCategories[0].category===""?"gone":""}" aria-hidden="true">${n.searchMode?n.i18n.searchResultsLabel:k.category?k.category:n.currentEmojisWithCategories.length>1?n.i18n.categories.custom:n.i18n.categories[n.currentGroup.name]}</div><div class="emoji-menu ${T!==0&&!n.searchMode&&n.currentGroup.id===-1?"visibility-auto":""}" style="${`--num-rows: ${Math.ceil(k.emojis.length/n.numColumns)}`}" data-action="updateOnIntersection" role="${n.searchMode?"listbox":"menu"}" aria-labelledby="menu-label-${T}" id="${n.searchMode?"search-results":null}">${j(k.emojis,n.searchMode,"emo")}</div></div>`,k=>k.category)}</div></div><div class="favorites onscreen emoji-menu ${n.message?"gone":""}" role="menu" aria-label="${n.i18n.favoritesLabel}" data-on-click="onEmojiClick">${j(n.currentFavorites,!1,"fav")}</div><button data-ref="baselineEmoji" aria-hidden="true" tabindex="-1" class="abs-pos hidden emoji baseline-emoji">😀</button></section>`,N=(k,T)=>{for(const A of e.querySelectorAll(`[${k}]`))T(A,A.getAttribute(k))};if(p){e.appendChild(E);for(const k of["click","focusout","input","keydown","keyup"])N(`data-on-${k}`,(T,A)=>{T.addEventListener(k,o[A])});N("data-ref",(k,T)=>{c[T]=k}),d.addEventListener("abort",()=>{e.removeChild(E)})}N("data-action",(k,T)=>{let A=m.get(T);A||m.set(T,A=new WeakSet),A.has(k)||(A.add(k),l[T](k))})}const Wu=typeof queueMicrotask=="function"?queueMicrotask:e=>Promise.resolve().then(e);function gP(e){let n=!1,a;const o=new Map,l=new Set;let c;const d=()=>{if(n)return;const h=[...l];l.clear();try{for(const b of h)b()}finally{c=!1,l.size&&(c=!0,Wu(d))}},m=new Proxy({},{get(h,b){if(a){let g=o.get(b);g||(g=new Set,o.set(b,g)),g.add(a)}return h[b]},set(h,b,g){if(h[b]!==g){h[b]=g;const y=o.get(b);if(y){for(const w of y)l.add(w);c||(c=!0,Wu(d))}}return!0}}),p=h=>{const b=()=>{const g=a;a=b;try{return h()}finally{a=g}};return b()};return e.addEventListener("abort",()=>{n=!0}),{state:m,createEffect:p}}function zp(e,n,a){if(e.length!==n.length)return!1;for(let o=0;o<e.length;o++)if(!a(e[o],n[o]))return!1;return!0}const p0=new WeakMap;function xP(e,n,a){{const o=e.closest(".tabpanel");let l=p0.get(o);l||(l=new IntersectionObserver(a,{root:o,rootMargin:"50% 0px 50% 0px",threshold:0}),p0.set(o,l),n.addEventListener("abort",()=>{l.disconnect()})),l.observe(e)}}const Pp=[],{assign:mu}=Object;function vP(e,n){const a={},o=new AbortController,l=o.signal,{state:c,createEffect:d}=gP(l),m=new Map;mu(c,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),mu(c,n),mu(c,{initialLoad:!0,currentEmojis:[],currentEmojisWithCategories:[],rawSearchText:"",searchText:"",searchMode:!1,activeSearchItem:-1,message:void 0,skinTonePickerExpanded:!1,skinTonePickerExpandedAfterAnimation:!1,currentSkinTone:0,activeSkinTone:0,skinToneButtonText:void 0,pickerStyle:void 0,skinToneButtonLabel:"",skinTones:[],currentFavorites:[],defaultFavoriteEmojis:void 0,numColumns:Pz,isRtl:!1,currentGroupIndex:0,groups:Mp,databaseLoaded:!1,activeSearchItemId:void 0}),d(()=>{c.currentGroup!==c.groups[c.currentGroupIndex]&&(c.currentGroup=c.groups[c.currentGroupIndex])});const p=Y=>{e.getElementById(Y).focus()},h=Y=>e.getElementById(`emo-${Y.id}`),b=(Y,le)=>{a.rootElement.dispatchEvent(new CustomEvent(Y,{detail:le,bubbles:!0,composed:!0}))},g=(Y,le)=>Y.id===le.id,y=(Y,le)=>{const{category:ye,emojis:Te}=Y,{category:Le,emojis:rt}=le;return ye!==Le?!1:zp(Te,rt,g)},w=Y=>{zp(c.currentEmojis,Y,g)||(c.currentEmojis=Y)},j=Y=>{c.searchMode!==Y&&(c.searchMode=Y)},S=Y=>{zp(c.currentEmojisWithCategories,Y,y)||(c.currentEmojisWithCategories=Y)},E=(Y,le)=>le&&Y.skins&&Y.skins[le]||Y.unicode,T={labelWithSkin:(Y,le)=>eP([Y.name||E(Y,le),Y.annotation,...Y.shortcodes||Pp].filter(Boolean)).join(", "),titleForEmoji:Y=>Y.annotation||(Y.shortcodes||Pp).join(", "),unicodeWithSkin:E},A={onClickSkinToneButton:F,onEmojiClick:D,onNavClick:H,onNavKeydown:Z,onSearchKeydown:I,onSkinToneOptionsClick:V,onSkinToneOptionsFocusOut:be,onSkinToneOptionsKeydown:oe,onSkinToneOptionsKeyup:ae,onSearchInput:ve},O={calculateEmojiGridStyle:B,updateOnIntersection:K};let M=!0;d(()=>{hP(e,c,T,A,O,a,l,m,M),M=!1}),c.emojiVersion||Op().then(Y=>{Y||(c.message=c.i18n.emojiUnsupportedMessage)}),d(()=>{async function Y(){let le=!1;const ye=setTimeout(()=>{le=!0,c.message=c.i18n.loadingMessage},Lz);try{await c.database.ready(),c.databaseLoaded=!0}catch(Te){console.error(Te),c.message=c.i18n.networkErrorMessage}finally{clearTimeout(ye),le&&(le=!1,c.message="")}}c.database&&Y()}),d(()=>{c.pickerStyle=`
--num-groups: ${c.groups.length};
--indicator-opacity: ${c.searchMode?0:1};
--num-skintones: ${i0};`}),d(()=>{c.customEmoji&&c.database&&z()}),d(()=>{c.customEmoji&&c.customEmoji.length?c.groups!==Nh&&(c.groups=Nh):c.groups!==Mp&&(c.currentGroupIndex&&c.currentGroupIndex--,c.groups=Mp)}),d(()=>{async function Y(){c.databaseLoaded&&(c.currentSkinTone=await c.database.getPreferredSkinTone())}Y()}),d(()=>{c.skinTones=Array(i0).fill().map((Y,le)=>qz(c.skinToneEmoji,le))}),d(()=>{c.skinToneButtonText=c.skinTones[c.currentSkinTone]}),d(()=>{c.skinToneButtonLabel=c.i18n.skinToneLabel.replace("{skinTone}",c.i18n.skinTones[c.currentSkinTone])}),d(()=>{async function Y(){const{database:le}=c,ye=(await Promise.all(Iz.map(Te=>le.getEmojiByUnicodeOrName(Te)))).filter(Boolean);c.defaultFavoriteEmojis=ye}c.databaseLoaded&&Y()});function z(){const{customEmoji:Y,database:le}=c,ye=Y||Pp;le.customEmoji!==ye&&(le.customEmoji=ye)}d(()=>{async function Y(){z();const{database:le,defaultFavoriteEmojis:ye,numColumns:Te}=c,Le=await le.getTopFavoriteEmoji(Te),rt=await xe(H5([...Le,...ye],ht=>ht.unicode||ht.name).slice(0,Te));c.currentFavorites=rt}c.databaseLoaded&&c.defaultFavoriteEmojis&&Y()});function B(Y){Zz(Y,l,()=>{{const le=getComputedStyle(a.rootElement),ye=parseInt(le.getPropertyValue("--num-columns"),10),Te=le.getPropertyValue("direction")==="rtl";c.numColumns=ye,c.isRtl=Te}})}function K(Y){xP(Y,l,le=>{for(const{target:ye,isIntersecting:Te}of le)ye.classList.toggle("onscreen",Te)})}d(()=>{async function Y(){const{searchText:le,currentGroup:ye,databaseLoaded:Te,customEmoji:Le}=c;if(!Te)c.currentEmojis=[],c.searchMode=!1;else if(le.length>=Oz){const rt=await L(le);c.searchText===le&&(w(rt),j(!0))}else{const{id:rt}=ye;if(rt!==-1||Le&&Le.length){const ht=await se(rt);c.currentGroup.id===rt&&(w(ht),j(!1))}}}Y()});const U=()=>{Nu(()=>tP(a.tabpanelElement))};d(()=>{const{currentEmojis:Y,emojiVersion:le}=c,ye=Y.filter(Te=>Te.unicode).filter(Te=>l0(Te)&&!Eh.has(Te.unicode));if(!le&&ye.length)w(Y),Nu(()=>q(ye));else{const Te=le?Y:Y.filter(ue);w(Te),U()}});function q(Y){Jz(Y,a.baselineEmoji,h)?U():c.currentEmojis=[...c.currentEmojis]}function ue(Y){return!Y.unicode||!l0(Y)||Eh.get(Y.unicode)}async function pe(Y){const le=c.emojiVersion||await Op();return Y.filter(({version:ye})=>!ye||ye<=le)}async function xe(Y){return Kz(Y,c.emojiVersion||await Op())}async function se(Y){const le=Y===-1?c.customEmoji:await c.database.getEmojiByGroup(Y);return xe(await pe(le))}async function L(Y){return xe(await pe(await c.database.getEmojiBySearchQuery(Y)))}d(()=>{}),d(()=>{function Y(){const{searchMode:ye,currentEmojis:Te}=c;if(ye)return[{category:"",emojis:Te}];const Le=new Map;for(const rt of Te){const ht=rt.category||"";let Mt=Le.get(ht);Mt||(Mt=[],Le.set(ht,Mt)),Mt.push(rt)}return[...Le.entries()].map(([rt,ht])=>({category:rt,emojis:ht})).sort((rt,ht)=>c.customCategorySorting(rt.category,ht.category))}const le=Y();S(le)}),d(()=>{c.activeSearchItemId=c.activeSearchItem!==-1&&c.currentEmojis[c.activeSearchItem].id}),d(()=>{const{rawSearchText:Y}=c;B5(()=>{c.searchText=(Y||"").trim(),c.activeSearchItem=-1})});function I(Y){if(!c.searchMode||!c.currentEmojis.length)return;const le=ye=>{yr(Y),c.activeSearchItem=Dp(ye,c.activeSearchItem,c.currentEmojis)};switch(Y.key){case"ArrowDown":return le(!1);case"ArrowUp":return le(!0);case"Enter":if(c.activeSearchItem===-1)c.activeSearchItem=0;else return yr(Y),_(c.currentEmojis[c.activeSearchItem].id)}}function H(Y){const{target:le}=Y,ye=le.closest(".nav-button");if(!ye)return;const Te=parseInt(ye.dataset.groupId,10);a.searchElement.value="",c.rawSearchText="",c.searchText="",c.activeSearchItem=-1,c.currentGroupIndex=c.groups.findIndex(Le=>Le.id===Te)}function Z(Y){const{target:le,key:ye}=Y,Te=Le=>{Le&&(yr(Y),Le.focus())};switch(ye){case"ArrowLeft":return Te(le.previousElementSibling);case"ArrowRight":return Te(le.nextElementSibling);case"Home":return Te(le.parentElement.firstElementChild);case"End":return Te(le.parentElement.lastElementChild)}}async function te(Y){const le=await c.database.getEmojiByUnicodeOrName(Y),ye=[...c.currentEmojis,...c.currentFavorites].find(Le=>Le.id===Y),Te=ye.unicode&&E(ye,c.currentSkinTone);return await c.database.incrementFavoriteEmojiCount(Y),{emoji:le,skinTone:c.currentSkinTone,...Te&&{unicode:Te},...ye.name&&{name:ye.name}}}async function _(Y){const le=te(Y);b("emoji-click-sync",le),b("emoji-click",await le)}function D(Y){const{target:le}=Y;if(!le.classList.contains("emoji"))return;yr(Y);const ye=le.id.substring(4);_(ye)}function G(Y){c.currentSkinTone=Y,c.skinTonePickerExpanded=!1,p("skintone-button"),b("skin-tone-change",{skinTone:Y}),c.database.setPreferredSkinTone(Y)}function V(Y){const{target:{id:le}}=Y,ye=le&&le.match(/^skintone-(\d)/);if(!ye)return;yr(Y);const Te=parseInt(ye[1],10);G(Te)}function F(Y){c.skinTonePickerExpanded=!c.skinTonePickerExpanded,c.activeSkinTone=c.currentSkinTone,c.skinTonePickerExpanded&&(yr(Y),Nu(()=>p("skintone-list")))}d(()=>{c.skinTonePickerExpanded?a.skinToneDropdown.addEventListener("transitionend",()=>{c.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):c.skinTonePickerExpandedAfterAnimation=!1});function oe(Y){if(!c.skinTonePickerExpanded)return;const le=async ye=>{yr(Y),c.activeSkinTone=ye};switch(Y.key){case"ArrowUp":return le(Dp(!0,c.activeSkinTone,c.skinTones));case"ArrowDown":return le(Dp(!1,c.activeSkinTone,c.skinTones));case"Home":return le(0);case"End":return le(c.skinTones.length-1);case"Enter":return yr(Y),G(c.activeSkinTone);case"Escape":return yr(Y),c.skinTonePickerExpanded=!1,p("skintone-button")}}function ae(Y){if(c.skinTonePickerExpanded)switch(Y.key){case" ":return yr(Y),G(c.activeSkinTone)}}async function be(Y){const{relatedTarget:le}=Y;(!le||le.id!=="skintone-list")&&(c.skinTonePickerExpanded=!1)}function ve(Y){c.rawSearchText=Y.target.value}return{$set(Y){mu(c,Y)},$destroy(){o.abort()}}}const bP="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",yP="en";var wP={categoriesLabel:"Categories",emojiUnsupportedMessage:"Your browser does not support color emoji.",favoritesLabel:"Favorites",loadingMessage:"Loading…",networkErrorMessage:"Could not load emoji.",regionLabel:"Emoji picker",searchDescription:"When search results are available, press up or down to select and enter to choose.",searchLabel:"Search",searchResultsLabel:"Search results",skinToneDescription:"When expanded, press up or down to select and enter to choose.",skinToneLabel:"Choose a skin tone (currently {skinTone})",skinTonesLabel:"Skin tones",skinTones:["Default","Light","Medium-Light","Medium","Medium-Dark","Dark"],categories:{custom:"Custom","smileys-emotion":"Smileys and emoticons","people-body":"People and body","animals-nature":"Animals and nature","food-drink":"Food and drink","travel-places":"Travel and places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"}},CP=':host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:"";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}';const V5=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],SP=`:host{--emoji-font-family:${U5}}`;class Hg extends HTMLElement{constructor(n){super(),this.attachShadow({mode:"open"});const a=document.createElement("style");a.textContent=CP+SP,this.shadowRoot.appendChild(a),this._ctx={locale:yP,dataSource:bP,skinToneEmoji:zz,customCategorySorting:$z,customEmoji:null,i18n:wP,emojiVersion:null,...n};for(const o of V5)o!=="database"&&Object.prototype.hasOwnProperty.call(this,o)&&(this._ctx[o]=this[o],delete this[o]);this._dbFlush()}connectedCallback(){h0(this),this._cmp||(this._cmp=vP(this.shadowRoot,this._ctx))}disconnectedCallback(){h0(this),Wu(()=>{if(!this.isConnected&&this._cmp){this._cmp.$destroy(),this._cmp=void 0;const{database:n}=this._ctx;n.close().catch(a=>console.error(a))}})}static get observedAttributes(){return["locale","data-source","skin-tone-emoji","emoji-version"]}attributeChangedCallback(n,a,o){this._set(n.replace(/-([a-z])/g,(l,c)=>c.toUpperCase()),n==="emoji-version"?parseFloat(o):o)}_set(n,a){this._ctx[n]=a,this._cmp&&this._cmp.$set({[n]:a}),["locale","dataSource"].includes(n)&&this._dbFlush()}_dbCreate(){const{locale:n,dataSource:a,database:o}=this._ctx;(!o||o.locale!==n||o.dataSource!==a)&&this._set("database",new _z({locale:n,dataSource:a}))}_dbFlush(){Wu(()=>this._dbCreate())}}const G5={};for(const e of V5)G5[e]={get(){return e==="database"&&this._dbCreate(),this._ctx[e]},set(n){if(e==="database")throw new Error("database is read-only");this._set(e,n)}};Object.defineProperties(Hg.prototype,G5);function h0(e){e instanceof Hg||Object.setPrototypeOf(e,customElements.get(e.tagName.toLowerCase()).prototype)}customElements.get("emoji-picker")||customElements.define("emoji-picker",Hg);function jP({onPick:e}){const n=f.useRef(null);return f.useEffect(()=>{const a=n.current;if(!a)return;const o=document.createElement("emoji-picker");o.className="unicode-emoji-picker-el",o.setAttribute("data-theme","dark");const l=c=>{var p;const d=c.detail,m=(d==null?void 0:d.unicode)??((p=d==null?void 0:d.emoji)==null?void 0:p.unicode);m&&e(m)};return o.addEventListener("emoji-click",l),a.appendChild(o),()=>{o.removeEventListener("emoji-click",l),o.remove()}},[e]),s.jsx("div",{ref:n,className:"unicode-emoji-panel-host overflow-hidden rounded-lg border border-border/50"})}const NP=/^<(a?):([^:>]+):(\d{17,20})>$/;function Eu(e,n,a=!1){return`${a?"<a":"<"}:${e}:${n}>`}function F5(e){const n=String(e??"").trim();if(!n)return{kind:"empty",value:""};const a=n.match(NP);return a?{kind:"custom",value:n,animated:a[1]==="a",name:a[2],id:a[3]}:{kind:"unicode",value:n}}function W5(e,n=!1){return`https://cdn.discordapp.com/emojis/${e}.${n?"gif":"png"}?size=64`}function EP(e,n=[]){const a=F5(e);if(a.kind==="custom"&&a.id&&!a.name){const o=n.find(l=>l.id===a.id);if(o)return{kind:"custom",value:Eu(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}if(a.kind==="custom"&&a.id){const o=n.find(l=>l.id===a.id);if(o&&a.value!==Eu(o.name,o.id,o.animated))return{kind:"custom",value:Eu(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}return a}function kP({value:e,guildEmojis:n,size:a="md"}){const o=EP(e,n),l=a==="lg"?"size-10":"size-7",c=a==="lg"?"text-3xl":"text-2xl";return o.kind==="empty"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"No emoji selected"}):o.kind==="custom"&&o.id?s.jsxs("span",{className:"inline-flex items-center gap-3",children:[s.jsx("img",{src:W5(o.id,o.animated),alt:o.name??"custom emoji",className:fe(l,"shrink-0 rounded-md"),loading:"lazy"}),s.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[s.jsxs("span",{className:"text-sm font-medium",children:[":",o.name,":"]}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:o.value})]})]}):s.jsx("span",{className:fe(c,"leading-none"),title:o.value,children:o.value})}function TP({id:e,label:n,description:a,value:o,onChange:l,readOnly:c}){const[d,m]=f.useState(!1),[p,h]=f.useState("server"),[b,g]=f.useState(null),[y,w]=f.useState(""),[j,S]=f.useState(!1),[E,N]=f.useState(""),k=f.useCallback(async(U=!1)=>{S(!0),w("");try{const q=await Ee.getGuildResources(U);q.data?(g(q.data),Array.isArray(q.data.emojis)||w("Server response is missing emojis. Restart the bot after updating.")):w("No guild data returned.")}catch(q){w(q instanceof Error?q.message:"Could not load server emojis")}finally{S(!1)}},[]);f.useEffect(()=>{d&&k(!0)},[d,k]);const T=f.useMemo(()=>Array.isArray(b==null?void 0:b.emojis)?b.emojis:[],[b]),A=f.useMemo(()=>{const U=E.trim().toLowerCase();return U?T.filter(q=>q.name.toLowerCase().includes(U)):T},[T,E]),O=String(o??""),M=F5(O);function z(U){l(U),m(!1)}function B(U){l(Eu(U.name,U.id,U.animated)),m(!1)}function K(){l("")}return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:e,children:n}),a?s.jsx("p",{className:"text-xs text-muted-foreground",children:a}):null,s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(kP,{value:o,guildEmojis:T,size:"lg"})}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(he,{type:"button",variant:"secondary",size:"sm",disabled:c,onClick:()=>m(!0),children:"Choose emoji"}),O?s.jsx(he,{type:"button",variant:"ghost",size:"sm",disabled:c,onClick:K,children:"Clear"}):null]})]}),s.jsx(zl,{open:d,onOpenChange:m,children:s.jsxs(qs,{className:"max-h-[min(90vh,720px)] max-w-lg gap-0 overflow-hidden p-0 sm:max-w-xl",children:[s.jsxs(Ks,{className:"space-y-1 border-b border-border px-5 py-4",children:[s.jsx(Xs,{children:"Choose emoji"}),s.jsxs(Zs,{children:["Server emojis save as"," ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"<:name:id>"}),". Standard emojis save as Unicode characters."]})]}),s.jsxs(N5,{value:p,onValueChange:U=>h(U),className:"flex min-h-0 flex-1 flex-col",children:[s.jsxs(zg,{className:"mx-5 mt-3 grid h-9 w-auto grid-cols-2",children:[s.jsx(xo,{value:"server",children:"Server"}),s.jsx(xo,{value:"unicode",children:"All emojis"})]}),s.jsxs(wh,{value:"server",className:"mt-0 flex-1 px-5 pb-4 pt-3",children:[s.jsxs("div",{className:"relative mb-3",children:[s.jsx(ge,{icon:ad,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(Ie,{placeholder:"Search by name…",value:E,onChange:U=>N(U.target.value),className:"h-9 border-border bg-secondary/30 pl-9"})]}),b?s.jsxs("p",{className:"mb-2 text-xs text-muted-foreground",children:[b.guildName," · ",T.length," custom emoji",T.length===1?"":"s"]}):null,s.jsx($l,{className:"h-[min(50vh,320px)] rounded-lg border border-border/50 bg-secondary/20",children:j?s.jsx("div",{className:"grid grid-cols-6 gap-2 p-3 sm:grid-cols-8",children:Array.from({length:24}).map((U,q)=>s.jsx(Be,{className:"aspect-square rounded-lg"},q))}):y?s.jsxs("div",{className:"space-y-3 p-4 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:y}),s.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>void k(!0),children:"Retry"})]}):A.length===0?s.jsx("p",{className:"p-6 text-center text-sm text-muted-foreground",children:T.length===0?"No custom emojis in this server, or the bot needs the Guild Emojis intent (restart after update).":"No emojis match your search."}):s.jsx("div",{className:"grid grid-cols-6 gap-1.5 p-2 sm:grid-cols-8",children:A.map(U=>{const q=M.kind==="custom"&&M.id===U.id;return s.jsx("button",{type:"button",title:`:${U.name}:`,className:fe("flex aspect-square items-center justify-center rounded-lg border border-transparent bg-background/50 transition-colors hover:border-primary/30 hover:bg-accent",q&&"border-primary/50 bg-primary/15 ring-2 ring-primary/30"),onClick:()=>B(U),children:s.jsx("img",{src:U.url??W5(U.id,U.animated),alt:U.name,className:"size-8 object-contain",loading:"lazy"})},U.id)})})})]}),s.jsx(wh,{value:"unicode",className:"mt-0 px-5 pb-4 pt-3",children:s.jsx(jP,{onPick:z})})]})]})}),s.jsx(Ie,{value:O,disabled:c,onChange:U=>l(U.target.value),placeholder:"Unicode or <:name:id>",className:"border-border bg-secondary/30 font-mono text-xs"})]})}const g0="BOT_TOKEN",RP="MODEL_API_KEY";function Vg({field:e,value:n,onChange:a,readOnly:o}){const l=e.path.replace(/\./g,"-");if(e.type==="googleFont")return s.jsx(_L,{field:e,value:n,onChange:a,readOnly:o});if(e.type==="boolean")return s.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border bg-secondary/20 px-3 py-2.5",children:[s.jsxs("div",{children:[s.jsx(ze,{htmlFor:l,className:"font-medium",children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null]}),s.jsx(At,{id:l,checked:!!n,disabled:o,onCheckedChange:a})]});if(e.type==="stringList")return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,s.jsx(RL,{value:Array.isArray(n)?n:[],onChange:a})]});if(e.type==="select"&&e.options)return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),s.jsxs(No,{value:String(n??""),disabled:o,onValueChange:a,children:[s.jsx(Ba,{id:l,className:"border-border bg-secondary/30",children:s.jsx(Eo,{placeholder:"Select…"})}),s.jsx(Ua,{children:e.options.map(d=>s.jsx(an,{value:d.value,children:d.label},d.value))})]})]});if(e.type==="color"){const d=jr(String(n??"#000000"));return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Id,{value:d,onChange:a}),s.jsx(Ie,{id:l,value:d,disabled:o,onChange:m=>a(m.target.value),onBlur:m=>a(jr(m.target.value,d)),className:"border-border bg-secondary/30 font-mono uppercase",placeholder:"#000000",maxLength:7})]})]})}if(e.type==="emoji")return s.jsx(TP,{id:l,label:e.label,description:e.description,value:n,onChange:a,readOnly:o});if(e.type==="discordChannel"||e.type==="discordRole"||e.type==="discordCategory"){const d=e.type==="discordRole"?"role":e.type==="discordCategory"?"category":"channel";return s.jsx(OL,{id:l,label:e.label,description:e.description,kind:d,value:n,onChange:a,readOnly:o})}if(e.type==="secret"){const d=n===g0||n===RP||!n?"":"••••••••••••";return s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,s.jsx(Ie,{id:l,type:"password",value:d,disabled:o,placeholder:e.placeholder??"Unchanged if empty",onChange:m=>{const p=m.target.value;a(p||(e.placeholder??g0))},className:"border-border bg-secondary/30"})]})}const c="border-border bg-secondary/30";return e.type==="textarea"?s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),s.jsx(Ld,{id:l,value:String(n??""),disabled:o,onChange:d=>a(d.target.value),className:`min-h-[88px] ${c}`})]}):s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:l,children:e.label}),e.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}):null,s.jsx(Ie,{id:l,type:e.type==="number"?"number":"text",value:n==null?"":String(n),disabled:o,onChange:d=>a(e.type==="number"?Number(d.target.value):d.target.value),placeholder:e.placeholder??(e.type==="discordId"?"Discord snowflake ID":void 0),className:c})]})}const Xe=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("rounded-xl border border-border bg-card text-card-foreground shadow-none",e),...n}));Xe.displayName="Card";const it=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("flex flex-col space-y-1.5 p-6",e),...n}));it.displayName="CardHeader";const lt=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("font-semibold leading-none tracking-tight",e),...n}));lt.displayName="CardTitle";const Et=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("text-sm text-muted-foreground",e),...n}));Et.displayName="CardDescription";const Ze=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("p-6 pt-0",e),...n}));Ze.displayName="CardContent";const Gg=f.forwardRef(({className:e,...n},a)=>s.jsx("div",{ref:a,className:fe("flex items-center p-6 pt-0",e),...n}));Gg.displayName="CardFooter";function x0(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function AP(e,n){if(typeof n=="boolean")return"boolean";if(typeof n=="number")return"number";if(Array.isArray(n))return"stringList";if(typeof n=="string"){const a=e.toLowerCase();return/emoji/.test(a)?"emoji":/guild.?id|guild_id/.test(a)?"discordId":/category/.test(a)?"discordCategory":/channel|forum/.test(a)?"discordChannel":/role|staff|admin|moderator/.test(a)?"discordRole":n.length>100?"textarea":"text"}return"text"}function Fg(e,n=""){const a=[];for(const[o,l]of Object.entries(e)){const c=n?`${n}.${o}`:o;if(Array.isArray(l)){if(l.length>0&&typeof l[0]=="object"&&l[0]!==null&&!Array.isArray(l[0]))continue;a.push({path:c,label:x0(o),type:"stringList"});continue}if(l&&typeof l=="object"&&Object.keys(l).length>0){a.push(...Fg(l,c));continue}a.push({path:c,label:x0(o),type:AP(o,l)})}return a}function MP(e){const n=Fg(e);return n.length===0?[{title:"Configuration",fields:[]}]:[{title:"Settings",description:"Values from this addon’s config file.",fields:n}]}function To(e,n){const a=n.split(".");let o=e;for(const l of a){if(o==null||typeof o!="object")return;o=o[l]}return o}function xl(e,n,a){const o=n.split("."),l=structuredClone(e);let c=l;for(let d=0;d<o.length-1;d++){const m=o[d];(c[m]==null||typeof c[m]!="object")&&(c[m]={}),c=c[m]}return c[o[o.length-1]]=a,l}function _P(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const OP=e=>{switch(e){case"success":return zP;case"info":return IP;case"warning":return PP;case"error":return $P;default:return null}},DP=Array(12).fill(0),LP=({visible:e,className:n})=>me.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},me.createElement("div",{className:"sonner-spinner"},DP.map((a,o)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),zP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),PP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.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"})),IP=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),$P=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.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"})),BP=me.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"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UP=()=>{const[e,n]=me.useState(document.hidden);return me.useEffect(()=>{const a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let kh=1;class HP{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;const{message:o,...l}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:kh++,d=this.toasts.find(p=>p.id===c),m=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),d?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...n,id:c,title:o}),{...p,...n,id:c,dismissible:m,title:o}):p):this.addToast({title:o,...l,dismissible:m,id:c}),c},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:n,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(o=>o({id:a.id,dismiss:!0}))}),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let o;a.loading!==void 0&&(o=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const l=Promise.resolve(n instanceof Function?n():n);let c=o!==void 0,d;const m=l.then(async h=>{if(d=["resolve",h],me.isValidElement(h))c=!1,this.create({id:o,type:"default",message:h});else if(GP(h)&&!h.ok){c=!1;const g=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,y=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description,j=typeof g=="object"&&!me.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:y,...j})}else if(h instanceof Error){c=!1;const g=typeof a.error=="function"?await a.error(h):a.error,y=typeof a.description=="function"?await a.description(h):a.description,j=typeof g=="object"&&!me.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:y,...j})}else if(a.success!==void 0){c=!1;const g=typeof a.success=="function"?await a.success(h):a.success,y=typeof a.description=="function"?await a.description(h):a.description,j=typeof g=="object"&&!me.isValidElement(g)?g:{message:g};this.create({id:o,type:"success",description:y,...j})}}).catch(async h=>{if(d=["reject",h],a.error!==void 0){c=!1;const b=typeof a.error=="function"?await a.error(h):a.error,g=typeof a.description=="function"?await a.description(h):a.description,w=typeof b=="object"&&!me.isValidElement(b)?b:{message:b};this.create({id:o,type:"error",description:g,...w})}}).finally(()=>{c&&(this.dismiss(o),o=void 0),a.finally==null||a.finally.call(a)}),p=()=>new Promise((h,b)=>m.then(()=>d[0]==="reject"?b(d[1]):h(d[1])).catch(b));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(n,a)=>{const o=(a==null?void 0:a.id)||kh++;return this.create({jsx:n(o),id:o,...a}),o},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const wn=new HP,VP=(e,n)=>{const a=(n==null?void 0:n.id)||kh++;return wn.addToast({title:e,...n,id:a}),a},GP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",FP=VP,WP=()=>wn.toasts,YP=()=>wn.getActiveToasts(),Bt=Object.assign(FP,{success:wn.success,info:wn.info,warning:wn.warning,error:wn.error,custom:wn.custom,message:wn.message,promise:wn.promise,dismiss:wn.dismiss,loading:wn.loading},{getHistory:WP,getToasts:YP});_P("[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 pu(e){return e.label!==void 0}const qP=3,KP="24px",XP="16px",v0=4e3,ZP=356,QP=14,JP=45,eI=200;function wr(...e){return e.filter(Boolean).join(" ")}function tI(e){const[n,a]=e.split("-"),o=[];return n&&o.push(n),a&&o.push(a),o}const nI=e=>{var n,a,o,l,c,d,m,p,h;const{invert:b,toast:g,unstyled:y,interacting:w,setHeights:j,visibleToasts:S,heights:E,index:N,toasts:k,expanded:T,removeToast:A,defaultRichColors:O,closeButton:M,style:z,cancelButtonStyle:B,actionButtonStyle:K,className:U="",descriptionClassName:q="",duration:ue,position:pe,gap:xe,expandByDefault:se,classNames:L,icons:I,closeButtonAriaLabel:H="Close toast"}=e,[Z,te]=me.useState(null),[_,D]=me.useState(null),[G,V]=me.useState(!1),[F,oe]=me.useState(!1),[ae,be]=me.useState(!1),[ve,Y]=me.useState(!1),[le,ye]=me.useState(!1),[Te,Le]=me.useState(0),[rt,ht]=me.useState(0),Mt=me.useRef(g.duration||ue||v0),Tr=me.useRef(null),_t=me.useRef(null),Ya=N===0,qa=N+1<=S,qt=g.type,dr=g.dismissible!==!1,Kt=g.className||"",ti=g.descriptionClassName||"",fr=me.useMemo(()=>E.findIndex(Me=>Me.toastId===g.id)||0,[E,g.id]),Lo=me.useMemo(()=>{var Me;return(Me=g.closeButton)!=null?Me:M},[g.closeButton,M]),Rr=me.useMemo(()=>g.duration||ue||v0,[g.duration,ue]),Xt=me.useRef(0),Qn=me.useRef(0),zo=me.useRef(0),mr=me.useRef(null),[pr,Ht]=pe.split("-"),ee=me.useMemo(()=>E.reduce((Me,Je,St)=>St>=fr?Me:Me+Je.height,0),[E,fr]),re=UP(),ke=g.invert||b,we=qt==="loading";Qn.current=me.useMemo(()=>fr*xe+ee,[fr,ee]),me.useEffect(()=>{Mt.current=Rr},[Rr]),me.useEffect(()=>{V(!0)},[]),me.useEffect(()=>{const Me=_t.current;if(Me){const Je=Me.getBoundingClientRect().height;return ht(Je),j(St=>[{toastId:g.id,height:Je,position:g.position},...St]),()=>j(St=>St.filter(kt=>kt.toastId!==g.id))}},[j,g.id]),me.useLayoutEffect(()=>{if(!G)return;const Me=_t.current,Je=Me.style.height;Me.style.height="auto";const St=Me.getBoundingClientRect().height;Me.style.height=Je,ht(St),j(kt=>kt.find(wt=>wt.toastId===g.id)?kt.map(wt=>wt.toastId===g.id?{...wt,height:St}:wt):[{toastId:g.id,height:St,position:g.position},...kt])},[G,g.title,g.description,j,g.id,g.jsx,g.action,g.cancel]);const De=me.useCallback(()=>{oe(!0),Le(Qn.current),j(Me=>Me.filter(Je=>Je.toastId!==g.id)),setTimeout(()=>{A(g)},eI)},[g,A,j,Qn]);me.useEffect(()=>{if(g.promise&&qt==="loading"||g.duration===1/0||g.type==="loading")return;let Me;return T||w||re?(()=>{if(zo.current<Xt.current){const kt=new Date().getTime()-Xt.current;Mt.current=Mt.current-kt}zo.current=new Date().getTime()})():(()=>{Mt.current!==1/0&&(Xt.current=new Date().getTime(),Me=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),De()},Mt.current))})(),()=>clearTimeout(Me)},[T,w,g,qt,re,De]),me.useEffect(()=>{g.delete&&(De(),g.onDismiss==null||g.onDismiss.call(g,g))},[De,g.delete]);function at(){var Me;if(I!=null&&I.loading){var Je;return me.createElement("div",{className:wr(L==null?void 0:L.loader,g==null||(Je=g.classNames)==null?void 0:Je.loader,"sonner-loader"),"data-visible":qt==="loading"},I.loading)}return me.createElement(LP,{className:wr(L==null?void 0:L.loader,g==null||(Me=g.classNames)==null?void 0:Me.loader),visible:qt==="loading"})}const ct=g.icon||(I==null?void 0:I[qt])||OP(qt);var mt,Zt;return me.createElement("li",{tabIndex:0,ref:_t,className:wr(U,Kt,L==null?void 0:L.toast,g==null||(n=g.classNames)==null?void 0:n.toast,L==null?void 0:L.default,L==null?void 0:L[qt],g==null||(a=g.classNames)==null?void 0:a[qt]),"data-sonner-toast":"","data-rich-colors":(mt=g.richColors)!=null?mt:O,"data-styled":!(g.jsx||g.unstyled||y),"data-mounted":G,"data-promise":!!g.promise,"data-swiped":le,"data-removed":F,"data-visible":qa,"data-y-position":pr,"data-x-position":Ht,"data-index":N,"data-front":Ya,"data-swiping":ae,"data-dismissible":dr,"data-type":qt,"data-invert":ke,"data-swipe-out":ve,"data-swipe-direction":_,"data-expanded":!!(T||se&&G),"data-testid":g.testId,style:{"--index":N,"--toasts-before":N,"--z-index":k.length-N,"--offset":`${F?Te:Qn.current}px`,"--initial-height":se?"auto":`${rt}px`,...z,...g.style},onDragEnd:()=>{be(!1),te(null),mr.current=null},onPointerDown:Me=>{Me.button!==2&&(we||!dr||(Tr.current=new Date,Le(Qn.current),Me.target.setPointerCapture(Me.pointerId),Me.target.tagName!=="BUTTON"&&(be(!0),mr.current={x:Me.clientX,y:Me.clientY})))},onPointerUp:()=>{var Me,Je,St;if(ve||!dr)return;mr.current=null;const kt=Number(((Me=_t.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jn=Number(((Je=_t.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wt=new Date().getTime()-((St=Tr.current)==null?void 0:St.getTime()),dn=Z==="x"?kt:Jn,Ka=Math.abs(dn)/wt;if(Math.abs(dn)>=JP||Ka>.11){Le(Qn.current),g.onDismiss==null||g.onDismiss.call(g,g),D(Z==="x"?kt>0?"right":"left":Jn>0?"down":"up"),De(),Y(!0);return}else{var fn,mn;(fn=_t.current)==null||fn.style.setProperty("--swipe-amount-x","0px"),(mn=_t.current)==null||mn.style.setProperty("--swipe-amount-y","0px")}ye(!1),be(!1),te(null)},onPointerMove:Me=>{var Je,St,kt;if(!mr.current||!dr||((Je=window.getSelection())==null?void 0:Je.toString().length)>0)return;const wt=Me.clientY-mr.current.y,dn=Me.clientX-mr.current.x;var Ka;const fn=(Ka=e.swipeDirections)!=null?Ka:tI(pe);!Z&&(Math.abs(dn)>1||Math.abs(wt)>1)&&te(Math.abs(dn)>Math.abs(wt)?"x":"y");let mn={x:0,y:0};const Po=er=>1/(1.5+Math.abs(er)/20);if(Z==="y"){if(fn.includes("top")||fn.includes("bottom"))if(fn.includes("top")&&wt<0||fn.includes("bottom")&&wt>0)mn.y=wt;else{const er=wt*Po(wt);mn.y=Math.abs(er)<Math.abs(wt)?er:wt}}else if(Z==="x"&&(fn.includes("left")||fn.includes("right")))if(fn.includes("left")&&dn<0||fn.includes("right")&&dn>0)mn.x=dn;else{const er=dn*Po(dn);mn.x=Math.abs(er)<Math.abs(dn)?er:dn}(Math.abs(mn.x)>0||Math.abs(mn.y)>0)&&ye(!0),(St=_t.current)==null||St.style.setProperty("--swipe-amount-x",`${mn.x}px`),(kt=_t.current)==null||kt.style.setProperty("--swipe-amount-y",`${mn.y}px`)}},Lo&&!g.jsx&&qt!=="loading"?me.createElement("button",{"aria-label":H,"data-disabled":we,"data-close-button":!0,onClick:we||!dr?()=>{}:()=>{De(),g.onDismiss==null||g.onDismiss.call(g,g)},className:wr(L==null?void 0:L.closeButton,g==null||(o=g.classNames)==null?void 0:o.closeButton)},(Zt=I==null?void 0:I.close)!=null?Zt:BP):null,(qt||g.icon||g.promise)&&g.icon!==null&&((I==null?void 0:I[qt])!==null||g.icon)?me.createElement("div",{"data-icon":"",className:wr(L==null?void 0:L.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||at():null,g.type!=="loading"?ct:null):null,me.createElement("div",{"data-content":"",className:wr(L==null?void 0:L.content,g==null||(c=g.classNames)==null?void 0:c.content)},me.createElement("div",{"data-title":"",className:wr(L==null?void 0:L.title,g==null||(d=g.classNames)==null?void 0:d.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?me.createElement("div",{"data-description":"",className:wr(q,ti,L==null?void 0:L.description,g==null||(m=g.classNames)==null?void 0:m.description)},typeof g.description=="function"?g.description():g.description):null),me.isValidElement(g.cancel)?g.cancel:g.cancel&&pu(g.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||B,onClick:Me=>{pu(g.cancel)&&dr&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Me),De())},className:wr(L==null?void 0:L.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,me.isValidElement(g.action)?g.action:g.action&&pu(g.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||K,onClick:Me=>{pu(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Me),!Me.defaultPrevented&&De())},className:wr(L==null?void 0:L.actionButton,g==null||(h=g.classNames)==null?void 0:h.actionButton)},g.action.label):null)};function b0(){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 rI(e,n){const a={};return[e,n].forEach((o,l)=>{const c=l===1,d=c?"--mobile-offset":"--offset",m=c?XP:KP;function p(h){["top","right","bottom","left"].forEach(b=>{a[`${d}-${b}`]=typeof h=="number"?`${h}px`:h})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(h=>{o[h]===void 0?a[`${d}-${h}`]=m:a[`${d}-${h}`]=typeof o[h]=="number"?`${o[h]}px`:o[h]}):p(m)}),a}const aI=me.forwardRef(function(n,a){const{id:o,invert:l,position:c="bottom-right",hotkey:d=["altKey","KeyT"],expand:m,closeButton:p,className:h,offset:b,mobileOffset:g,theme:y="light",richColors:w,duration:j,style:S,visibleToasts:E=qP,toastOptions:N,dir:k=b0(),gap:T=QP,icons:A,containerAriaLabel:O="Notifications"}=n,[M,z]=me.useState([]),B=me.useMemo(()=>o?M.filter(G=>G.toasterId===o):M.filter(G=>!G.toasterId),[M,o]),K=me.useMemo(()=>Array.from(new Set([c].concat(B.filter(G=>G.position).map(G=>G.position)))),[B,c]),[U,q]=me.useState([]),[ue,pe]=me.useState(!1),[xe,se]=me.useState(!1),[L,I]=me.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=me.useRef(null),Z=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),te=me.useRef(null),_=me.useRef(!1),D=me.useCallback(G=>{z(V=>{var F;return(F=V.find(oe=>oe.id===G.id))!=null&&F.delete||wn.dismiss(G.id),V.filter(({id:oe})=>oe!==G.id)})},[]);return me.useEffect(()=>wn.subscribe(G=>{if(G.dismiss){requestAnimationFrame(()=>{z(V=>V.map(F=>F.id===G.id?{...F,delete:!0}:F))});return}setTimeout(()=>{X0.flushSync(()=>{z(V=>{const F=V.findIndex(oe=>oe.id===G.id);return F!==-1?[...V.slice(0,F),{...V[F],...G},...V.slice(F+1)]:[G,...V]})})})}),[M]),me.useEffect(()=>{if(y!=="system"){I(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?I("dark"):I("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:V})=>{I(V?"dark":"light")})}catch{G.addListener(({matches:F})=>{try{I(F?"dark":"light")}catch(oe){console.error(oe)}})}},[y]),me.useEffect(()=>{M.length<=1&&pe(!1)},[M]),me.useEffect(()=>{const G=V=>{var F;if(d.every(be=>V[be]||V.code===be)){var ae;pe(!0),(ae=H.current)==null||ae.focus()}V.code==="Escape"&&(document.activeElement===H.current||(F=H.current)!=null&&F.contains(document.activeElement))&&pe(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[d]),me.useEffect(()=>{if(H.current)return()=>{te.current&&(te.current.focus({preventScroll:!0}),te.current=null,_.current=!1)}},[H.current]),me.createElement("section",{ref:a,"aria-label":`${O} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},K.map((G,V)=>{var F;const[oe,ae]=G.split("-");return B.length?me.createElement("ol",{key:G,dir:k==="auto"?b0():k,tabIndex:-1,ref:H,className:h,"data-sonner-toaster":!0,"data-sonner-theme":L,"data-y-position":oe,"data-x-position":ae,style:{"--front-toast-height":`${((F=U[0])==null?void 0:F.height)||0}px`,"--width":`${ZP}px`,"--gap":`${T}px`,...S,...rI(b,g)},onBlur:be=>{_.current&&!be.currentTarget.contains(be.relatedTarget)&&(_.current=!1,te.current&&(te.current.focus({preventScroll:!0}),te.current=null))},onFocus:be=>{be.target instanceof HTMLElement&&be.target.dataset.dismissible==="false"||_.current||(_.current=!0,te.current=be.relatedTarget)},onMouseEnter:()=>pe(!0),onMouseMove:()=>pe(!0),onMouseLeave:()=>{xe||pe(!1)},onDragEnd:()=>pe(!1),onPointerDown:be=>{be.target instanceof HTMLElement&&be.target.dataset.dismissible==="false"||se(!0)},onPointerUp:()=>se(!1)},B.filter(be=>!be.position&&V===0||be.position===G).map((be,ve)=>{var Y,le;return me.createElement(nI,{key:be.id,icons:A,index:ve,toast:be,defaultRichColors:w,duration:(Y=N==null?void 0:N.duration)!=null?Y:j,className:N==null?void 0:N.className,descriptionClassName:N==null?void 0:N.descriptionClassName,invert:l,visibleToasts:E,closeButton:(le=N==null?void 0:N.closeButton)!=null?le:p,interacting:xe,position:G,style:N==null?void 0:N.style,unstyled:N==null?void 0:N.unstyled,classNames:N==null?void 0:N.classNames,cancelButtonStyle:N==null?void 0:N.cancelButtonStyle,actionButtonStyle:N==null?void 0:N.actionButtonStyle,closeButtonAriaLabel:N==null?void 0:N.closeButtonAriaLabel,removeToast:D,toasts:B.filter(ye=>ye.position==be.position),heights:U.filter(ye=>ye.position==be.position),setHeights:q,expandByDefault:m,gap:T,expanded:ue,swipeDirections:n.swipeDirections})})):null}))});async function ku(e){const n=Bt.loading("Saving changes…");try{const a=await e();if(Bt.success("Changes saved",{id:n}),a.botRestart){const o=Bt.loading("Restarting bot…");a.botRestart.success?Bt.success("Bot started",{id:o}):Bt.error(a.botRestart.error??"Could not start bot",{id:o})}return a}catch(a){throw Bt.error(a instanceof Error?a.message:"Save failed",{id:n}),a}}function oI({filename:e}){const{canEditConfig:n}=Ut(),a=!n("supportbot"),[o,l]=f.useState(null),[c,d]=f.useState(null),[m,p]=f.useState(!0),[h,b]=f.useState(!1),[g,y]=f.useState(""),[w,j]=f.useState(""),S=f.useCallback(async()=>{p(!0),y(""),j("");try{const O=(await Ee.getAddonConfigJson(e)).data??{};l(O),d(structuredClone(O))}catch(A){y(A instanceof Error?A.message:"Failed to load config")}finally{p(!1)}},[e]);f.useEffect(()=>{S()},[S]);const E=o?MP(o):null;function N(A,O){l(M=>M&&xl(M,A,O))}async function k(){if(!(a||!o)){b(!0),y(""),j("");try{const A=await ku(()=>Ee.saveAddonConfig(e,o));j(A.message||"Saved."),await S()}catch(A){y(A instanceof Error?A.message:"Save failed")}finally{b(!1)}}}if(m)return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Be,{className:"h-24 w-full rounded-xl"}),s.jsx(Be,{className:"h-48 w-full rounded-xl"})]});if(!o||!E)return s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g||"Failed to load"})});const T=c&&JSON.stringify(o)!==JSON.stringify(c);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[T?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,s.jsx(he,{variant:"outline",size:"sm",onClick:S,disabled:m||h,children:"Reload"}),a?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(he,{size:"sm",onClick:k,disabled:h||!T,children:[s.jsx(ge,{icon:nd,size:16,className:"mr-1.5"}),h?"Saving…":"Save"]})]}),g?s.jsxs(We,{variant:"destructive",children:[s.jsx(ge,{icon:Bh,size:18}),s.jsx(Ye,{children:g})]}):null,w?s.jsx(We,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(Ye,{children:w})}):null,E.map(A=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-3",children:[s.jsx(lt,{className:"text-base",children:A.title}),A.description?s.jsx(Et,{children:A.description}):null]}),s.jsx(Ze,{className:"grid gap-4 sm:grid-cols-2",children:A.fields.map(O=>s.jsx("div",{className:O.type==="textarea"||O.type==="stringList"?"sm:col-span-2":"",children:s.jsx(Vg,{field:O,value:To(o,O.path),readOnly:a,onChange:M=>N(O.path,M)})},O.path))})]},A.title))]})}function sI(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function iI(e,n){const a=new Set(e.flatMap(d=>d.fields.map(m=>m.path))),o=Fg(n).filter(d=>!a.has(d.path));if(o.length===0)return e;const l=new Map;for(const d of o){const m=d.path.split(".")[0]??"Other",p=l.get(m)??[];p.push(d),l.set(m,p)}const c=[...l.entries()].sort(([d],[m])=>d.localeCompare(m)).map(([d,m])=>({title:sI(d),description:"These options exist in your config file but are not in the main editor sections.",fields:m.sort((p,h)=>p.path.localeCompare(h.path))}));return[...e,...c]}function y0(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,o=Array(n);a<n;a++)o[a]=e[a];return o}function lI(e){if(Array.isArray(e))return e}function cI(e,n,a){return(n=gI(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function uI(e,n){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var o,l,c,d,m=[],p=!0,h=!1;try{if(c=(a=a.call(e)).next,n!==0)for(;!(p=(o=c.call(a)).done)&&(m.push(o.value),m.length!==n);p=!0);}catch(b){h=!0,l=b}finally{try{if(!p&&a.return!=null&&(d=a.return(),Object(d)!==d))return}finally{if(h)throw l}}return m}}function dI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w0(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),a.push.apply(a,o)}return a}function C0(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?w0(Object(a),!0).forEach(function(o){cI(e,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):w0(Object(a)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(a,o))})}return e}function fI(e,n){if(e==null)return{};var a,o,l=mI(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)a=c[o],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(l[a]=e[a])}return l}function mI(e,n){if(e==null)return{};var a={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(n.indexOf(o)!==-1)continue;a[o]=e[o]}return a}function pI(e,n){return lI(e)||uI(e,n)||xI(e,n)||dI()}function hI(e,n){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var o=a.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function gI(e){var n=hI(e,"string");return typeof n=="symbol"?n:n+""}function xI(e,n){if(e){if(typeof e=="string")return y0(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?y0(e,n):void 0}}function vI(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function S0(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),a.push.apply(a,o)}return a}function j0(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?S0(Object(a),!0).forEach(function(o){vI(e,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S0(Object(a)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(a,o))})}return e}function bI(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return function(o){return n.reduceRight(function(l,c){return c(l)},o)}}function Ji(e){return function n(){for(var a=this,o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];return l.length>=e.length?e.apply(this,l):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(l,m))}}}function Yu(e){return{}.toString.call(e).includes("Object")}function yI(e){return!Object.keys(e).length}function vl(e){return typeof e=="function"}function wI(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function CI(e,n){return Yu(n)||Oa("changeType"),Object.keys(n).some(function(a){return!wI(e,a)})&&Oa("changeField"),n}function SI(e){vl(e)||Oa("selectorType")}function jI(e){vl(e)||Yu(e)||Oa("handlerType"),Yu(e)&&Object.values(e).some(function(n){return!vl(n)})&&Oa("handlersType")}function NI(e){e||Oa("initialIsRequired"),Yu(e)||Oa("initialType"),yI(e)&&Oa("initialContent")}function EI(e,n){throw new Error(e[n]||e.default)}var kI={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Oa=Ji(EI)(kI),hu={changes:CI,selector:SI,handler:jI,initial:NI};function TI(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};hu.initial(e),hu.handler(n);var a={current:e},o=Ji(MI)(a,n),l=Ji(AI)(a),c=Ji(hu.changes)(e),d=Ji(RI)(a);function m(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(b){return b};return hu.selector(h),h(a.current)}function p(h){bI(o,l,c,d)(h)}return[m,p]}function RI(e,n){return vl(n)?n(e.current):n}function AI(e,n){return e.current=j0(j0({},e.current),n),n}function MI(e,n,a){return vl(n)?n(e.current):Object.keys(a).forEach(function(o){var l;return(l=n[o])===null||l===void 0?void 0:l.call(n,e.current[o])}),a}var _I={create:TI},OI={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function DI(e){return function n(){for(var a=this,o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];return l.length>=e.length?e.apply(this,l):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(l,m))}}}function LI(e){return{}.toString.call(e).includes("Object")}function zI(e){return e||N0("configIsRequired"),LI(e)||N0("configType"),e.urls?(PI(),{paths:{vs:e.urls.monacoBase}}):e}function PI(){console.warn(Y5.deprecation)}function II(e,n){throw new Error(e[n]||e.default)}var Y5={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
You are using deprecated way of configuration.
Instead of using
monaco.config({ urls: { monacoBase: '...' } })
use
monaco.config({ paths: { vs: '...' } })
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
`},N0=DI(II)(Y5),$I={config:zI},BI=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return function(l){return a.reduceRight(function(c,d){return d(c)},l)}};function q5(e,n){return Object.keys(n).forEach(function(a){n[a]instanceof Object&&e[a]&&Object.assign(n[a],q5(e[a],n[a]))}),C0(C0({},e),n)}var UI={type:"cancelation",msg:"operation is manually canceled"};function Ip(e){var n=!1,a=new Promise(function(o,l){e.then(function(c){return n?l(UI):o(c)}),e.catch(l)});return a.cancel=function(){return n=!0},a}var HI=["monaco"],VI=_I.create({config:OI,isInitialized:!1,resolve:null,reject:null,monaco:null}),K5=pI(VI,2),Ul=K5[0],Ud=K5[1];function GI(e){var n=$I.config(e),a=n.monaco,o=fI(n,HI);Ud(function(l){return{config:q5(l.config,o),monaco:a}})}function FI(){var e=Ul(function(n){var a=n.monaco,o=n.isInitialized,l=n.resolve;return{monaco:a,isInitialized:o,resolve:l}});if(!e.isInitialized){if(Ud({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ip($p);if(window.monaco&&window.monaco.editor)return X5(window.monaco),e.resolve(window.monaco),Ip($p);BI(WI,qI)(KI)}return Ip($p)}function WI(e){return document.body.appendChild(e)}function YI(e){var n=document.createElement("script");return e&&(n.src=e),n}function qI(e){var n=Ul(function(o){var l=o.config,c=o.reject;return{config:l,reject:c}}),a=YI("".concat(n.config.paths.vs,"/loader.js"));return a.onload=function(){return e()},a.onerror=n.reject,a}function KI(){var e=Ul(function(a){var o=a.config,l=a.resolve,c=a.reject;return{config:o,resolve:l,reject:c}}),n=window.require;n.config(e.config),n(["vs/editor/editor.main"],function(a){var o=a.m||a;X5(o),e.resolve(o)},function(a){e.reject(a)})}function X5(e){Ul().monaco||Ud({monaco:e})}function XI(){return Ul(function(e){var n=e.monaco;return n})}var $p=new Promise(function(e,n){return Ud({resolve:e,reject:n})}),Z5={config:GI,init:FI,__getMonacoInstance:XI},ZI={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Bp=ZI,QI={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},JI=QI;function e$({children:e}){return me.createElement("div",{style:JI.container},e)}var t$=e$,n$=t$;function r$({width:e,height:n,isEditorReady:a,loading:o,_ref:l,className:c,wrapperProps:d}){return me.createElement("section",{style:{...Bp.wrapper,width:e,height:n},...d},!a&&me.createElement(n$,null,o),me.createElement("div",{ref:l,style:{...Bp.fullWidth,...!a&&Bp.hide},className:c}))}var a$=r$,Q5=f.memo(a$);function o$(e){f.useEffect(e,[])}var J5=o$;function s$(e,n,a=!0){let o=f.useRef(!0);f.useEffect(o.current||!a?()=>{o.current=!1}:e,n)}var Mn=s$;function al(){}function Rs(e,n,a,o){return i$(e,o)||l$(e,n,a,o)}function i$(e,n){return e.editor.getModel(eN(e,n))}function l$(e,n,a,o){return e.editor.createModel(n,a,o?eN(e,o):void 0)}function eN(e,n){return e.Uri.parse(n)}function c$({original:e,modified:n,language:a,originalLanguage:o,modifiedLanguage:l,originalModelPath:c,modifiedModelPath:d,keepCurrentOriginalModel:m=!1,keepCurrentModifiedModel:p=!1,theme:h="light",loading:b="Loading...",options:g={},height:y="100%",width:w="100%",className:j,wrapperProps:S={},beforeMount:E=al,onMount:N=al}){let[k,T]=f.useState(!1),[A,O]=f.useState(!0),M=f.useRef(null),z=f.useRef(null),B=f.useRef(null),K=f.useRef(N),U=f.useRef(E),q=f.useRef(!1);J5(()=>{let se=Z5.init();return se.then(L=>(z.current=L)&&O(!1)).catch(L=>(L==null?void 0:L.type)!=="cancelation"&&console.error("Monaco initialization: error:",L)),()=>M.current?xe():se.cancel()}),Mn(()=>{if(M.current&&z.current){let se=M.current.getOriginalEditor(),L=Rs(z.current,e||"",o||a||"text",c||"");L!==se.getModel()&&se.setModel(L)}},[c],k),Mn(()=>{if(M.current&&z.current){let se=M.current.getModifiedEditor(),L=Rs(z.current,n||"",l||a||"text",d||"");L!==se.getModel()&&se.setModel(L)}},[d],k),Mn(()=>{let se=M.current.getModifiedEditor();se.getOption(z.current.editor.EditorOption.readOnly)?se.setValue(n||""):n!==se.getValue()&&(se.executeEdits("",[{range:se.getModel().getFullModelRange(),text:n||"",forceMoveMarkers:!0}]),se.pushUndoStop())},[n],k),Mn(()=>{var se,L;(L=(se=M.current)==null?void 0:se.getModel())==null||L.original.setValue(e||"")},[e],k),Mn(()=>{let{original:se,modified:L}=M.current.getModel();z.current.editor.setModelLanguage(se,o||a||"text"),z.current.editor.setModelLanguage(L,l||a||"text")},[a,o,l],k),Mn(()=>{var se;(se=z.current)==null||se.editor.setTheme(h)},[h],k),Mn(()=>{var se;(se=M.current)==null||se.updateOptions(g)},[g],k);let ue=f.useCallback(()=>{var I;if(!z.current)return;U.current(z.current);let se=Rs(z.current,e||"",o||a||"text",c||""),L=Rs(z.current,n||"",l||a||"text",d||"");(I=M.current)==null||I.setModel({original:se,modified:L})},[a,n,l,e,o,c,d]),pe=f.useCallback(()=>{var se;!q.current&&B.current&&(M.current=z.current.editor.createDiffEditor(B.current,{automaticLayout:!0,...g}),ue(),(se=z.current)==null||se.editor.setTheme(h),T(!0),q.current=!0)},[g,h,ue]);f.useEffect(()=>{k&&K.current(M.current,z.current)},[k]),f.useEffect(()=>{!A&&!k&&pe()},[A,k,pe]);function xe(){var L,I,H,Z;let se=(L=M.current)==null?void 0:L.getModel();m||((I=se==null?void 0:se.original)==null||I.dispose()),p||((H=se==null?void 0:se.modified)==null||H.dispose()),(Z=M.current)==null||Z.dispose()}return me.createElement(Q5,{width:w,height:y,isEditorReady:k,loading:b,_ref:B,className:j,wrapperProps:S})}var u$=c$;f.memo(u$);function d$(e){let n=f.useRef();return f.useEffect(()=>{n.current=e},[e]),n.current}var f$=d$,gu=new Map;function m$({defaultValue:e,defaultLanguage:n,defaultPath:a,value:o,language:l,path:c,theme:d="light",line:m,loading:p="Loading...",options:h={},overrideServices:b={},saveViewState:g=!0,keepCurrentModel:y=!1,width:w="100%",height:j="100%",className:S,wrapperProps:E={},beforeMount:N=al,onMount:k=al,onChange:T,onValidate:A=al}){let[O,M]=f.useState(!1),[z,B]=f.useState(!0),K=f.useRef(null),U=f.useRef(null),q=f.useRef(null),ue=f.useRef(k),pe=f.useRef(N),xe=f.useRef(),se=f.useRef(o),L=f$(c),I=f.useRef(!1),H=f.useRef(!1);J5(()=>{let _=Z5.init();return _.then(D=>(K.current=D)&&B(!1)).catch(D=>(D==null?void 0:D.type)!=="cancelation"&&console.error("Monaco initialization: error:",D)),()=>U.current?te():_.cancel()}),Mn(()=>{var D,G,V,F;let _=Rs(K.current,e||o||"",n||l||"",c||a||"");_!==((D=U.current)==null?void 0:D.getModel())&&(g&&gu.set(L,(G=U.current)==null?void 0:G.saveViewState()),(V=U.current)==null||V.setModel(_),g&&((F=U.current)==null||F.restoreViewState(gu.get(c))))},[c],O),Mn(()=>{var _;(_=U.current)==null||_.updateOptions(h)},[h],O),Mn(()=>{!U.current||o===void 0||(U.current.getOption(K.current.editor.EditorOption.readOnly)?U.current.setValue(o):o!==U.current.getValue()&&(H.current=!0,U.current.executeEdits("",[{range:U.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),U.current.pushUndoStop(),H.current=!1))},[o],O),Mn(()=>{var D,G;let _=(D=U.current)==null?void 0:D.getModel();_&&l&&((G=K.current)==null||G.editor.setModelLanguage(_,l))},[l],O),Mn(()=>{var _;m!==void 0&&((_=U.current)==null||_.revealLine(m))},[m],O),Mn(()=>{var _;(_=K.current)==null||_.editor.setTheme(d)},[d],O);let Z=f.useCallback(()=>{var _;if(!(!q.current||!K.current)&&!I.current){pe.current(K.current);let D=c||a,G=Rs(K.current,o||e||"",n||l||"",D||"");U.current=(_=K.current)==null?void 0:_.editor.create(q.current,{model:G,automaticLayout:!0,...h},b),g&&U.current.restoreViewState(gu.get(D)),K.current.editor.setTheme(d),m!==void 0&&U.current.revealLine(m),M(!0),I.current=!0}},[e,n,a,o,l,c,h,b,g,d,m]);f.useEffect(()=>{O&&ue.current(U.current,K.current)},[O]),f.useEffect(()=>{!z&&!O&&Z()},[z,O,Z]),se.current=o,f.useEffect(()=>{var _,D;O&&T&&((_=xe.current)==null||_.dispose(),xe.current=(D=U.current)==null?void 0:D.onDidChangeModelContent(G=>{H.current||T(U.current.getValue(),G)}))},[O,T]),f.useEffect(()=>{if(O){let _=K.current.editor.onDidChangeMarkers(D=>{var V;let G=(V=U.current.getModel())==null?void 0:V.uri;if(G&&D.find(F=>F.path===G.path)){let F=K.current.editor.getModelMarkers({resource:G});A==null||A(F)}});return()=>{_==null||_.dispose()}}return()=>{}},[O,A]);function te(){var _,D;(_=xe.current)==null||_.dispose(),y?g&&gu.set(c,U.current.saveViewState()):(D=U.current.getModel())==null||D.dispose(),U.current.dispose()}return me.createElement(Q5,{width:w,height:j,isEditorReady:O,loading:p,_ref:q,className:S,wrapperProps:E})}var p$=m$,h$=f.memo(p$),g$=h$;function x$(e){return e!==null&&typeof e=="object"&&"Command"in e}function v$(e){return Object.entries(e).filter(([,n])=>x$(n)).map(([n,a])=>({key:n,...a}))}function b$({data:e,onChange:n}){const a=v$(e);function o(l,c){const d=e[l];n({...e,[l]:{...d,...c}})}return a.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands found in this config."}):s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.map(l=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row items-center gap-2 space-y-0 pb-2",children:[s.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(ge,{icon:Da,size:18})}),s.jsx(lt,{className:"text-base",children:l.key})]}),s.jsxs(Ze,{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(ze,{htmlFor:`${l.key}-enabled`,children:"Enabled"}),s.jsx(At,{id:`${l.key}-enabled`,checked:l.Enabled!==!1,onCheckedChange:c=>o(l.key,{Enabled:c})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(ze,{children:"Slash command"}),s.jsx(Ie,{value:l.Command??"",onChange:c=>o(l.key,{Command:c.target.value}),className:"border-border bg-secondary/30 font-mono"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(ze,{children:"Description"}),s.jsx(Ie,{value:l.Description??"",onChange:c=>o(l.key,{Description:c.target.value}),className:"border-border bg-secondary/30"})]})]})]},l.key))})}function y$(e,n){let a=structuredClone(n);if(e==="supportbot"){const o=To(a,"General.Token");o&&o!=="BOT_TOKEN"&&(a=xl(a,"General.Token","BOT_TOKEN"))}if(e==="supportbot-ai"){const o=To(a,"General.Model_API_Key");o&&o!=="MODEL_API_KEY"&&(a=xl(a,"General.Model_API_Key","MODEL_API_KEY"))}return a}function w$(e,n,a,o){const l={};for(const c of n)for(const d of c.fields){const m=To(a,d.path),p=To(o,d.path);d.type==="secret"&&(m==="BOT_TOKEN"||m==="MODEL_API_KEY"||m===""||m===void 0)||JSON.stringify(m)!==JSON.stringify(p)&&(l[`${e}:${d.path}`]=m)}return l}function C$({configFile:e}){const{canEditConfig:n}=Ut(),a=!n(e),[o,l]=f.useState(null),[c,d]=f.useState(null),[m,p]=f.useState(!0),[h,b]=f.useState(!1),[g,y]=f.useState(""),[w,j]=f.useState(""),[S,E]=f.useState("visual"),[N,k]=f.useState(""),[T,A]=f.useState(""),[O]=Ju(),[M,z]=f.useState(()=>O.get("tab")||null),B=D_(e),K=f.useMemo(()=>!B||B==="commands"||!o?B:iI(B,o),[B,o]);f.useEffect(()=>{var I;if(K&&K!=="commands"){const H=O.get("tab");if(H&&K.find(Z=>Z.title.toLowerCase()===H.toLowerCase())){const Z=K.find(te=>te.title.toLowerCase()===H.toLowerCase());Z&&Z.title!==M&&z(Z.title)}else(!M||!K.find(Z=>Z.title===M))&&z(((I=K[0])==null?void 0:I.title)||null)}},[K,M,O]);const U=f.useCallback(async()=>{p(!0),y(""),j("");try{const H=(await Ee.getConfigJson(e)).data??{},Z=y$(e,H);l(Z),d(Z);const _=(await Ee.getConfigRaw(e)).data??"",D=E8(_,e);k(D),A(D)}catch(I){y(I instanceof Error?I.message:"Failed to load config")}finally{p(!1)}},[e]);f.useEffect(()=>{U()},[U]);function q(I,H){l(Z=>Z&&xl(Z,I,H))}async function ue(){if(!(a||N===T)){b(!0),y(""),j("");try{const I=await ku(()=>Ee.saveConfigRaw(e,N));j(I.message||"Config saved."),await U()}catch(I){y(I instanceof Error?I.message:"Save failed")}finally{b(!1)}}}async function pe(){if(!(a||!o||!c)){if(S==="yaml"){await ue();return}b(!0),y(""),j("");try{if(B==="commands"){const I={};for(const Z of Object.keys(o))JSON.stringify(o[Z])!==JSON.stringify(c[Z])&&(I[`${e}:${Z}`]=o[Z]);if(Object.keys(I).length===0){j("No changes to save.");return}const H=await ku(()=>Ee.updateConfigFields(I));j(H.message||"")}else if(K&&K!=="commands"){const I=w$(e,K,o,c);if(Object.keys(I).length===0){j("No changes to save.");return}const H=await ku(()=>Ee.updateConfigFields(I));j(H.message||"")}await U()}catch(I){y(I instanceof Error?I.message:"Save failed")}finally{b(!1)}}}if(B===null)return s.jsx(We,{children:s.jsx(Ye,{children:"No visual editor available for this file."})});if(m)return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Be,{className:"h-24 w-full rounded-xl"}),s.jsx(Be,{className:"h-48 w-full rounded-xl"})]});if(!o)return s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g||"Failed to load"})});const xe=c&&JSON.stringify(o)!==JSON.stringify(c),L=S==="yaml"?N!==T:xe;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[s.jsx(he,{type:"button",variant:S==="visual"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>E("visual"),children:"Visual"}),s.jsx(he,{type:"button",variant:S==="yaml"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>E("yaml"),children:"YAML"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[L?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,s.jsx(he,{variant:"outline",size:"sm",onClick:U,disabled:m||h,children:"Reload"}),a?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(he,{size:"sm",onClick:pe,disabled:h||!L,children:[s.jsx(ge,{icon:nd,size:16,className:"mr-1.5"}),h?"Saving…":"Save"]})]})]}),g?s.jsxs(We,{variant:"destructive",children:[s.jsx(ge,{icon:Bh,size:18}),s.jsx(Ye,{children:g})]}):null,w?s.jsx(We,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(Ye,{children:w})}):null,S==="yaml"?s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-3",children:[s.jsx(lt,{className:"text-base",children:"Raw YAML"}),s.jsx(Et,{children:"Edit the full file. Use this for nested lists (e.g. welcome buttons) or any option not in Visual mode."})]}),s.jsx(Ze,{className:"h-[min(520px,60vh)] overflow-hidden rounded-b-xl border-t border-border p-0",children:s.jsx(g$,{height:"100%",language:"yaml",theme:"vs-dark",value:N,onChange:I=>k(I||""),options:{readOnly:a,minimap:{enabled:!1},fontSize:13,wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:16},tabSize:2}})})]}):B==="commands"?s.jsx(b$,{data:o,onChange:I=>l(I)}):K&&K!=="commands"?s.jsxs("div",{className:"grid gap-6 lg:grid-cols-[200px_1fr]",children:[s.jsx("nav",{className:"flex flex-col gap-1",children:K.map(I=>s.jsx("button",{onClick:()=>z(I.title),className:fe("text-left px-3 py-2 text-sm rounded-md transition-colors",M===I.title?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:I.title},I.title))}),s.jsx("div",{className:"min-w-0",children:K.filter(I=>I.title===M).map(I=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-3",children:[s.jsx(lt,{className:"text-base",children:I.title}),I.description?s.jsx(Et,{children:I.description}):null]}),s.jsx(Ze,{className:"grid gap-4 sm:grid-cols-2",children:I.fields.map(H=>s.jsx("div",{className:H.type==="textarea"||H.type==="stringList"?"sm:col-span-2":"",children:s.jsx(Vg,{field:H,value:To(o,H.path),readOnly:a,onChange:Z=>q(H.path,Z)})},H.path))})]},I.title))})]}):null]})}const S$=Ee.listConfigs(),j$={supportbot:"Bot config","ticket-panel":"Ticket panel",commands:"Commands",messages:"Messages","supportbot-ai":"AI assistant"};function N$(){var T,A;const{permissions:e,canViewConfig:n}=Ut(),{files:a}=f2(),[o,l]=Ju(),c=o.get("file"),d=n("supportbot"),m=f.useMemo(()=>S$.filter(O=>n(O)),[n]),p=f.useMemo(()=>d?a:[],[d,a]),h=f.useMemo(()=>[...m,...p.map(O=>el(O))],[m,p]),b=h[0]??"",[g,y]=f.useState(()=>c&&h.includes(c)?c:b);if(f.useEffect(()=>{c&&h.includes(c)?y(c):h.includes(g)||(y(b),b&&l({file:b}))},[c,h,g,b,l]),h.length===0)return s.jsx(Qr,{to:Wh(e),replace:!0});const w=O8(g),j=(w==null?void 0:w.type)==="addon",S=j?w.file:null,E=j?m2(S):j$[g]??"Configuration",N=j?!!((T=e==null?void 0:e.configs.supportbot)!=null&&T.edit):e?!!((A=e.configs[g])!=null&&A.edit):!1,k=j?S:`${g}.yml`;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:E}),s.jsx("p",{className:"text-muted-foreground",children:N?`Edit ${k} — changes apply to the running bot without restarting the dashboard.`:`Viewing ${k} — you do not have permission to save changes.`})]}),s.jsx("div",{className:"mt-6",children:j&&S?s.jsx(oI,{filename:S},S):s.jsx(C$,{configFile:g},g)})]})}const E$={oauth_not_configured:"Discord OAuth is not configured. Complete setup at /setup first.",not_allowed:"Your Discord account is not allowed. Ask an owner to add you under Users, or add your ID to OwnerUserIds in Configs/api.yml.",invalid_state:"Login session expired. Please try again.",missing_code:"Discord did not return an authorization code. Please try again.",oauth_failed:"Could not complete Discord sign-in. Check your OAuth settings.",access_denied:"You cancelled Discord sign-in."};function k$(e){return e?E$[e]||"Sign-in failed. Please try again.":""}function T$(){const{branding:e}=od(),{isAuthenticated:n,loading:a,loginWithDiscord:o}=Ut(),[l]=Ju(),c=f.useMemo(()=>k$(l.get("error")),[l]);return!a&&n?s.jsx(Qr,{to:"/",replace:!0}):s.jsx("div",{className:"relative flex min-h-svh items-center justify-center bg-[#0c0c10] p-4 overflow-hidden",children:s.jsxs(Xe,{className:"relative z-10 w-full max-w-md overflow-hidden rounded-3xl border border-white/10 bg-card/30 p-2 shadow-2xl backdrop-blur-2xl",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent pointer-events-none"}),s.jsxs(it,{className:"space-y-6 pt-10 pb-4 text-center",children:[s.jsx("div",{className:"mx-auto flex size-28 items-center justify-center overflow-hidden rounded-3xl bg-white/5 p-4 shadow-inner ring-1 ring-white/10 transition-transform duration-500 hover:scale-105",children:s.jsx("img",{src:"/logo.png",alt:"SupportBot Logo",className:"h-full w-full object-contain drop-shadow-xl"})}),s.jsxs("div",{children:[s.jsx(lt,{className:"bg-gradient-to-br from-white to-white/50 bg-clip-text text-3xl font-extrabold tracking-tight text-transparent",children:e.title||"SupportBot"}),s.jsx(Et,{className:"mt-2 text-base font-medium text-white/50",children:"Sign in to your dashboard"})]})]}),s.jsxs(Ze,{className:"space-y-6 pb-10",children:[s.jsxs("div",{className:"text-center space-y-1",children:[s.jsx("p",{className:"text-sm font-medium text-white/50",children:"Securely authenticate using your Discord account."}),s.jsxs("p",{className:"text-xs text-white/30",children:["Credentials are configured in ",s.jsx("code",{className:"rounded bg-white/5 px-1 py-0.5 text-white/40",children:"Configs/api.yml"})]})]}),c?s.jsx(We,{variant:"destructive",className:"border-red-500/50 bg-red-500/10 text-red-200 backdrop-blur-md",children:s.jsx(Ye,{className:"font-medium",children:c})}):null,s.jsxs(he,{type:"button",className:"group relative w-full overflow-hidden rounded-2xl bg-primary px-8 py-6 text-base font-bold text-primary-foreground shadow-[0_0_20px_rgba(var(--primary),0.3)] transition-all duration-300 hover:scale-[1.02] hover:shadow-[0_0_30px_rgba(var(--primary),0.5)] active:scale-95",disabled:a,onClick:o,children:[s.jsx("div",{className:"absolute inset-0 translate-x-[-100%] bg-gradient-to-r from-transparent via-white/20 to-transparent transition-transform duration-1000 group-hover:translate-x-[100%]"}),s.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 127.14 96.36",fill:"currentColor",children:s.jsx("path",{d:"M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1,105.25,105.25,0,0,0,32.19-16.14c2.64-27.38-4.51-51.11-19.32-72.15ZM42.68,68.22c-5.28,0-9.66-4.9-9.66-10.89s4.29-10.89,9.66-10.89c5.41,0,9.75,4.9,9.66,10.89C52.34,63.32,48.09,68.22,42.68,68.22Zm41.76,0c-5.28,0-9.66-4.9-9.66-10.89s4.29-10.89,9.66-10.89c5.41,0,9.75,4.9,9.66,10.89C84.44,63.32,80.19,68.22,84.44,68.22Z"})}),a?"Authenticating...":"Continue with Discord"]})]})]})]})})}const Os=[{id:"botToken",title:"Bot token",subtitle:"Connect your Discord bot",icon:Hh},{id:"secretKey",title:"Session secret",subtitle:"Secure dashboard logins",icon:y8},{id:"oauth",title:"Discord OAuth",subtitle:"Sign in with Discord",icon:oy},{id:"redirectUri",title:"Redirect URL",subtitle:"OAuth callback address",icon:rd},{id:"owners",title:"Dashboard owners",subtitle:"Who can access this panel",icon:Fp},{id:"emeraldApi",title:"Emerald API",subtitle:"One-click addons",icon:oy}];function R$(e){return e==="oauth"?"oauth":e==="owners"?"owners":e}function A$({brandingTitle:e,faviconUrl:n,faviconVersion:a,hasFavicon:o,children:l}){return s.jsx("div",{className:"min-h-svh bg-background",children:s.jsxs("div",{className:"mx-auto flex min-h-svh max-w-6xl flex-col px-4 py-6 md:px-8 md:py-10",children:[s.jsxs("header",{className:"mb-8 flex items-center gap-4",children:[o&&n?s.jsx("img",{src:`${n}${a?`?v=${a}`:""}`,alt:"",className:"size-12 rounded-2xl border border-border object-contain"}):s.jsx("div",{className:"flex size-12 items-center justify-center rounded-2xl border border-border bg-primary text-primary-foreground",children:s.jsx(ge,{icon:Hh,size:24})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"First-time setup"}),s.jsx("h1",{className:"text-2xl font-semibold tracking-tight md:text-3xl",children:e})]})]}),l]})})}function M$({currentIndex:e,validation:n}){const a=(e+1)/Os.length*100;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Step ",e+1," of ",Os.length]}),s.jsxs("span",{children:[Math.round(a),"%"]})]}),s.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-secondary",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-300 ease-out",style:{width:`${a}%`}})})]}),s.jsx("nav",{className:"hidden space-y-1 md:block","aria-label":"Setup steps",children:Os.map((o,l)=>{var h;const c=R$(o.id),d=(h=n[c])==null?void 0:h.ok,m=l===e,p=l<e;return s.jsxs("div",{className:fe("flex items-start gap-3 rounded-xl border px-3 py-3 transition-colors",m&&"border-primary bg-secondary",!m&&"border-transparent",p&&!m&&"opacity-80"),children:[s.jsx("div",{className:fe("flex size-9 shrink-0 items-center justify-center rounded-lg",d?"bg-emerald-500/15 text-emerald-500":m?"bg-primary text-primary-foreground":"bg-secondary text-muted-foreground"),children:d?s.jsx(ge,{icon:ed,size:18}):s.jsx(ge,{icon:o.icon,size:18})}),s.jsxs("div",{className:"min-w-0 pt-0.5",children:[s.jsx("p",{className:fe("text-sm font-medium leading-none",m&&"text-foreground",!m&&"text-muted-foreground"),children:o.title}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:o.subtitle})]})]},o.id)})}),s.jsx("p",{className:"hidden text-xs leading-relaxed text-muted-foreground md:block",children:"Each step can be tested with Discord before you continue. You can move back anytime to change a value."})]})}function _$({step:e,children:n,footer:a}){return s.jsxs("div",{className:"flex min-h-[min(520px,70vh)] flex-col rounded-2xl border border-border bg-card",children:[s.jsxs("div",{className:"border-b border-border px-6 py-5 md:px-8",children:[s.jsxs("div",{className:"flex items-center gap-3 md:hidden",children:[s.jsx("div",{className:"flex size-10 items-center justify-center rounded-lg bg-primary text-primary-foreground",children:s.jsx(ge,{icon:e.icon,size:20})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold",children:e.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e.subtitle})]})]}),s.jsxs("div",{className:"hidden md:block",children:[s.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:e.title}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e.subtitle})]})]}),s.jsx("div",{className:"flex flex-1 flex-col px-6 py-6 md:px-8",children:n}),a?s.jsx("div",{className:"border-t border-border px-6 py-4 md:px-8",children:a}):null]})}function ei({result:e}){var n,a;return e?e.ok?s.jsx(We,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:s.jsxs(Ye,{className:"space-y-2",children:[e.bot?s.jsxs("p",{children:["Connected as ",s.jsxs("strong",{children:["@",e.bot.username]}),e.applicationId?s.jsxs("span",{className:"text-emerald-600/80 dark:text-emerald-400/80",children:[" ","· App ID ",e.applicationId]}):null]}):null,(n=e.users)!=null&&n.length?s.jsx("ul",{className:"space-y-1",children:e.users.map(o=>s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(ge,{icon:ed,size:14}),o.globalName||o.username,s.jsx("span",{className:"font-mono text-xs opacity-80",children:o.id})]},o.id))}):null,!e.bot&&!((a=e.users)!=null&&a.length)?s.jsx("p",{children:e.warning||"Verified successfully."}):null]})}):s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:e.error})}):null}function O$({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Open the"," ",s.jsx("a",{href:"https://discord.com/developers/applications",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Discord Developer Portal"}),", select your application, go to ",s.jsx("strong",{children:"Bot"}),", and reset or copy the token."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"botToken",children:"Bot token"}),s.jsx(Ie,{id:"botToken",type:"password",autoComplete:"off",value:e.botToken,onChange:c=>n({...e,botToken:c.target.value}),placeholder:"MTI…",className:"h-11 font-mono text-sm"})]}),s.jsx(ei,{result:a.botToken}),s.jsx("div",{className:"mt-auto",children:s.jsx(he,{type:"button",variant:"secondary",disabled:o||!e.botToken,onClick:l,children:o?"Checking with Discord…":"Verify bot token"})})]})}function D$({values:e,setValues:n,validation:a,validating:o,onValidate:l,onGenerate:c}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"This random string signs your login cookies. Store it like a password — do not commit it to public repos."}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"secretKey",children:"Session secret"}),s.jsx(Ie,{id:"secretKey",type:"password",autoComplete:"off",value:e.secretKey,onChange:d=>n({...e,secretKey:d.target.value}),className:"h-11 font-mono text-sm"})]}),s.jsx(ei,{result:a.secretKey}),s.jsxs("div",{className:"mt-auto flex flex-wrap gap-2",children:[s.jsx(he,{type:"button",variant:"outline",onClick:c,children:"Generate secure secret"}),s.jsx(he,{type:"button",variant:"secondary",disabled:o||!e.secretKey,onClick:l,children:o?"Checking…":"Validate"})]})]})}function L$({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Use the ",s.jsx("strong",{children:"same application"})," as your bot. Under OAuth2, copy the Client ID and Client Secret."]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(ze,{htmlFor:"clientId",children:"Client ID"}),s.jsx(Ie,{id:"clientId",value:e.clientId,onChange:c=>n({...e,clientId:c.target.value}),className:"h-11 font-mono text-sm"})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(ze,{htmlFor:"clientSecret",children:"Client Secret"}),s.jsx(Ie,{id:"clientSecret",type:"password",autoComplete:"off",value:e.clientSecret,onChange:c=>n({...e,clientSecret:c.target.value}),className:"h-11 font-mono text-sm"})]})]}),s.jsx(ei,{result:a.oauth}),s.jsx("div",{className:"mt-auto",children:s.jsx(he,{type:"button",variant:"secondary",disabled:o||!e.clientId||!e.clientSecret,onClick:l,children:o?"Checking with Discord…":"Verify OAuth credentials"})})]})}function z$({values:e,setValues:n,validation:a}){async function o(){if(e.redirectUri)try{await navigator.clipboard.writeText(e.redirectUri)}catch{}}return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Add this exact URL under ",s.jsx("strong",{children:"OAuth2 → Redirects"})," in the Developer Portal. It must match character-for-character."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"redirectUri",children:"Redirect URI"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ie,{id:"redirectUri",value:e.redirectUri,onChange:l=>n({...e,redirectUri:l.target.value}),className:"h-11 flex-1 font-mono text-xs"}),s.jsx(he,{type:"button",variant:"outline",size:"icon",className:"size-11 shrink-0",onClick:()=>void o(),title:"Copy URL",children:s.jsx(ge,{icon:t2,size:18})})]})]}),a.redirectUri&&!a.redirectUri.ok?s.jsx(ei,{result:a.redirectUri}):s.jsx(We,{className:"border-border bg-secondary",children:s.jsx(Ye,{className:"text-sm text-muted-foreground",children:"We pre-filled this from your current dashboard URL. If you access the panel from a different domain later, update this and add the new URL in Discord too."})})]})}function P$({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Enable ",s.jsx("strong",{children:"Developer Mode"})," in Discord (Settings → Advanced), then right-click your profile and ",s.jsx("strong",{children:"Copy User ID"}),". Add one ID per line."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"owners",children:"Owner user IDs"}),s.jsx(Ld,{id:"owners",value:e.ownerUserIds,onChange:c=>n({...e,ownerUserIds:c.target.value}),placeholder:`829112572816130058
987654321098765432`,className:"min-h-[120px] font-mono text-sm"})]}),s.jsx(ei,{result:a.owners}),s.jsx("div",{className:"mt-auto",children:s.jsx(he,{type:"button",variant:"secondary",disabled:o||!e.ownerUserIds.trim(),onClick:l,children:o?"Checking with Discord…":"Verify owner IDs"})})]})}function I$({onContinue:e}){return s.jsx("div",{className:"mx-auto flex w-full max-w-lg flex-1 flex-col justify-center py-8",children:s.jsxs("div",{className:"rounded-2xl border border-border bg-card px-6 py-10 text-center md:px-10",children:[s.jsx("div",{className:"mx-auto mb-6 flex size-16 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:s.jsx(ge,{icon:ed,size:40})}),s.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Setup complete"}),s.jsxs("p",{className:"mx-auto mt-3 max-w-sm text-sm leading-relaxed text-muted-foreground",children:["Your configuration has been saved. Restart the server for changes to take effect — stop the running process, then start it again (for example"," ",s.jsx("code",{className:"rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm start"}),")."]}),s.jsx(We,{className:"mt-6 text-left",children:s.jsx(Ye,{children:"After restarting, sign in with Discord to open the dashboard."})}),s.jsx(he,{type:"button",size:"lg",className:"mt-8 min-w-[220px]",onClick:e,children:"Continue to sign in"})]})})}function $$({currentIndex:e,validating:n,saving:a,onBack:o,onNext:l,onFinish:c}){const d=e===Os.length-1;return s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs(he,{type:"button",variant:"ghost",disabled:e===0||a,onClick:o,children:[s.jsx(ge,{icon:J0,size:18,className:"mr-1"}),"Back"]}),s.jsx("div",{className:"flex flex-1 justify-end gap-2",children:d?s.jsx(he,{type:"button",size:"lg",disabled:a||n,onClick:c,className:"min-w-[200px]",children:a?"Saving…":"Finish setup"}):s.jsxs(he,{type:"button",size:"lg",disabled:n||a,onClick:l,children:["Continue",s.jsx(ge,{icon:Uh,size:18,className:"ml-1"})]})})]})}function B$({values:e,setValues:n,validation:a,validating:o,onValidate:l}){return s.jsxs("div",{className:"flex flex-1 flex-col gap-5",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["An Emerald Services API key is optional, but required to use the one-click addon installer in the dashboard. You can get yours from the"," ",s.jsx("a",{href:"https://emeraldsrv.dev",target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",children:"Emerald Services Marketplace"}),"."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"emeraldApiKey",children:"Emerald API key (Optional)"}),s.jsx(Ie,{id:"emeraldApiKey",type:"password",autoComplete:"off",value:e.emeraldApiKey,onChange:c=>n({...e,emeraldApiKey:c.target.value}),placeholder:"em_...",className:"h-11 font-mono text-sm"})]}),s.jsx(ei,{result:a.emeraldApi}),s.jsx("div",{className:"mt-auto",children:s.jsx(he,{type:"button",variant:"secondary",disabled:o,onClick:l,children:o?"Checking…":e.emeraldApiKey?"Verify key":"Skip step"})})]})}function U$(){const e=crypto.randomUUID().replace(/-/g,""),n=crypto.randomUUID().replace(/-/g,"");return e+n}function H$(e){return e.split(/[\s,]+/).map(n=>n.trim()).filter(Boolean)}function E0(e){return e==="oauth"?"oauth":e==="owners"?"owners":e==="emeraldApi"?"emeraldApi":e}function V$(){const e=Ro(),{branding:n}=od(),{loading:a,error:o,refresh:l,status:c}=Pj(),[d,m]=f.useState(0),[p,h]=f.useState({botToken:"",secretKey:"",clientId:"",clientSecret:"",redirectUri:"",ownerUserIds:"",emeraldApiKey:""}),[b,g]=f.useState({}),[y,w]=f.useState(!1),[j,S]=f.useState(!1),[E,N]=f.useState(""),[k,T]=f.useState(!1),A=Os[d];f.useEffect(()=>{c!=null&&c.suggestedRedirectUri&&!p.redirectUri&&h(q=>({...q,redirectUri:c.suggestedRedirectUri}))},[c==null?void 0:c.suggestedRedirectUri,p.redirectUri]);const O=f.useMemo(()=>({botToken:p.botToken,secretKey:p.secretKey,clientId:p.clientId,clientSecret:p.clientSecret,redirectUri:p.redirectUri,ownerUserIds:H$(p.ownerUserIds),emeraldApiKey:p.emeraldApiKey}),[p]);async function M(){w(!0),N("");try{const q=await Ee.validateSetup(O);return g(ue=>{var pe;return{...ue,...(pe=q.data)==null?void 0:pe.results}}),q.data}catch(q){return N(q instanceof Error?q.message:"Validation failed"),null}finally{w(!1)}}async function z(){var pe,xe;const q=E0(A.id),ue=await M();return!!((xe=(pe=ue==null?void 0:ue.results)==null?void 0:pe[q])!=null&&xe.ok)}async function B(){const q=E0(A.id),ue=b[q];!(ue!=null&&ue.ok)&&!await z()||m(pe=>Math.min(pe+1,Os.length-1))}async function K(){S(!0),N("");try{const q=await M();if(!(q!=null&&q.ok)){N("Fix the steps marked with errors before finishing.");return}await Ee.completeSetup(O),T(!0)}catch(q){N(q instanceof Error?q.message:"Could not save setup")}finally{S(!1)}}function U(){const q={values:p,setValues:h,validation:b,validating:y};switch(A.id){case"botToken":return s.jsx(O$,{...q,onValidate:()=>void z()});case"secretKey":return s.jsx(D$,{...q,onGenerate:()=>h(ue=>({...ue,secretKey:U$()})),onValidate:()=>void z()});case"oauth":return s.jsx(L$,{...q,onValidate:()=>void z()});case"redirectUri":return s.jsx(z$,{values:p,setValues:h,validation:b});case"owners":return s.jsx(P$,{...q,onValidate:()=>void z()});case"emeraldApi":return s.jsx(B$,{...q,onValidate:()=>void z()})}}return a?s.jsx("div",{className:"min-h-svh bg-background px-4 py-10",children:s.jsxs("div",{className:"mx-auto max-w-6xl space-y-8",children:[s.jsx(Be,{className:"h-14 w-64"}),s.jsxs("div",{className:"grid gap-8 lg:grid-cols-[280px_1fr]",children:[s.jsx(Be,{className:"hidden h-80 lg:block"}),s.jsx(Be,{className:"h-[520px] rounded-2xl"})]})]})}):s.jsxs(A$,{brandingTitle:n.title,faviconUrl:n.faviconUrl,faviconVersion:n.updatedAt??void 0,hasFavicon:n.hasFavicon,children:[o?s.jsx(We,{variant:"destructive",className:"mb-6",children:s.jsx(Ye,{children:o})}):null,E?s.jsx(We,{variant:"destructive",className:"mb-6",children:s.jsx(Ye,{children:E})}):null,k?s.jsx(I$,{onContinue:async()=>{await l(),e("/login",{replace:!0})}}):s.jsxs("div",{className:"grid flex-1 gap-8 lg:grid-cols-[minmax(0,280px)_1fr]",children:[s.jsx(M$,{currentIndex:d,validation:b}),s.jsx(_$,{step:A,footer:s.jsx($$,{currentIndex:d,validating:y,saving:j,onBack:()=>m(q=>Math.max(0,q-1)),onNext:()=>void B(),onFinish:()=>void K()}),children:U()})]})]})}const G$={todo:"bg-rose-500/15 text-rose-400",progress:"bg-amber-500/15 text-amber-400",done:"bg-emerald-500/15 text-emerald-400"};function F$({title:e,icon:n,href:a,badge:o="Configured",status:l="done"}){return s.jsxs(Ft,{to:a,className:fe("flex items-center gap-3 rounded-2xl border border-border bg-card p-4 transition-colors","hover:border-primary hover:bg-secondary"),children:[s.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center rounded-full bg-secondary text-primary",children:s.jsx(ge,{icon:n,size:20})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate font-semibold",children:e}),s.jsx("span",{className:fe("mt-1 inline-flex rounded-md px-2 py-0.5 text-[10px] font-semibold",G$[l]),children:o})]})]})}function W$({percent:e,size:n=128,className:a,trackClassName:o="stroke-white/20",strokeClassName:l="stroke-white"}){const d=2*Math.PI*42,m=Math.min(100,Math.max(0,e)),p=d-m/100*d;return s.jsxs("div",{className:fe("relative inline-flex",a),children:[s.jsxs("svg",{width:n,height:n,viewBox:"0 0 100 100",className:"-rotate-90","aria-hidden":!0,children:[s.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",className:o}),s.jsx("circle",{cx:"50",cy:"50",r:42,fill:"none",strokeWidth:"9",strokeLinecap:"round",strokeDasharray:d,strokeDashoffset:p,className:l})]}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[s.jsxs("span",{className:"text-2xl font-bold tabular-nums leading-none",children:[Math.round(m),"%"]}),s.jsx("span",{className:"mt-0.5 text-[10px] font-medium uppercase tracking-wide opacity-80",children:"Complete"})]})]})}const Y$={todo:{dot:"bg-rose-500",badge:"bg-rose-500/15 text-rose-400",label:"Needs setup"},progress:{dot:"bg-amber-400",badge:"bg-amber-500/15 text-amber-400",label:"In progress"},done:{dot:"bg-sky-400",badge:"bg-sky-500/15 text-sky-400",label:"Active"}};function q$({title:e,subtitle:n,icon:a,href:o,status:l,meta:c="Open in dashboard"}){const d=Y$[l];return s.jsxs(Ft,{to:o,className:fe("group flex min-w-[280px] flex-1 flex-col gap-4 rounded-2xl border border-border bg-card p-4 transition-colors","hover:border-primary hover:bg-secondary","sm:min-w-[300px] lg:min-w-0"),children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("span",{className:fe("mt-1.5 size-2 shrink-0 rounded-full",d.dot)}),s.jsx("span",{className:"text-xs text-muted-foreground",children:n})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold leading-snug tracking-tight",children:e}),s.jsx("span",{className:fe("mt-2 inline-flex rounded-md px-2 py-0.5 text-[11px] font-semibold",d.badge),children:d.label})]}),s.jsxs("div",{className:"mt-auto flex items-center justify-between border-t border-border pt-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg bg-secondary text-primary",children:s.jsx(ge,{icon:a,size:16})}),s.jsx("span",{className:"text-xs text-muted-foreground",children:c})]}),s.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[s.jsx(ge,{icon:rd,size:14,className:"opacity-60"}),s.jsx(ge,{icon:vo,size:14,className:"opacity-60 group-hover:text-primary"}),s.jsx(ge,{icon:Uh,size:14,className:"text-primary opacity-0 transition-opacity group-hover:opacity-100"})]})]})]})}function K$({stats:e}){const n=[{id:"ping",label:"Gateway latency",detail:`${e.bot.ping}ms`,badge:e.bot.ping<200?"Good":"High",badgeClass:e.bot.ping<200?"bg-emerald-500/15 text-emerald-400":"bg-amber-500/15 text-amber-400"},{id:"uptime",label:"Bot uptime",detail:Fh(e.bot.uptime),badge:"Live",badgeClass:"bg-primary/20 text-primary"},{id:"ram",label:"Memory usage",detail:`${e.hosting.ram_used} / ${e.hosting.ram_total}`,badge:`${e.hosting.ram_percent}%`,badgeClass:"bg-sky-500/15 text-sky-400"}];return s.jsxs("aside",{className:"hidden w-[min(100%,320px)] shrink-0 space-y-4 xl:block",children:[s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[s.jsxs(lt,{className:"text-sm font-semibold",children:["Connected servers (",e.servers,")"]}),s.jsx(he,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:s.jsx("span",{className:"text-lg leading-none",children:"+"})})]}),s.jsxs(Ze,{className:"pt-0",children:[s.jsxs("div",{className:"flex -space-x-2",children:[Array.from({length:Math.min(6,e.servers)}).map((a,o)=>s.jsxs(Ia,{className:"size-9 border-2 border-card ring-0",children:[s.jsx(Co,{src:e.bot.avatar,alt:""}),s.jsx($a,{className:"bg-primary/25 text-[10px] text-primary",children:String(o+1)})]},o)),e.servers>6?s.jsxs("div",{className:"flex size-9 items-center justify-center rounded-full border-2 border-card bg-secondary text-xs font-medium text-muted-foreground",children:["+",e.servers-6]}):null]}),s.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:[e.users.toLocaleString()," members across your guilds"]})]})]}),s.jsx(Xe,{className:"overflow-hidden border-border bg-secondary",children:s.jsx(Ze,{className:"p-5",children:s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex size-10 items-center justify-center rounded-xl bg-primary text-primary-foreground",children:s.jsx(ge,{icon:b8,size:22})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold",children:"Keep SupportBot up to date"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Check for releases and install updates from settings."})]}),s.jsx(he,{asChild:!0,size:"sm",className:"w-full",children:s.jsxs(Ft,{to:"/settings",children:[s.jsx(ge,{icon:td,size:16,className:"mr-2"}),"Open settings"]})})]})})}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(lt,{className:"text-sm font-semibold",children:"System activity"}),s.jsx(he,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:s.jsx("span",{className:"text-base leading-none",children:"⋯"})})]}),s.jsxs(Ze,{className:"space-y-1 p-0 pb-2",children:[n.map(a=>s.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-secondary/40",children:[s.jsxs(Ia,{className:"size-9",children:[s.jsx(Co,{src:e.bot.avatar,alt:e.bot.username}),s.jsx($a,{className:"bg-secondary text-xs",children:"SB"})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:a.label}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.detail})]}),s.jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold ${a.badgeClass}`,children:a.badge})]},a.id)),s.jsx(he,{asChild:!0,variant:"ghost",className:"mx-2 mt-1 w-[calc(100%-1rem)] justify-between text-xs text-muted-foreground",children:s.jsxs(Ft,{to:"/system",children:["All system details",s.jsx(ge,{icon:Uh,size:14})]})})]})]}),s.jsx(Xe,{className:"border-border bg-card",children:s.jsxs(Ze,{className:"flex items-center gap-3 p-4",children:[s.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg bg-secondary text-primary",children:s.jsx(ge,{icon:vo,size:18})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"text-sm font-medium",children:["v",e.bot.version]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["CPU ",e.hosting.cpu_load]})]})]})})]})}const tN={todo:"Needs setup",progress:"In progress",done:"Active"};function Th(e,n,a="Configure module"){const o=n==null?void 0:n[e];return o||{status:"todo",subtitle:a}}function X$(){return s.jsxs("div",{className:"flex gap-6",children:[s.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Be,{className:"h-44 rounded-2xl"}),s.jsx(Be,{className:"h-44 rounded-2xl"})]}),s.jsx(Be,{className:"h-8 w-48"}),s.jsx("div",{className:"flex gap-4 overflow-hidden",children:Array.from({length:3}).map((e,n)=>s.jsx(Be,{className:"h-40 min-w-[280px] rounded-2xl"},n))}),s.jsx(Be,{className:"h-8 w-56"}),s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Array.from({length:4}).map((e,n)=>s.jsx(Be,{className:"h-20 rounded-2xl"},n))})]}),s.jsx(Be,{className:"hidden h-[520px] w-80 shrink-0 rounded-2xl xl:block"})]})}function Z$(){const{stats:e,loading:n,error:a}=sd(),[o,l]=f.useState("all"),c=f.useMemo(()=>{if(!e)return 0;const b=e.tickets.total||0;return b===0?100:Math.round(e.tickets.closed/b*100)},[e]),d=f.useMemo(()=>o==="open"||o==="closed"?Ts.filter(b=>b.category==="tickets"):o==="all"?Ts:Ts.filter(b=>b.category===o),[o]);if(n)return s.jsx(X$,{});if(a||!e)return s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:a||"No stats available"})});const m=e.tickets.open,p=e.tickets.closed,h=e.tickets.total;return s.jsxs("div",{className:"flex flex-col gap-6 xl:flex-row xl:items-start",children:[s.jsxs("div",{className:"min-w-0 flex-1 space-y-6",children:[s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Xe,{className:"overflow-hidden border-border bg-card",children:s.jsxs(Ze,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"text-lg font-semibold leading-snug",children:["You have"," ",s.jsx("span",{className:"text-primary",children:m})," open ticket",m===1?"":"s"]}),s.jsx("p",{className:"max-w-xs text-sm text-muted-foreground",children:"Review transcripts or tune your ticket panel so new requests are handled smoothly."}),s.jsx(he,{asChild:!0,size:"sm",className:"rounded-lg px-5",children:s.jsx(Ft,{to:"/transcripts",children:"Review"})})]}),s.jsxs("div",{className:"relative mx-auto flex size-28 shrink-0 items-end justify-center sm:mx-0 sm:size-32","aria-hidden":!0,children:[s.jsx("div",{className:"absolute inset-0 rounded-2xl bg-secondary"}),s.jsx("span",{className:"relative text-6xl",children:"🎫"})]})]})}),s.jsx(Xe,{className:"overflow-hidden border-border bg-primary text-primary-foreground",children:s.jsxs(Ze,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-sm font-medium text-white/80",children:"Ticket summary"}),s.jsxs("ul",{className:"space-y-1.5 text-sm",children:[s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),s.jsxs("span",{className:"text-white/90",children:[h," total"]})]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),s.jsxs("span",{className:"text-white/90",children:[p," closed"]})]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-white/70"}),s.jsxs("span",{className:"text-white/90",children:[m," open"]})]})]})]}),s.jsx(W$,{percent:c,size:120})]})})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Module overview"}),s.jsx(N5,{value:o,onValueChange:b=>l(b),children:s.jsxs(zg,{className:"h-auto flex-wrap rounded-xl bg-secondary/60 p-1",children:[s.jsx(xo,{value:"all",className:"rounded-lg text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"All"}),s.jsx(xo,{value:"open",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Open"}),s.jsx(xo,{value:"closed",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Closed"}),L_.filter(b=>b.id!=="all").map(b=>s.jsx(xo,{value:b.id,className:"rounded-lg text-xs data-[state=active]:bg-background",children:b.label},b.id))]})})]}),s.jsx("div",{className:"-mx-1 flex gap-4 overflow-x-auto px-1 pb-2 lg:grid lg:grid-cols-3 lg:overflow-visible",children:(o==="open"?[{id:"open-queue",title:"Open ticket queue",subtitle:`${m} waiting`,icon:ll,href:"/tickets",status:"done",meta:"View live tickets"}]:o==="closed"?[{id:"closed-archive",title:"Closed tickets",subtitle:`${p} resolved`,icon:ed,href:"/transcripts",status:"done",meta:"Browse archive"}]:d.map(b=>{const g=Th(b.id,e.modules,b.description);return{id:b.id,title:b.title,subtitle:g.subtitle,icon:b.icon,href:b.href,status:g.status,meta:g.status==="done"?"View settings":"Configure"}})).map(b=>s.jsx(q$,{title:b.title,subtitle:b.subtitle,icon:b.icon,href:b.href,status:b.status,meta:b.meta},b.id))})]}),s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-xl font-bold tracking-tight",children:"Active modules"}),s.jsx(Ft,{to:"/configs",className:"text-sm font-medium text-primary hover:underline",children:"See all"})]}),s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Ts.slice(0,4).map(b=>{const g=Th(b.id,e.modules);return s.jsx(F$,{title:b.title,icon:b.icon,href:b.href,badge:tN[g.status],status:g.status},b.id)})})]})]}),s.jsx(K$,{stats:e})]})}function Q$(){const{permissions:e}=Ut();return qn(e,"overview")?s.jsx(Z$,{}):s.jsx(Qr,{to:Wh(e),replace:!0})}function Kr({permission:e,children:n}){const{loading:a,isAuthenticated:o,permissions:l}=Ut();return a?s.jsx("div",{className:"flex flex-1 items-center justify-center py-16 text-sm text-muted-foreground",children:"Loading…"}):o?qn(l,e)?s.jsx(s.Fragment,{children:n}):s.jsx(Qr,{to:Wh(l),replace:!0}):s.jsx(Qr,{to:"/login",replace:!0})}function J$(){const{hasPermission:e}=Ut(),n=e("settings.update"),a=Ro(),[o,l]=f.useState([]),[c,d]=f.useState(""),[m,p]=f.useState(!0),[h,b]=f.useState(""),[g,y]=f.useState(""),[w,j]=f.useState(null),S=f.useCallback(async()=>{p(!0),b("");try{const N=await Ee.getAddonsCatalog();N.data&&(l(N.data.addons),d(N.data.repository))}catch(N){b(N instanceof Error?N.message:"Failed to load addons")}finally{p(!1)}},[]);f.useEffect(()=>{S()},[S]);async function E(N){if(n){j(N.id),y(""),b("");try{const k=await Ee.installAddon(N.id);y(k.message||`${N.name} installed.`),await S();const T=N.configFiles[0];T&&a(`/configs?file=${el(T)}`)}catch(k){b(k instanceof Error?k.message:"Install failed")}finally{j(null)}}}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Addons"}),s.jsxs("p",{className:"text-muted-foreground",children:["Requires an API key from"," ",s.jsx("a",{href:"https://emeraldsrv.dev",target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"emeraldsrv.dev"})," ","to browse and install addons. Configs will appear in the sidebar once installed."]})]}),s.jsxs(he,{variant:"outline",size:"sm",onClick:S,disabled:m,children:[s.jsx(ge,{icon:r2,size:16,className:fe("mr-1.5",m&&"animate-spin")}),"Refresh"]})]}),h?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:h})}):null,g?s.jsx(We,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(Ye,{children:g})}):null,s.jsxs("section",{className:"space-y-4",children:[s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-widest text-muted-foreground",children:"Marketplace"}),m?s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsx(Be,{className:"h-40 rounded-xl"}),s.jsx(Be,{className:"h-40 rounded-xl"}),s.jsx(Be,{className:"h-40 rounded-xl"})]}):s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:o.map(N=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-2",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs(lt,{className:"flex items-center gap-2 text-lg",children:[s.jsx(ge,{icon:Gh,size:20,className:"text-primary"}),N.name]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(An,{variant:"outline",className:"shrink-0 uppercase tracking-widest text-[10px]",children:N.price===0||!N.price?"Free":`$${N.price}`}),N.installed?s.jsxs(An,{variant:"secondary",className:"shrink-0 gap-1",children:[s.jsx(ge,{icon:j8,size:14}),"Installed"]}):null]})]}),s.jsx(Et,{children:N.description})]}),s.jsxs(Ze,{className:"space-y-2 text-xs text-muted-foreground",children:[N.is_external?s.jsxs("p",{children:["Available on: ",s.jsx("span",{className:"font-medium text-foreground",children:N.external_store||"External Store"})]}):null,N.configFiles&&N.configFiles.length>0?s.jsxs("p",{children:["Config:"," ",N.configFiles.map((k,T)=>s.jsxs("span",{children:[T>0?", ":null,s.jsx(Ft,{to:`/configs?file=${el(k)}`,className:"font-mono text-primary hover:underline",children:k})]},k))]}):null]}),s.jsxs(Gg,{className:"flex flex-wrap gap-2",children:[N.is_external?s.jsx(he,{variant:"outline",size:"sm",asChild:!0,children:s.jsx("a",{href:N.repositoryUrl,target:"_blank",rel:"noreferrer",children:"View Store"})}):null,N.installed&&N.configFiles&&N.configFiles[0]?s.jsx(he,{size:"sm",variant:"secondary",asChild:!0,children:s.jsx(Ft,{to:`/configs?file=${el(N.configFiles[0])}`,children:"Edit config"})}):null,N.installed?s.jsx(he,{size:"sm",disabled:!0,variant:"secondary",children:"Installed"}):N.is_external?null:s.jsxs(he,{size:"sm",disabled:!n||w===N.id,onClick:()=>E(N),children:[s.jsx(ge,{icon:td,size:14,className:"mr-1"}),w===N.id?"Installing…":"Install"]})]})]},N.id))})]})]})}function eB(){const{permissions:e}=Ut(),[n,a]=f.useState(!1),[o,l]=f.useState(!1),[c,d]=f.useState(""),[m,p]=f.useState(""),[h,b]=f.useState(""),[g,y]=f.useState("Administrator"),[w,j]=f.useState(""),[S,E]=f.useState(""),[N,k]=f.useState("General"),T=i2(e,"supportbot"),A=async()=>{if(!m.match(/^[a-z0-9_-]+$/i)){Bt.error("Command name can only contain letters, numbers, underscores and dashes.");return}a(!0),l(!1);try{const O=await Ee.buildAddon({name:m.toLowerCase(),description:h||"A custom command",permission:g,embed:{title:w,description:S||"Hello from your custom command!",color:N}});l(!0),d(O.message||"Restart required."),Bt.success(`Addon ${m}.js created successfully!`)}catch(O){Bt.error(O instanceof Error?O.message:"Failed to build addon")}finally{a(!1)}};return T?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Addon Builder"}),s.jsx("p",{className:"text-muted-foreground",children:"Visually scaffold a custom slash command addon for your bot."})]}),o?s.jsxs(We,{className:"border-green-500/20 bg-green-500/10 text-green-600 dark:text-green-400",children:[s.jsx(Vy,{className:"h-4 w-4"}),s.jsxs(Ye,{className:"ml-2",children:["Successfully built ",s.jsxs("strong",{children:[m,".js"]}),"! ",c]})]}):null,s.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Xe,{children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Command Details"}),s.jsx(Et,{children:"Configure how users trigger the command."})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Command Name"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"/"}),s.jsx(Ie,{placeholder:"ping",value:m,onChange:O=>p(O.target.value.replace(/[^a-z0-9_-]/gi,"").toLowerCase())})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Description"}),s.jsx(Ie,{placeholder:"Replies with a custom embed",value:h,onChange:O=>b(O.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Required Permission"}),s.jsxs(No,{value:g,onValueChange:y,children:[s.jsx(Ba,{children:s.jsx(Eo,{})}),s.jsxs(Ua,{children:[s.jsx(an,{value:"none",children:"@everyone"}),s.jsx(an,{value:"Administrator",children:"Administrator"}),s.jsx(an,{value:"ManageMessages",children:"Manage Messages"}),s.jsx(an,{value:"ManageGuild",children:"Manage Server"})]})]})]})]})]}),s.jsxs(Xe,{children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Response Embed"}),s.jsx(Et,{children:"What the bot will reply with."})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Embed Title (Optional)"}),s.jsx(Ie,{placeholder:"Hello!",value:w,onChange:O=>j(O.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Embed Description"}),s.jsx(Ld,{placeholder:"Type your message here...",className:"resize-none",rows:4,value:S,onChange:O=>E(O.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Embed Color"}),s.jsxs(No,{value:N,onValueChange:k,children:[s.jsx(Ba,{children:s.jsx(Eo,{})}),s.jsxs(Ua,{children:[s.jsx(an,{value:"General",children:"Theme General"}),s.jsx(an,{value:"Success",children:"Theme Success"}),s.jsx(an,{value:"Warning",children:"Theme Warning"}),s.jsx(an,{value:"Error",children:"Theme Error"})]})]})]})]})]})]}),s.jsx("div",{className:"space-y-6",children:s.jsxs(Xe,{className:"sticky top-6 border-primary/20",children:[s.jsx(it,{children:s.jsxs(lt,{className:"text-sm font-medium flex items-center gap-2",children:[s.jsx(ge,{icon:C8,size:16,className:"text-primary"}),"Live Preview"]})}),s.jsx(Ze,{children:s.jsx("div",{className:"rounded-md border bg-[#313338] p-4 font-sans text-sm text-[#dbdee1]",children:s.jsxs("div",{className:"flex gap-4",children:[s.jsx("div",{className:"size-10 shrink-0 rounded-full bg-indigo-500 flex items-center justify-center font-bold text-white",children:"B"}),s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium text-white",children:"SupportBot"}),s.jsxs("span",{className:"text-[10px] text-white font-medium uppercase px-1.5 py-0.5 rounded bg-[#5865F2] flex items-center gap-1",children:[s.jsx(Vy,{size:10})," BOT"]}),s.jsx("span",{className:"text-xs text-[#949ba4]",children:"Today at 12:00 PM"})]}),s.jsxs("div",{className:"mt-2 rounded bg-[#2b2d31] border-l-4 border-l-[#5865F2] px-4 py-3 max-w-[432px]",children:[w&&s.jsx("div",{className:"mb-1 font-semibold text-white",children:w}),s.jsx("div",{className:"whitespace-pre-wrap",children:S||"Hello from your custom command!"})]})]})]})})}),s.jsx(Gg,{children:s.jsxs(he,{className:"w-full gap-2",size:"lg",disabled:!m||n,onClick:A,children:[s.jsx(ge,{icon:Da,size:18}),n?"Building...":"Generate Addon"]})})]})})]})]}):s.jsx("div",{className:"flex h-[50vh] items-center justify-center text-muted-foreground",children:"You don't have permission to build addons."})}const Wg="supportbot-dashboard-accent",ol="#45b46c",tB=["--primary","--ring","--chart-1","--sidebar-primary","--sidebar-ring","--accent","--accent-foreground","--sidebar-accent","--sidebar-accent-foreground"];function nB(e){const n=jr(e,ol),a=parseInt(n.slice(1,3),16)/255,o=parseInt(n.slice(3,5),16)/255,l=parseInt(n.slice(5,7),16)/255,c=Math.max(a,o,l),d=Math.min(a,o,l),m=(c+d)/2;let p=0,h=0;if(c!==d){const b=c-d;switch(h=m>.5?b/(2-c-d):b/(c+d),c){case a:p=((o-l)/b+(o<l?6:0))/6;break;case o:p=((l-a)/b+2)/6;break;default:p=((a-o)/b+4)/6;break}}return{h:Math.round(p*360),s:Math.round(h*100),l:Math.round(m*100)}}function Xr(e,n,a){return`${e} ${n}% ${a}%`}function nN(e){const n=jr(e,ol),{h:a,s:o,l}=nB(n),c=document.documentElement,d=Math.min(Math.max(o,45),85),m=Math.min(Math.max(l,42),62);return c.style.setProperty("--primary",Xr(a,d,m)),c.style.setProperty("--ring",Xr(a,d,m)),c.style.setProperty("--chart-1",Xr(a,d,m)),c.style.setProperty("--sidebar-primary",Xr(a,d,m)),c.style.setProperty("--sidebar-ring",Xr(a,d,m)),c.style.setProperty("--primary-foreground","0 0% 100%"),c.style.setProperty("--sidebar-primary-foreground","0 0% 100%"),c.style.setProperty("--accent",Xr(a,Math.round(d*.64),18)),c.style.setProperty("--accent-foreground",Xr(a,Math.min(Math.round(d*1.15),90),78)),c.style.setProperty("--sidebar-accent",Xr(a,Math.round(d*.57),14)),c.style.setProperty("--sidebar-accent-foreground",Xr(a,Math.min(Math.round(d*1.07),88),82)),n}function rB(){for(const e of tB)document.documentElement.style.removeProperty(e);document.documentElement.style.removeProperty("--primary-foreground"),document.documentElement.style.removeProperty("--sidebar-primary-foreground")}function rN(){try{const e=localStorage.getItem(Wg);return!e||!yh(e)?null:jr(e)}catch{return null}}function k0(e){const n=nN(e);try{localStorage.setItem(Wg,n)}catch{}return n}function aB(){try{localStorage.removeItem(Wg)}catch{}rB()}function oB(){const e=rN();e&&nN(e)}function sB(e){return new Promise((n,a)=>{const o=new FileReader;o.onload=()=>n(String(o.result)),o.onerror=()=>a(new Error("Could not read file")),o.readAsDataURL(e)})}function iB({canEdit:e}){const[n,a]=f.useState(!1),[o,l]=f.useState(""),[c,d]=f.useState(!1);async function m(){if(e){a(!0),l("");try{const p=await Ee.resetDashboard();l(p.message||"Dashboard reset successfully."),setTimeout(()=>{window.location.href="/setup"},1500)}catch(p){l(p instanceof Error?p.message:"Reset failed"),a(!1)}}}return e?s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reset the dashboard to factory settings. This clears the configuration and returns you to the initial setup screen."}),s.jsxs(zl,{open:c,onOpenChange:d,children:[s.jsx(x_,{asChild:!0,children:s.jsx(he,{type:"button",variant:"destructive",children:"Reset Dashboard"})}),s.jsxs(qs,{children:[s.jsxs(Ks,{children:[s.jsx(Xs,{children:"Are you absolutely sure?"}),s.jsx(Zs,{children:"This action cannot be undone. This will reset the dashboard to setup mode. You will need to reconnect the Discord OAuth and reconfigure the dashboard owners."})]}),o&&s.jsx("p",{className:"text-sm font-medium text-destructive",children:o}),s.jsxs(Pl,{children:[s.jsx(he,{variant:"outline",onClick:()=>d(!1),disabled:n,children:"Cancel"}),s.jsx(he,{variant:"destructive",onClick:()=>void m(),disabled:n,children:n?"Resetting...":"Yes, reset dashboard"})]})]})]})]}):null}function lB({canEdit:e}){const{branding:n,setBrandingLocal:a}=od(),o=f.useRef(null),[l,c]=f.useState(n.title),[d,m]=f.useState(n.pageTitle),[p,h]=f.useState(!1),[b,g]=f.useState(!1),[y,w]=f.useState("");f.useEffect(()=>{c(n.title),m(n.pageTitle)},[n.title,n.pageTitle]);const j=n.hasFavicon&&n.faviconUrl?`${n.faviconUrl}${n.updatedAt?`?v=${n.updatedAt}`:""}`:null;async function S(){if(e){h(!0),w("");try{const T=await Ee.updateBranding({title:l,pageTitle:d});T.data&&a(T.data),w(T.message||"Branding saved.")}catch(T){w(T instanceof Error?T.message:"Save failed")}finally{h(!1)}}}async function E(T){if(!(!e||!T)){g(!0),w("");try{const A=await sB(T),O=await Ee.uploadBrandingFavicon(A);O.data&&a(O.data),w(O.message||"Favicon uploaded.")}catch(A){w(A instanceof Error?A.message:"Upload failed")}finally{g(!1),o.current&&(o.current.value="")}}}async function N(){if(e){g(!0),w("");try{const T=await Ee.removeBrandingFavicon();T.data&&a(T.data),w(T.message||"Favicon removed.")}catch(T){w(T instanceof Error?T.message:"Remove failed")}finally{g(!1)}}}const k=l.trim()!==n.title||d.trim()!==n.pageTitle;return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Branding Text"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Sidebar title and browser tab title — saved on the server for everyone using this dashboard."})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"brand-title",children:"Sidebar title"}),s.jsx(Ie,{id:"brand-title",value:l,disabled:!e,maxLength:64,onChange:T=>c(T.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"brand-page-title",children:"Browser tab title"}),s.jsx(Ie,{id:"brand-page-title",value:d,disabled:!e,maxLength:80,onChange:T=>m(T.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot Dashboard"})]})]}),e?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{type:"button",disabled:p||!k,onClick:()=>void S(),children:p?"Saving…":"Save titles"}),y&&k?s.jsx("span",{className:"text-xs text-muted-foreground",children:y}):null]}):null]}),s.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Favicon"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, ICO, SVG, JPEG, or WebP — max 512 KB. Shown in the browser tab and beside the sidebar title."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsx("div",{className:"flex size-16 items-center justify-center overflow-hidden rounded-lg border border-border bg-secondary/30",children:j?s.jsx("img",{src:j,alt:"Favicon preview",className:"size-full object-contain p-2"}):s.jsx(ge,{icon:d8,size:24,className:"text-muted-foreground/50"})}),s.jsx("input",{ref:o,type:"file",accept:"image/png,image/jpeg,image/x-icon,image/vnd.microsoft.icon,image/svg+xml,image/webp,.ico",className:"hidden",disabled:!e||b,onChange:T=>{var A;return void E(((A=T.target.files)==null?void 0:A[0])??null)}}),s.jsxs("div",{className:"flex flex-col gap-2",children:[e?s.jsxs("div",{className:"flex gap-2",children:[s.jsx(he,{type:"button",variant:"secondary",disabled:b,onClick:()=>{var T;return(T=o.current)==null?void 0:T.click()},children:b?"Uploading…":"Upload Favicon"}),n.hasFavicon?s.jsx(he,{type:"button",variant:"destructive",disabled:b,onClick:()=>void N(),children:"Remove"}):null]}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}),!k&&y?s.jsx("span",{className:"text-xs text-muted-foreground",children:y}):null]})]})]})]})}function cB(){var g,y,w,j,S,E,N,k,T,A,O;const{hasPermission:e}=Ut(),n=e("settings.update"),[a,o]=f.useState(!0),[l,c]=f.useState(!1),[d,m]=f.useState(""),[p,h]=f.useState(null);f.useEffect(()=>{Ee.getConfigJson("api").then(M=>{M.data&&h(M.data)}).catch(()=>m("Failed to load API config")).finally(()=>o(!1))},[]);async function b(){var M,z,B,K,U,q,ue,pe,xe,se,L;if(!(!n||!p)){c(!0),m("");try{const I={"api:API.Port":(M=p.API)==null?void 0:M.Port,"api:API.EmeraldAPIKey":(z=p.API)==null?void 0:z.EmeraldAPIKey,"api:API.TrustProxy":(B=p.API)==null?void 0:B.TrustProxy,"api:API.OAuth.Enabled":(U=(K=p.API)==null?void 0:K.OAuth)==null?void 0:U.Enabled,"api:API.OAuth.ClientId":(ue=(q=p.API)==null?void 0:q.OAuth)==null?void 0:ue.ClientId,"api:API.OAuth.ClientSecret":(xe=(pe=p.API)==null?void 0:pe.OAuth)==null?void 0:xe.ClientSecret,"api:API.OAuth.RedirectUri":(L=(se=p.API)==null?void 0:se.OAuth)==null?void 0:L.RedirectUri};await Ee.updateConfigFields(I),m("API settings saved and backend restarted.")}catch(I){m(I instanceof Error?I.message:"Save failed")}finally{c(!1)}}}return a?s.jsx("div",{className:"animate-pulse h-32 bg-secondary/20 rounded-md"}):p?s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Core API Settings"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure the internal API that powers this dashboard."})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"API Port"}),s.jsx(Ie,{type:"number",value:((g=p.API)==null?void 0:g.Port)||"",disabled:!n,onChange:M=>h({...p,API:{...p.API,Port:parseInt(M.target.value)||3e3}}),className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Emerald API Key"}),s.jsx(Ie,{type:"password",value:((y=p.API)==null?void 0:y.EmeraldAPIKey)||"",disabled:!n,onChange:M=>h({...p,API:{...p.API,EmeraldAPIKey:M.target.value}}),className:"border-border bg-secondary/30"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(At,{checked:((w=p.API)==null?void 0:w.TrustProxy)||!1,disabled:!n,onCheckedChange:M=>h({...p,API:{...p.API,TrustProxy:M}})}),s.jsx(ze,{className:"text-sm",children:"Trust Proxy (Enable if using Cloudflare/Nginx)"})]})]}),s.jsxs("div",{className:"space-y-4 border-t border-border pt-6",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"OAuth Authentication"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Discord application credentials for dashboard login."})]}),s.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[s.jsx(At,{checked:((S=(j=p.API)==null?void 0:j.OAuth)==null?void 0:S.Enabled)||!1,disabled:!n,onCheckedChange:M=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,Enabled:M}}})}}),s.jsx(ze,{className:"text-sm",children:"Enable OAuth"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Client ID"}),s.jsx(Ie,{value:((N=(E=p.API)==null?void 0:E.OAuth)==null?void 0:N.ClientId)||"",disabled:!n,onChange:M=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,ClientId:M.target.value}}})},className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Client Secret"}),s.jsx(Ie,{type:"password",value:((T=(k=p.API)==null?void 0:k.OAuth)==null?void 0:T.ClientSecret)||"",disabled:!n,onChange:M=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,ClientSecret:M.target.value}}})},className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(ze,{children:"Redirect URI"}),s.jsx(Ie,{value:((O=(A=p.API)==null?void 0:A.OAuth)==null?void 0:O.RedirectUri)||"",disabled:!n,onChange:M=>{var z;return h({...p,API:{...p.API,OAuth:{...(z=p.API)==null?void 0:z.OAuth,RedirectUri:M.target.value}}})},className:"border-border bg-secondary/30"}),s.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Must match the OAuth2 callback URL registered in the Discord Developer Portal exactly."})]})]})]}),n?s.jsxs("div",{className:"flex items-center gap-2 border-t border-border pt-6",children:[s.jsx(he,{type:"button",disabled:l,onClick:()=>void b(),children:l?"Saving…":"Save API Config"}),d?s.jsx("span",{className:"text-xs text-muted-foreground",children:d}):null]}):null]}):null}function uB(){const{hasPermission:e}=Ut(),n=e("settings.update"),[a,o]=f.useState(null),[l,c]=f.useState(!0),[d,m]=f.useState(!1),[p,h]=f.useState(""),[b,g]=f.useState(""),[y,w]=f.useState(()=>rN()??ol),[j,S]=f.useState(""),[E,N]=f.useState("appearance"),k=f.useCallback(async()=>{c(!0),h("");try{const A=await Ee.checkForUpdates();A.data&&o(A.data)}catch(A){h(A instanceof Error?A.message:"Could not check for updates")}finally{c(!1)}},[]);f.useEffect(()=>{k()},[k]);async function T(A){if(A.updateAvailable){m(!0),h(""),g("");try{const O=await Ee.runUpdate(A.id,A.latest,A.zipUrl);g(O.message||"Update installed. Restart your server (stop and run npm start again) to finish applying changes."),await k()}catch(O){h(O instanceof Error?O.message:"Update failed")}finally{m(!1)}}}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),s.jsx("p",{className:"text-muted-foreground",children:"Application updates and maintenance — config files are edited under each module in the sidebar."})]}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-start",children:[s.jsx("aside",{className:"w-full md:w-56 shrink-0 sticky top-6",children:s.jsxs("nav",{className:"flex flex-row md:flex-col overflow-x-auto space-x-2 md:space-x-0 md:space-y-1 pb-2 md:pb-0",children:[s.jsx(he,{variant:E==="appearance"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>N("appearance"),children:"Appearance"}),s.jsx(he,{variant:E==="api"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>N("api"),children:"API Config"}),s.jsx(he,{variant:E==="updates"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>N("updates"),children:"Update Checker"}),n&&s.jsx(he,{variant:"ghost",className:`justify-start w-full text-destructive hover:bg-destructive/10 hover:text-destructive ${E==="danger"?"bg-destructive/10 border-l-2 border-destructive rounded-l-none":""}`,onClick:()=>N("danger"),children:"Danger Zone"})]})}),s.jsxs("main",{className:"flex-1 w-full max-w-4xl space-y-6",children:[E==="appearance"&&s.jsx("div",{className:"space-y-6",children:s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Dashboard appearance"}),s.jsx(Et,{children:"Customise branding for all users, and pick an accent colour for this browser only."})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsx(lB,{canEdit:n}),s.jsxs("div",{className:"border-t border-border pt-4",children:[s.jsx("p",{className:"mb-1 text-sm font-medium",children:"Accent colour"}),s.jsx("p",{className:"mb-4 text-xs text-muted-foreground",children:"Buttons, links, and highlights — saved in this browser only."}),s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Id,{value:y,onChange:A=>{w(A),k0(A),S("Accent updated.")}}),s.jsx(Ie,{id:"accent-colour",value:y,onChange:A=>w(A.target.value),onBlur:()=>{const A=jr(y,ol);w(A),k0(A),S("Accent updated.")},className:"w-32 border-border bg-secondary/30 font-mono uppercase",maxLength:7})]}),s.jsx(he,{type:"button",variant:"outline",onClick:()=>{aB(),w(ol),S("Reset to default purple.")},children:"Reset to default"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 text-sm mt-5",children:[s.jsx("span",{className:"rounded-md bg-primary px-3 py-1.5 font-medium text-primary-foreground",children:"Primary button"}),s.jsx("span",{className:"rounded-md bg-primary/15 px-3 py-1.5 text-primary",children:"Highlight"}),s.jsx("span",{className:"rounded-md bg-accent px-3 py-1.5 text-accent-foreground",children:"Accent surface"})]}),j?s.jsx("p",{className:"text-xs text-muted-foreground",children:j}):null]})]})]})}),E==="danger"&&n&&s.jsxs(Xe,{className:"border-destructive/50 bg-destructive/5",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg text-destructive",children:"Danger Zone"}),s.jsx(Et,{className:"text-destructive/80",children:"Destructive actions that reset or permanently alter your dashboard."})]}),s.jsx(Ze,{children:s.jsx(iB,{canEdit:n})})]}),E==="api"&&s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"API Configuration"}),s.jsx(Et,{children:"Configure the internal API settings, Emerald API key, and OAuth."})]}),s.jsx(Ze,{children:s.jsx(cB,{})})]}),E==="updates"&&s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Software updates"}),s.jsx(Et,{children:"Manage updates for the bot and dashboard."})]}),s.jsxs(Ze,{className:"space-y-4",children:[l?s.jsx(Be,{className:"h-24 w-full"}):a&&a.length>0?s.jsx("div",{className:"space-y-4",children:a.map(A=>s.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-secondary/20 p-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("p",{className:"font-medium text-sm",children:[s.jsx("a",{href:A.repository,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:A.name})," ","(",A.branch," branch)"]}),s.jsxs("div",{className:"flex gap-x-4 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Installed: "}),s.jsxs("span",{className:"font-mono font-medium",children:["v",A.current]})]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Latest: "}),s.jsxs("span",{className:"font-mono font-medium",children:["v",A.latest]})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[A.updateAvailable?s.jsx("p",{className:"text-sm text-amber-500",children:"A newer version is available. Update downloads files while keeping your Configs and Data."}):s.jsx("p",{className:"text-sm text-emerald-500",children:"You are on the latest release."}),A.updateAvailable&&n?s.jsxs(he,{type:"button",size:"sm",onClick:()=>void T(A),disabled:d,children:[d?s.jsx(ge,{icon:r2,size:16,className:"mr-2 animate-spin"}):s.jsx(ge,{icon:td,size:16,className:"mr-2"}),d?"Installing…":"Update now"]}):null,A.updateAvailable&&!n?s.jsx("p",{className:"text-xs text-muted-foreground",children:"You cannot install updates with your role."}):null]})]},A.id))}):null,p?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:p})}):null,b?s.jsx(We,{children:s.jsx(Ye,{children:b})}):null,s.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:s.jsxs(he,{type:"button",variant:"outline",onClick:k,disabled:l||d,children:[s.jsx(ge,{icon:or,size:16,className:"mr-2"}),"Check again"]})})]})]})]})]})]})}function Yg(e){const[n,a]=f.useState(!1),o=f.useRef(e);return o.current=e,f.useEffect(()=>{let l=null,c=null;const d=()=>{l=new EventSource("/api/stream"),l.onopen=()=>{a(!0)},l.addEventListener("connected",()=>{a(!0)}),l.addEventListener("metrics",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onMetrics)==null||h.call(p,b)}catch{}}),l.addEventListener("log",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onLog)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_message",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketMessage)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_message_deleted",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketMessageDeleted)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_message_updated",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketMessageUpdated)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_created",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketCreated)==null||h.call(p,b)}catch{}}),l.addEventListener("ticket_closed",m=>{var p,h;try{const b=JSON.parse(m.data);(h=(p=o.current).onTicketClosed)==null||h.call(p,b)}catch{}}),l.onerror=()=>{a(!1),l==null||l.close(),c=window.setTimeout(d,4e3)}};return d(),()=>{c&&window.clearTimeout(c),l&&l.close()}},[]),{connected:n}}function Ct({label:e,value:n,mono:a=!1}){return s.jsxs("div",{className:"flex flex-col gap-1 border-b border-border py-3 last:border-0 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("dt",{className:"text-sm text-muted-foreground",children:e}),s.jsx("dd",{className:`text-sm font-medium text-foreground ${a?"font-mono text-xs sm:text-sm":""}`,children:n})]})}const dB={ok:"Healthy",missing_config:"Guild ID not set",not_in_guild:"Not in configured server",extra_guilds:"Extra servers joined",offline:"Bot offline"};function fB(e){return e==="ok"?"text-emerald-500":e==="offline"?"text-destructive":"text-amber-500"}function mB(){var E;const{stats:e,loading:n,error:a,refresh:o}=sd(),[l,c]=f.useState(null),[d,m]=f.useState(null),[p,h]=f.useState(!1),[b,g]=f.useState(null),{connected:y}=Yg({onMetrics:N=>{g(N)}}),w=f.useCallback(async()=>{const[N,k]=await Promise.all([Ee.getGuildStatus().catch(()=>null),Ee.health().catch(()=>null)]);N!=null&&N.data&&c(N.data),k!=null&&k.success&&k.data&&m({dashboard:k.data.dashboard,botReady:k.data.botReady,oauthEnabled:k.data.oauthEnabled,setupComplete:k.data.setupComplete})},[]);f.useEffect(()=>{w()},[w]);async function j(){h(!0);try{await Promise.all([o(),w()])}finally{h(!1)}}if(n&&!e)return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Be,{className:"h-10 w-64"}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Be,{className:"h-56 rounded-2xl"}),s.jsx(Be,{className:"h-56 rounded-2xl"})]})]});if(a||!e)return s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:a||"Could not load system details."})});const S=e.bot.ping<200;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(he,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2 h-8 px-2 text-muted-foreground",children:s.jsxs(Ft,{to:"/",children:[s.jsx(ge,{icon:J0,size:16,className:"mr-1.5"}),"Back to dashboard"]})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"System details"}),s.jsx("p",{className:"text-muted-foreground",children:"Live bot, host, and dashboard status — refreshed every 30 seconds."})]})]}),s.jsxs(he,{type:"button",variant:"outline",disabled:p,onClick:()=>void j(),children:[s.jsx(ge,{icon:or,size:16,className:"mr-2"}),p?"Refreshing…":"Refresh now"]})]}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Discord bot"}),s.jsx(Et,{children:"Connection and identity"})]}),s.jsxs(Ze,{children:[s.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s.jsxs(Ia,{className:"size-12",children:[s.jsx(Co,{src:e.bot.avatar,alt:e.bot.username}),s.jsx($a,{children:"SB"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold",children:e.bot.username}),s.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.bot.id})]})]}),s.jsxs("dl",{children:[s.jsx(Ct,{label:"Version",value:`v${e.bot.version}`,mono:!0}),s.jsx(Ct,{label:"Gateway latency",value:s.jsxs("span",{className:S?"text-emerald-500":"text-amber-500",children:[e.bot.ping," ms"]})}),s.jsx(Ct,{label:"Process uptime",value:Fh(e.bot.uptime)}),s.jsx(Ct,{label:"Connected servers",value:e.servers.toLocaleString()}),s.jsx(Ct,{label:"Members tracked",value:e.users.toLocaleString()}),e.bot.inviteUrl?s.jsx(Ct,{label:"Invite link",value:s.jsx("a",{href:e.bot.inviteUrl,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"Open in Discord"})}):null]})]})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(lt,{className:"text-lg",children:"Host machine"}),s.jsx(Et,{children:"Server resources running this instance"})]}),s.jsxs(An,{variant:y?"default":"outline",className:"text-xs",children:[s.jsx("span",{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${y?"bg-emerald-500 animate-pulse":"bg-muted"}`}),y?"Live Stream":"Polling"]})]}),s.jsx(Ze,{children:s.jsxs("dl",{children:[s.jsx(Ct,{label:"Memory used",value:b?`${(b.ram_used_mb/1024).toFixed(2)} GB / ${(b.ram_total_mb/1024).toFixed(2)} GB`:`${e.hosting.ram_used} / ${e.hosting.ram_total}`}),s.jsx(Ct,{label:"Memory usage",value:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:(b?b.ram_percent:e.hosting.ram_percent)>85?"text-amber-500 font-bold":"text-foreground font-medium",children:[b?b.ram_percent:e.hosting.ram_percent,"%"]}),s.jsx("div",{className:"w-24 h-2 bg-secondary rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${b?b.ram_percent:e.hosting.ram_percent}%`}})})]})}),s.jsx(Ct,{label:"CPU load (1 min avg)",value:b?String(b.cpu_load):e.hosting.cpu_load,mono:!0}),s.jsx(Ct,{label:"Host uptime",value:e.hosting.uptime})]})})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Tickets"}),s.jsx(Et,{children:"Database snapshot"})]}),s.jsx(Ze,{children:s.jsxs("dl",{children:[s.jsx(Ct,{label:"Total tickets",value:e.tickets.total}),s.jsx(Ct,{label:"Open",value:s.jsx("span",{className:"text-primary",children:e.tickets.open})}),s.jsx(Ct,{label:"Closed",value:e.tickets.closed}),s.jsx(Ct,{label:"Transcripts",value:s.jsx(Ft,{to:"/transcripts",className:"text-primary underline-offset-4 hover:underline",children:"Browse archive"})})]})})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Guild health"}),s.jsx(Et,{children:"Configured server and membership"})]}),s.jsx(Ze,{children:l?s.jsxs("dl",{children:[s.jsx(Ct,{label:"Status",value:s.jsx("span",{className:fB(l.status),children:dB[l.status]})}),s.jsx(Ct,{label:"Configured guild ID",value:l.configuredGuildId||"Not set",mono:!0}),l.configuredGuild?s.jsx(Ct,{label:"Configured server",value:`${l.configuredGuild.name} (${((E=l.configuredGuild.memberCount)==null?void 0:E.toLocaleString())??"?"} members)`}):null,l.message?s.jsx("div",{className:"mt-3 rounded-lg border border-border bg-secondary/30 px-3 py-2 text-sm text-muted-foreground",children:l.message}):null,l.extraGuilds.length>0?s.jsxs("div",{className:"mt-3 space-y-2",children:[s.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Extra servers"}),s.jsx("ul",{className:"space-y-1 text-sm",children:l.extraGuilds.map(N=>s.jsxs("li",{className:"font-mono text-xs",children:[N.name," · ",N.id]},N.id))})]}):null]}):s.jsx(Be,{className:"h-24 w-full"})})]})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Dashboard services"}),s.jsx(Et,{children:"API and authentication"})]}),s.jsx(Ze,{children:d?s.jsxs("dl",{className:"max-w-xl",children:[s.jsx(Ct,{label:"Dashboard UI",value:d.dashboard?"Available":"Missing build"}),s.jsx(Ct,{label:"Bot connection",value:d.botReady?"Online":"Starting or offline"}),s.jsx(Ct,{label:"Discord OAuth",value:d.oauthEnabled?"Configured":"Not configured"}),s.jsx(Ct,{label:"Initial setup",value:d.setupComplete?"Complete":"Incomplete"}),s.jsx(Ct,{label:"Software updates",value:s.jsx(Ft,{to:"/settings",className:"text-primary underline-offset-4 hover:underline",children:"Open settings"})}),s.jsx(Ct,{label:"Logs",value:s.jsx(Ft,{to:"/logs",className:"text-primary underline-offset-4 hover:underline",children:"View log files"})})]}):s.jsx(Be,{className:"h-32 w-full max-w-xl"})})]}),e.modules?s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-lg",children:"Module setup status"}),s.jsx(Et,{children:"Which features are configured and active"})]}),s.jsx(Ze,{children:s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Ts.map(N=>{const k=Th(N.id,e.modules);return s.jsxs(Ft,{to:N.href,className:"flex items-start justify-between gap-3 rounded-xl border border-border bg-secondary/20 px-4 py-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium",children:N.title}),s.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:k.subtitle})]}),s.jsx("span",{className:"shrink-0 rounded-full bg-secondary px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:tN[k.status]})]},N.id)})})})]}):null]})}function pB(e){if(!e)return"—";const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}const hB=[{id:"all",label:"All"},{id:"Output",label:"Output"},{id:"Warn",label:"Warn"},{id:"Error",label:"Error"}],gB=["Output","Warn","Error"],xB={Output:"text-foreground/90",Warn:"text-amber-400",Error:"text-rose-400"},vB={Output:"bg-muted text-muted-foreground",Warn:"bg-amber-500/15 text-amber-400",Error:"bg-rose-500/15 text-rose-400"},qu=2e3,bB=2e3;function Rh(e,n){return`${e.type}-${e.timestamp??"na"}-${n}-${e.message.slice(0,32)}`}function yB(e,n,a){const o=a?[]:e,l=new Set(o.map((m,p)=>Rh(m,p))),c=[];for(let m=0;m<n.length;m++){const p=Rh(n[m],m);l.has(p)||(l.add(p),c.push(n[m]))}const d=[...o,...c];return d.length>qu?d.slice(d.length-qu):d}function wB(){const[e,n]=f.useState([]),[a,o]=f.useState(!0),[l,c]=f.useState(""),[d,m]=f.useState(!1),[p,h]=f.useState(!0),[b,g]=f.useState("all"),[y,w]=f.useState(""),[j,S]=f.useState(!0),[E,N]=f.useState(""),k=f.useRef(null),T=f.useRef(null),A=f.useRef(d);A.current=d;const O=f.useMemo(()=>b==="all"?gB:[b],[b]),M=f.useCallback(U=>{A.current||b!=="all"&&U.type!==b||(n(q=>{const ue=[...q,U];return ue.length>qu?ue.slice(ue.length-qu):ue}),S(!0))},[b]);Yg({onLog:M});const z=f.useCallback(async U=>{var pe,xe;const q=await Ee.getLogs({types:O,cursor:U?void 0:k.current??void 0,tail:U?500:0}),ue=((pe=q.data)==null?void 0:pe.entries)??[];return k.current=((xe=q.data)==null?void 0:xe.cursor)??{},n(se=>yB(se,ue,U)),ue.length},[O]),B=f.useCallback(async()=>{var U;o(!0),c(""),k.current=null;try{const pe=(((U=(await Ee.getLogsMeta()).data)==null?void 0:U.files)??[]).filter(xe=>xe.file).map(xe=>`${xe.type}: ${xe.file}`).join(" · ");N(pe||"No log files yet — output appears when the bot runs."),await z(!0),S(!0)}catch(q){c(q instanceof Error?q.message:"Failed to load logs"),S(!1)}finally{o(!1)}},[z]);f.useEffect(()=>{B()},[B]),f.useEffect(()=>{if(d||a)return;const U=window.setInterval(async()=>{if(!A.current)try{await z(!1),S(!0),c("")}catch(q){S(!1),c(q instanceof Error?q.message:"Live update failed")}},bB);return()=>window.clearInterval(U)},[d,a,z]),f.useEffect(()=>{if(!p||d)return;const U=T.current;U&&(U.scrollTop=U.scrollHeight)},[e,p,d]);const K=f.useMemo(()=>e.filter(U=>{var ue;if(b!=="all"&&U.type!==b)return!1;if(!y.trim())return!0;const q=y.toLowerCase();return U.message.toLowerCase().includes(q)||(((ue=U.timestamp)==null?void 0:ue.toLowerCase().includes(q))??!1)}),[e,b,y]);return s.jsxs("div",{className:"flex h-[calc(100svh-8rem)] min-h-[480px] flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Logs"}),s.jsx("p",{className:"text-muted-foreground",children:"Live bot output — updates every 2 seconds"}),E?s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:E}):null]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:fe("size-2 rounded-full",j&&!d?"animate-pulse bg-emerald-500":"bg-muted-foreground")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:d?"Paused":j?"Live":"Disconnected"})]})]}),l?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:l})}):null,s.jsxs(Xe,{className:"flex min-h-0 flex-1 flex-col border-border bg-card",children:[s.jsxs(it,{className:"shrink-0 space-y-4 border-b border-border pb-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs(lt,{className:"text-base font-medium",children:["Console",a?null:s.jsxs("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:[K.length," line",K.length===1?"":"s"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border px-2 py-1",children:[s.jsx(At,{id:"auto-scroll",checked:p,onCheckedChange:h}),s.jsx(ze,{htmlFor:"auto-scroll",className:"text-xs font-normal",children:"Auto-scroll"})]}),s.jsxs(he,{type:"button",variant:"outline",size:"sm",onClick:()=>m(U=>!U),children:[s.jsx(ge,{icon:d?v8:x8,size:16,className:"mr-1.5"}),d?"Resume":"Pause"]}),s.jsxs(he,{type:"button",variant:"outline",size:"sm",onClick:()=>{n([]),B()},disabled:a,children:[s.jsx(ge,{icon:or,size:16,className:"mr-1.5"}),"Refresh"]})]})]}),s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[s.jsx("div",{className:"flex flex-wrap gap-1 rounded-xl bg-secondary/50 p-1",children:hB.map(U=>s.jsx(he,{type:"button",variant:b===U.id?"secondary":"ghost",size:"sm",className:"h-8 rounded-lg text-xs",onClick:()=>g(U.id),children:U.label},U.id))}),s.jsxs("div",{className:"relative flex-1 sm:max-w-xs",children:[s.jsx(ge,{icon:ad,size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(Ie,{placeholder:"Filter lines…",value:y,onChange:U=>w(U.target.value),className:"h-9 pl-9"})]})]})]}),s.jsx(Ze,{className:"min-h-0 flex-1 p-0",children:a?s.jsx("div",{className:"space-y-2 p-4",children:Array.from({length:8}).map((U,q)=>s.jsx(Be,{className:"h-4 w-full"},q))}):s.jsx("div",{ref:T,className:"h-full max-h-[calc(100svh-18rem)] overflow-y-auto bg-[#0d0d12] p-4 font-mono text-[13px] leading-relaxed",children:K.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No log lines yet. Start the bot and activity will appear here (also written to the Logs folder on disk)."}):s.jsx("ul",{className:"space-y-1",children:K.map((U,q)=>s.jsxs("li",{className:"flex gap-2 rounded px-1 py-0.5 hover:bg-white/[0.03]",children:[s.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:pB(U.timestamp)}),s.jsx("span",{className:fe("shrink-0 rounded px-1.5 py-0 text-[10px] font-semibold uppercase",vB[U.type]),children:U.type}),s.jsx("span",{className:fe("min-w-0 flex-1 whitespace-pre-wrap break-words",xB[U.type]),children:U.message||" "})]},Rh(U,q)))})})})]})]})}const CB=[{title:"Colors",description:"Theme colors used across the transcript page.",fields:[{path:"Theme.Background",label:"Page background",type:"color"},{path:"Theme.Panel",label:"Panel background",type:"color"},{path:"Theme.PanelSecondary",label:"Secondary panel",type:"color"},{path:"Theme.Border",label:"Borders",type:"color"},{path:"Theme.Text",label:"Main text",type:"color"},{path:"Theme.Muted",label:"Muted text",type:"color"},{path:"Theme.Accent",label:"Accent",type:"color"},{path:"Theme.Link",label:"Links",type:"color"},{path:"Theme.AttachmentLink",label:"Attachment links",type:"color"},{path:"Theme.CodeBackground",label:"Code blocks",type:"color"}]},{title:"Typography",fields:[{path:"Typography.FontFamily",label:"Font family",type:"googleFont",description:"Google Fonts are loaded automatically in saved transcripts."}]},{title:"Header",fields:[{path:"Header.Title",label:"Title",type:"text"},{path:"Header.Subtitle",label:"Subtitle",type:"textarea",description:"Placeholders: {{ticketName}} {{ticketId}} {{messageCount}} {{reason}}. Use **text** for bold."},{path:"Header.Badge",label:"Badge label",type:"text"},{path:"Header.ShowMetaCards",label:"Show info cards",type:"boolean"}]},{title:"Info card labels",fields:[{path:"Meta.ChannelLabel",label:"Channel label",type:"text"},{path:"Meta.TicketIdLabel",label:"Ticket ID label",type:"text"},{path:"Meta.MessageCountLabel",label:"Message count label",type:"text"},{path:"Meta.CloseReasonLabel",label:"Close reason label",type:"text"},{path:"Meta.DefaultCloseReason",label:"Default close reason",type:"text"}]},{title:"Messages section",fields:[{path:"Messages.SectionTitle",label:"Section heading",type:"text"},{path:"Messages.EmptyState",label:"Empty state text",type:"text"}]},{title:"Advanced CSS",description:"Optional extra CSS appended to the transcript stylesheet.",fields:[{path:"Advanced.CustomCss",label:"Custom CSS",type:"textarea",description:"Example: .badge { font-size: 1rem; }"}]}],SB=450;function jB(e,n){return n&&e!=="viewer"}function NB(){const{user:e,hasPermission:n}=Ut(),a=!jB(e==null?void 0:e.role,n("transcripts")),[o,l]=f.useState(null),[c,d]=f.useState(null),[m,p]=f.useState(!0),[h,b]=f.useState(!1),[g,y]=f.useState(""),[w,j]=f.useState(""),[S,E]=f.useState(""),[N,k]=f.useState(!1),T=f.useRef(null),A=f.useCallback(async()=>{var K;p(!0),y(""),j("");try{const q=(await Ee.getTranscriptTemplate()).data??null;if(q){const ue={...q,Typography:{...q.Typography,FontFamily:d5((K=q.Typography)==null?void 0:K.FontFamily)}};l(ue),d(structuredClone(ue))}}catch(U){y(U instanceof Error?U.message:"Failed to load template")}finally{p(!1)}},[]);f.useEffect(()=>{A()},[A]);const O=f.useCallback(async K=>{k(!0);try{const U=await Ee.previewTranscriptTemplate(K);E(U)}catch{E("<!DOCTYPE html><body style='padding:2rem;font-family:sans-serif'><p>Preview failed to load.</p></body>")}finally{k(!1)}},[]);f.useEffect(()=>{if(o)return T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{O(o)},SB),()=>{T.current&&clearTimeout(T.current)}},[o,O]);function M(K,U){l(q=>q&&xl(q,K,U))}async function z(){if(!(a||!o)){b(!0),y(""),j("");try{const K=await Ee.saveTranscriptTemplate(o);j(K.message||"Saved."),d(structuredClone(o))}catch(K){y(K instanceof Error?K.message:"Save failed")}finally{b(!1)}}}const B=o&&c&&JSON.stringify(o)!==JSON.stringify(c);return m?s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Be,{className:"h-96 rounded-xl"}),s.jsx(Be,{className:"h-96 rounded-xl"})]}):o?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize how new ticket transcripts look. Existing saved transcripts are not changed."}),s.jsxs("div",{className:"flex items-center gap-2",children:[B?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,a?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(he,{size:"sm",onClick:z,disabled:h||!B,children:[s.jsx(ge,{icon:nd,size:16,className:"mr-1.5"}),h?"Saving…":"Save appearance"]})]})]}),g?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g})}):null,w?s.jsx(We,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(Ye,{children:w})}):null,s.jsxs("div",{className:"grid min-h-0 gap-4 xl:grid-cols-[minmax(320px,420px)_1fr]",children:[s.jsx(EB,{data:o,readOnly:a,onPatch:M}),s.jsxs(Xe,{className:"flex min-h-[520px] flex-col overflow-hidden border-border bg-card",children:[s.jsxs(it,{className:"pb-2",children:[s.jsx(lt,{className:"text-base",children:"Live preview"}),s.jsxs(Et,{children:["Sample ticket with your current settings",N?" · updating…":""]})]}),s.jsx(Ze,{className:"min-h-0 flex-1 p-4 pt-0",children:s.jsx("iframe",{title:"Transcript template preview",srcDoc:S,className:fe("h-[min(640px,calc(100svh-14rem))] w-full rounded-lg border border-border bg-background",N&&"opacity-60"),sandbox:"allow-same-origin"})})]})]})]}):s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g||"Failed to load template"})})}function EB({data:e,readOnly:n,onPatch:a}){return s.jsx("div",{className:"max-h-[min(720px,calc(100svh-12rem))] space-y-4 overflow-y-auto pr-1",children:CB.map(o=>s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{className:"pb-3",children:[s.jsx(lt,{className:"text-base",children:o.title}),o.description?s.jsx(Et,{children:o.description}):null]}),s.jsx(Ze,{className:"grid gap-4 sm:grid-cols-2",children:o.fields.map(l=>s.jsx("div",{className:l.type==="textarea"?"sm:col-span-2":"",children:s.jsx(Vg,{field:l,value:To(e,l.path),readOnly:n,onChange:c=>a(l.path,c)})},l.path))})]},o.title))})}function kB(e,n){return n&&e!=="viewer"}function TB(){const{user:e,hasPermission:n}=Ut(),a=!kB(e==null?void 0:e.role,n("transcripts")),[o,l]=f.useState(null),[c,d]=f.useState(!0),[m,p]=f.useState(!1),[h,b]=f.useState(!1),[g,y]=f.useState(""),[w,j]=f.useState(""),S=f.useCallback(async()=>{var k,T,A;d(!0),y(""),j("");try{const M=(await Ee.getTranscriptSettings()).data;M&&l({autoDelete:{enabled:!!((k=M.autoDelete)!=null&&k.enabled),afterDays:((T=M.autoDelete)==null?void 0:T.afterDays)??30},publicAccess:{enabled:!!((A=M.publicAccess)!=null&&A.enabled)}})}catch(O){y(O instanceof Error?O.message:"Failed to load settings")}finally{d(!1)}},[]);f.useEffect(()=>{S()},[S]);async function E(){if(!(!o||a)){p(!0),y(""),j("");try{const k=await Ee.updateTranscriptSettings(o);k.data&&l({autoDelete:{enabled:k.data.autoDelete.enabled,afterDays:k.data.autoDelete.afterDays},publicAccess:{enabled:k.data.publicAccess.enabled}}),j(k.message??"Settings saved.")}catch(k){y(k instanceof Error?k.message:"Failed to save settings")}finally{p(!1)}}}async function N(){var k,T;if(!a){b(!0),y(""),j("");try{const A=await Ee.purgeTranscripts();j(A.message??((k=A.data)!=null&&k.skipped?"Auto-delete is disabled.":`Removed ${((T=A.data)==null?void 0:T.deleted)??0} transcript(s).`))}catch(A){y(A instanceof Error?A.message:"Purge failed")}finally{b(!1)}}}return c?s.jsxs("div",{className:"space-y-4",children:[s.jsx(Be,{className:"h-40 w-full rounded-xl"}),s.jsx(Be,{className:"h-40 w-full rounded-xl"})]}):o?s.jsxs("div",{className:"mx-auto max-w-2xl space-y-4",children:[a?s.jsx(We,{children:s.jsx(Ye,{children:"You have view-only access. An admin or editor can change these settings."})}):null,g?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g})}):null,w?s.jsx(We,{children:s.jsx(Ye,{children:w})}):null,s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-base",children:"Auto-delete"}),s.jsx(Et,{children:"Remove transcript files automatically after they reach a certain age. The server checks hourly and whenever you open the library."})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.autoDelete.enabled,disabled:a,onChange:k=>l(T=>T&&{...T,autoDelete:{...T.autoDelete,enabled:k.target.checked}})}),s.jsxs("span",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"Enable auto-delete"}),s.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Deletes HTML files in Data/Transcripts based on last modified time."})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",htmlFor:"transcript-after-days",children:"Delete after (days)"}),s.jsx(Ie,{id:"transcript-after-days",type:"number",min:1,max:3650,disabled:a||!o.autoDelete.enabled,value:o.autoDelete.afterDays,onChange:k=>l(T=>T&&{...T,autoDelete:{...T.autoDelete,afterDays:Math.min(3650,Math.max(1,parseInt(k.target.value,10)||1))}}),className:"max-w-[8rem]"})]}),s.jsxs(he,{type:"button",variant:"outline",size:"sm",disabled:a||h,onClick:()=>void N(),children:[s.jsx(ge,{icon:or,size:16,className:fe(h&&"animate-spin")}),"Run cleanup now"]})]})]}),s.jsxs(Xe,{className:"border-border bg-card",children:[s.jsxs(it,{children:[s.jsx(lt,{className:"text-base",children:"Public transcripts"}),s.jsxs(Et,{children:["When enabled, anyone with the link can view a transcript at"," ",s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:typeof window<"u"?`${window.location.origin}/transcripts/:id`:"/transcripts/:id"})," ","without signing in. Channel IDs are numeric but not secret—only enable if you are comfortable sharing links."]})]}),s.jsx(Ze,{children:s.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[s.jsx("input",{type:"checkbox",className:"mt-1 size-4 rounded border-border accent-primary",checked:o.publicAccess.enabled,disabled:a,onChange:k=>l(T=>T&&{...T,publicAccess:{enabled:k.target.checked}})}),s.jsxs("span",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"Allow public transcript URLs"}),s.jsx("span",{className:"mt-0.5 block text-muted-foreground",children:"Dashboard preview and download still require login."})]})]})})]}),a?null:s.jsxs(he,{type:"button",disabled:m,onClick:()=>void E(),children:[s.jsx(ge,{icon:nd,size:16}),m?"Saving…":"Save settings"]})]}):s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:"Could not load transcript settings."})})}function RB(e,n){return n&&e!=="viewer"}function T0(e){return e==null?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function R0(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function AB(){var G;const{user:e,hasPermission:n}=Ut(),a=RB(e==null?void 0:e.role,n("transcripts")),[o,l]=f.useState("browse"),[c,d]=f.useState([]),[m,p]=f.useState(null),[h,b]=f.useState(!0),[g,y]=f.useState(""),[w,j]=f.useState(""),[S,E]=f.useState(""),[N,k]=f.useState(0),[T,A]=f.useState(!1),[O,M]=f.useState(!1),[z,B]=f.useState(!1),[K,U]=f.useState(!1),q=f.useCallback(async()=>{b(!0),j("");try{const F=(await Ee.listTranscripts()).data??[];d(F),p(oe=>{var ae;return oe&&F.some(be=>be.id===oe)?oe:((ae=F[0])==null?void 0:ae.id)??null})}catch(V){j(V instanceof Error?V.message:"Failed to load transcripts")}finally{b(!1)}},[]);f.useEffect(()=>{q()},[q]),f.useEffect(()=>{o==="browse"&&Ee.getTranscriptSettings().then(V=>{var F,oe;B(!!((oe=(F=V.data)==null?void 0:F.publicAccess)!=null&&oe.enabled))}).catch(()=>B(!1))},[o]);const ue=f.useMemo(()=>{if(!S.trim())return c;const V=S.toLowerCase();return c.filter(F=>F.id.includes(V)||F.filename.toLowerCase().includes(V)||F.ticketName&&F.ticketName.toLowerCase().includes(V))},[c,S]),pe=f.useMemo(()=>c.find(V=>V.id===m)??null,[c,m]),xe=m?`/api/system/transcripts/${encodeURIComponent(m)}/view`:null,se=m?`/api/system/transcripts/${encodeURIComponent(m)}/download`:null,L=m&&z?`${window.location.origin}/transcripts/${encodeURIComponent(m)}`:null;function I(V){y(""),p(V),k(F=>F+1)}function H(){xe&&window.open(xe,"_blank","noopener,noreferrer")}function Z(){L&&window.open(L,"_blank","noopener,noreferrer")}async function te(){if(L)try{await navigator.clipboard.writeText(L),U(!0),window.setTimeout(()=>U(!1),2e3)}catch{y("Could not copy link to clipboard.")}}async function _(){var F;if(!m||!a)return;const V=((F=pe==null?void 0:pe.ticketName)==null?void 0:F.trim())||`channel ${m}`;if(window.confirm(`Delete the transcript for ${V}? This cannot be undone.`)){M(!0),y("");try{await Ee.deleteTranscript(m),await q()}catch(oe){y(oe instanceof Error?oe.message:"Failed to delete transcript")}finally{M(!1)}}}async function D(){if(!(!se||!pe)){A(!0),y("");try{const V=await fetch(se,{credentials:"include"});if(!V.ok){const be=await V.json().catch(()=>({}));throw new Error(be.error||`Download failed (${V.status})`)}const F=await V.blob(),oe=URL.createObjectURL(F),ae=document.createElement("a");ae.href=oe,ae.download=pe.filename,ae.click(),URL.revokeObjectURL(oe)}catch(V){y(V instanceof Error?V.message:"Failed to download transcript")}finally{A(!1)}}}return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Transcripts"}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Browse saved transcripts or customize how new ones look when tickets close."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[s.jsx(he,{type:"button",variant:o==="browse"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>l("browse"),children:"Library"}),s.jsx(he,{type:"button",variant:o==="appearance"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>l("appearance"),children:"Appearance"}),s.jsx(he,{type:"button",variant:o==="settings"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>l("settings"),children:"Settings"})]}),o==="browse"?s.jsxs(he,{variant:"outline",size:"sm",onClick:()=>q(),disabled:h,children:[s.jsx(ge,{icon:or,size:16,className:fe(h&&"animate-spin")}),"Refresh"]}):null]})]}),o==="appearance"?s.jsx(NB,{}):o==="settings"?s.jsx(TB,{}):s.jsxs(s.Fragment,{children:[w?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:w})}):null,s.jsxs("div",{className:"grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(240px,320px)_1fr]",children:[s.jsxs(Xe,{className:"flex min-h-[420px] flex-col border-border bg-card",children:[s.jsxs(it,{className:"space-y-3 pb-3",children:[s.jsxs(lt,{className:"text-base font-medium",children:["Saved transcripts",!h&&c.length>0?s.jsxs("span",{className:"ml-2 font-normal text-muted-foreground",children:["(",c.length,")"]}):null]}),s.jsxs("div",{className:"relative",children:[s.jsx(ge,{icon:ad,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(Ie,{placeholder:"Search by ticket name or channel ID…",value:S,onChange:V=>E(V.target.value),className:"pl-9"})]})]}),s.jsx(Ze,{className:"min-h-0 flex-1 p-0 pb-4",children:s.jsx($l,{className:"h-[min(520px,calc(100svh-16rem))] px-4",children:h?s.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((V,F)=>s.jsx(Be,{className:"h-16 w-full rounded-lg"},F))}):ue.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center text-sm text-muted-foreground",children:[s.jsx(ge,{icon:il,size:32,className:"opacity-40"}),s.jsx("p",{children:c.length===0?"No transcripts yet. They appear when tickets are closed.":"No transcripts match your search."})]}):s.jsx("ul",{className:"space-y-1.5",children:ue.map(V=>{var ae;const F=V.id===m,oe=((ae=V.ticketName)==null?void 0:ae.trim())||`Channel ${V.id}`;return s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>I(V.id),className:fe("w-full rounded-lg border px-3 py-2.5 text-left transition-colors",F?"border-primary/50 bg-primary/10":"border-transparent bg-secondary/30 hover:bg-secondary/50"),children:[s.jsx("p",{className:"truncate text-sm font-medium",children:oe}),s.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[R0(V.createdAt),V.size!=null?` · ${T0(V.size)}`:""]})]})},V.id)})})})})]}),s.jsxs(Xe,{className:"flex min-h-[420px] flex-col overflow-hidden border-border bg-card",children:[s.jsxs(it,{className:"flex flex-row flex-wrap items-center justify-between gap-2 space-y-0 pb-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(lt,{className:"truncate text-base font-medium",children:pe?((G=pe.ticketName)==null?void 0:G.trim())||`Channel ${pe.id}`:"Preview"}),pe?s.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[R0(pe.createdAt),pe.size!=null?` · ${T0(pe.size)}`:""]}):null]}),s.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[L?s.jsxs(s.Fragment,{children:[s.jsxs(he,{variant:"outline",size:"sm",onClick:()=>void te(),children:[s.jsx(ge,{icon:t2,size:16}),K?"Copied":"Copy link"]}),s.jsxs(he,{variant:"outline",size:"sm",onClick:Z,children:[s.jsx(ge,{icon:rd,size:16}),"Public page"]})]}):null,s.jsxs(he,{variant:"outline",size:"sm",disabled:!xe,onClick:H,children:[s.jsx(ge,{icon:s8,size:16}),"Open tab"]}),s.jsxs(he,{variant:"outline",size:"sm",disabled:!se||T,onClick:()=>void D(),children:[s.jsx(ge,{icon:td,size:16}),T?"Saving…":"Download"]}),a?s.jsxs(he,{variant:"outline",size:"sm",disabled:!m||O,className:"text-destructive hover:text-destructive",onClick:()=>void _(),children:[s.jsx(ge,{icon:wl,size:16}),O?"Deleting…":"Delete"]}):null]})]}),s.jsxs(Ze,{className:"flex min-h-0 flex-1 flex-col gap-2 p-4 pt-0",children:[g?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:g})}):null,pe&&xe?s.jsx("iframe",{title:`Transcript ${pe.id}`,src:xe,className:"min-h-[min(560px,calc(100svh-18rem))] w-full flex-1 rounded-lg border border-border bg-background",sandbox:"allow-same-origin"},N):s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border py-16 text-center text-sm text-muted-foreground",children:[s.jsx(ge,{icon:il,size:40,className:"opacity-30"}),s.jsx("p",{children:"Select a transcript from the list to preview it here."})]})]})]})]})]})]})}function MB(){const[e,n]=f.useState([]),[a,o]=f.useState(""),[l,c]=f.useState(!0),[d,m]=f.useState(""),[p,h]=f.useState(null),[b,g]=f.useState(!1),[y,w]=f.useState(!1),[j,S]=f.useState([]),[E,N]=f.useState(!1),[k,T]=f.useState(""),[A,O]=f.useState([]),[M,z]=f.useState(!1),[B,K]=f.useState(null),[U,q]=f.useState(!1),[ue,pe]=f.useState(""),[xe,se]=f.useState(null),[L,I]=f.useState(""),[H,Z]=f.useState(!1),[te,_]=f.useState(null),[D,G]=f.useState(""),[V,F]=f.useState(null),oe=ee=>{_(ee),G("Closed via Web Dashboard"),Z(!0)},ae=async()=>{if(!te)return;const ee=te.ticket_id;F(ee);try{await Ee.closeTicket(ee,D||"Closed via Web Dashboard"),Bt.success("Ticket closed and transcript saved."),n(re=>re.filter(ke=>ke.ticket_id!==ee)),(p==null?void 0:p.ticket_id)===ee&&(g(!1),w(!1),h(null)),Z(!1),_(null)}catch(re){Bt.error(re instanceof Error?re.message:"Failed to close ticket.")}finally{F(null)}},be=f.useRef(null),ve=f.useRef(null),Y=()=>{var ee;(ee=be.current)==null||ee.scrollIntoView({behavior:"smooth"})},le=f.useCallback(async()=>{c(!0),m("");try{const ee=await Ee.listOpenTickets();ee.data&&(o(ee.data.guildId),n(ee.data.tickets.sort((re,ke)=>ke.created_at-re.created_at)))}catch(ee){m(ee instanceof Error?ee.message:"Failed to load open tickets")}finally{c(!1)}},[]);f.useEffect(()=>{le()},[le]),f.useEffect(()=>{Ee.getGuildResources().then(ee=>{ee.data&&K(ee.data)}).catch(()=>{})},[]);const ye=f.useCallback(ee=>{p&&ee.ticketId===p.ticket_id&&(S(re=>re.some(ke=>ke.id===ee.message.id)?re:[...re,ee.message]),setTimeout(Y,100))},[p]),Te=f.useCallback(ee=>{p&&ee.ticketId===p.ticket_id&&S(re=>re.filter(ke=>ke.id!==ee.messageId))},[p]),Le=f.useCallback(ee=>{p&&ee.ticketId===p.ticket_id&&S(re=>re.map(ke=>ke.id===ee.messageId?{...ke,content:ee.content}:ke))},[p]),rt=f.useCallback(ee=>{n(re=>re.some(ke=>ke.ticket_id===ee.ticket_id)?re:[ee,...re]),Bt.info("New Ticket Created",{description:`#${ee.ticket_id} - ${ee.subject||"No Subject"}`})},[]),ht=f.useCallback(ee=>{n(re=>re.filter(ke=>ke.ticket_id!==ee.ticket_id)),(p==null?void 0:p.ticket_id)===ee.ticket_id&&Bt.warning("Active ticket was closed in Discord.")},[p]);Yg({onTicketMessage:ye,onTicketMessageDeleted:Te,onTicketMessageUpdated:Le,onTicketCreated:rt,onTicketClosed:ht});const Mt=async ee=>{var re;h(ee),g(!0),N(!0),S([]),O([]),se(null);try{const ke=await Ee.getTicketMessages(ee.ticket_id);(re=ke.data)!=null&&re.messages&&(S(ke.data.messages),setTimeout(Y,150))}catch(ke){Bt.error(ke instanceof Error?ke.message:"Failed to fetch messages")}finally{N(!1)}},Tr=ee=>{const re=Array.from(ee.target.files||[]);re.length&&(re.forEach(ke=>{const we=new FileReader;we.onload=De=>{var ct;const at=(ct=De.target)==null?void 0:ct.result;O(mt=>[...mt,{filename:ke.name,data:at,previewUrl:ke.type.startsWith("image/")?at:void 0,sizeMb:(ke.size/1024/1024).toFixed(2)}])},we.readAsDataURL(ke)}),ve.current&&(ve.current.value=""))},_t=ee=>{O(re=>re.filter((ke,we)=>we!==ee))},Ya=async ee=>{var we;if(ee.preventDefault(),!k.trim()&&!A.length||!p||M)return;const re=k.trim(),ke=[...A];z(!0),T(""),O([]),q(!1);try{const De=await Ee.me().catch(()=>null),at=((we=De==null?void 0:De.data)==null?void 0:we.username)||"Staff",ct=await Ee.sendTicketReply(p.ticket_id,re,at,ke.map(mt=>({filename:mt.filename,data:mt.data})));ct.data&&(S(mt=>mt.some(Zt=>Zt.id===ct.data.id)?mt:[...mt,{id:ct.data.id,author:ct.data.author,content:ct.data.content,attachments:ct.data.attachments||[],createdAt:ct.data.createdAt}]),setTimeout(Y,100))}catch(De){Bt.error(De instanceof Error?De.message:"Failed to send reply to Discord."),T(re),O(ke)}finally{z(!1)}},qa=async ee=>{if(p)try{await Ee.deleteTicketMessage(p.ticket_id,ee),S(re=>re.filter(ke=>ke.id!==ee)),Bt.success("Message deleted in Discord.")}catch(re){Bt.error(re instanceof Error?re.message:"Failed to delete message.")}},qt=ee=>{se(ee.id),I(ee.content)},dr=()=>{se(null),I("")},Kt=async ee=>{if(!(!p||!L.trim()))try{await Ee.editTicketMessage(p.ticket_id,ee,L.trim()),S(re=>re.map(ke=>ke.id===ee?{...ke,content:L.trim()}:ke)),se(null),Bt.success("Message updated in Discord.")}catch(re){Bt.error(re instanceof Error?re.message:"Failed to edit message.")}},ti=ee=>{const re=ee.target.value;T(re);const ke=ee.target.selectionStart||re.length,we=re.slice(0,ke),De=we.lastIndexOf("@");if(De!==-1&&!we.slice(De).includes(" ")){const at=we.slice(De+1).toLowerCase();pe(at),q(!0)}else q(!1)},fr=(ee,re,ke)=>{const we=k.lastIndexOf("@"),De=k.slice(0,we),at=ke?`<@&${re}>`:`<@${re}>`;T(`${De}${at} `),q(!1)},Lo=ee=>{const re=Math.floor((Date.now()-ee)/1e3);return Fh(re)},Rr=ee=>new Date(ee).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Xt=ee=>{if(!ee)return null;const re=/(```[\s\S]*?```|`[^`]+`|\*\*\*[\s\S]+?\*\*\*|\*\*[\s\S]+?\*\*|__[\s\S]+?__|~~[\s\S]+?~~|\|\|[\s\S]+?\|\||<@!?&?\d+>|^###\s[^\n]+|^##\s[^\n]+|^-#\s[^\n]+|\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+)/gm;return ee.split(re).map((we,De)=>{var Zt;if(!we)return null;if(we.startsWith("-# "))return s.jsx("span",{className:"text-xs text-muted-foreground font-medium block my-0.5 opacity-80",children:Xt(we.slice(3))},De);if(we.startsWith("## "))return s.jsx("span",{className:"text-base font-bold text-foreground block my-1 tracking-tight",children:Xt(we.slice(3))},De);if(we.startsWith("### "))return s.jsx("span",{className:"text-sm font-bold text-foreground block my-0.5",children:Xt(we.slice(4))},De);if(we.startsWith("```")&&we.endsWith("```")&&we.length>=6){const Me=we.slice(3,-3).replace(/^[a-z0-9_-]+\n/i,"");return s.jsx("pre",{className:"bg-black/60 p-2.5 rounded-lg text-xs font-mono my-1.5 border border-border overflow-x-auto text-emerald-400 font-mono",children:s.jsx("code",{children:Me})},De)}if(we.startsWith("`")&&we.endsWith("`")&&we.length>2)return s.jsx("code",{className:"bg-black/50 px-1.5 py-0.5 rounded text-xs font-mono text-emerald-300 border border-border/40",children:we.slice(1,-1)},De);if(we.startsWith("***")&&we.endsWith("***")&&we.length>6)return s.jsx("strong",{className:"font-bold italic",children:Xt(we.slice(3,-3))},De);if(we.startsWith("**")&&we.endsWith("**")&&we.length>4)return s.jsx("strong",{className:"font-bold",children:Xt(we.slice(2,-2))},De);if(we.startsWith("__")&&we.endsWith("__")&&we.length>4)return s.jsx("span",{className:"underline underline-offset-2",children:Xt(we.slice(2,-2))},De);if(we.startsWith("~~")&&we.endsWith("~~")&&we.length>4)return s.jsx("span",{className:"line-through opacity-80",children:Xt(we.slice(2,-2))},De);if(we.startsWith("||")&&we.endsWith("||")&&we.length>4)return s.jsx("span",{className:"bg-secondary text-transparent hover:text-foreground hover:bg-secondary/50 px-1.5 py-0.5 rounded transition-all cursor-pointer select-none border border-border/30",title:"Click to reveal spoiler",children:we.slice(2,-2)},De);const at=we.match(/^<@!?(\d+)>$/);if(at){const Me=at[1],Je=new Map;p&&Je.set(p.user_id,"Ticket Author"),j.forEach(kt=>{var Jn;(Jn=kt.author)!=null&&Jn.id&&Je.set(kt.author.id,kt.author.globalName||kt.author.username)});const St=Je.get(Me);return s.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded font-semibold text-xs bg-primary/20 text-primary mx-0.5",title:`User ID: ${Me}`,children:["@",St||"User"]},De)}const ct=we.match(/^<@&(\d+)>$/);if(ct){const Me=ct[1],Je=(Zt=B==null?void 0:B.roles)==null?void 0:Zt.find(St=>St.id===Me);return s.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded font-semibold text-xs bg-amber-500/20 text-amber-400 mx-0.5",children:["@",Je?Je.name:`Role (${Me})`]},De)}const mt=we.match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(mt){const Me=mt[1],Je=mt[2];return s.jsx("a",{href:Je,target:"_blank",rel:"noreferrer",className:"text-primary underline hover:opacity-80 break-all",children:Me},De)}return/^https?:\/\/[^\s]+$/i.test(we)?/\.(gif|jpe?g|png|webp)(\?[^\s]*)?$/i.test(we)||/cdn\.discordapp\.com\/(emojis|attachments)\//i.test(we)||/images\.discordapp\.net\//i.test(we)||/media\d*\.giphy\.com\//i.test(we)?s.jsx("span",{className:"block my-1",children:s.jsx("img",{src:we,alt:"GIF/Image",className:"max-h-64 rounded-lg border border-border object-contain hover:opacity-95 transition-opacity",loading:"lazy"})},De):s.jsx("a",{href:we,target:"_blank",rel:"noreferrer",className:"text-primary underline hover:opacity-80 break-all",children:we},De):we})},Qn=ee=>!ee||ee.length===0?null:s.jsx("div",{className:"space-y-2 mt-1",children:ee.map(re=>{var at,ct,mt;const ke=((at=re.contentType)==null?void 0:at.startsWith("image/"))||/\.(png|jpe?g|gif|webp|svg)$/i.test(re.name),we=((ct=re.contentType)==null?void 0:ct.startsWith("video/"))||/\.(mp4|webm|mov|mkv)$/i.test(re.name),De=((mt=re.contentType)==null?void 0:mt.startsWith("audio/"))||/\.(mp3|wav|ogg|m4a)$/i.test(re.name);return ke?s.jsx("div",{className:"rounded-lg overflow-hidden border border-border bg-black/40",children:s.jsx("a",{href:re.url,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:re.url,alt:re.name,className:"max-h-80 max-w-full object-contain hover:opacity-95 transition-opacity",loading:"lazy"})})},re.id):we?s.jsx("div",{className:"rounded-lg overflow-hidden border border-border bg-black",children:s.jsx("video",{src:re.url,controls:!0,className:"max-h-80 max-w-full"})},re.id):De?s.jsx("div",{className:"p-2 border border-border rounded-lg bg-secondary/20",children:s.jsx("audio",{src:re.url,controls:!0,className:"w-full h-8"})},re.id):s.jsxs("div",{className:"p-2.5 rounded-lg border border-border bg-secondary/20 flex items-center justify-between text-xs gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 truncate",children:[s.jsx(ge,{icon:ay,size:16,className:"text-primary shrink-0"}),s.jsx("span",{className:"truncate font-medium",children:re.name})]}),s.jsx(he,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 px-2 text-xs",children:s.jsx("a",{href:re.url,target:"_blank",rel:"noreferrer",download:!0,children:"Download"})})]},re.id)})}),zo=ee=>!ee||ee.length===0?null:s.jsx("div",{className:"space-y-3 mt-1.5 w-full",children:ee.map((re,ke)=>{var we,De,at,ct;return s.jsxs("div",{className:"rounded-lg border border-border/60 bg-secondary/30 p-3.5 text-xs space-y-2 border-l-4 shadow-sm relative overflow-hidden max-w-xl",style:{borderLeftColor:re.color||"#5865F2"},children:[re.author&&s.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-foreground",children:[re.author.iconURL&&s.jsx("img",{src:re.author.iconURL,alt:"",className:"h-4 w-4 rounded-full"}),s.jsx("span",{children:re.author.name})]}),((we=re.thumbnail)==null?void 0:we.url)&&s.jsx("img",{src:re.thumbnail.url,alt:"",className:"h-12 w-12 rounded object-cover absolute top-3 right-3 border border-border"}),re.title&&s.jsx("h4",{className:"font-bold text-sm text-foreground tracking-tight pr-12",children:Xt(re.title)}),re.description&&s.jsx("div",{className:"text-muted-foreground whitespace-pre-wrap leading-relaxed pr-12",children:Xt(re.description)}),re.fields&&re.fields.length>0&&s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2.5 pt-2 border-t border-border/30",children:re.fields.map((mt,Zt)=>s.jsxs("div",{className:`space-y-0.5 ${mt.inline?"":"sm:col-span-2"}`,children:[s.jsx("p",{className:"font-semibold text-foreground text-[11px] uppercase tracking-wider",children:mt.name}),s.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:Xt(mt.value)})]},Zt))}),((De=re.image)==null?void 0:De.url)&&s.jsx("div",{className:"rounded-md overflow-hidden border border-border mt-2",children:s.jsx("img",{src:re.image.url,alt:"",className:"max-h-64 w-full object-cover"})}),(re.footer||re.timestamp)&&s.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-border/20 text-[10px] text-muted-foreground",children:[((at=re.footer)==null?void 0:at.iconURL)&&s.jsx("img",{src:re.footer.iconURL,alt:"",className:"h-3.5 w-3.5 rounded-full"}),((ct=re.footer)==null?void 0:ct.text)&&s.jsx("span",{children:re.footer.text}),re.timestamp&&s.jsxs("span",{children:[new Date(re.timestamp).toLocaleDateString()," ",new Date(re.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]})]},ke)})}),mr=ee=>{if(!ee||ee.length===0)return null;const re=ee.map(ke=>({...ke,components:(ke.components||[]).filter(we=>we.customId||we.url||we.type===2||we.type===3||we.type==="BUTTON"||we.type==="STRING_SELECT")})).filter(ke=>ke.components&&ke.components.length>0);return re.length===0?null:s.jsx("div",{className:"space-y-2 mt-2.5 w-full",children:re.map((ke,we)=>{var De;return s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:(De=ke.components)==null?void 0:De.map((at,ct)=>s.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-secondary/80 text-secondary-foreground text-xs font-semibold border border-border/80 shadow-sm hover:bg-secondary transition-colors cursor-pointer",children:[at.emoji&&s.jsx("span",{children:at.emoji}),s.jsx("span",{children:at.label||at.customId||"Button"})]},ct))},we)})})},pr=()=>s.jsx($l,{className:"flex-1 p-4 sm:p-6",children:s.jsxs("div",{className:"max-w-4xl mx-auto w-full space-y-4",children:[E?s.jsxs("div",{className:"space-y-4 p-4",children:[s.jsx(Be,{className:"h-10 w-3/4"}),s.jsx(Be,{className:"h-10 w-1/2 ml-auto"}),s.jsx(Be,{className:"h-10 w-2/3"})]}):j.length===0?s.jsx("div",{className:"p-12 text-center text-muted-foreground text-sm",children:"No recent messages in this ticket channel."}):j.map(ee=>{var re;return s.jsxs("div",{className:`group flex items-start gap-3 ${ee.author.isDashboard?"flex-row-reverse":""}`,children:[s.jsxs(Ia,{className:"h-8 w-8 shrink-0",children:[s.jsx(Co,{src:ee.author.avatar,alt:ee.author.username}),s.jsx($a,{children:s.jsx(ge,{icon:N8,size:16})})]}),s.jsxs("div",{className:`flex flex-col space-y-1 max-w-[80%] ${ee.author.isDashboard?"items-end":"items-start"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-semibold text-foreground",children:ee.author.globalName||ee.author.username}),ee.author.bot&&s.jsx(An,{variant:"secondary",className:"px-1 py-0 text-[10px]",children:"BOT"}),ee.author.isDashboard&&s.jsx(An,{variant:"default",className:"px-1 py-0 text-[10px]",children:"STAFF"}),s.jsx("span",{children:Rr(ee.createdAt)}),s.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-1",children:[s.jsx(he,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:()=>qt(ee),title:"Edit Message",children:s.jsx(ge,{icon:a2,size:12})}),s.jsx(he,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-destructive",onClick:()=>qa(ee.id),title:"Delete Message",children:s.jsx(ge,{icon:wl,size:12})})]})]}),xe===ee.id?s.jsxs("div",{className:"flex items-center gap-2 w-full mt-1",children:[s.jsx(Ie,{value:L,onChange:ke=>I(ke.target.value),className:"h-8 text-sm",autoFocus:!0}),s.jsx(he,{size:"sm",className:"h-8 px-2 bg-primary",onClick:()=>Kt(ee.id),children:s.jsx(ge,{icon:S8,size:14})}),s.jsx(he,{size:"sm",variant:"ghost",className:"h-8 px-2",onClick:dr,children:s.jsx(ge,{icon:Zr,size:14})})]}):ee.content?s.jsx("div",{className:`rounded-lg px-3.5 py-2.5 text-sm whitespace-pre-wrap ${ee.author.isDashboard?"bg-primary text-primary-foreground":"bg-secondary/40 text-secondary-foreground border border-border/50"}`,style:ee.containerColor||ee.author.bot&&!((re=ee.embeds)!=null&&re.length)?{borderLeftWidth:"4px",borderLeftColor:ee.containerColor||"#5865F2"}:void 0,children:Xt(ee.content)}):null,Qn(ee.attachments),zo(ee.embeds),mr(ee.components)]})]},ee.id)}),s.jsx("div",{ref:be})]})}),Ht=()=>{var ee;return s.jsxs("div",{className:"p-4 border-t border-border bg-secondary/10 flex flex-col gap-2 relative",children:[A.length>0&&s.jsx("div",{className:"max-w-4xl mx-auto w-full flex items-center gap-2 flex-wrap mb-1",children:A.map((re,ke)=>s.jsxs("div",{className:"flex items-center gap-2 p-1.5 px-3 rounded-lg border border-border bg-secondary text-xs",children:[re.previewUrl?s.jsx("img",{src:re.previewUrl,alt:"",className:"h-6 w-6 rounded object-cover"}):s.jsx(ge,{icon:ay,size:14,className:"text-primary"}),s.jsx("span",{className:"font-medium max-w-[120px] truncate",children:re.filename}),s.jsxs("span",{className:"text-muted-foreground text-[10px]",children:[re.sizeMb,"MB"]}),s.jsx("button",{type:"button",onClick:()=>_t(ke),className:"text-muted-foreground hover:text-destructive ml-1",children:s.jsx(ge,{icon:Zr,size:12})})]},ke))}),U&&s.jsxs("div",{className:"max-w-4xl mx-auto w-full absolute bottom-full mb-2 z-50 bg-popover text-popover-foreground border border-border rounded-xl shadow-xl overflow-hidden max-h-48 overflow-y-auto",children:[s.jsx("div",{className:"p-2 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider border-b",children:"Mentions (@)"}),p&&s.jsxs("button",{type:"button",onClick:()=>fr("Ticket Author",p.user_id,!1),className:"w-full text-left p-2 hover:bg-secondary flex items-center justify-between text-xs",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ia,{className:"h-5 w-5",children:s.jsx($a,{children:"U"})}),s.jsx("span",{className:"font-medium",children:"Ticket Author"})]}),s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["@",p.user_id]})]}),(ee=B==null?void 0:B.roles)==null?void 0:ee.filter(re=>re.name.toLowerCase().includes(ue)).slice(0,5).map(re=>s.jsxs("button",{type:"button",onClick:()=>fr(re.name,re.id,!0),className:"w-full text-left p-2 hover:bg-secondary flex items-center justify-between text-xs",children:[s.jsxs("span",{className:"font-medium text-amber-400",children:["@",re.name]}),s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"Role"})]},re.id))]}),s.jsxs("form",{onSubmit:Ya,className:"max-w-4xl mx-auto w-full flex items-center gap-2",children:[s.jsx("input",{type:"file",ref:ve,multiple:!0,onChange:Tr,className:"hidden",accept:"image/*,video/*,audio/*,.pdf,.zip,.txt,.json"}),s.jsx(he,{type:"button",variant:"outline",size:"sm",onClick:()=>{var re;return(re=ve.current)==null?void 0:re.click()},title:"Attach files or media",className:"h-9 px-2.5",children:s.jsx(ge,{icon:u8,size:16})}),s.jsx(Ie,{value:k,onChange:ti,placeholder:"Type a reply... Use @ to tag roles or users",disabled:M||E,className:"flex-1"}),s.jsx(he,{type:"submit",size:"sm",disabled:M||!k.trim()&&!A.length||E,children:M?s.jsx(ge,{icon:or,size:16,className:"animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(ge,{icon:w8,size:16,className:"mr-1.5"}),"Send"]})})]})]})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Open Tickets"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage open support tickets & reply live to Discord channels from the web dashboard."})]}),s.jsxs(he,{onClick:()=>void le(),disabled:l,variant:"outline",size:"sm",children:[s.jsx(ge,{icon:or,size:16,className:l?"animate-spin mr-2":"mr-2"}),"Refresh"]})]}),s.jsx(Xe,{className:"border-border bg-card",children:s.jsx(Ze,{className:"p-0",children:l?s.jsxs("div",{className:"space-y-4 p-6",children:[s.jsx(Be,{className:"h-12 w-full"}),s.jsx(Be,{className:"h-12 w-full"}),s.jsx(Be,{className:"h-12 w-full"})]}):d?s.jsx("div",{className:"p-6",children:s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:d})})}):e.length===0?s.jsx("div",{className:"p-12 text-center text-muted-foreground",children:"No open tickets at the moment!"}):s.jsx("div",{className:"divide-y divide-border",children:e.map(ee=>s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between p-4 hover:bg-secondary/10 transition-colors gap-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("p",{className:"font-medium text-primary",children:ee.subject||"Untitled Ticket"}),s.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:["#",ee.ticket_id]}),s.jsx(An,{variant:"outline",className:"text-xs capitalize",children:ee.department}),s.jsxs(An,{variant:ee.priority==="high"?"destructive":ee.priority==="medium"?"secondary":"outline",className:"text-xs capitalize",children:[ee.priority," priority"]})]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["User ID: ",s.jsx("span",{className:"font-mono",children:ee.user_id}),ee.description&&` • ${ee.description}`]})]}),s.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto justify-end",children:[s.jsxs("div",{className:"text-sm text-muted-foreground flex items-center whitespace-nowrap mr-2",children:[s.jsx(ge,{icon:i8,size:14,className:"mr-1.5"}),Lo(ee.created_at)]}),s.jsxs(he,{variant:"default",size:"sm",onClick:()=>Mt(ee),className:"bg-primary text-primary-foreground hover:bg-primary/90",children:[s.jsx(ge,{icon:l8,size:16,className:"mr-2"}),"Live Chat"]}),s.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>oe(ee),disabled:V===ee.ticket_id,children:[V===ee.ticket_id?s.jsx(ge,{icon:or,size:14,className:"animate-spin mr-1.5"}):s.jsx(ge,{icon:Zr,size:14,className:"mr-1.5"}),"Close"]}),a&&s.jsx(he,{variant:"secondary",size:"sm",asChild:!0,children:s.jsx("a",{href:`https://discord.com/channels/${a}/${ee.ticket_id}`,target:"_blank",rel:"noreferrer",children:s.jsx(ge,{icon:rd,size:16})})})]})]},ee.ticket_id))})})}),b&&y&&s.jsx("div",{className:"fixed inset-0 z-50 bg-black/65 backdrop-blur-sm flex items-center justify-center p-4 sm:p-6 lg:p-8 animate-in fade-in-0",onClick:ee=>{ee.target===ee.currentTarget&&w(!1)},children:s.jsxs("div",{className:"bg-card text-card-foreground border border-border rounded-2xl shadow-2xl flex flex-col w-full max-w-5xl h-[88vh] overflow-hidden animate-in zoom-in-95",children:[s.jsxs("div",{className:"p-4 border-b border-border bg-secondary/20 flex flex-col space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[s.jsx("h2",{className:"text-lg font-bold tracking-tight truncate",children:(p==null?void 0:p.subject)||"Ticket Live Chat"}),s.jsxs(An,{variant:"outline",className:"font-mono text-xs shrink-0",children:["#",p==null?void 0:p.ticket_id]}),(p==null?void 0:p.department)&&s.jsx(An,{variant:"secondary",className:"text-xs capitalize shrink-0",children:p.department})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[p&&s.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>oe(p),disabled:V===p.ticket_id,className:"h-8 px-2.5 text-xs",children:[V===p.ticket_id?s.jsx(ge,{icon:or,size:14,className:"animate-spin mr-1.5"}):s.jsx(ge,{icon:Zr,size:14,className:"mr-1.5"}),"Close Ticket"]}),s.jsxs(he,{variant:"outline",size:"sm",onClick:()=>w(!1),className:"h-8 px-3 text-xs flex items-center gap-1.5",children:[s.jsx(ge,{icon:h8,size:14}),s.jsx("span",{children:"Collapse"})]}),s.jsx(he,{variant:"ghost",size:"icon",onClick:()=>{g(!1),w(!1)},className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:s.jsx(ge,{icon:Zr,size:18})})]})]}),(p==null?void 0:p.description)&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p.description})]}),pr(),Ht()]})}),b&&!y&&s.jsx(UC,{open:b,onOpenChange:g,children:s.jsxs(bg,{side:"right",className:"w-full sm:max-w-xl p-0 flex flex-col h-full bg-card",children:[s.jsxs(yg,{className:"p-4 border-b border-border space-y-1 bg-secondary/20",children:[s.jsxs("div",{className:"flex items-center justify-between pr-8",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[s.jsx(wg,{className:"text-base font-bold truncate",children:(p==null?void 0:p.subject)||"Ticket Live Chat"}),s.jsxs(An,{variant:"outline",className:"font-mono text-xs shrink-0",children:["#",p==null?void 0:p.ticket_id]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[p&&s.jsxs(he,{variant:"destructive",size:"sm",onClick:()=>oe(p),disabled:V===p.ticket_id,className:"h-7 px-2 text-xs",children:[V===p.ticket_id?s.jsx(ge,{icon:or,size:13,className:"animate-spin mr-1"}):s.jsx(ge,{icon:Zr,size:13,className:"mr-1"}),"Close"]}),s.jsxs(he,{variant:"outline",size:"sm",onClick:()=>w(!0),className:"h-7 px-2 text-xs flex items-center gap-1",title:"Open in Full View",children:[s.jsx(ge,{icon:p8,size:13}),s.jsx("span",{children:"Full View"})]})]})]}),(p==null?void 0:p.description)&&s.jsx(Cg,{className:"text-xs text-muted-foreground truncate",children:p.description})]}),pr(),Ht()]})}),s.jsx(zl,{open:H,onOpenChange:Z,children:s.jsxs(qs,{className:"sm:max-w-md bg-card border-border rounded-xl",children:[s.jsxs(Ks,{children:[s.jsxs(Xs,{className:"text-lg font-bold flex items-center gap-2",children:[s.jsx(ge,{icon:Zr,className:"text-destructive",size:20}),"Close Ticket #",te==null?void 0:te.ticket_id]}),s.jsx(Zs,{className:"text-xs text-muted-foreground pt-1",children:"Are you sure you want to close this ticket? A transcript will be created and the channel will be deleted in Discord."})]}),s.jsxs("div",{className:"space-y-2 py-2",children:[s.jsx("label",{className:"text-xs font-semibold text-foreground",children:"Reason for closing (Optional)"}),s.jsx(Ie,{value:D,onChange:ee=>G(ee.target.value),placeholder:"e.g. Issue resolved by support team",className:"text-sm"})]}),s.jsxs(Pl,{className:"gap-2 sm:gap-0 mt-2",children:[s.jsx(he,{variant:"outline",size:"sm",onClick:()=>Z(!1),disabled:!!V,children:"Cancel"}),s.jsxs(he,{variant:"destructive",size:"sm",onClick:ae,disabled:!!V,children:[V?s.jsx(ge,{icon:or,size:14,className:"animate-spin mr-1.5"}):s.jsx(ge,{icon:Zr,size:14,className:"mr-1.5"}),"Confirm Close"]})]})]})})]})}const _B=["admin","moderator","editor","viewer","custom"];function OB(){return{mode:"add",id:"",username:"",globalName:"",role:"viewer",enabled:!0,permissions:_a("viewer"),yamlOwner:!1}}function DB({permissions:e,onChange:n,disabled:a}){const o=d=>n({...e,...d}),l=[{key:"overview",title:"Dashboard Overview",description:"Access to system metrics, bot health status, and main dashboard stats."},{key:"tickets",title:"Tickets",description:"View open support tickets, live web chat, send staff replies, and close tickets."},{key:"transcripts",title:"Transcripts",description:"Access saved ticket HTML transcripts and configure public transcript options."},{key:"logs",title:"Console Logs",description:"View real-time bot terminal output, system logs, and runtime error traces."}],c=[["supportbot","Bot config","Main bot token, prefix, channels, categories, and core settings."],["ticket-panel","Ticket panel","Ticket home embed, button labels, dropdown options, and panel styling."],["commands","Commands","Enable/disable slash commands, descriptions, and custom names."],["messages","Messages","Custom bot response messages, welcome embeds, and embed colors."],["supportbot-ai","AI assistant","Configure AI support rules, model API keys, and auto-response channels."]];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"General Capabilities"}),s.jsxs("div",{className:"grid gap-2.5",children:[l.map(({key:d,title:m,description:p})=>s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsx(At,{checked:e[d]??(d==="tickets"?e.overview:!1),disabled:a,onCheckedChange:h=>o({[d]:h}),className:"shrink-0"})]},d)),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View system branding, OAuth configurations, and system health details."})]}),s.jsx(At,{checked:e.settings.view,disabled:a,onCheckedChange:d=>o({settings:{...e.settings,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (Install Updates)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Perform 1-click bot system updates and trigger bot server restarts."})]}),s.jsx(At,{checked:e.settings.update,disabled:a,onCheckedChange:d=>o({settings:{...e.settings,update:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View dashboard staff accounts and permission group listings."})]}),s.jsx(At,{checked:e.users.view,disabled:a,onCheckedChange:d=>o({users:{...e.users,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (Manage)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Create, edit, assign, and delete staff accounts and permission groups."})]}),s.jsx(At,{checked:e.users.manage,disabled:a,onCheckedChange:d=>o({users:{...e.users,manage:d}}),className:"shrink-0"})]})]})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Configuration Files Access"}),s.jsx("div",{className:"grid gap-2.5",children:c.map(([d,m,p])=>{var b;const h=((b=e.configs)==null?void 0:b[d])??{view:!1,edit:!1};return s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"View"}),s.jsx(At,{checked:h.view,disabled:a,onCheckedChange:g=>o({configs:{...e.configs,[d]:{...h,view:g}}})})]}),s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"Edit"}),s.jsx(At,{checked:h.edit,disabled:a,onCheckedChange:g=>o({configs:{...e.configs,[d]:{...h,edit:g,view:g?!0:h.view}}})})]})]})]},d)})})]})]})}function LB(e){return e.permissions.users.manage?"Full + user management":e.permissions.settings.update?"Configs + settings updates":Object.values(e.permissions.configs).some(n=>n.edit)?"Can edit configs":"View only"}function zB(){const{user:e,hasPermission:n}=Ut(),a=n("users.manage"),[o,l]=f.useState([]),[c,d]=f.useState([]),[m,p]=f.useState(!0),[h,b]=f.useState(""),[g,y]=f.useState(null),[w,j]=f.useState(!1),S=f.useCallback(async()=>{p(!0),b("");try{const[M,z]=await Promise.all([Ee.listDashboardUsers(),Ee.listGroups().catch(()=>({data:{groups:[]}}))]);M.data&&l(M.data.users),z.data&&d(z.data.groups)}catch(M){b(M instanceof Error?M.message:"Failed to load users")}finally{p(!1)}},[]);f.useEffect(()=>{S()},[S]);const E=f.useMemo(()=>[...o].sort((M,z)=>M.yamlOwner!==z.yamlOwner?M.yamlOwner?-1:1:(M.username||M.id).localeCompare(z.username||z.id)),[o]);function N(){y(OB())}function k(M){y({mode:"edit",id:M.id,username:M.username||"",globalName:M.globalName||"",role:M.yamlOwner?"owner":M.role,enabled:M.enabled,permissions:M.role==="custom"?M.permissions:_a(M.role),yamlOwner:M.yamlOwner})}function T(M){g&&y({...g,role:M,permissions:_a(M,g.permissions)})}async function A(){if(!(!g||!a)){j(!0),b("");try{g.mode==="add"?await Ee.addDashboardUser({id:g.id.trim(),role:g.role,username:g.username||void 0,globalName:g.globalName||void 0,enabled:g.enabled,permissions:g.role==="custom"?g.permissions:void 0}):await Ee.updateDashboardUser(g.id,{role:g.yamlOwner?void 0:g.role,enabled:g.enabled,username:g.username||void 0,globalName:g.globalName||void 0,permissions:g.role==="custom"?g.permissions:void 0}),y(null),await S()}catch(M){b(M instanceof Error?M.message:"Could not save user")}finally{j(!1)}}}async function O(M){if(a&&window.confirm("Remove this user from the dashboard?")){b("");try{await Ee.removeDashboardUser(M),await S()}catch(z){b(z instanceof Error?z.message:"Could not remove user")}}}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Users"}),s.jsxs("p",{className:"text-muted-foreground",children:["Control who can sign in and what they can view or edit. Owners in"," ",s.jsx("code",{className:"rounded bg-primary/10 px-1 text-xs text-primary",children:"api.yml"})," ","always have full access."]})]}),a?s.jsxs(he,{onClick:N,children:[s.jsx(ge,{icon:Z0,size:16,className:"mr-2"}),"Add user"]}):null]}),h?s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:h})}):null,s.jsx(Xe,{className:"border-border bg-card overflow-hidden",children:s.jsx(Ze,{className:"p-0",children:m?s.jsxs("div",{className:"p-4 space-y-2",children:[s.jsx(Be,{className:"h-8 w-full rounded-md"}),s.jsx(Be,{className:"h-8 w-full rounded-md"})]}):E.length===0?s.jsx("div",{className:"p-6 text-center text-xs text-muted-foreground",children:"No users found."}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border/80 bg-secondary/30 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-2.5",children:"User"}),s.jsx("th",{className:"px-4 py-2.5",children:"Group"}),s.jsx("th",{className:"px-4 py-2.5",children:"Access Summary"}),s.jsx("th",{className:"px-4 py-2.5",children:"Status"}),a&&s.jsx("th",{className:"px-4 py-2.5 text-right",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-border/40",children:E.map(M=>{const z=c.find(U=>U.id===M.groupId||U.id===M.role),B=(z==null?void 0:z.color)||"#10B981",K=(z==null?void 0:z.name)||sy[M.yamlOwner?"owner":M.role]||M.role;return s.jsxs("tr",{className:"transition-colors hover:bg-secondary/25",children:[s.jsx("td",{className:"px-4 py-2.5 font-medium whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsxs(Ia,{className:"size-7",children:[s.jsx(Co,{src:M.avatar,alt:M.username}),s.jsx($a,{className:"text-[10px]",children:(M.username||M.id).slice(0,2).toUpperCase()})]}),s.jsxs("div",{className:"min-w-0 leading-tight",children:[s.jsxs("p",{className:"truncate font-semibold text-foreground text-xs",children:[l2(M),M.id===(e==null?void 0:e.id)?s.jsx("span",{className:"text-[11px] text-primary font-normal ml-1",children:"(you)"}):""]}),s.jsx("p",{className:"truncate text-[10px] text-muted-foreground font-mono",children:M.id})]})]})}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full shrink-0 shadow-sm",style:{backgroundColor:B}}),s.jsx("span",{className:"font-medium text-xs text-foreground",children:K}),M.yamlOwner&&s.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20",children:"Config Owner"})]})}),s.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground max-w-xs truncate",children:LB(M)}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:M.enabled?s.jsx(An,{className:"text-[10px] px-2 py-0.5 bg-emerald-500/15 text-emerald-400 hover:bg-emerald-500/15 border-emerald-500/20",children:"Active"}):s.jsx(An,{variant:"outline",className:"text-[10px] px-2 py-0.5",children:"Disabled"})}),a&&s.jsx("td",{className:"px-4 py-2.5 text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>k(M),children:[s.jsx(ge,{icon:c8,size:13}),"Edit"]}),!M.yamlOwner&&s.jsxs(he,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-destructive",onClick:()=>O(M.id),children:[s.jsx(ge,{icon:wl,size:13}),"Remove"]})]})})]},M.id)})})]})})})}),s.jsx(zl,{open:!!g,onOpenChange:M=>!M&&y(null),children:s.jsxs(qs,{className:"max-h-[90vh] max-w-lg overflow-y-auto",children:[s.jsxs(Ks,{children:[s.jsx(Xs,{children:(g==null?void 0:g.mode)==="add"?"Add dashboard user":"Edit user"}),s.jsx(Zs,{children:g!=null&&g.yamlOwner?"This user is an owner in api.yml. Role and removal are managed in the config file.":k8[(g==null?void 0:g.role)??"viewer"]})]}),g?s.jsxs("div",{className:"space-y-4",children:[g.mode==="add"?s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"discord-id",children:"Discord user ID"}),s.jsx(Ie,{id:"discord-id",value:g.id,onChange:M=>y({...g,id:M.target.value}),placeholder:"829112572816130058"})]}):null,s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Display name (optional)"}),s.jsx(Ie,{value:g.globalName,onChange:M=>y({...g,globalName:M.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Username (optional)"}),s.jsx(Ie,{value:g.username,onChange:M=>y({...g,username:M.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{children:"Permission Group"}),s.jsxs(No,{value:g.role,disabled:g.yamlOwner,onValueChange:M=>{const z=c.find(B=>B.id===M);z?y({...g,role:M,permissions:z.permissions}):T(M)},children:[s.jsx(Ba,{children:s.jsx(Eo,{})}),s.jsx(Ua,{children:g.yamlOwner?s.jsx(an,{value:"owner",children:"Owner"}):c.length>0?c.map(M=>s.jsx(an,{value:M.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-2.5 rounded-full shrink-0",style:{backgroundColor:M.color||"#10B981"}}),s.jsx("span",{children:M.name})]})},M.id)):_B.map(M=>s.jsx(an,{value:M,children:sy[M]},M))})]})]}),s.jsxs("label",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2",children:[s.jsx("span",{className:"text-sm",children:"Account enabled"}),s.jsx(At,{checked:g.enabled,disabled:g.yamlOwner,onCheckedChange:M=>y({...g,enabled:M})})]}),g.role==="custom"&&!g.yamlOwner?s.jsx(DB,{permissions:g.permissions,onChange:M=>y({...g,permissions:M})}):null]}):null,s.jsxs(Pl,{children:[s.jsx(he,{variant:"outline",onClick:()=>y(null),children:"Cancel"}),s.jsx(he,{disabled:w||!a||(g==null?void 0:g.mode)==="add"&&!/^\d{17,20}$/.test(g.id.trim()),onClick:()=>void A(),children:w?"Saving…":"Save"})]})]})})]})}const PB=[{name:"Emerald",hex:"#10B981"},{name:"Blue",hex:"#3B82F6"},{name:"Purple",hex:"#8B5CF6"},{name:"Amber",hex:"#F59E0B"},{name:"Red",hex:"#EF4444"},{name:"Cyan",hex:"#06B6D4"},{name:"Gray",hex:"#6B7280"}];function IB({permissions:e,onChange:n,disabled:a}){const o=d=>n({...e,...d}),l=[{key:"overview",title:"Dashboard Overview",description:"Access to system metrics, bot health status, and main dashboard stats."},{key:"tickets",title:"Tickets",description:"View open support tickets, live web chat, send staff replies, and close tickets."},{key:"transcripts",title:"Transcripts",description:"Access saved ticket HTML transcripts and configure public transcript options."},{key:"logs",title:"Console Logs",description:"View real-time bot terminal output, system logs, and runtime error traces."}],c=[["supportbot","Bot config","Main bot token, prefix, channels, categories, and core settings."],["ticket-panel","Ticket panel","Ticket home embed, button labels, dropdown options, and panel styling."],["commands","Commands","Enable/disable slash commands, descriptions, and custom names."],["messages","Messages","Custom bot response messages, welcome embeds, and embed colors."],["supportbot-ai","AI assistant","Configure AI support rules, model API keys, and auto-response channels."]];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"General Capabilities"}),s.jsxs("div",{className:"grid gap-2.5",children:[l.map(({key:d,title:m,description:p})=>s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsx(At,{checked:e[d]??(d==="tickets"?e.overview:!1),disabled:a,onCheckedChange:h=>o({[d]:h}),className:"shrink-0"})]},d)),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View system branding, OAuth configurations, and system health details."})]}),s.jsx(At,{checked:e.settings.view,disabled:a,onCheckedChange:d=>o({settings:{...e.settings,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Settings (Install Updates)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Perform 1-click bot system updates and trigger bot server restarts."})]}),s.jsx(At,{checked:e.settings.update,disabled:a,onCheckedChange:d=>o({settings:{...e.settings,update:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (View)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"View dashboard staff accounts and permission group listings."})]}),s.jsx(At,{checked:e.users.view,disabled:a,onCheckedChange:d=>o({users:{...e.users,view:d}}),className:"shrink-0"})]}),s.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Users & Groups (Manage)"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Create, edit, assign, and delete staff accounts and permission groups."})]}),s.jsx(At,{checked:e.users.manage,disabled:a,onCheckedChange:d=>o({users:{...e.users,manage:d}}),className:"shrink-0"})]})]})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Configuration Files Access"}),s.jsx("div",{className:"grid gap-2.5",children:c.map(([d,m,p])=>{var b;const h=((b=e.configs)==null?void 0:b[d])??{view:!1,edit:!1};return s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-border bg-secondary/20 p-3 transition-colors hover:bg-secondary/40",children:[s.jsxs("div",{className:"space-y-0.5 min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold text-foreground",children:m}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:p})]}),s.jsxs("div",{className:"flex items-center gap-4 shrink-0",children:[s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"View"}),s.jsx(At,{checked:h.view,disabled:a,onCheckedChange:g=>o({configs:{...e.configs,[d]:{...h,view:g}}})})]}),s.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground cursor-pointer",children:[s.jsx("span",{children:"Edit"}),s.jsx(At,{checked:h.edit,disabled:a,onCheckedChange:g=>o({configs:{...e.configs,[d]:{...h,edit:g,view:g?!0:h.view}}})})]})]})]},d)})})]})]})}function $B(){const{impersonateGroup:e,impersonatedGroup:n,stopImpersonation:a}=Ut(),[o,l]=f.useState([]),[c,d]=f.useState(!0),[m,p]=f.useState(null),[h,b]=f.useState(null),[g,y]=f.useState(!1),[w,j]=f.useState("add"),[S,E]=f.useState(!1),[N,k]=f.useState(""),[T,A]=f.useState(""),[O,M]=f.useState(""),[z,B]=f.useState("#10B981"),[K,U]=f.useState(""),[q,ue]=f.useState(_a("viewer")),pe=async()=>{var H;d(!0),p(null);try{const Z=await Ee.listGroups();l(((H=Z.data)==null?void 0:H.groups)||[])}catch(Z){p(Z instanceof Error?Z.message:"Failed to load groups")}finally{d(!1)}};f.useEffect(()=>{pe()},[]);const xe=()=>{j("add"),k(""),A(""),M(""),B("#10B981"),U(""),ue(_a("viewer")),y(!0)},se=H=>{j("edit"),k(H.id),A(H.name),M(H.description||""),B(H.color||"#10B981"),U(H.discordRoleId||""),ue(H.permissions||_a("viewer")),y(!0)},L=async()=>{if(!T.trim()){p("Group name is required");return}E(!0),p(null);try{w==="add"?(await Ee.createGroup({name:T.trim(),description:O.trim(),color:z,discordRoleId:K.trim()||null,permissions:q}),b(`Group "${T}" created successfully.`)):(await Ee.updateGroup(N,{name:T.trim(),description:O.trim(),color:z,discordRoleId:K.trim()||null,permissions:q}),b(`Group "${T}" updated successfully.`)),y(!1),await pe()}catch(H){p(H instanceof Error?H.message:"Failed to save group")}finally{E(!1)}},I=async H=>{if(!H.isSystem&&confirm(`Are you sure you want to delete the group "${H.name}"?`))try{await Ee.deleteGroup(H.id),b(`Group "${H.name}" deleted.`),await pe()}catch(Z){p(Z instanceof Error?Z.message:"Failed to delete group")}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Permission Groups"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Create custom permission groups, assign staff members, and optionally sync with Discord Role IDs."})]}),s.jsxs(he,{onClick:xe,className:"shrink-0 gap-2 bg-primary",children:[s.jsx(ge,{icon:Z0,size:18}),"Create Group"]})]}),m&&s.jsx(We,{variant:"destructive",children:s.jsx(Ye,{children:m})}),h&&s.jsx(We,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-500",children:s.jsxs(Ye,{className:"flex items-center justify-between",children:[s.jsx("span",{children:h}),s.jsx(he,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>b(null),children:"Dismiss"})]})}),s.jsx(Xe,{className:"border-border bg-card overflow-hidden",children:s.jsx(Ze,{className:"p-0",children:c?s.jsxs("div",{className:"p-4 space-y-2",children:[s.jsx(Be,{className:"h-8 w-full rounded-md"}),s.jsx(Be,{className:"h-8 w-full rounded-md"})]}):o.length===0?s.jsx("div",{className:"p-6 text-center text-xs text-muted-foreground",children:'No permission groups found. Click "Create Group" to add one.'}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border/80 bg-secondary/30 text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-2.5",children:"Group"}),s.jsx("th",{className:"px-4 py-2.5",children:"Description"}),s.jsx("th",{className:"px-4 py-2.5",children:"Discord Role ID"}),s.jsx("th",{className:"px-4 py-2.5",children:"Enabled Permissions"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-border/40",children:o.map(H=>{var Z,te,_,D,G,V,F;return s.jsxs("tr",{className:"transition-colors hover:bg-secondary/25",children:[s.jsx("td",{className:"px-4 py-2.5 font-medium whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"size-2.5 rounded-full shrink-0 shadow-sm",style:{backgroundColor:H.color||"#10B981"}}),s.jsx("span",{className:"text-foreground font-semibold text-xs",children:H.name}),H.isSystem&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold px-1.5 py-0.5 rounded-full bg-secondary text-secondary-foreground border border-border/80",children:[s.jsx(ge,{icon:bu,size:10}),"System"]})]})}),s.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground max-w-xs truncate",children:H.description||"—"}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:H.discordRoleId?s.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground font-mono bg-secondary/50 px-2 py-0.5 rounded border border-border/50",children:[s.jsx(ge,{icon:bu,size:12,className:"text-primary"}),H.discordRoleId]}):s.jsx("span",{className:"text-xs text-muted-foreground/60",children:"—"})}),s.jsx("td",{className:"px-4 py-2.5",children:s.jsxs("div",{className:"flex flex-wrap gap-1 max-w-md",children:[((Z=H.permissions)==null?void 0:Z.overview)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20",children:"Overview"}),(((te=H.permissions)==null?void 0:te.tickets)??((_=H.permissions)==null?void 0:_.overview))&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:"Tickets"}),((D=H.permissions)==null?void 0:D.transcripts)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-400 border border-purple-500/20",children:"Transcripts"}),((G=H.permissions)==null?void 0:G.logs)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20",children:"Logs"}),((F=(V=H.permissions)==null?void 0:V.users)==null?void 0:F.manage)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20",children:"User Mgmt"})]})}),s.jsx("td",{className:"px-4 py-2.5 text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"ghost",className:`h-7 px-2 text-xs gap-1 ${(n==null?void 0:n.id)===H.id?"text-amber-400 font-bold bg-amber-500/15 border border-amber-500/30":"text-amber-400 hover:text-amber-300 hover:bg-amber-500/10"}`,onClick:()=>(n==null?void 0:n.id)===H.id?a():e(H.id),children:[s.jsx(ge,{icon:bu,size:13}),(n==null?void 0:n.id)===H.id?"Active Preview":"View as Group"]}),!H.isSystem&&s.jsxs(s.Fragment,{children:[s.jsxs(he,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>se(H),children:[s.jsx(ge,{icon:a2,size:13}),"Edit"]}),s.jsxs(he,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-destructive",onClick:()=>I(H),children:[s.jsx(ge,{icon:wl,size:13}),"Delete"]})]})]})})]},H.id)})})]})})})}),s.jsx(zl,{open:g,onOpenChange:y,children:s.jsxs(qs,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(Ks,{children:[s.jsx(Xs,{children:w==="add"?"Create Permission Group":`Edit Group: ${T}`}),s.jsx(Zs,{children:"Configure group metadata, custom color badge, Discord role sync, and permission rules."})]}),s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"group-name",children:"Group Name"}),s.jsx(Ie,{id:"group-name",placeholder:"e.g. Support Staff",value:T,onChange:H=>A(H.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"group-color",children:"Color Badge"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Id,{value:z,onChange:B}),s.jsx(Ie,{value:z,onChange:H=>B(H.target.value),placeholder:"#10B981",className:"w-28 font-mono text-sm uppercase"}),s.jsx("div",{className:"flex flex-wrap gap-1 ml-auto",children:PB.map(H=>s.jsx("button",{type:"button",className:"size-6 rounded-full border border-white/20 transition-transform hover:scale-110",style:{backgroundColor:H.hex},onClick:()=>B(H.hex),title:H.name},H.hex))})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"group-desc",children:"Description"}),s.jsx(Ie,{id:"group-desc",placeholder:"Brief description of what members in this group can access...",value:O,onChange:H=>M(H.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"discord-role-id",children:"Discord Role ID (Optional Auto-Sync)"}),s.jsx(Ie,{id:"discord-role-id",placeholder:"e.g. 123456789012345678",value:K,onChange:H=>U(H.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"If provided, Discord users with this Role ID will automatically inherit this group upon login."})]}),s.jsxs("div",{className:"pt-2",children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Group Permission Matrix"}),s.jsx(IB,{permissions:q,onChange:ue})]})]}),s.jsxs(Pl,{className:"gap-2 sm:gap-0",children:[s.jsx(he,{variant:"outline",onClick:()=>y(!1),disabled:S,children:"Cancel"}),s.jsx(he,{onClick:L,disabled:S,className:"bg-primary",children:S?"Saving...":w==="add"?"Create Group":"Save Changes"})]})]})})]})}function BB({children:e}){const{isAuthenticated:n,loading:a}=Ut();return a?s.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):n?s.jsx(s.Fragment,{children:e}):s.jsx(Qr,{to:"/login",replace:!0})}function UB(){const{complete:e,loading:n}=Pj(),a=Ln();return n?s.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):e?a.pathname==="/setup"?s.jsx(Qr,{to:"/login",replace:!0}):s.jsxs(ny,{children:[s.jsx(rn,{path:"/login",element:s.jsx(T$,{})}),s.jsxs(rn,{element:s.jsx(BB,{children:s.jsx(ND,{})}),children:[s.jsx(rn,{index:!0,element:s.jsx(Q$,{})}),s.jsx(rn,{path:"system",element:s.jsx(Kr,{permission:"overview",children:s.jsx(mB,{})})}),s.jsx(rn,{path:"settings",element:s.jsx(Kr,{permission:"settings.view",children:s.jsx(uB,{})})}),s.jsx(rn,{path:"configs",element:s.jsx(N$,{})}),s.jsx(rn,{path:"logs",element:s.jsx(Kr,{permission:"logs",children:s.jsx(wB,{})})}),s.jsx(rn,{path:"tickets",element:s.jsx(Kr,{permission:"transcripts",children:s.jsx(MB,{})})}),s.jsx(rn,{path:"transcripts",element:s.jsx(Kr,{permission:"transcripts",children:s.jsx(AB,{})})}),s.jsx(rn,{path:"users",element:s.jsx(Kr,{permission:"users.view",children:s.jsx(zB,{})})}),s.jsx(rn,{path:"groups",element:s.jsx(Kr,{permission:"users.view",children:s.jsx($B,{})})}),s.jsx(rn,{path:"addons",element:s.jsx(Kr,{permission:"settings.view",children:s.jsx(J$,{})})}),s.jsx(rn,{path:"addons/builder",element:s.jsx(Kr,{permission:"settings.update",children:s.jsx(eB,{})})})]}),s.jsx(rn,{path:"*",element:s.jsx(Qr,{to:"/",replace:!0})})]}):s.jsxs(ny,{children:[s.jsx(rn,{path:"/setup",element:s.jsx(V$,{})}),s.jsx(rn,{path:"*",element:s.jsx(Qr,{to:"/setup",replace:!0})})]})}function HB({...e}){return s.jsx(aI,{theme:"dark",position:"bottom-right",richColors:!0,closeButton:!0,style:{fontFamily:'"Poppins", system-ui, sans-serif'},toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-card group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground"}},...e})}oB();E3.createRoot(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(ZE,{children:s.jsx(tS,{children:s.jsx(M8,{children:s.jsx(ED,{children:s.jsxs(A8,{children:[s.jsx(UB,{}),s.jsx(HB,{})]})})})})})}));