181 lines
824 KiB
JavaScript
181 lines
824 KiB
JavaScript
var w3=Object.defineProperty;var xy=t=>{throw TypeError(t)};var j3=(t,n,a)=>n in t?w3(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a;var vy=(t,n,a)=>j3(t,typeof n!="symbol"?n+"":n,a),by=(t,n,a)=>n.has(t)||xy("Cannot "+a);var pn=(t,n,a)=>(by(t,n,"read from private field"),a?a.call(t):n.get(t)),yy=(t,n,a)=>n.has(t)?xy("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,a),dp=(t,n,a,o)=>(by(t,n,"write to private field"),o?o.call(t,a):n.set(t,a),a);function C3(t,n){for(var a=0;a<n.length;a++){const o=n[a];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in t)){const l=Object.getOwnPropertyDescriptor(o,c);l&&Object.defineProperty(t,c,l.get?l:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const l of c)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function a(c){const l={};return c.integrity&&(l.integrity=c.integrity),c.referrerPolicy&&(l.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?l.credentials="include":c.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(c){if(c.ep)return;c.ep=!0;const l=a(c);fetch(c.href,l)}})();function s2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fp={exports:{}},Sl={};/**
|
||
* @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 wy;function S3(){if(wy)return Sl;wy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,c,l){var d=null;if(l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),"key"in c){l={};for(var m in c)m!=="key"&&(l[m]=c[m])}else l=c;return c=l.ref,{$$typeof:t,type:o,key:d,ref:c!==void 0?c:null,props:l}}return Sl.Fragment=n,Sl.jsx=a,Sl.jsxs=a,Sl}var jy;function N3(){return jy||(jy=1,fp.exports=S3()),fp.exports}var s=N3(),mp={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 Cy;function E3(){if(Cy)return Pe;Cy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),w=Symbol.iterator;function y(O){return O===null||typeof O!="object"?null:(O=w&&O[w]||O["@@iterator"],typeof O=="function"?O:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function k(O,D,$){this.props=O,this.context=D,this.refs=E,this.updater=$||C}k.prototype.isReactComponent={},k.prototype.setState=function(O,D){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,D,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function N(){}N.prototype=k.prototype;function T(O,D,$){this.props=O,this.context=D,this.refs=E,this.updater=$||C}var M=T.prototype=new N;M.constructor=T,S(M,k.prototype),M.isPureReactComponent=!0;var _=Array.isArray;function R(){}var L={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function K(O,D,$){var H=$.ref;return{$$typeof:t,type:O,key:D,ref:H!==void 0?H:null,props:$}}function I(O,D){return K(O.type,D,O.props)}function G(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function Y(O){var D={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function($){return D[$]})}var ce=/\/+/g;function fe(O,D){return typeof O=="object"&&O!==null&&O.key!=null?Y(""+O.key):D.toString(36)}function se(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(R,R):(O.status="pending",O.then(function(D){O.status==="pending"&&(O.status="fulfilled",O.value=D)},function(D){O.status==="pending"&&(O.status="rejected",O.reason=D)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function P(O,D,$,H,X){var xe=typeof O;(xe==="undefined"||xe==="boolean")&&(O=null);var q=!1;if(O===null)q=!0;else switch(xe){case"bigint":case"string":case"number":q=!0;break;case"object":switch(O.$$typeof){case t:case n:q=!0;break;case v:return q=O._init,P(q(O._payload),D,$,H,X)}}if(q)return X=X(O),q=H===""?"."+fe(O,0):H,_(X)?($="",q!=null&&($=q.replace(ce,"$&/")+"/"),P(X,D,$,"",function(B){return B})):X!=null&&(G(X)&&(X=I(X,$+(X.key==null||O&&O.key===X.key?"":(""+X.key).replace(ce,"$&/")+"/")+q)),D.push(X)),1;q=0;var ge=H===""?".":H+":";if(_(O))for(var me=0;me<O.length;me++)H=O[me],xe=ge+fe(H,me),q+=P(H,D,$,xe,X);else if(me=y(O),typeof me=="function")for(O=me.call(O),me=0;!(H=O.next()).done;)H=H.value,xe=ge+fe(H,me++),q+=P(H,D,$,xe,X);else if(xe==="object"){if(typeof O.then=="function")return P(se(O),D,$,H,X);throw D=String(O),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return q}function Z(O,D,$){if(O==null)return O;var H=[],X=0;return P(O,H,"","",function(xe){return D.call($,xe,X++)}),H}function ae(O){if(O._status===-1){var D=O._result;D=D(),D.then(function($){(O._status===0||O._status===-1)&&(O._status=1,O._result=$)},function($){(O._status===0||O._status===-1)&&(O._status=2,O._result=$)}),O._status===-1&&(O._status=0,O._result=D)}if(O._status===1)return O._result.default;throw O._result}var re=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},V={map:Z,forEach:function(O,D,$){Z(O,function(){D.apply(this,arguments)},$)},count:function(O){var D=0;return Z(O,function(){D++}),D},toArray:function(O){return Z(O,function(D){return D})||[]},only:function(O){if(!G(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Pe.Activity=b,Pe.Children=V,Pe.Component=k,Pe.Fragment=a,Pe.Profiler=c,Pe.PureComponent=T,Pe.StrictMode=o,Pe.Suspense=p,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return L.H.useMemoCache(O)}},Pe.cache=function(O){return function(){return O.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(O,D,$){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var H=S({},O.props),X=O.key;if(D!=null)for(xe in D.key!==void 0&&(X=""+D.key),D)!te.call(D,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&D.ref===void 0||(H[xe]=D[xe]);var xe=arguments.length-2;if(xe===1)H.children=$;else if(1<xe){for(var q=Array(xe),ge=0;ge<xe;ge++)q[ge]=arguments[ge+2];H.children=q}return K(O.type,X,H)},Pe.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},Pe.createElement=function(O,D,$){var H,X={},xe=null;if(D!=null)for(H in D.key!==void 0&&(xe=""+D.key),D)te.call(D,H)&&H!=="key"&&H!=="__self"&&H!=="__source"&&(X[H]=D[H]);var q=arguments.length-2;if(q===1)X.children=$;else if(1<q){for(var ge=Array(q),me=0;me<q;me++)ge[me]=arguments[me+2];X.children=ge}if(O&&O.defaultProps)for(H in q=O.defaultProps,q)X[H]===void 0&&(X[H]=q[H]);return K(O,xe,X)},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(O){return{$$typeof:m,render:O}},Pe.isValidElement=G,Pe.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:ae}},Pe.memo=function(O,D){return{$$typeof:g,type:O,compare:D===void 0?null:D}},Pe.startTransition=function(O){var D=L.T,$={};L.T=$;try{var H=O(),X=L.S;X!==null&&X($,H),typeof H=="object"&&H!==null&&typeof H.then=="function"&&H.then(R,re)}catch(xe){re(xe)}finally{D!==null&&$.types!==null&&(D.types=$.types),L.T=D}},Pe.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Pe.use=function(O){return L.H.use(O)},Pe.useActionState=function(O,D,$){return L.H.useActionState(O,D,$)},Pe.useCallback=function(O,D){return L.H.useCallback(O,D)},Pe.useContext=function(O){return L.H.useContext(O)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(O,D){return L.H.useDeferredValue(O,D)},Pe.useEffect=function(O,D){return L.H.useEffect(O,D)},Pe.useEffectEvent=function(O){return L.H.useEffectEvent(O)},Pe.useId=function(){return L.H.useId()},Pe.useImperativeHandle=function(O,D,$){return L.H.useImperativeHandle(O,D,$)},Pe.useInsertionEffect=function(O,D){return L.H.useInsertionEffect(O,D)},Pe.useLayoutEffect=function(O,D){return L.H.useLayoutEffect(O,D)},Pe.useMemo=function(O,D){return L.H.useMemo(O,D)},Pe.useOptimistic=function(O,D){return L.H.useOptimistic(O,D)},Pe.useReducer=function(O,D,$){return L.H.useReducer(O,D,$)},Pe.useRef=function(O){return L.H.useRef(O)},Pe.useState=function(O){return L.H.useState(O)},Pe.useSyncExternalStore=function(O,D,$){return L.H.useSyncExternalStore(O,D,$)},Pe.useTransition=function(){return L.H.useTransition()},Pe.version="19.2.8",Pe}var Sy;function Xh(){return Sy||(Sy=1,mp.exports=E3()),mp.exports}var f=Xh();const be=s2(f),xi=C3({__proto__:null,default:be},[f]);var pp={exports:{}},Nl={},hp={exports:{}},gp={};/**
|
||
* @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 Ny;function k3(){return Ny||(Ny=1,(function(t){function n(P,Z){var ae=P.length;P.push(Z);e:for(;0<ae;){var re=ae-1>>>1,V=P[re];if(0<c(V,Z))P[re]=Z,P[ae]=V,ae=re;else break e}}function a(P){return P.length===0?null:P[0]}function o(P){if(P.length===0)return null;var Z=P[0],ae=P.pop();if(ae!==Z){P[0]=ae;e:for(var re=0,V=P.length,O=V>>>1;re<O;){var D=2*(re+1)-1,$=P[D],H=D+1,X=P[H];if(0>c($,ae))H<V&&0>c(X,$)?(P[re]=X,P[H]=ae,re=H):(P[re]=$,P[D]=ae,re=D);else if(H<V&&0>c(X,ae))P[re]=X,P[H]=ae,re=H;else break e}}return Z}function c(P,Z){var ae=P.sortIndex-Z.sortIndex;return ae!==0?ae:P.id-Z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var d=Date,m=d.now();t.unstable_now=function(){return d.now()-m}}var p=[],g=[],v=1,b=null,w=3,y=!1,C=!1,S=!1,E=!1,k=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function M(P){for(var Z=a(g);Z!==null;){if(Z.callback===null)o(g);else if(Z.startTime<=P)o(g),Z.sortIndex=Z.expirationTime,n(p,Z);else break;Z=a(g)}}function _(P){if(S=!1,M(P),!C)if(a(p)!==null)C=!0,R||(R=!0,Y());else{var Z=a(g);Z!==null&&se(_,Z.startTime-P)}}var R=!1,L=-1,te=5,K=-1;function I(){return E?!0:!(t.unstable_now()-K<te)}function G(){if(E=!1,R){var P=t.unstable_now();K=P;var Z=!0;try{e:{C=!1,S&&(S=!1,N(L),L=-1),y=!0;var ae=w;try{t:{for(M(P),b=a(p);b!==null&&!(b.expirationTime>P&&I());){var re=b.callback;if(typeof re=="function"){b.callback=null,w=b.priorityLevel;var V=re(b.expirationTime<=P);if(P=t.unstable_now(),typeof V=="function"){b.callback=V,M(P),Z=!0;break t}b===a(p)&&o(p),M(P)}else o(p);b=a(p)}if(b!==null)Z=!0;else{var O=a(g);O!==null&&se(_,O.startTime-P),Z=!1}}break e}finally{b=null,w=ae,y=!1}Z=void 0}}finally{Z?Y():R=!1}}}var Y;if(typeof T=="function")Y=function(){T(G)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,fe=ce.port2;ce.port1.onmessage=G,Y=function(){fe.postMessage(null)}}else Y=function(){k(G,0)};function se(P,Z){L=k(function(){P(t.unstable_now())},Z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function(P){switch(w){case 1:case 2:case 3:var Z=3;break;default:Z=w}var ae=w;w=Z;try{return P()}finally{w=ae}},t.unstable_requestPaint=function(){E=!0},t.unstable_runWithPriority=function(P,Z){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var ae=w;w=P;try{return Z()}finally{w=ae}},t.unstable_scheduleCallback=function(P,Z,ae){var re=t.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?re+ae:re):ae=re,P){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=ae+V,P={id:v++,callback:Z,priorityLevel:P,startTime:ae,expirationTime:V,sortIndex:-1},ae>re?(P.sortIndex=ae,n(g,P),a(p)===null&&P===a(g)&&(S?(N(L),L=-1):S=!0,se(_,ae-re))):(P.sortIndex=V,n(p,P),C||y||(C=!0,R||(R=!0,Y()))),P},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(P){var Z=w;return function(){var ae=w;w=Z;try{return P.apply(this,arguments)}finally{w=ae}}}})(gp)),gp}var Ey;function T3(){return Ey||(Ey=1,hp.exports=k3()),hp.exports}var xp={exports:{}},hn={};/**
|
||
* @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 ky;function M3(){if(ky)return hn;ky=1;var t=Xh();function n(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+g+" 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},c=Symbol.for("react.portal");function l(p,g,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:b==null?null:""+b,children:p,containerInfo:g,implementation:v}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,hn.createPortal=function(p,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(n(299));return l(p,g,null,v)},hn.flushSync=function(p){var g=d.T,v=o.p;try{if(d.T=null,o.p=2,p)return p()}finally{d.T=g,o.p=v,o.d.f()}},hn.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(p,g))},hn.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},hn.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var v=g.as,b=m(v,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,y=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?o.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:b,integrity:w,fetchPriority:y}):v==="script"&&o.d.X(p,{crossOrigin:b,integrity:w,fetchPriority:y,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},hn.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=m(g.as,g.crossOrigin);o.d.M(p,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(p)},hn.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,b=m(v,g.crossOrigin);o.d.L(p,v,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},hn.preloadModule=function(p,g){if(typeof p=="string")if(g){var v=m(g.as,g.crossOrigin);o.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(p)},hn.requestFormReset=function(p){o.d.r(p)},hn.unstable_batchedUpdates=function(p,g){return p(g)},hn.useFormState=function(p,g,v){return d.H.useFormState(p,g,v)},hn.useFormStatus=function(){return d.H.useHostTransitionStatus()},hn.version="19.2.8",hn}var Ty;function o2(){if(Ty)return xp.exports;Ty=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),xp.exports=M3(),xp.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 My;function R3(){if(My)return Nl;My=1;var t=T3(),n=Xh(),a=o2();function o(e){var r="https://react.dev/errors/"+e;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 #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var r=e,i=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(i=r.return),e=r.return;while(e)}return r.tag===3?i:null}function d(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function m(e){if(e.tag===31){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function p(e){if(l(e)!==e)throw Error(o(188))}function g(e){var r=e.alternate;if(!r){if(r=l(e),r===null)throw Error(o(188));return r!==e?null:e}for(var i=e,u=r;;){var h=i.return;if(h===null)break;var x=h.alternate;if(x===null){if(u=h.return,u!==null){i=u;continue}break}if(h.child===x.child){for(x=h.child;x;){if(x===i)return p(h),e;if(x===u)return p(h),r;x=x.sibling}throw Error(o(188))}if(i.return!==u.return)i=h,u=x;else{for(var j=!1,A=h.child;A;){if(A===i){j=!0,i=h,u=x;break}if(A===u){j=!0,u=h,i=x;break}A=A.sibling}if(!j){for(A=x.child;A;){if(A===i){j=!0,i=x,u=h;break}if(A===u){j=!0,u=x,i=h;break}A=A.sibling}if(!j)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?e:r}function v(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e;for(e=e.child;e!==null;){if(r=v(e),r!==null)return r;e=e.sibling}return null}var b=Object.assign,w=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),T=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Symbol.for("react.client.reference");function fe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case k:return"Profiler";case E:return"StrictMode";case _:return"Suspense";case R:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case T:return e.displayName||"Context";case N:return(e._context.displayName||"Context")+".Consumer";case M:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return r=e.displayName||null,r!==null?r:fe(e.type)||"Memo";case te:r=e._payload,e=e._init;try{return fe(e(r))}catch{}}return null}var se=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},re=[],V=-1;function O(e){return{current:e}}function D(e){0>V||(e.current=re[V],re[V]=null,V--)}function $(e,r){V++,re[V]=e.current,e.current=r}var H=O(null),X=O(null),xe=O(null),q=O(null);function ge(e,r){switch($(xe,r),$(X,e),$(H,null),r.nodeType){case 9:case 11:e=(e=r.documentElement)&&(e=e.namespaceURI)?Bb(e):0;break;default:if(e=r.tagName,r=r.namespaceURI)r=Bb(r),e=$b(r,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(H),$(H,e)}function me(){D(H),D(X),D(xe)}function B(e){e.memoizedState!==null&&$(q,e);var r=H.current,i=$b(r,e.type);r!==i&&($(X,e),$(H,i))}function ie(e){X.current===e&&(D(H),D(X)),q.current===e&&(D(q),yl._currentValue=ae)}var we,Ce;function ze(e){if(we===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);we=r&&r[1]||"",Ce=-1<i.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+we+e+Ce}var Ke=!1;function ft(e,r){if(!e||Ke)return"";Ke=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(ne){var ee=ne}Reflect.construct(e,[],he)}else{try{he.call()}catch(ne){ee=ne}e.call(he.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(he=e())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=u.DetermineComponentFrameRoot(),j=x[0],A=x[1];if(j&&A){var z=j.split(`
|
||
`),J=A.split(`
|
||
`);for(h=u=0;u<z.length&&!z[u].includes("DetermineComponentFrameRoot");)u++;for(;h<J.length&&!J[h].includes("DetermineComponentFrameRoot");)h++;if(u===z.length||h===J.length)for(u=z.length-1,h=J.length-1;1<=u&&0<=h&&z[u]!==J[h];)h--;for(;1<=u&&0<=h;u--,h--)if(z[u]!==J[h]){if(u!==1||h!==1)do if(u--,h--,0>h||z[u]!==J[h]){var le=`
|
||
`+z[u].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=u&&0<=h);break}}}finally{Ke=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ze(i):""}function Pt(e,r){switch(e.tag){case 26:case 27:case 5:return ze(e.type);case 16:return ze("Lazy");case 13:return e.child!==r&&r!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return ft(e.type,!1);case 11:return ft(e.type.render,!1);case 1:return ft(e.type,!0);case 31:return ze("Activity");default:return""}}function gn(e){try{var r="",i=null;do r+=Pt(e,i),i=e,e=e.return;while(e);return r}catch(u){return`
|
||
Error generating stack: `+u.message+`
|
||
`+u.stack}}var Yr=Object.prototype.hasOwnProperty,_n=t.unstable_scheduleCallback,wn=t.unstable_cancelCallback,Xn=t.unstable_shouldYield,Zn=t.unstable_requestPaint,It=t.unstable_now,po=t.unstable_getCurrentPriorityLevel,nn=t.unstable_ImmediatePriority,Dn=t.unstable_UserBlockingPriority,Da=t.unstable_NormalPriority,ho=t.unstable_LowPriority,Qn=t.unstable_IdlePriority,Es=t.log,qr=t.unstable_setDisableYieldValue,gr=null,Tt=null;function On(e){if(typeof Es=="function"&&qr(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(gr,e)}catch{}}var Mt=Math.clz32?Math.clz32:go,Oi=Math.log,Li=Math.LN2;function go(e){return e>>>=0,e===0?32:31-(Oi(e)/Li|0)|0}var Kr=256,Oa=262144,Mr=4194304;function Kt(e){var r=e&42;if(r!==0)return r;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function La(e,r,i){var u=e.pendingLanes;if(u===0)return 0;var h=0,x=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var A=u&134217727;return A!==0?(u=A&~x,u!==0?h=Kt(u):(j&=A,j!==0?h=Kt(j):i||(i=A&~e,i!==0&&(h=Kt(i))))):(A=u&~x,A!==0?h=Kt(A):j!==0?h=Kt(j):i||(i=u&~e,i!==0&&(h=Kt(i)))),h===0?0:r!==0&&r!==h&&(r&x)===0&&(x=h&-h,i=r&-r,x>=i||x===32&&(i&4194048)!==0)?r:h}function Oe(e,r){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&r)===0}function tt(e,r){switch(e){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 it(){var e=Mr;return Mr<<=1,(Mr&62914560)===0&&(Mr=4194304),e}function rn(e){for(var r=[],i=0;31>i;i++)r.push(e);return r}function Ft(e,r){e.pendingLanes|=r,r!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Rt(e,r,i,u,h,x){var j=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var A=e.entanglements,z=e.expirationTimes,J=e.hiddenUpdates;for(i=j&~i;0<i;){var le=31-Mt(i),he=1<<le;A[le]=0,z[le]=-1;var ee=J[le];if(ee!==null)for(J[le]=null,le=0;le<ee.length;le++){var ne=ee[le];ne!==null&&(ne.lane&=-536870913)}i&=~he}u!==0&&Jn(e,u,0),x!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=x&~(j&~r))}function Jn(e,r,i){e.pendingLanes|=r,e.suspendedLanes&=~r;var u=31-Mt(r);e.entangledLanes|=r,e.entanglements[u]=e.entanglements[u]|1073741824|i&261930}function fn(e,r){var i=e.entangledLanes|=r;for(e=e.entanglements;i;){var u=31-Mt(i),h=1<<u;h&r|e[u]&r&&(e[u]|=r),i&=~h}}function Ln(e,r){var i=r&-r;return i=(i&42)!==0?1:xo(i),(i&(e.suspendedLanes|r))!==0?0:i}function xo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function vo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function W(){var e=Z.p;return e!==0?e:(e=window.event,e===void 0?32:uy(e.type))}function oe(e,r){var i=Z.p;try{return Z.p=e,r()}finally{Z.p=i}}var Se=Math.random().toString(36).slice(2),ye="__reactFiber$"+Se,Re="__reactProps$"+Se,nt="__reactContainer$"+Se,mt="__reactEvents$"+Se,bt="__reactListeners$"+Se,Rr="__reactHandles$"+Se,xn="__reactResources$"+Se,mn="__reactMarker$"+Se;function Wr(e){delete e[ye],delete e[Re],delete e[mt],delete e[bt],delete e[Rr]}function xr(e){var r=e[ye];if(r)return r;for(var i=e.parentNode;i;){if(r=i[nt]||i[ye]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(e=Kb(e);e!==null;){if(i=e[ye])return i;e=Kb(e)}return r}e=i,i=e.parentNode}return null}function Xr(e){if(e=e[ye]||e[nt]){var r=e.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return e}return null}function zi(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e.stateNode;throw Error(o(33))}function bo(e){var r=e[xn];return r||(r=e[xn]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Wt(e){e[mn]=!0}var Tx=new Set,Mx={};function ks(e,r){yo(e,r),yo(e+"Capture",r)}function yo(e,r){for(Mx[e]=r,e=0;e<r.length;e++)Tx.add(r[e])}var f5=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]*$"),Rx={},Ax={};function m5(e){return Yr.call(Ax,e)?!0:Yr.call(Rx,e)?!1:f5.test(e)?Ax[e]=!0:(Rx[e]=!0,!1)}function hc(e,r,i){if(m5(r))if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){e.removeAttribute(r);return}}e.setAttribute(r,""+i)}}function gc(e,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttribute(r,""+i)}}function Zr(e,r,i,u){if(u===null)e.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(r,i,""+u)}}function er(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _x(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function p5(e,r,i){var u=Object.getOwnPropertyDescriptor(e.constructor.prototype,r);if(!e.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,x=u.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return h.call(this)},set:function(j){i=""+j,x.call(this,j)}}),Object.defineProperty(e,r,{enumerable:u.enumerable}),{getValue:function(){return i},setValue:function(j){i=""+j},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function rf(e){if(!e._valueTracker){var r=_x(e)?"checked":"value";e._valueTracker=p5(e,r,""+e[r])}}function Dx(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var i=r.getValue(),u="";return e&&(u=_x(e)?e.checked?"true":"false":e.value),e=u,e!==i?(r.setValue(e),!0):!1}function xc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var h5=/[\n"\\]/g;function tr(e){return e.replace(h5,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function af(e,r,i,u,h,x,j,A){e.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.type=j:e.removeAttribute("type"),r!=null?j==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+er(r)):e.value!==""+er(r)&&(e.value=""+er(r)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),r!=null?sf(e,j,er(r)):i!=null?sf(e,j,er(i)):u!=null&&e.removeAttribute("value"),h==null&&x!=null&&(e.defaultChecked=!!x),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.name=""+er(A):e.removeAttribute("name")}function Ox(e,r,i,u,h,x,j,A){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.type=x),r!=null||i!=null){if(!(x!=="submit"&&x!=="reset"||r!=null)){rf(e);return}i=i!=null?""+er(i):"",r=r!=null?""+er(r):i,A||r===e.value||(e.value=r),e.defaultValue=r}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,e.checked=A?e.checked:!!u,e.defaultChecked=!!u,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(e.name=j),rf(e)}function sf(e,r,i){r==="number"&&xc(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function wo(e,r,i,u){if(e=e.options,r){r={};for(var h=0;h<i.length;h++)r["$"+i[h]]=!0;for(i=0;i<e.length;i++)h=r.hasOwnProperty("$"+e[i].value),e[i].selected!==h&&(e[i].selected=h),h&&u&&(e[i].defaultSelected=!0)}else{for(i=""+er(i),r=null,h=0;h<e.length;h++){if(e[h].value===i){e[h].selected=!0,u&&(e[h].defaultSelected=!0);return}r!==null||e[h].disabled||(r=e[h])}r!==null&&(r.selected=!0)}}function Lx(e,r,i){if(r!=null&&(r=""+er(r),r!==e.value&&(e.value=r),i==null)){e.defaultValue!==r&&(e.defaultValue=r);return}e.defaultValue=i!=null?""+er(i):""}function zx(e,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=er(r),e.defaultValue=i,u=e.textContent,u===i&&u!==""&&u!==null&&(e.value=u),rf(e)}function jo(e,r){if(r){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=r;return}}e.textContent=r}var g5=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 Px(e,r,i){var u=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?u?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="":u?e.setProperty(r,i):typeof i!="number"||i===0||g5.has(r)?r==="float"?e.cssFloat=i:e[r]=(""+i).trim():e[r]=i+"px"}function Ix(e,r,i){if(r!=null&&typeof r!="object")throw Error(o(62));if(e=e.style,i!=null){for(var u in i)!i.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?e.setProperty(u,""):u==="float"?e.cssFloat="":e[u]="");for(var h in r)u=r[h],r.hasOwnProperty(h)&&i[h]!==u&&Px(e,h,u)}else for(var x in r)r.hasOwnProperty(x)&&Px(e,x,r[x])}function of(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var x5=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"]]),v5=/^[\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 vc(e){return v5.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Qr(){}var lf=null;function cf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Co=null,So=null;function Ux(e){var r=Xr(e);if(r&&(e=r.stateNode)){var i=e[Re]||null;e:switch(e=r.stateNode,r.type){case"input":if(af(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+tr(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var u=i[r];if(u!==e&&u.form===e.form){var h=u[Re]||null;if(!h)throw Error(o(90));af(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<i.length;r++)u=i[r],u.form===e.form&&Dx(u)}break e;case"textarea":Lx(e,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&wo(e,!!i.multiple,r,!1)}}}var uf=!1;function Bx(e,r,i){if(uf)return e(r,i);uf=!0;try{var u=e(r);return u}finally{if(uf=!1,(Co!==null||So!==null)&&(su(),Co&&(r=Co,e=So,So=Co=null,Ux(r),e)))for(r=0;r<e.length;r++)Ux(e[r])}}function Pi(e,r){var i=e.stateNode;if(i===null)return null;var u=i[Re]||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)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,r,typeof i));return i}var Jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),df=!1;if(Jr)try{var Ii={};Object.defineProperty(Ii,"passive",{get:function(){df=!0}}),window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{df=!1}var za=null,ff=null,bc=null;function $x(){if(bc)return bc;var e,r=ff,i=r.length,u,h="value"in za?za.value:za.textContent,x=h.length;for(e=0;e<i&&r[e]===h[e];e++);var j=i-e;for(u=1;u<=j&&r[i-u]===h[x-u];u++);return bc=h.slice(e,1<u?1-u:void 0)}function yc(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function wc(){return!0}function Hx(){return!1}function jn(e){function r(i,u,h,x,j){this._reactName=i,this._targetInst=h,this.type=u,this.nativeEvent=x,this.target=j,this.currentTarget=null;for(var A in e)e.hasOwnProperty(A)&&(i=e[A],this[A]=i?i(x):x[A]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?wc:Hx,this.isPropagationStopped=Hx,this}return b(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=wc)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=wc)},persist:function(){},isPersistent:wc}),r}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jc=jn(Ts),Ui=b({},Ts,{view:0,detail:0}),b5=jn(Ui),mf,pf,Bi,Cc=b({},Ui,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Bi&&(Bi&&e.type==="mousemove"?(mf=e.screenX-Bi.screenX,pf=e.screenY-Bi.screenY):pf=mf=0,Bi=e),mf)},movementY:function(e){return"movementY"in e?e.movementY:pf}}),Gx=jn(Cc),y5=b({},Cc,{dataTransfer:0}),w5=jn(y5),j5=b({},Ui,{relatedTarget:0}),hf=jn(j5),C5=b({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),S5=jn(C5),N5=b({},Ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),E5=jn(N5),k5=b({},Ts,{data:0}),Vx=jn(k5),T5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M5={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"},R5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function A5(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=R5[e])?!!r[e]:!1}function gf(){return A5}var _5=b({},Ui,{key:function(e){if(e.key){var r=T5[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=yc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?M5[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gf,charCode:function(e){return e.type==="keypress"?yc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?yc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),D5=jn(_5),O5=b({},Cc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fx=jn(O5),L5=b({},Ui,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gf}),z5=jn(L5),P5=b({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),I5=jn(P5),U5=b({},Cc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),B5=jn(U5),$5=b({},Ts,{newState:0,oldState:0}),H5=jn($5),G5=[9,13,27,32],xf=Jr&&"CompositionEvent"in window,$i=null;Jr&&"documentMode"in document&&($i=document.documentMode);var V5=Jr&&"TextEvent"in window&&!$i,Yx=Jr&&(!xf||$i&&8<$i&&11>=$i),qx=" ",Kx=!1;function Wx(e,r){switch(e){case"keyup":return G5.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var No=!1;function F5(e,r){switch(e){case"compositionend":return Xx(r);case"keypress":return r.which!==32?null:(Kx=!0,qx);case"textInput":return e=r.data,e===qx&&Kx?null:e;default:return null}}function Y5(e,r){if(No)return e==="compositionend"||!xf&&Wx(e,r)?(e=$x(),bc=ff=za=null,No=!1,e):null;switch(e){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 Yx&&r.locale!=="ko"?null:r.data;default:return null}}var q5={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 Zx(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!q5[e.type]:r==="textarea"}function Qx(e,r,i,u){Co?So?So.push(u):So=[u]:Co=u,r=fu(r,"onChange"),0<r.length&&(i=new jc("onChange","change",null,i,u),e.push({event:i,listeners:r}))}var Hi=null,Gi=null;function K5(e){Ob(e,0)}function Sc(e){var r=zi(e);if(Dx(r))return e}function Jx(e,r){if(e==="change")return r}var e1=!1;if(Jr){var vf;if(Jr){var bf="oninput"in document;if(!bf){var t1=document.createElement("div");t1.setAttribute("oninput","return;"),bf=typeof t1.oninput=="function"}vf=bf}else vf=!1;e1=vf&&(!document.documentMode||9<document.documentMode)}function n1(){Hi&&(Hi.detachEvent("onpropertychange",r1),Gi=Hi=null)}function r1(e){if(e.propertyName==="value"&&Sc(Gi)){var r=[];Qx(r,Gi,e,cf(e)),Bx(K5,r)}}function W5(e,r,i){e==="focusin"?(n1(),Hi=r,Gi=i,Hi.attachEvent("onpropertychange",r1)):e==="focusout"&&n1()}function X5(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sc(Gi)}function Z5(e,r){if(e==="click")return Sc(r)}function Q5(e,r){if(e==="input"||e==="change")return Sc(r)}function J5(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var zn=typeof Object.is=="function"?Object.is:J5;function Vi(e,r){if(zn(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var i=Object.keys(e),u=Object.keys(r);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var h=i[u];if(!Yr.call(r,h)||!zn(e[h],r[h]))return!1}return!0}function a1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function s1(e,r){var i=a1(e);e=0;for(var u;i;){if(i.nodeType===3){if(u=e+i.textContent.length,e<=r&&u>=r)return{node:i,offset:r-e};e=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=a1(i)}}function o1(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?o1(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function i1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var r=xc(e.document);r instanceof e.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)e=r.contentWindow;else break;r=xc(e.document)}return r}function yf(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}var e4=Jr&&"documentMode"in document&&11>=document.documentMode,Eo=null,wf=null,Fi=null,jf=!1;function l1(e,r,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;jf||Eo==null||Eo!==xc(u)||(u=Eo,"selectionStart"in u&&yf(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&&Vi(Fi,u)||(Fi=u,u=fu(wf,"onSelect"),0<u.length&&(r=new jc("onSelect","select",null,r,i),e.push({event:r,listeners:u}),r.target=Eo)))}function Ms(e,r){var i={};return i[e.toLowerCase()]=r.toLowerCase(),i["Webkit"+e]="webkit"+r,i["Moz"+e]="moz"+r,i}var ko={animationend:Ms("Animation","AnimationEnd"),animationiteration:Ms("Animation","AnimationIteration"),animationstart:Ms("Animation","AnimationStart"),transitionrun:Ms("Transition","TransitionRun"),transitionstart:Ms("Transition","TransitionStart"),transitioncancel:Ms("Transition","TransitionCancel"),transitionend:Ms("Transition","TransitionEnd")},Cf={},c1={};Jr&&(c1=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 Rs(e){if(Cf[e])return Cf[e];if(!ko[e])return e;var r=ko[e],i;for(i in r)if(r.hasOwnProperty(i)&&i in c1)return Cf[e]=r[i];return e}var u1=Rs("animationend"),d1=Rs("animationiteration"),f1=Rs("animationstart"),t4=Rs("transitionrun"),n4=Rs("transitionstart"),r4=Rs("transitioncancel"),m1=Rs("transitionend"),p1=new Map,Sf="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(" ");Sf.push("scrollEnd");function vr(e,r){p1.set(e,r),ks(r,[e])}var Nc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},nr=[],To=0,Nf=0;function Ec(){for(var e=To,r=Nf=To=0;r<e;){var i=nr[r];nr[r++]=null;var u=nr[r];nr[r++]=null;var h=nr[r];nr[r++]=null;var x=nr[r];if(nr[r++]=null,u!==null&&h!==null){var j=u.pending;j===null?h.next=h:(h.next=j.next,j.next=h),u.pending=h}x!==0&&h1(i,h,x)}}function kc(e,r,i,u){nr[To++]=e,nr[To++]=r,nr[To++]=i,nr[To++]=u,Nf|=u,e.lanes|=u,e=e.alternate,e!==null&&(e.lanes|=u)}function Ef(e,r,i,u){return kc(e,r,i,u),Tc(e)}function As(e,r){return kc(e,null,null,r),Tc(e)}function h1(e,r,i){e.lanes|=i;var u=e.alternate;u!==null&&(u.lanes|=i);for(var h=!1,x=e.return;x!==null;)x.childLanes|=i,u=x.alternate,u!==null&&(u.childLanes|=i),x.tag===22&&(e=x.stateNode,e===null||e._visibility&1||(h=!0)),e=x,x=x.return;return e.tag===3?(x=e.stateNode,h&&r!==null&&(h=31-Mt(i),e=x.hiddenUpdates,u=e[h],u===null?e[h]=[r]:u.push(r),r.lane=i|536870912),x):null}function Tc(e){if(50<ml)throw ml=0,Lm=null,Error(o(185));for(var r=e.return;r!==null;)e=r,r=e.return;return e.tag===3?e.stateNode:null}var Mo={};function a4(e,r,i,u){this.tag=e,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 Pn(e,r,i,u){return new a4(e,r,i,u)}function kf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ea(e,r){var i=e.alternate;return i===null?(i=Pn(e.tag,r,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=r,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,r=e.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function g1(e,r){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=r,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,r=i.dependencies,e.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),e}function Mc(e,r,i,u,h,x){var j=0;if(u=e,typeof e=="function")kf(e)&&(j=1);else if(typeof e=="string")j=c3(e,i,H.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=Pn(31,i,r,h),e.elementType=K,e.lanes=x,e;case S:return _s(i.children,h,x,r);case E:j=8,h|=24;break;case k:return e=Pn(12,i,r,h|2),e.elementType=k,e.lanes=x,e;case _:return e=Pn(13,i,r,h),e.elementType=_,e.lanes=x,e;case R:return e=Pn(19,i,r,h),e.elementType=R,e.lanes=x,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:j=10;break e;case N:j=9;break e;case M:j=11;break e;case L:j=14;break e;case te:j=16,u=null;break e}j=29,i=Error(o(130,e===null?"null":typeof e,"")),u=null}return r=Pn(j,i,r,h),r.elementType=e,r.type=u,r.lanes=x,r}function _s(e,r,i,u){return e=Pn(7,e,u,r),e.lanes=i,e}function Tf(e,r,i){return e=Pn(6,e,null,r),e.lanes=i,e}function x1(e){var r=Pn(18,null,null,0);return r.stateNode=e,r}function Mf(e,r,i){return r=Pn(4,e.children!==null?e.children:[],e.key,r),r.lanes=i,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}var v1=new WeakMap;function rr(e,r){if(typeof e=="object"&&e!==null){var i=v1.get(e);return i!==void 0?i:(r={value:e,source:r,stack:gn(r)},v1.set(e,r),r)}return{value:e,source:r,stack:gn(r)}}var Ro=[],Ao=0,Rc=null,Yi=0,ar=[],sr=0,Pa=null,Ar=1,_r="";function ta(e,r){Ro[Ao++]=Yi,Ro[Ao++]=Rc,Rc=e,Yi=r}function b1(e,r,i){ar[sr++]=Ar,ar[sr++]=_r,ar[sr++]=Pa,Pa=e;var u=Ar;e=_r;var h=32-Mt(u)-1;u&=~(1<<h),i+=1;var x=32-Mt(r)+h;if(30<x){var j=h-h%5;x=(u&(1<<j)-1).toString(32),u>>=j,h-=j,Ar=1<<32-Mt(r)+h|i<<h|u,_r=x+e}else Ar=1<<x|i<<h|u,_r=e}function Rf(e){e.return!==null&&(ta(e,1),b1(e,1,0))}function Af(e){for(;e===Rc;)Rc=Ro[--Ao],Ro[Ao]=null,Yi=Ro[--Ao],Ro[Ao]=null;for(;e===Pa;)Pa=ar[--sr],ar[sr]=null,_r=ar[--sr],ar[sr]=null,Ar=ar[--sr],ar[sr]=null}function y1(e,r){ar[sr++]=Ar,ar[sr++]=_r,ar[sr++]=Pa,Ar=r.id,_r=r.overflow,Pa=e}var an=null,yt=null,Je=!1,Ia=null,or=!1,_f=Error(o(519));function Ua(e){var r=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qi(rr(r,e)),_f}function w1(e){var r=e.stateNode,i=e.type,u=e.memoizedProps;switch(r[ye]=e,r[Re]=u,i){case"dialog":Ve("cancel",r),Ve("close",r);break;case"iframe":case"object":case"embed":Ve("load",r);break;case"video":case"audio":for(i=0;i<hl.length;i++)Ve(hl[i],r);break;case"source":Ve("error",r);break;case"img":case"image":case"link":Ve("error",r),Ve("load",r);break;case"details":Ve("toggle",r);break;case"input":Ve("invalid",r),Ox(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ve("invalid",r);break;case"textarea":Ve("invalid",r),zx(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||Ib(r.textContent,i)?(u.popover!=null&&(Ve("beforetoggle",r),Ve("toggle",r)),u.onScroll!=null&&Ve("scroll",r),u.onScrollEnd!=null&&Ve("scrollend",r),u.onClick!=null&&(r.onclick=Qr),r=!0):r=!1,r||Ua(e,!0)}function j1(e){for(an=e.return;an;)switch(an.tag){case 5:case 31:case 13:or=!1;return;case 27:case 3:or=!0;return;default:an=an.return}}function _o(e){if(e!==an)return!1;if(!Je)return j1(e),Je=!0,!1;var r=e.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Xm(e.type,e.memoizedProps)),i=!i),i&&yt&&Ua(e),j1(e),r===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));yt=qb(e)}else if(r===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));yt=qb(e)}else r===27?(r=yt,Ja(e.type)?(e=tp,tp=null,yt=e):yt=r):yt=an?lr(e.stateNode.nextSibling):null;return!0}function Ds(){yt=an=null,Je=!1}function Df(){var e=Ia;return e!==null&&(En===null?En=e:En.push.apply(En,e),Ia=null),e}function qi(e){Ia===null?Ia=[e]:Ia.push(e)}var Of=O(null),Os=null,na=null;function Ba(e,r,i){$(Of,r._currentValue),r._currentValue=i}function ra(e){e._currentValue=Of.current,D(Of)}function Lf(e,r,i){for(;e!==null;){var u=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),e===i)break;e=e.return}}function zf(e,r,i,u){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var x=h.dependencies;if(x!==null){var j=h.child;x=x.firstContext;e:for(;x!==null;){var A=x;x=h;for(var z=0;z<r.length;z++)if(A.context===r[z]){x.lanes|=i,A=x.alternate,A!==null&&(A.lanes|=i),Lf(x.return,i,e),u||(j=null);break e}x=A.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(o(341));j.lanes|=i,x=j.alternate,x!==null&&(x.lanes|=i),Lf(j,i,e),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===e){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function Do(e,r,i,u){e=null;for(var h=r,x=!1;h!==null;){if(!x){if((h.flags&524288)!==0)x=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var j=h.alternate;if(j===null)throw Error(o(387));if(j=j.memoizedProps,j!==null){var A=h.type;zn(h.pendingProps.value,j.value)||(e!==null?e.push(A):e=[A])}}else if(h===q.current){if(j=h.alternate,j===null)throw Error(o(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(yl):e=[yl])}h=h.return}e!==null&&zf(r,e,i,u),r.flags|=262144}function Ac(e){for(e=e.firstContext;e!==null;){if(!zn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ls(e){Os=e,na=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function sn(e){return C1(Os,e)}function _c(e,r){return Os===null&&Ls(e),C1(e,r)}function C1(e,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},na===null){if(e===null)throw Error(o(308));na=r,e.dependencies={lanes:0,firstContext:r},e.flags|=524288}else na=na.next=r;return i}var s4=typeof AbortController<"u"?AbortController:function(){var e=[],r=this.signal={aborted:!1,addEventListener:function(i,u){e.push(u)}};this.abort=function(){r.aborted=!0,e.forEach(function(i){return i()})}},o4=t.unstable_scheduleCallback,i4=t.unstable_NormalPriority,Ut={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pf(){return{controller:new s4,data:new Map,refCount:0}}function Ki(e){e.refCount--,e.refCount===0&&o4(i4,function(){e.controller.abort()})}var Wi=null,If=0,Oo=0,Lo=null;function l4(e,r){if(Wi===null){var i=Wi=[];If=0,Oo=$m(),Lo={status:"pending",value:void 0,then:function(u){i.push(u)}}}return If++,r.then(S1,S1),r}function S1(){if(--If===0&&Wi!==null){Lo!==null&&(Lo.status="fulfilled");var e=Wi;Wi=null,Oo=0,Lo=null;for(var r=0;r<e.length;r++)(0,e[r])()}}function c4(e,r){var i=[],u={status:"pending",value:null,reason:null,then:function(h){i.push(h)}};return e.then(function(){u.status="fulfilled",u.value=r;for(var h=0;h<i.length;h++)(0,i[h])(r)},function(h){for(u.status="rejected",u.reason=h,h=0;h<i.length;h++)(0,i[h])(void 0)}),u}var N1=P.S;P.S=function(e,r){lb=It(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&l4(e,r),N1!==null&&N1(e,r)};var zs=O(null);function Uf(){var e=zs.current;return e!==null?e:xt.pooledCache}function Dc(e,r){r===null?$(zs,zs.current):$(zs,r.pool)}function E1(){var e=Uf();return e===null?null:{parent:Ut._currentValue,pool:e}}var zo=Error(o(460)),Bf=Error(o(474)),Oc=Error(o(542)),Lc={then:function(){}};function k1(e){return e=e.status,e==="fulfilled"||e==="rejected"}function T1(e,r,i){switch(i=e[i],i===void 0?e.push(r):i!==r&&(r.then(Qr,Qr),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,R1(e),e;default:if(typeof r.status=="string")r.then(Qr,Qr);else{if(e=xt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=r,e.status="pending",e.then(function(u){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=u}},function(u){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,R1(e),e}throw Is=r,zo}}function Ps(e){try{var r=e._init;return r(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Is=i,zo):i}}var Is=null;function M1(){if(Is===null)throw Error(o(459));var e=Is;return Is=null,e}function R1(e){if(e===zo||e===Oc)throw Error(o(483))}var Po=null,Xi=0;function zc(e){var r=Xi;return Xi+=1,Po===null&&(Po=[]),T1(Po,e,r)}function Zi(e,r){r=r.props.ref,e.ref=r!==void 0?r:null}function Pc(e,r){throw r.$$typeof===w?Error(o(525)):(e=Object.prototype.toString.call(r),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e)))}function A1(e){function r(F,U){if(e){var Q=F.deletions;Q===null?(F.deletions=[U],F.flags|=16):Q.push(U)}}function i(F,U){if(!e)return null;for(;U!==null;)r(F,U),U=U.sibling;return null}function u(F){for(var U=new Map;F!==null;)F.key!==null?U.set(F.key,F):U.set(F.index,F),F=F.sibling;return U}function h(F,U){return F=ea(F,U),F.index=0,F.sibling=null,F}function x(F,U,Q){return F.index=Q,e?(Q=F.alternate,Q!==null?(Q=Q.index,Q<U?(F.flags|=67108866,U):Q):(F.flags|=67108866,U)):(F.flags|=1048576,U)}function j(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function A(F,U,Q,de){return U===null||U.tag!==6?(U=Tf(Q,F.mode,de),U.return=F,U):(U=h(U,Q),U.return=F,U)}function z(F,U,Q,de){var Ae=Q.type;return Ae===S?le(F,U,Q.props.children,de,Q.key):U!==null&&(U.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===te&&Ps(Ae)===U.type)?(U=h(U,Q.props),Zi(U,Q),U.return=F,U):(U=Mc(Q.type,Q.key,Q.props,null,F.mode,de),Zi(U,Q),U.return=F,U)}function J(F,U,Q,de){return U===null||U.tag!==4||U.stateNode.containerInfo!==Q.containerInfo||U.stateNode.implementation!==Q.implementation?(U=Mf(Q,F.mode,de),U.return=F,U):(U=h(U,Q.children||[]),U.return=F,U)}function le(F,U,Q,de,Ae){return U===null||U.tag!==7?(U=_s(Q,F.mode,de,Ae),U.return=F,U):(U=h(U,Q),U.return=F,U)}function he(F,U,Q){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Tf(""+U,F.mode,Q),U.return=F,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case y:return Q=Mc(U.type,U.key,U.props,null,F.mode,Q),Zi(Q,U),Q.return=F,Q;case C:return U=Mf(U,F.mode,Q),U.return=F,U;case te:return U=Ps(U),he(F,U,Q)}if(se(U)||Y(U))return U=_s(U,F.mode,Q,null),U.return=F,U;if(typeof U.then=="function")return he(F,zc(U),Q);if(U.$$typeof===T)return he(F,_c(F,U),Q);Pc(F,U)}return null}function ee(F,U,Q,de){var Ae=U!==null?U.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ae!==null?null:A(F,U,""+Q,de);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return Q.key===Ae?z(F,U,Q,de):null;case C:return Q.key===Ae?J(F,U,Q,de):null;case te:return Q=Ps(Q),ee(F,U,Q,de)}if(se(Q)||Y(Q))return Ae!==null?null:le(F,U,Q,de,null);if(typeof Q.then=="function")return ee(F,U,zc(Q),de);if(Q.$$typeof===T)return ee(F,U,_c(F,Q),de);Pc(F,Q)}return null}function ne(F,U,Q,de,Ae){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return F=F.get(Q)||null,A(U,F,""+de,Ae);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case y:return F=F.get(de.key===null?Q:de.key)||null,z(U,F,de,Ae);case C:return F=F.get(de.key===null?Q:de.key)||null,J(U,F,de,Ae);case te:return de=Ps(de),ne(F,U,Q,de,Ae)}if(se(de)||Y(de))return F=F.get(Q)||null,le(U,F,de,Ae,null);if(typeof de.then=="function")return ne(F,U,Q,zc(de),Ae);if(de.$$typeof===T)return ne(F,U,Q,_c(U,de),Ae);Pc(U,de)}return null}function Ee(F,U,Q,de){for(var Ae=null,rt=null,ke=U,$e=U=0,Xe=null;ke!==null&&$e<Q.length;$e++){ke.index>$e?(Xe=ke,ke=null):Xe=ke.sibling;var at=ee(F,ke,Q[$e],de);if(at===null){ke===null&&(ke=Xe);break}e&&ke&&at.alternate===null&&r(F,ke),U=x(at,U,$e),rt===null?Ae=at:rt.sibling=at,rt=at,ke=Xe}if($e===Q.length)return i(F,ke),Je&&ta(F,$e),Ae;if(ke===null){for(;$e<Q.length;$e++)ke=he(F,Q[$e],de),ke!==null&&(U=x(ke,U,$e),rt===null?Ae=ke:rt.sibling=ke,rt=ke);return Je&&ta(F,$e),Ae}for(ke=u(ke);$e<Q.length;$e++)Xe=ne(ke,F,$e,Q[$e],de),Xe!==null&&(e&&Xe.alternate!==null&&ke.delete(Xe.key===null?$e:Xe.key),U=x(Xe,U,$e),rt===null?Ae=Xe:rt.sibling=Xe,rt=Xe);return e&&ke.forEach(function(as){return r(F,as)}),Je&&ta(F,$e),Ae}function Le(F,U,Q,de){if(Q==null)throw Error(o(151));for(var Ae=null,rt=null,ke=U,$e=U=0,Xe=null,at=Q.next();ke!==null&&!at.done;$e++,at=Q.next()){ke.index>$e?(Xe=ke,ke=null):Xe=ke.sibling;var as=ee(F,ke,at.value,de);if(as===null){ke===null&&(ke=Xe);break}e&&ke&&as.alternate===null&&r(F,ke),U=x(as,U,$e),rt===null?Ae=as:rt.sibling=as,rt=as,ke=Xe}if(at.done)return i(F,ke),Je&&ta(F,$e),Ae;if(ke===null){for(;!at.done;$e++,at=Q.next())at=he(F,at.value,de),at!==null&&(U=x(at,U,$e),rt===null?Ae=at:rt.sibling=at,rt=at);return Je&&ta(F,$e),Ae}for(ke=u(ke);!at.done;$e++,at=Q.next())at=ne(ke,F,$e,at.value,de),at!==null&&(e&&at.alternate!==null&&ke.delete(at.key===null?$e:at.key),U=x(at,U,$e),rt===null?Ae=at:rt.sibling=at,rt=at);return e&&ke.forEach(function(y3){return r(F,y3)}),Je&&ta(F,$e),Ae}function gt(F,U,Q,de){if(typeof Q=="object"&&Q!==null&&Q.type===S&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:e:{for(var Ae=Q.key;U!==null;){if(U.key===Ae){if(Ae=Q.type,Ae===S){if(U.tag===7){i(F,U.sibling),de=h(U,Q.props.children),de.return=F,F=de;break e}}else if(U.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===te&&Ps(Ae)===U.type){i(F,U.sibling),de=h(U,Q.props),Zi(de,Q),de.return=F,F=de;break e}i(F,U);break}else r(F,U);U=U.sibling}Q.type===S?(de=_s(Q.props.children,F.mode,de,Q.key),de.return=F,F=de):(de=Mc(Q.type,Q.key,Q.props,null,F.mode,de),Zi(de,Q),de.return=F,F=de)}return j(F);case C:e:{for(Ae=Q.key;U!==null;){if(U.key===Ae)if(U.tag===4&&U.stateNode.containerInfo===Q.containerInfo&&U.stateNode.implementation===Q.implementation){i(F,U.sibling),de=h(U,Q.children||[]),de.return=F,F=de;break e}else{i(F,U);break}else r(F,U);U=U.sibling}de=Mf(Q,F.mode,de),de.return=F,F=de}return j(F);case te:return Q=Ps(Q),gt(F,U,Q,de)}if(se(Q))return Ee(F,U,Q,de);if(Y(Q)){if(Ae=Y(Q),typeof Ae!="function")throw Error(o(150));return Q=Ae.call(Q),Le(F,U,Q,de)}if(typeof Q.then=="function")return gt(F,U,zc(Q),de);if(Q.$$typeof===T)return gt(F,U,_c(F,Q),de);Pc(F,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,U!==null&&U.tag===6?(i(F,U.sibling),de=h(U,Q),de.return=F,F=de):(i(F,U),de=Tf(Q,F.mode,de),de.return=F,F=de),j(F)):i(F,U)}return function(F,U,Q,de){try{Xi=0;var Ae=gt(F,U,Q,de);return Po=null,Ae}catch(ke){if(ke===zo||ke===Oc)throw ke;var rt=Pn(29,ke,null,F.mode);return rt.lanes=de,rt.return=F,rt}finally{}}}var Us=A1(!0),_1=A1(!1),$a=!1;function $f(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hf(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,r,i){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(ot&2)!==0){var h=u.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),u.pending=r,r=Tc(e),h1(e,null,i),r}return kc(e,u,r,i),Tc(e)}function Qi(e,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var u=r.lanes;u&=e.pendingLanes,i|=u,r.lanes=i,fn(e,i)}}function Gf(e,r){var i=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var h=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var j={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};x===null?h=x=j:x=x.next=j,i=i.next}while(i!==null);x===null?h=x=r:x=x.next=r}else h=x=r;i={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:x,shared:u.shared,callbacks:u.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=r:e.next=r,i.lastBaseUpdate=r}var Vf=!1;function Ji(){if(Vf){var e=Lo;if(e!==null)throw e}}function el(e,r,i,u){Vf=!1;var h=e.updateQueue;$a=!1;var x=h.firstBaseUpdate,j=h.lastBaseUpdate,A=h.shared.pending;if(A!==null){h.shared.pending=null;var z=A,J=z.next;z.next=null,j===null?x=J:j.next=J,j=z;var le=e.alternate;le!==null&&(le=le.updateQueue,A=le.lastBaseUpdate,A!==j&&(A===null?le.firstBaseUpdate=J:A.next=J,le.lastBaseUpdate=z))}if(x!==null){var he=h.baseState;j=0,le=J=z=null,A=x;do{var ee=A.lane&-536870913,ne=ee!==A.lane;if(ne?(We&ee)===ee:(u&ee)===ee){ee!==0&&ee===Oo&&(Vf=!0),le!==null&&(le=le.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Ee=e,Le=A;ee=r;var gt=i;switch(Le.tag){case 1:if(Ee=Le.payload,typeof Ee=="function"){he=Ee.call(gt,he,ee);break e}he=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Le.payload,ee=typeof Ee=="function"?Ee.call(gt,he,ee):Ee,ee==null)break e;he=b({},he,ee);break e;case 2:$a=!0}}ee=A.callback,ee!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=h.callbacks,ne===null?h.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:A.tag,payload:A.payload,callback:A.callback,next:null},le===null?(J=le=ne,z=he):le=le.next=ne,j|=ee;if(A=A.next,A===null){if(A=h.shared.pending,A===null)break;ne=A,A=ne.next,ne.next=null,h.lastBaseUpdate=ne,h.shared.pending=null}}while(!0);le===null&&(z=he),h.baseState=z,h.firstBaseUpdate=J,h.lastBaseUpdate=le,x===null&&(h.shared.lanes=0),Ka|=j,e.lanes=j,e.memoizedState=he}}function D1(e,r){if(typeof e!="function")throw Error(o(191,e));e.call(r)}function O1(e,r){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)D1(i[e],r)}var Io=O(null),Ic=O(0);function L1(e,r){e=fa,$(Ic,e),$(Io,r),fa=e|r.baseLanes}function Ff(){$(Ic,fa),$(Io,Io.current)}function Yf(){fa=Ic.current,D(Io),D(Ic)}var In=O(null),ir=null;function Va(e){var r=e.alternate;$(Lt,Lt.current&1),$(In,e),ir===null&&(r===null||Io.current!==null||r.memoizedState!==null)&&(ir=e)}function qf(e){$(Lt,Lt.current),$(In,e),ir===null&&(ir=e)}function z1(e){e.tag===22?($(Lt,Lt.current),$(In,e),ir===null&&(ir=e)):Fa()}function Fa(){$(Lt,Lt.current),$(In,In.current)}function Un(e){D(In),ir===e&&(ir=null),D(Lt)}var Lt=O(0);function Uc(e){for(var r=e;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Jm(i)||ep(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===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var aa=0,Ue=null,pt=null,Bt=null,Bc=!1,Uo=!1,Bs=!1,$c=0,tl=0,Bo=null,u4=0;function At(){throw Error(o(321))}function Kf(e,r){if(r===null)return!1;for(var i=0;i<r.length&&i<e.length;i++)if(!zn(e[i],r[i]))return!1;return!0}function Wf(e,r,i,u,h,x){return aa=x,Ue=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,P.H=e===null||e.memoizedState===null?bv:um,Bs=!1,x=i(u,h),Bs=!1,Uo&&(x=I1(r,i,u,h)),P1(e),x}function P1(e){P.H=al;var r=pt!==null&&pt.next!==null;if(aa=0,Bt=pt=Ue=null,Bc=!1,tl=0,Bo=null,r)throw Error(o(300));e===null||$t||(e=e.dependencies,e!==null&&Ac(e)&&($t=!0))}function I1(e,r,i,u){Ue=e;var h=0;do{if(Uo&&(Bo=null),tl=0,Uo=!1,25<=h)throw Error(o(301));if(h+=1,Bt=pt=null,e.updateQueue!=null){var x=e.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}P.H=yv,x=r(i,u)}while(Uo);return x}function d4(){var e=P.H,r=e.useState()[0];return r=typeof r.then=="function"?nl(r):r,e=e.useState()[0],(pt!==null?pt.memoizedState:null)!==e&&(Ue.flags|=1024),r}function Xf(){var e=$c!==0;return $c=0,e}function Zf(e,r,i){r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~i}function Qf(e){if(Bc){for(e=e.memoizedState;e!==null;){var r=e.queue;r!==null&&(r.pending=null),e=e.next}Bc=!1}aa=0,Bt=pt=Ue=null,Uo=!1,tl=$c=0,Bo=null}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Ue.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function zt(){if(pt===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=pt.next;var r=Bt===null?Ue.memoizedState:Bt.next;if(r!==null)Bt=r,pt=e;else{if(e===null)throw Ue.alternate===null?Error(o(467)):Error(o(310));pt=e,e={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},Bt===null?Ue.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function Hc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function nl(e){var r=tl;return tl+=1,Bo===null&&(Bo=[]),e=T1(Bo,e,r),r=Ue,(Bt===null?r.memoizedState:Bt.next)===null&&(r=r.alternate,P.H=r===null||r.memoizedState===null?bv:um),e}function Gc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return nl(e);if(e.$$typeof===T)return sn(e)}throw Error(o(438,String(e)))}function Jf(e){var r=null,i=Ue.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var u=Ue.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(h){return h.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=Hc(),Ue.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(e),u=0;u<e;u++)i[u]=I;return r.index++,i}function sa(e,r){return typeof r=="function"?r(e):r}function Vc(e){var r=zt();return em(r,pt,e)}function em(e,r,i){var u=e.queue;if(u===null)throw Error(o(311));u.lastRenderedReducer=i;var h=e.baseQueue,x=u.pending;if(x!==null){if(h!==null){var j=h.next;h.next=x.next,x.next=j}r.baseQueue=h=x,u.pending=null}if(x=e.baseState,h===null)e.memoizedState=x;else{r=h.next;var A=j=null,z=null,J=r,le=!1;do{var he=J.lane&-536870913;if(he!==J.lane?(We&he)===he:(aa&he)===he){var ee=J.revertLane;if(ee===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),he===Oo&&(le=!0);else if((aa&ee)===ee){J=J.next,ee===Oo&&(le=!0);continue}else he={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(A=z=he,j=x):z=z.next=he,Ue.lanes|=ee,Ka|=ee;he=J.action,Bs&&i(x,he),x=J.hasEagerState?J.eagerState:i(x,he)}else ee={lane:he,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(A=z=ee,j=x):z=z.next=ee,Ue.lanes|=he,Ka|=he;J=J.next}while(J!==null&&J!==r);if(z===null?j=x:z.next=A,!zn(x,e.memoizedState)&&($t=!0,le&&(i=Lo,i!==null)))throw i;e.memoizedState=x,e.baseState=j,e.baseQueue=z,u.lastRenderedState=x}return h===null&&(u.lanes=0),[e.memoizedState,u.dispatch]}function tm(e){var r=zt(),i=r.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var u=i.dispatch,h=i.pending,x=r.memoizedState;if(h!==null){i.pending=null;var j=h=h.next;do x=e(x,j.action),j=j.next;while(j!==h);zn(x,r.memoizedState)||($t=!0),r.memoizedState=x,r.baseQueue===null&&(r.baseState=x),i.lastRenderedState=x}return[x,u]}function U1(e,r,i){var u=Ue,h=zt(),x=Je;if(x){if(i===void 0)throw Error(o(407));i=i()}else i=r();var j=!zn((pt||h).memoizedState,i);if(j&&(h.memoizedState=i,$t=!0),h=h.queue,am(H1.bind(null,u,h,e),[e]),h.getSnapshot!==r||j||Bt!==null&&Bt.memoizedState.tag&1){if(u.flags|=2048,$o(9,{destroy:void 0},$1.bind(null,u,h,i,r),null),xt===null)throw Error(o(349));x||(aa&127)!==0||B1(u,r,i)}return i}function B1(e,r,i){e.flags|=16384,e={getSnapshot:r,value:i},r=Ue.updateQueue,r===null?(r=Hc(),Ue.updateQueue=r,r.stores=[e]):(i=r.stores,i===null?r.stores=[e]:i.push(e))}function $1(e,r,i,u){r.value=i,r.getSnapshot=u,G1(r)&&V1(e)}function H1(e,r,i){return i(function(){G1(r)&&V1(e)})}function G1(e){var r=e.getSnapshot;e=e.value;try{var i=r();return!zn(e,i)}catch{return!0}}function V1(e){var r=As(e,2);r!==null&&kn(r,e,2)}function nm(e){var r=vn();if(typeof e=="function"){var i=e;if(e=i(),Bs){On(!0);try{i()}finally{On(!1)}}}return r.memoizedState=r.baseState=e,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:e},r}function F1(e,r,i,u){return e.baseState=i,em(e,pt,typeof u=="function"?u:sa)}function f4(e,r,i,u,h){if(qc(e))throw Error(o(485));if(e=r.action,e!==null){var x={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){x.listeners.push(j)}};P.T!==null?i(!0):x.isTransition=!1,u(x),i=r.pending,i===null?(x.next=r.pending=x,Y1(r,x)):(x.next=i.next,r.pending=i.next=x)}}function Y1(e,r){var i=r.action,u=r.payload,h=e.state;if(r.isTransition){var x=P.T,j={};P.T=j;try{var A=i(h,u),z=P.S;z!==null&&z(j,A),q1(e,r,A)}catch(J){rm(e,r,J)}finally{x!==null&&j.types!==null&&(x.types=j.types),P.T=x}}else try{x=i(h,u),q1(e,r,x)}catch(J){rm(e,r,J)}}function q1(e,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(u){K1(e,r,u)},function(u){return rm(e,r,u)}):K1(e,r,i)}function K1(e,r,i){r.status="fulfilled",r.value=i,W1(r),e.state=i,r=e.pending,r!==null&&(i=r.next,i===r?e.pending=null:(i=i.next,r.next=i,Y1(e,i)))}function rm(e,r,i){var u=e.pending;if(e.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=i,W1(r),r=r.next;while(r!==u)}e.action=null}function W1(e){e=e.listeners;for(var r=0;r<e.length;r++)(0,e[r])()}function X1(e,r){return r}function Z1(e,r){if(Je){var i=xt.formState;if(i!==null){e:{var u=Ue;if(Je){if(yt){t:{for(var h=yt,x=or;h.nodeType!==8;){if(!x){h=null;break t}if(h=lr(h.nextSibling),h===null){h=null;break t}}x=h.data,h=x==="F!"||x==="F"?h:null}if(h){yt=lr(h.nextSibling),u=h.data==="F!";break e}}Ua(u)}u=!1}u&&(r=i[0])}}return i=vn(),i.memoizedState=i.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:X1,lastRenderedState:r},i.queue=u,i=gv.bind(null,Ue,u),u.dispatch=i,u=nm(!1),x=cm.bind(null,Ue,!1,u.queue),u=vn(),h={state:r,dispatch:null,action:e,pending:null},u.queue=h,i=f4.bind(null,Ue,h,x,i),h.dispatch=i,u.memoizedState=e,[r,i,!1]}function Q1(e){var r=zt();return J1(r,pt,e)}function J1(e,r,i){if(r=em(e,r,X1)[0],e=Vc(sa)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=nl(r)}catch(j){throw j===zo?Oc:j}else u=r;r=zt();var h=r.queue,x=h.dispatch;return i!==r.memoizedState&&(Ue.flags|=2048,$o(9,{destroy:void 0},m4.bind(null,h,i),null)),[u,x,e]}function m4(e,r){e.action=r}function ev(e){var r=zt(),i=pt;if(i!==null)return J1(r,i,e);zt(),r=r.memoizedState,i=zt();var u=i.queue.dispatch;return i.memoizedState=e,[r,u,!1]}function $o(e,r,i,u){return e={tag:e,create:i,deps:u,inst:r,next:null},r=Ue.updateQueue,r===null&&(r=Hc(),Ue.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=e.next=e:(u=i.next,i.next=e,e.next=u,r.lastEffect=e),e}function tv(){return zt().memoizedState}function Fc(e,r,i,u){var h=vn();Ue.flags|=e,h.memoizedState=$o(1|r,{destroy:void 0},i,u===void 0?null:u)}function Yc(e,r,i,u){var h=zt();u=u===void 0?null:u;var x=h.memoizedState.inst;pt!==null&&u!==null&&Kf(u,pt.memoizedState.deps)?h.memoizedState=$o(r,x,i,u):(Ue.flags|=e,h.memoizedState=$o(1|r,x,i,u))}function nv(e,r){Fc(8390656,8,e,r)}function am(e,r){Yc(2048,8,e,r)}function p4(e){Ue.flags|=4;var r=Ue.updateQueue;if(r===null)r=Hc(),Ue.updateQueue=r,r.events=[e];else{var i=r.events;i===null?r.events=[e]:i.push(e)}}function rv(e){var r=zt().memoizedState;return p4({ref:r,nextImpl:e}),function(){if((ot&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}function av(e,r){return Yc(4,2,e,r)}function sv(e,r){return Yc(4,4,e,r)}function ov(e,r){if(typeof r=="function"){e=e();var i=r(e);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function iv(e,r,i){i=i!=null?i.concat([e]):null,Yc(4,4,ov.bind(null,r,e),i)}function sm(){}function lv(e,r){var i=zt();r=r===void 0?null:r;var u=i.memoizedState;return r!==null&&Kf(r,u[1])?u[0]:(i.memoizedState=[e,r],e)}function cv(e,r){var i=zt();r=r===void 0?null:r;var u=i.memoizedState;if(r!==null&&Kf(r,u[1]))return u[0];if(u=e(),Bs){On(!0);try{e()}finally{On(!1)}}return i.memoizedState=[u,r],u}function om(e,r,i){return i===void 0||(aa&1073741824)!==0&&(We&261930)===0?e.memoizedState=r:(e.memoizedState=i,e=ub(),Ue.lanes|=e,Ka|=e,i)}function uv(e,r,i,u){return zn(i,r)?i:Io.current!==null?(e=om(e,i,u),zn(e,r)||($t=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(We&261930)===0?($t=!0,e.memoizedState=i):(e=ub(),Ue.lanes|=e,Ka|=e,r)}function dv(e,r,i,u,h){var x=Z.p;Z.p=x!==0&&8>x?x:8;var j=P.T,A={};P.T=A,cm(e,!1,r,i);try{var z=h(),J=P.S;if(J!==null&&J(A,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var le=c4(z,u);rl(e,r,le,Hn(e))}else rl(e,r,u,Hn(e))}catch(he){rl(e,r,{then:function(){},status:"rejected",reason:he},Hn())}finally{Z.p=x,j!==null&&A.types!==null&&(j.types=A.types),P.T=j}}function h4(){}function im(e,r,i,u){if(e.tag!==5)throw Error(o(476));var h=fv(e).queue;dv(e,h,r,ae,i===null?h4:function(){return mv(e),i(u)})}function fv(e){var r=e.memoizedState;if(r!==null)return r;r={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:ae},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:i},next:null},e.memoizedState=r,e=e.alternate,e!==null&&(e.memoizedState=r),r}function mv(e){var r=fv(e);r.next===null&&(r=e.alternate.memoizedState),rl(e,r.next.queue,{},Hn())}function lm(){return sn(yl)}function pv(){return zt().memoizedState}function hv(){return zt().memoizedState}function g4(e){for(var r=e.return;r!==null;){switch(r.tag){case 24:case 3:var i=Hn();e=Ha(i);var u=Ga(r,e,i);u!==null&&(kn(u,r,i),Qi(u,r,i)),r={cache:Pf()},e.payload=r;return}r=r.return}}function x4(e,r,i){var u=Hn();i={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},qc(e)?xv(r,i):(i=Ef(e,r,i,u),i!==null&&(kn(i,e,u),vv(i,r,u)))}function gv(e,r,i){var u=Hn();rl(e,r,i,u)}function rl(e,r,i,u){var h={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(qc(e))xv(r,h);else{var x=e.alternate;if(e.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var j=r.lastRenderedState,A=x(j,i);if(h.hasEagerState=!0,h.eagerState=A,zn(A,j))return kc(e,r,h,0),xt===null&&Ec(),!1}catch{}finally{}if(i=Ef(e,r,h,u),i!==null)return kn(i,e,u),vv(i,r,u),!0}return!1}function cm(e,r,i,u){if(u={lane:2,revertLane:$m(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},qc(e)){if(r)throw Error(o(479))}else r=Ef(e,i,u,2),r!==null&&kn(r,e,2)}function qc(e){var r=e.alternate;return e===Ue||r!==null&&r===Ue}function xv(e,r){Uo=Bc=!0;var i=e.pending;i===null?r.next=r:(r.next=i.next,i.next=r),e.pending=r}function vv(e,r,i){if((i&4194048)!==0){var u=r.lanes;u&=e.pendingLanes,i|=u,r.lanes=i,fn(e,i)}}var al={readContext:sn,use:Gc,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};al.useEffectEvent=At;var bv={readContext:sn,use:Gc,useCallback:function(e,r){return vn().memoizedState=[e,r===void 0?null:r],e},useContext:sn,useEffect:nv,useImperativeHandle:function(e,r,i){i=i!=null?i.concat([e]):null,Fc(4194308,4,ov.bind(null,r,e),i)},useLayoutEffect:function(e,r){return Fc(4194308,4,e,r)},useInsertionEffect:function(e,r){Fc(4,2,e,r)},useMemo:function(e,r){var i=vn();r=r===void 0?null:r;var u=e();if(Bs){On(!0);try{e()}finally{On(!1)}}return i.memoizedState=[u,r],u},useReducer:function(e,r,i){var u=vn();if(i!==void 0){var h=i(r);if(Bs){On(!0);try{i(r)}finally{On(!1)}}}else h=r;return u.memoizedState=u.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},u.queue=e,e=e.dispatch=x4.bind(null,Ue,e),[u.memoizedState,e]},useRef:function(e){var r=vn();return e={current:e},r.memoizedState=e},useState:function(e){e=nm(e);var r=e.queue,i=gv.bind(null,Ue,r);return r.dispatch=i,[e.memoizedState,i]},useDebugValue:sm,useDeferredValue:function(e,r){var i=vn();return om(i,e,r)},useTransition:function(){var e=nm(!1);return e=dv.bind(null,Ue,e.queue,!0,!1),vn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,r,i){var u=Ue,h=vn();if(Je){if(i===void 0)throw Error(o(407));i=i()}else{if(i=r(),xt===null)throw Error(o(349));(We&127)!==0||B1(u,r,i)}h.memoizedState=i;var x={value:i,getSnapshot:r};return h.queue=x,nv(H1.bind(null,u,x,e),[e]),u.flags|=2048,$o(9,{destroy:void 0},$1.bind(null,u,x,i,r),null),i},useId:function(){var e=vn(),r=xt.identifierPrefix;if(Je){var i=_r,u=Ar;i=(u&~(1<<32-Mt(u)-1)).toString(32)+i,r="_"+r+"R_"+i,i=$c++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=u4++,r="_"+r+"r_"+i.toString(32)+"_";return e.memoizedState=r},useHostTransitionStatus:lm,useFormState:Z1,useActionState:Z1,useOptimistic:function(e){var r=vn();r.memoizedState=r.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=cm.bind(null,Ue,!0,i),i.dispatch=r,[e,r]},useMemoCache:Jf,useCacheRefresh:function(){return vn().memoizedState=g4.bind(null,Ue)},useEffectEvent:function(e){var r=vn(),i={impl:e};return r.memoizedState=i,function(){if((ot&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},um={readContext:sn,use:Gc,useCallback:lv,useContext:sn,useEffect:am,useImperativeHandle:iv,useInsertionEffect:av,useLayoutEffect:sv,useMemo:cv,useReducer:Vc,useRef:tv,useState:function(){return Vc(sa)},useDebugValue:sm,useDeferredValue:function(e,r){var i=zt();return uv(i,pt.memoizedState,e,r)},useTransition:function(){var e=Vc(sa)[0],r=zt().memoizedState;return[typeof e=="boolean"?e:nl(e),r]},useSyncExternalStore:U1,useId:pv,useHostTransitionStatus:lm,useFormState:Q1,useActionState:Q1,useOptimistic:function(e,r){var i=zt();return F1(i,pt,e,r)},useMemoCache:Jf,useCacheRefresh:hv};um.useEffectEvent=rv;var yv={readContext:sn,use:Gc,useCallback:lv,useContext:sn,useEffect:am,useImperativeHandle:iv,useInsertionEffect:av,useLayoutEffect:sv,useMemo:cv,useReducer:tm,useRef:tv,useState:function(){return tm(sa)},useDebugValue:sm,useDeferredValue:function(e,r){var i=zt();return pt===null?om(i,e,r):uv(i,pt.memoizedState,e,r)},useTransition:function(){var e=tm(sa)[0],r=zt().memoizedState;return[typeof e=="boolean"?e:nl(e),r]},useSyncExternalStore:U1,useId:pv,useHostTransitionStatus:lm,useFormState:ev,useActionState:ev,useOptimistic:function(e,r){var i=zt();return pt!==null?F1(i,pt,e,r):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Jf,useCacheRefresh:hv};yv.useEffectEvent=rv;function dm(e,r,i,u){r=e.memoizedState,i=i(u,r),i=i==null?r:b({},r,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var fm={enqueueSetState:function(e,r,i){e=e._reactInternals;var u=Hn(),h=Ha(u);h.payload=r,i!=null&&(h.callback=i),r=Ga(e,h,u),r!==null&&(kn(r,e,u),Qi(r,e,u))},enqueueReplaceState:function(e,r,i){e=e._reactInternals;var u=Hn(),h=Ha(u);h.tag=1,h.payload=r,i!=null&&(h.callback=i),r=Ga(e,h,u),r!==null&&(kn(r,e,u),Qi(r,e,u))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var i=Hn(),u=Ha(i);u.tag=2,r!=null&&(u.callback=r),r=Ga(e,u,i),r!==null&&(kn(r,e,i),Qi(r,e,i))}};function wv(e,r,i,u,h,x,j){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,x,j):r.prototype&&r.prototype.isPureReactComponent?!Vi(i,u)||!Vi(h,x):!0}function jv(e,r,i,u){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,u),r.state!==e&&fm.enqueueReplaceState(r,r.state,null)}function $s(e,r){var i=r;if("ref"in r){i={};for(var u in r)u!=="ref"&&(i[u]=r[u])}if(e=e.defaultProps){i===r&&(i=b({},i));for(var h in e)i[h]===void 0&&(i[h]=e[h])}return i}function Cv(e){Nc(e)}function Sv(e){console.error(e)}function Nv(e){Nc(e)}function Kc(e,r){try{var i=e.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function Ev(e,r,i){try{var u=e.onCaughtError;u(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function mm(e,r,i){return i=Ha(i),i.tag=3,i.payload={element:null},i.callback=function(){Kc(e,r)},i}function kv(e){return e=Ha(e),e.tag=3,e}function Tv(e,r,i,u){var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var x=u.value;e.payload=function(){return h(x)},e.callback=function(){Ev(r,i,u)}}var j=i.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(e.callback=function(){Ev(r,i,u),typeof h!="function"&&(Wa===null?Wa=new Set([this]):Wa.add(this));var A=u.stack;this.componentDidCatch(u.value,{componentStack:A!==null?A:""})})}function v4(e,r,i,u,h){if(i.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=i.alternate,r!==null&&Do(r,i,h,!0),i=In.current,i!==null){switch(i.tag){case 31:case 13:return ir===null?ou():i.alternate===null&&_t===0&&(_t=3),i.flags&=-257,i.flags|=65536,i.lanes=h,u===Lc?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([u]):r.add(u),Im(e,u,h)),!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)),Im(e,u,h)),!1}throw Error(o(435,i.tag))}return Im(e,u,h),ou(),!1}if(Je)return r=In.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=h,u!==_f&&(e=Error(o(422),{cause:u}),qi(rr(e,i)))):(u!==_f&&(r=Error(o(423),{cause:u}),qi(rr(r,i))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,u=rr(u,i),h=mm(e.stateNode,u,h),Gf(e,h),_t!==4&&(_t=2)),!1;var x=Error(o(520),{cause:u});if(x=rr(x,i),fl===null?fl=[x]:fl.push(x),_t!==4&&(_t=2),r===null)return!0;u=rr(u,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,e=h&-h,i.lanes|=e,e=mm(i.stateNode,u,e),Gf(i,e),!1;case 1:if(r=i.type,x=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Wa===null||!Wa.has(x))))return i.flags|=65536,h&=-h,i.lanes|=h,h=kv(h),Tv(h,e,i,u),Gf(i,h),!1}i=i.return}while(i!==null);return!1}var pm=Error(o(461)),$t=!1;function on(e,r,i,u){r.child=e===null?_1(r,null,i,u):Us(r,e.child,i,u)}function Mv(e,r,i,u,h){i=i.render;var x=r.ref;if("ref"in u){var j={};for(var A in u)A!=="ref"&&(j[A]=u[A])}else j=u;return Ls(r),u=Wf(e,r,i,j,x,h),A=Xf(),e!==null&&!$t?(Zf(e,r,h),oa(e,r,h)):(Je&&A&&Rf(r),r.flags|=1,on(e,r,u,h),r.child)}function Rv(e,r,i,u,h){if(e===null){var x=i.type;return typeof x=="function"&&!kf(x)&&x.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=x,Av(e,r,x,u,h)):(e=Mc(i.type,null,u,r,r.mode,h),e.ref=r.ref,e.return=r,r.child=e)}if(x=e.child,!jm(e,h)){var j=x.memoizedProps;if(i=i.compare,i=i!==null?i:Vi,i(j,u)&&e.ref===r.ref)return oa(e,r,h)}return r.flags|=1,e=ea(x,u),e.ref=r.ref,e.return=r,r.child=e}function Av(e,r,i,u,h){if(e!==null){var x=e.memoizedProps;if(Vi(x,u)&&e.ref===r.ref)if($t=!1,r.pendingProps=u=x,jm(e,h))(e.flags&131072)!==0&&($t=!0);else return r.lanes=e.lanes,oa(e,r,h)}return hm(e,r,i,u,h)}function _v(e,r,i,u){var h=u.children,x=e!==null?e.memoizedState:null;if(e===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(x=x!==null?x.baseLanes|i:i,e!==null){for(u=r.child=e.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~x}else u=0,r.child=null;return Dv(e,r,x,i,u)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},e!==null&&Dc(r,x!==null?x.cachePool:null),x!==null?L1(r,x):Ff(),z1(r);else return u=r.lanes=536870912,Dv(e,r,x!==null?x.baseLanes|i:i,i,u)}else x!==null?(Dc(r,x.cachePool),L1(r,x),Fa(),r.memoizedState=null):(e!==null&&Dc(r,null),Ff(),Fa());return on(e,r,h,i),r.child}function sl(e,r){return e!==null&&e.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Dv(e,r,i,u,h){var x=Uf();return x=x===null?null:{parent:Ut._currentValue,pool:x},r.memoizedState={baseLanes:i,cachePool:x},e!==null&&Dc(r,null),Ff(),z1(r),e!==null&&Do(e,r,u,!0),r.childLanes=h,null}function Wc(e,r){return r=Zc({mode:r.mode,children:r.children},e.mode),r.ref=e.ref,e.child=r,r.return=e,r}function Ov(e,r,i){return Us(r,e.child,null,i),e=Wc(r,r.pendingProps),e.flags|=2,Un(r),r.memoizedState=null,e}function b4(e,r,i){var u=r.pendingProps,h=(r.flags&128)!==0;if(r.flags&=-129,e===null){if(Je){if(u.mode==="hidden")return e=Wc(r,u),r.lanes=536870912,sl(null,e);if(qf(r),(e=yt)?(e=Yb(e,or),e=e!==null&&e.data==="&"?e:null,e!==null&&(r.memoizedState={dehydrated:e,treeContext:Pa!==null?{id:Ar,overflow:_r}:null,retryLane:536870912,hydrationErrors:null},i=x1(e),i.return=r,r.child=i,an=r,yt=null)):e=null,e===null)throw Ua(r);return r.lanes=536870912,null}return Wc(r,u)}var x=e.memoizedState;if(x!==null){var j=x.dehydrated;if(qf(r),h)if(r.flags&256)r.flags&=-257,r=Ov(e,r,i);else if(r.memoizedState!==null)r.child=e.child,r.flags|=128,r=null;else throw Error(o(558));else if($t||Do(e,r,i,!1),h=(i&e.childLanes)!==0,$t||h){if(u=xt,u!==null&&(j=Ln(u,i),j!==0&&j!==x.retryLane))throw x.retryLane=j,As(e,j),kn(u,e,j),pm;ou(),r=Ov(e,r,i)}else e=x.treeContext,yt=lr(j.nextSibling),an=r,Je=!0,Ia=null,or=!1,e!==null&&y1(r,e),r=Wc(r,u),r.flags|=4096;return r}return e=ea(e.child,{mode:u.mode,children:u.children}),e.ref=r.ref,r.child=e,e.return=r,e}function Xc(e,r){var i=r.ref;if(i===null)e!==null&&e.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(e===null||e.ref!==i)&&(r.flags|=4194816)}}function hm(e,r,i,u,h){return Ls(r),i=Wf(e,r,i,u,void 0,h),u=Xf(),e!==null&&!$t?(Zf(e,r,h),oa(e,r,h)):(Je&&u&&Rf(r),r.flags|=1,on(e,r,i,h),r.child)}function Lv(e,r,i,u,h,x){return Ls(r),r.updateQueue=null,i=I1(r,u,i,h),P1(e),u=Xf(),e!==null&&!$t?(Zf(e,r,x),oa(e,r,x)):(Je&&u&&Rf(r),r.flags|=1,on(e,r,i,x),r.child)}function zv(e,r,i,u,h){if(Ls(r),r.stateNode===null){var x=Mo,j=i.contextType;typeof j=="object"&&j!==null&&(x=sn(j)),x=new i(u,x),r.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=fm,r.stateNode=x,x._reactInternals=r,x=r.stateNode,x.props=u,x.state=r.memoizedState,x.refs={},$f(r),j=i.contextType,x.context=typeof j=="object"&&j!==null?sn(j):Mo,x.state=r.memoizedState,j=i.getDerivedStateFromProps,typeof j=="function"&&(dm(r,i,j,u),x.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(j=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),j!==x.state&&fm.enqueueReplaceState(x,x.state,null),el(r,u,x,h),Ji(),x.state=r.memoizedState),typeof x.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(e===null){x=r.stateNode;var A=r.memoizedProps,z=$s(i,A);x.props=z;var J=x.context,le=i.contextType;j=Mo,typeof le=="object"&&le!==null&&(j=sn(le));var he=i.getDerivedStateFromProps;le=typeof he=="function"||typeof x.getSnapshotBeforeUpdate=="function",A=r.pendingProps!==A,le||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A||J!==j)&&jv(r,x,u,j),$a=!1;var ee=r.memoizedState;x.state=ee,el(r,u,x,h),Ji(),J=r.memoizedState,A||ee!==J||$a?(typeof he=="function"&&(dm(r,i,he,u),J=r.memoizedState),(z=$a||wv(r,i,z,u,ee,J,j))?(le||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(r.flags|=4194308)):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=J),x.props=u,x.state=J,x.context=j,u=z):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{x=r.stateNode,Hf(e,r),j=r.memoizedProps,le=$s(i,j),x.props=le,he=r.pendingProps,ee=x.context,J=i.contextType,z=Mo,typeof J=="object"&&J!==null&&(z=sn(J)),A=i.getDerivedStateFromProps,(J=typeof A=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(j!==he||ee!==z)&&jv(r,x,u,z),$a=!1,ee=r.memoizedState,x.state=ee,el(r,u,x,h),Ji();var ne=r.memoizedState;j!==he||ee!==ne||$a||e!==null&&e.dependencies!==null&&Ac(e.dependencies)?(typeof A=="function"&&(dm(r,i,A,u),ne=r.memoizedState),(le=$a||wv(r,i,le,u,ee,ne,z)||e!==null&&e.dependencies!==null&&Ac(e.dependencies))?(J||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,ne,z),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,ne,z)),typeof x.componentDidUpdate=="function"&&(r.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof x.componentDidUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=ne),x.props=u,x.state=ne,x.context=z,u=le):(typeof x.componentDidUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&ee===e.memoizedState||(r.flags|=1024),u=!1)}return x=u,Xc(e,r),u=(r.flags&128)!==0,x||u?(x=r.stateNode,i=u&&typeof i.getDerivedStateFromError!="function"?null:x.render(),r.flags|=1,e!==null&&u?(r.child=Us(r,e.child,null,h),r.child=Us(r,null,i,h)):on(e,r,i,h),r.memoizedState=x.state,e=r.child):e=oa(e,r,h),e}function Pv(e,r,i,u){return Ds(),r.flags|=256,on(e,r,i,u),r.child}var gm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xm(e){return{baseLanes:e,cachePool:E1()}}function vm(e,r,i){return e=e!==null?e.childLanes&~i:0,r&&(e|=$n),e}function Iv(e,r,i){var u=r.pendingProps,h=!1,x=(r.flags&128)!==0,j;if((j=x)||(j=e!==null&&e.memoizedState===null?!1:(Lt.current&2)!==0),j&&(h=!0,r.flags&=-129),j=(r.flags&32)!==0,r.flags&=-33,e===null){if(Je){if(h?Va(r):Fa(),(e=yt)?(e=Yb(e,or),e=e!==null&&e.data!=="&"?e:null,e!==null&&(r.memoizedState={dehydrated:e,treeContext:Pa!==null?{id:Ar,overflow:_r}:null,retryLane:536870912,hydrationErrors:null},i=x1(e),i.return=r,r.child=i,an=r,yt=null)):e=null,e===null)throw Ua(r);return ep(e)?r.lanes=32:r.lanes=536870912,null}var A=u.children;return u=u.fallback,h?(Fa(),h=r.mode,A=Zc({mode:"hidden",children:A},h),u=_s(u,h,i,null),A.return=r,u.return=r,A.sibling=u,r.child=A,u=r.child,u.memoizedState=xm(i),u.childLanes=vm(e,j,i),r.memoizedState=gm,sl(null,u)):(Va(r),bm(r,A))}var z=e.memoizedState;if(z!==null&&(A=z.dehydrated,A!==null)){if(x)r.flags&256?(Va(r),r.flags&=-257,r=ym(e,r,i)):r.memoizedState!==null?(Fa(),r.child=e.child,r.flags|=128,r=null):(Fa(),A=u.fallback,h=r.mode,u=Zc({mode:"visible",children:u.children},h),A=_s(A,h,i,null),A.flags|=2,u.return=r,A.return=r,u.sibling=A,r.child=u,Us(r,e.child,null,i),u=r.child,u.memoizedState=xm(i),u.childLanes=vm(e,j,i),r.memoizedState=gm,r=sl(null,u));else if(Va(r),ep(A)){if(j=A.nextSibling&&A.nextSibling.dataset,j)var J=j.dgst;j=J,u=Error(o(419)),u.stack="",u.digest=j,qi({value:u,source:null,stack:null}),r=ym(e,r,i)}else if($t||Do(e,r,i,!1),j=(i&e.childLanes)!==0,$t||j){if(j=xt,j!==null&&(u=Ln(j,i),u!==0&&u!==z.retryLane))throw z.retryLane=u,As(e,u),kn(j,e,u),pm;Jm(A)||ou(),r=ym(e,r,i)}else Jm(A)?(r.flags|=192,r.child=e.child,r=null):(e=z.treeContext,yt=lr(A.nextSibling),an=r,Je=!0,Ia=null,or=!1,e!==null&&y1(r,e),r=bm(r,u.children),r.flags|=4096);return r}return h?(Fa(),A=u.fallback,h=r.mode,z=e.child,J=z.sibling,u=ea(z,{mode:"hidden",children:u.children}),u.subtreeFlags=z.subtreeFlags&65011712,J!==null?A=ea(J,A):(A=_s(A,h,i,null),A.flags|=2),A.return=r,u.return=r,u.sibling=A,r.child=u,sl(null,u),u=r.child,A=e.child.memoizedState,A===null?A=xm(i):(h=A.cachePool,h!==null?(z=Ut._currentValue,h=h.parent!==z?{parent:z,pool:z}:h):h=E1(),A={baseLanes:A.baseLanes|i,cachePool:h}),u.memoizedState=A,u.childLanes=vm(e,j,i),r.memoizedState=gm,sl(e.child,u)):(Va(r),i=e.child,e=i.sibling,i=ea(i,{mode:"visible",children:u.children}),i.return=r,i.sibling=null,e!==null&&(j=r.deletions,j===null?(r.deletions=[e],r.flags|=16):j.push(e)),r.child=i,r.memoizedState=null,i)}function bm(e,r){return r=Zc({mode:"visible",children:r},e.mode),r.return=e,e.child=r}function Zc(e,r){return e=Pn(22,e,null,r),e.lanes=0,e}function ym(e,r,i){return Us(r,e.child,null,i),e=bm(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function Uv(e,r,i){e.lanes|=r;var u=e.alternate;u!==null&&(u.lanes|=r),Lf(e.return,r,i)}function wm(e,r,i,u,h,x){var j=e.memoizedState;j===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:h,treeForkCount:x}:(j.isBackwards=r,j.rendering=null,j.renderingStartTime=0,j.last=u,j.tail=i,j.tailMode=h,j.treeForkCount=x)}function Bv(e,r,i){var u=r.pendingProps,h=u.revealOrder,x=u.tail;u=u.children;var j=Lt.current,A=(j&2)!==0;if(A?(j=j&1|2,r.flags|=128):j&=1,$(Lt,j),on(e,r,u,i),u=Je?Yi:0,!A&&e!==null&&(e.flags&128)!==0)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Uv(e,i,r);else if(e.tag===19)Uv(e,i,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(h){case"forwards":for(i=r.child,h=null;i!==null;)e=i.alternate,e!==null&&Uc(e)===null&&(h=i),i=i.sibling;i=h,i===null?(h=r.child,r.child=null):(h=i.sibling,i.sibling=null),wm(r,!1,h,i,x,u);break;case"backwards":case"unstable_legacy-backwards":for(i=null,h=r.child,r.child=null;h!==null;){if(e=h.alternate,e!==null&&Uc(e)===null){r.child=h;break}e=h.sibling,h.sibling=i,i=h,h=e}wm(r,!0,i,null,x,u);break;case"together":wm(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function oa(e,r,i){if(e!==null&&(r.dependencies=e.dependencies),Ka|=r.lanes,(i&r.childLanes)===0)if(e!==null){if(Do(e,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(e!==null&&r.child!==e.child)throw Error(o(153));if(r.child!==null){for(e=r.child,i=ea(e,e.pendingProps),r.child=i,i.return=r;e.sibling!==null;)e=e.sibling,i=i.sibling=ea(e,e.pendingProps),i.return=r;i.sibling=null}return r.child}function jm(e,r){return(e.lanes&r)!==0?!0:(e=e.dependencies,!!(e!==null&&Ac(e)))}function y4(e,r,i){switch(r.tag){case 3:ge(r,r.stateNode.containerInfo),Ba(r,Ut,e.memoizedState.cache),Ds();break;case 27:case 5:B(r);break;case 4:ge(r,r.stateNode.containerInfo);break;case 10:Ba(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,qf(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Va(r),r.flags|=128,null):(i&r.child.childLanes)!==0?Iv(e,r,i):(Va(r),e=oa(e,r,i),e!==null?e.sibling:null);Va(r);break;case 19:var h=(e.flags&128)!==0;if(u=(i&r.childLanes)!==0,u||(Do(e,r,i,!1),u=(i&r.childLanes)!==0),h){if(u)return Bv(e,r,i);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),$(Lt,Lt.current),u)break;return null;case 22:return r.lanes=0,_v(e,r,i,r.pendingProps);case 24:Ba(r,Ut,e.memoizedState.cache)}return oa(e,r,i)}function $v(e,r,i){if(e!==null)if(e.memoizedProps!==r.pendingProps)$t=!0;else{if(!jm(e,i)&&(r.flags&128)===0)return $t=!1,y4(e,r,i);$t=(e.flags&131072)!==0}else $t=!1,Je&&(r.flags&1048576)!==0&&b1(r,Yi,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(e=Ps(r.elementType),r.type=e,typeof e=="function")kf(e)?(u=$s(e,u),r.tag=1,r=zv(null,r,e,u,i)):(r.tag=0,r=hm(null,r,e,u,i));else{if(e!=null){var h=e.$$typeof;if(h===M){r.tag=11,r=Mv(null,r,e,u,i);break e}else if(h===L){r.tag=14,r=Rv(null,r,e,u,i);break e}}throw r=fe(e)||e,Error(o(306,r,""))}}return r;case 0:return hm(e,r,r.type,r.pendingProps,i);case 1:return u=r.type,h=$s(u,r.pendingProps),zv(e,r,u,h,i);case 3:e:{if(ge(r,r.stateNode.containerInfo),e===null)throw Error(o(387));u=r.pendingProps;var x=r.memoizedState;h=x.element,Hf(e,r),el(r,u,null,i);var j=r.memoizedState;if(u=j.cache,Ba(r,Ut,u),u!==x.cache&&zf(r,[Ut],i,!0),Ji(),u=j.element,x.isDehydrated)if(x={element:u,isDehydrated:!1,cache:j.cache},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){r=Pv(e,r,u,i);break e}else if(u!==h){h=rr(Error(o(424)),r),qi(h),r=Pv(e,r,u,i);break e}else{switch(e=r.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(yt=lr(e.firstChild),an=r,Je=!0,Ia=null,or=!0,i=_1(r,null,u,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Ds(),u===h){r=oa(e,r,i);break e}on(e,r,u,i)}r=r.child}return r;case 26:return Xc(e,r),e===null?(i=Qb(r.type,null,r.pendingProps,null))?r.memoizedState=i:Je||(i=r.type,e=r.pendingProps,u=mu(xe.current).createElement(i),u[ye]=r,u[Re]=e,ln(u,i,e),Wt(u),r.stateNode=u):r.memoizedState=Qb(r.type,e.memoizedProps,r.pendingProps,e.memoizedState),null;case 27:return B(r),e===null&&Je&&(u=r.stateNode=Wb(r.type,r.pendingProps,xe.current),an=r,or=!0,h=yt,Ja(r.type)?(tp=h,yt=lr(u.firstChild)):yt=h),on(e,r,r.pendingProps.children,i),Xc(e,r),e===null&&(r.flags|=4194304),r.child;case 5:return e===null&&Je&&((h=u=yt)&&(u=X4(u,r.type,r.pendingProps,or),u!==null?(r.stateNode=u,an=r,yt=lr(u.firstChild),or=!1,h=!0):h=!1),h||Ua(r)),B(r),h=r.type,x=r.pendingProps,j=e!==null?e.memoizedProps:null,u=x.children,Xm(h,x)?u=null:j!==null&&Xm(h,j)&&(r.flags|=32),r.memoizedState!==null&&(h=Wf(e,r,d4,null,null,i),yl._currentValue=h),Xc(e,r),on(e,r,u,i),r.child;case 6:return e===null&&Je&&((e=i=yt)&&(i=Z4(i,r.pendingProps,or),i!==null?(r.stateNode=i,an=r,yt=null,e=!0):e=!1),e||Ua(r)),null;case 13:return Iv(e,r,i);case 4:return ge(r,r.stateNode.containerInfo),u=r.pendingProps,e===null?r.child=Us(r,null,u,i):on(e,r,u,i),r.child;case 11:return Mv(e,r,r.type,r.pendingProps,i);case 7:return on(e,r,r.pendingProps,i),r.child;case 8:return on(e,r,r.pendingProps.children,i),r.child;case 12:return on(e,r,r.pendingProps.children,i),r.child;case 10:return u=r.pendingProps,Ba(r,r.type,u.value),on(e,r,u.children,i),r.child;case 9:return h=r.type._context,u=r.pendingProps.children,Ls(r),h=sn(h),u=u(h),r.flags|=1,on(e,r,u,i),r.child;case 14:return Rv(e,r,r.type,r.pendingProps,i);case 15:return Av(e,r,r.type,r.pendingProps,i);case 19:return Bv(e,r,i);case 31:return b4(e,r,i);case 22:return _v(e,r,i,r.pendingProps);case 24:return Ls(r),u=sn(Ut),e===null?(h=Uf(),h===null&&(h=xt,x=Pf(),h.pooledCache=x,x.refCount++,x!==null&&(h.pooledCacheLanes|=i),h=x),r.memoizedState={parent:u,cache:h},$f(r),Ba(r,Ut,h)):((e.lanes&i)!==0&&(Hf(e,r),el(r,null,null,i),Ji()),h=e.memoizedState,x=r.memoizedState,h.parent!==u?(h={parent:u,cache:u},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),Ba(r,Ut,u)):(u=x.cache,Ba(r,Ut,u),u!==h.cache&&zf(r,[Ut],i,!0))),on(e,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(o(156,r.tag))}function ia(e){e.flags|=4}function Cm(e,r,i,u,h){if((r=(e.mode&32)!==0)&&(r=!1),r){if(e.flags|=16777216,(h&335544128)===h)if(e.stateNode.complete)e.flags|=8192;else if(pb())e.flags|=8192;else throw Is=Lc,Bf}else e.flags&=-16777217}function Hv(e,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ry(r))if(pb())e.flags|=8192;else throw Is=Lc,Bf}function Qc(e,r){r!==null&&(e.flags|=4),e.flags&16384&&(r=e.tag!==22?it():536870912,e.lanes|=r,Fo|=r)}function ol(e,r){if(!Je)switch(e.tailMode){case"hidden":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function wt(e){var r=e.alternate!==null&&e.alternate.child===e.child,i=0,u=0;if(r)for(var h=e.child;h!==null;)i|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)i|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=u,e.childLanes=i,r}function w4(e,r,i){var u=r.pendingProps;switch(Af(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(r),null;case 1:return wt(r),null;case 3:return i=r.stateNode,u=null,e!==null&&(u=e.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),ra(Ut),me(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(_o(r)?ia(r):e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Df())),wt(r),null;case 26:var h=r.type,x=r.memoizedState;return e===null?(ia(r),x!==null?(wt(r),Hv(r,x)):(wt(r),Cm(r,h,null,u,i))):x?x!==e.memoizedState?(ia(r),wt(r),Hv(r,x)):(wt(r),r.flags&=-16777217):(e=e.memoizedProps,e!==u&&ia(r),wt(r),Cm(r,h,e,u,i)),null;case 27:if(ie(r),i=xe.current,h=r.type,e!==null&&r.stateNode!=null)e.memoizedProps!==u&&ia(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return wt(r),null}e=H.current,_o(r)?w1(r):(e=Wb(h,u,i),r.stateNode=e,ia(r))}return wt(r),null;case 5:if(ie(r),h=r.type,e!==null&&r.stateNode!=null)e.memoizedProps!==u&&ia(r);else{if(!u){if(r.stateNode===null)throw Error(o(166));return wt(r),null}if(x=H.current,_o(r))w1(r);else{var j=mu(xe.current);switch(x){case 1:x=j.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:x=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":x=j.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":x=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":x=j.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof u.is=="string"?j.createElement("select",{is:u.is}):j.createElement("select"),u.multiple?x.multiple=!0:u.size&&(x.size=u.size);break;default:x=typeof u.is=="string"?j.createElement(h,{is:u.is}):j.createElement(h)}}x[ye]=r,x[Re]=u;e:for(j=r.child;j!==null;){if(j.tag===5||j.tag===6)x.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===r)break e;for(;j.sibling===null;){if(j.return===null||j.return===r)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}r.stateNode=x;e:switch(ln(x,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ia(r)}}return wt(r),Cm(r,r.type,e===null?null:e.memoizedProps,r.pendingProps,i),null;case 6:if(e&&r.stateNode!=null)e.memoizedProps!==u&&ia(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(o(166));if(e=xe.current,_o(r)){if(e=r.stateNode,i=r.memoizedProps,u=null,h=an,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}e[ye]=r,e=!!(e.nodeValue===i||u!==null&&u.suppressHydrationWarning===!0||Ib(e.nodeValue,i)),e||Ua(r,!0)}else e=mu(e).createTextNode(u),e[ye]=r,r.stateNode=e}return wt(r),null;case 31:if(i=r.memoizedState,e===null||e.memoizedState!==null){if(u=_o(r),i!==null){if(e===null){if(!u)throw Error(o(318));if(e=r.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ye]=r}else Ds(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;wt(r),e=!1}else i=Df(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return r.flags&256?(Un(r),r):(Un(r),null);if((r.flags&128)!==0)throw Error(o(558))}return wt(r),null;case 13:if(u=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=_o(r),u!==null&&u.dehydrated!==null){if(e===null){if(!h)throw Error(o(318));if(h=r.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(o(317));h[ye]=r}else Ds(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;wt(r),h=!1}else h=Df(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(Un(r),r):(Un(r),null)}return Un(r),(r.flags&128)!==0?(r.lanes=i,r):(i=u!==null,e=e!==null&&e.memoizedState!==null,i&&(u=r.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==h&&(u.flags|=2048)),i!==e&&i&&(r.child.flags|=8192),Qc(r,r.updateQueue),wt(r),null);case 4:return me(),e===null&&Fm(r.stateNode.containerInfo),wt(r),null;case 10:return ra(r.type),wt(r),null;case 19:if(D(Lt),u=r.memoizedState,u===null)return wt(r),null;if(h=(r.flags&128)!==0,x=u.rendering,x===null)if(h)ol(u,!1);else{if(_t!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(x=Uc(e),x!==null){for(r.flags|=128,ol(u,!1),e=x.updateQueue,r.updateQueue=e,Qc(r,e),r.subtreeFlags=0,e=i,i=r.child;i!==null;)g1(i,e),i=i.sibling;return $(Lt,Lt.current&1|2),Je&&ta(r,u.treeForkCount),r.child}e=e.sibling}u.tail!==null&&It()>ru&&(r.flags|=128,h=!0,ol(u,!1),r.lanes=4194304)}else{if(!h)if(e=Uc(x),e!==null){if(r.flags|=128,h=!0,e=e.updateQueue,r.updateQueue=e,Qc(r,e),ol(u,!0),u.tail===null&&u.tailMode==="hidden"&&!x.alternate&&!Je)return wt(r),null}else 2*It()-u.renderingStartTime>ru&&i!==536870912&&(r.flags|=128,h=!0,ol(u,!1),r.lanes=4194304);u.isBackwards?(x.sibling=r.child,r.child=x):(e=u.last,e!==null?e.sibling=x:r.child=x,u.last=x)}return u.tail!==null?(e=u.tail,u.rendering=e,u.tail=e.sibling,u.renderingStartTime=It(),e.sibling=null,i=Lt.current,$(Lt,h?i&1|2:i&1),Je&&ta(r,u.treeForkCount),e):(wt(r),null);case 22:case 23:return Un(r),Yf(),u=r.memoizedState!==null,e!==null?e.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(i&536870912)!==0&&(r.flags&128)===0&&(wt(r),r.subtreeFlags&6&&(r.flags|=8192)):wt(r),i=r.updateQueue,i!==null&&Qc(r,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==i&&(r.flags|=2048),e!==null&&D(zs),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),ra(Ut),wt(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function j4(e,r){switch(Af(r),r.tag){case 1:return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return ra(Ut),me(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 26:case 27:case 5:return ie(r),null;case 31:if(r.memoizedState!==null){if(Un(r),r.alternate===null)throw Error(o(340));Ds()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 13:if(Un(r),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(o(340));Ds()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return D(Lt),null;case 4:return me(),null;case 10:return ra(r.type),null;case 22:case 23:return Un(r),Yf(),e!==null&&D(zs),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 24:return ra(Ut),null;case 25:return null;default:return null}}function Gv(e,r){switch(Af(r),r.tag){case 3:ra(Ut),me();break;case 26:case 27:case 5:ie(r);break;case 4:me();break;case 31:r.memoizedState!==null&&Un(r);break;case 13:Un(r);break;case 19:D(Lt);break;case 10:ra(r.type);break;case 22:case 23:Un(r),Yf(),e!==null&&D(zs);break;case 24:ra(Ut)}}function il(e,r){try{var i=r.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var h=u.next;i=h;do{if((i.tag&e)===e){u=void 0;var x=i.create,j=i.inst;u=x(),j.destroy=u}i=i.next}while(i!==h)}}catch(A){ct(r,r.return,A)}}function Ya(e,r,i){try{var u=r.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var x=h.next;u=x;do{if((u.tag&e)===e){var j=u.inst,A=j.destroy;if(A!==void 0){j.destroy=void 0,h=r;var z=i,J=A;try{J()}catch(le){ct(h,z,le)}}}u=u.next}while(u!==x)}}catch(le){ct(r,r.return,le)}}function Vv(e){var r=e.updateQueue;if(r!==null){var i=e.stateNode;try{O1(r,i)}catch(u){ct(e,e.return,u)}}}function Fv(e,r,i){i.props=$s(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(u){ct(e,r,u)}}function ll(e,r){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var u=e.stateNode;break;case 30:u=e.stateNode;break;default:u=e.stateNode}typeof i=="function"?e.refCleanup=i(u):i.current=u}}catch(h){ct(e,r,h)}}function Dr(e,r){var i=e.ref,u=e.refCleanup;if(i!==null)if(typeof u=="function")try{u()}catch(h){ct(e,r,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(h){ct(e,r,h)}else i.current=null}function Yv(e){var r=e.type,i=e.memoizedProps,u=e.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(h){ct(e,e.return,h)}}function Sm(e,r,i){try{var u=e.stateNode;V4(u,e.type,i,r),u[Re]=r}catch(h){ct(e,e.return,h)}}function qv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ja(e.type)||e.tag===4}function Nm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ja(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Em(e,r,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(e),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=Qr));else if(u!==4&&(u===27&&Ja(e.type)&&(i=e.stateNode,r=null),e=e.child,e!==null))for(Em(e,r,i),e=e.sibling;e!==null;)Em(e,r,i),e=e.sibling}function Jc(e,r,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?i.insertBefore(e,r):i.appendChild(e);else if(u!==4&&(u===27&&Ja(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Jc(e,r,i),e=e.sibling;e!==null;)Jc(e,r,i),e=e.sibling}function Kv(e){var r=e.stateNode,i=e.memoizedProps;try{for(var u=e.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);ln(r,u,i),r[ye]=e,r[Re]=i}catch(x){ct(e,e.return,x)}}var la=!1,Ht=!1,km=!1,Wv=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function C4(e,r){if(e=e.containerInfo,Km=yu,e=i1(e),yf(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var h=u.anchorOffset,x=u.focusNode;u=u.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var j=0,A=-1,z=-1,J=0,le=0,he=e,ee=null;t:for(;;){for(var ne;he!==i||h!==0&&he.nodeType!==3||(A=j+h),he!==x||u!==0&&he.nodeType!==3||(z=j+u),he.nodeType===3&&(j+=he.nodeValue.length),(ne=he.firstChild)!==null;)ee=he,he=ne;for(;;){if(he===e)break t;if(ee===i&&++J===h&&(A=j),ee===x&&++le===u&&(z=j),(ne=he.nextSibling)!==null)break;he=ee,ee=he.parentNode}he=ne}i=A===-1||z===-1?null:{start:A,end:z}}else i=null}i=i||{start:0,end:0}}else i=null;for(Wm={focusedElem:e,selectionRange:i},yu=!1,Xt=r;Xt!==null;)if(r=Xt,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,Xt=e;else for(;Xt!==null;){switch(r=Xt,x=r.alternate,e=r.flags,r.tag){case 0:if((e&4)!==0&&(e=r.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)h=e[i],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&x!==null){e=void 0,i=r,h=x.memoizedProps,x=x.memoizedState,u=i.stateNode;try{var Ee=$s(i.type,h);e=u.getSnapshotBeforeUpdate(Ee,x),u.__reactInternalSnapshotBeforeUpdate=e}catch(Le){ct(i,i.return,Le)}}break;case 3:if((e&1024)!==0){if(e=r.stateNode.containerInfo,i=e.nodeType,i===9)Qm(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Qm(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=r.sibling,e!==null){e.return=r.return,Xt=e;break}Xt=r.return}}function Xv(e,r,i){var u=i.flags;switch(i.tag){case 0:case 11:case 15:ua(e,i),u&4&&il(5,i);break;case 1:if(ua(e,i),u&4)if(e=i.stateNode,r===null)try{e.componentDidMount()}catch(j){ct(i,i.return,j)}else{var h=$s(i.type,r.memoizedProps);r=r.memoizedState;try{e.componentDidUpdate(h,r,e.__reactInternalSnapshotBeforeUpdate)}catch(j){ct(i,i.return,j)}}u&64&&Vv(i),u&512&&ll(i,i.return);break;case 3:if(ua(e,i),u&64&&(e=i.updateQueue,e!==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{O1(e,r)}catch(j){ct(i,i.return,j)}}break;case 27:r===null&&u&4&&Kv(i);case 26:case 5:ua(e,i),r===null&&u&4&&Yv(i),u&512&&ll(i,i.return);break;case 12:ua(e,i);break;case 31:ua(e,i),u&4&&Jv(e,i);break;case 13:ua(e,i),u&4&&eb(e,i),u&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=_4.bind(null,i),Q4(e,i))));break;case 22:if(u=i.memoizedState!==null||la,!u){r=r!==null&&r.memoizedState!==null||Ht,h=la;var x=Ht;la=u,(Ht=r)&&!x?da(e,i,(i.subtreeFlags&8772)!==0):ua(e,i),la=h,Ht=x}break;case 30:break;default:ua(e,i)}}function Zv(e){var r=e.alternate;r!==null&&(e.alternate=null,Zv(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&Wr(r)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var St=null,Cn=!1;function ca(e,r,i){for(i=i.child;i!==null;)Qv(e,r,i),i=i.sibling}function Qv(e,r,i){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(gr,i)}catch{}switch(i.tag){case 26:Ht||Dr(i,r),ca(e,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Ht||Dr(i,r);var u=St,h=Cn;Ja(i.type)&&(St=i.stateNode,Cn=!1),ca(e,r,i),xl(i.stateNode),St=u,Cn=h;break;case 5:Ht||Dr(i,r);case 6:if(u=St,h=Cn,St=null,ca(e,r,i),St=u,Cn=h,St!==null)if(Cn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(i.stateNode)}catch(x){ct(i,r,x)}else try{St.removeChild(i.stateNode)}catch(x){ct(i,r,x)}break;case 18:St!==null&&(Cn?(e=St,Vb(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Jo(e)):Vb(St,i.stateNode));break;case 4:u=St,h=Cn,St=i.stateNode.containerInfo,Cn=!0,ca(e,r,i),St=u,Cn=h;break;case 0:case 11:case 14:case 15:Ya(2,i,r),Ht||Ya(4,i,r),ca(e,r,i);break;case 1:Ht||(Dr(i,r),u=i.stateNode,typeof u.componentWillUnmount=="function"&&Fv(i,r,u)),ca(e,r,i);break;case 21:ca(e,r,i);break;case 22:Ht=(u=Ht)||i.memoizedState!==null,ca(e,r,i),Ht=u;break;default:ca(e,r,i)}}function Jv(e,r){if(r.memoizedState===null&&(e=r.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jo(e)}catch(i){ct(r,r.return,i)}}}function eb(e,r){if(r.memoizedState===null&&(e=r.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jo(e)}catch(i){ct(r,r.return,i)}}function S4(e){switch(e.tag){case 31:case 13:case 19:var r=e.stateNode;return r===null&&(r=e.stateNode=new Wv),r;case 22:return e=e.stateNode,r=e._retryCache,r===null&&(r=e._retryCache=new Wv),r;default:throw Error(o(435,e.tag))}}function eu(e,r){var i=S4(e);r.forEach(function(u){if(!i.has(u)){i.add(u);var h=D4.bind(null,e,u);u.then(h,h)}})}function Sn(e,r){var i=r.deletions;if(i!==null)for(var u=0;u<i.length;u++){var h=i[u],x=e,j=r,A=j;e:for(;A!==null;){switch(A.tag){case 27:if(Ja(A.type)){St=A.stateNode,Cn=!1;break e}break;case 5:St=A.stateNode,Cn=!1;break e;case 3:case 4:St=A.stateNode.containerInfo,Cn=!0;break e}A=A.return}if(St===null)throw Error(o(160));Qv(x,j,h),St=null,Cn=!1,x=h.alternate,x!==null&&(x.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)tb(r,e),r=r.sibling}var br=null;function tb(e,r){var i=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Sn(r,e),Nn(e),u&4&&(Ya(3,e,e.return),il(3,e),Ya(5,e,e.return));break;case 1:Sn(r,e),Nn(e),u&512&&(Ht||i===null||Dr(i,i.return)),u&64&&la&&(e=e.updateQueue,e!==null&&(u=e.callbacks,u!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?u:i.concat(u))));break;case 26:var h=br;if(Sn(r,e),Nn(e),u&512&&(Ht||i===null||Dr(i,i.return)),u&4){var x=i!==null?i.memoizedState:null;if(u=e.memoizedState,i===null)if(u===null)if(e.stateNode===null){e:{u=e.type,i=e.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":x=h.getElementsByTagName("title")[0],(!x||x[mn]||x[ye]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=h.createElement(u),h.head.insertBefore(x,h.querySelector("head > title"))),ln(x,u,i),x[ye]=e,Wt(x),u=x;break e;case"link":var j=ty("link","href",h).get(u+(i.href||""));if(j){for(var A=0;A<j.length;A++)if(x=j[A],x.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&x.getAttribute("rel")===(i.rel==null?null:i.rel)&&x.getAttribute("title")===(i.title==null?null:i.title)&&x.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){j.splice(A,1);break t}}x=h.createElement(u),ln(x,u,i),h.head.appendChild(x);break;case"meta":if(j=ty("meta","content",h).get(u+(i.content||""))){for(A=0;A<j.length;A++)if(x=j[A],x.getAttribute("content")===(i.content==null?null:""+i.content)&&x.getAttribute("name")===(i.name==null?null:i.name)&&x.getAttribute("property")===(i.property==null?null:i.property)&&x.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&x.getAttribute("charset")===(i.charSet==null?null:i.charSet)){j.splice(A,1);break t}}x=h.createElement(u),ln(x,u,i),h.head.appendChild(x);break;default:throw Error(o(468,u))}x[ye]=e,Wt(x),u=x}e.stateNode=u}else ny(h,e.type,e.stateNode);else e.stateNode=ey(h,u,e.memoizedProps);else x!==u?(x===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):x.count--,u===null?ny(h,e.type,e.stateNode):ey(h,u,e.memoizedProps)):u===null&&e.stateNode!==null&&Sm(e,e.memoizedProps,i.memoizedProps)}break;case 27:Sn(r,e),Nn(e),u&512&&(Ht||i===null||Dr(i,i.return)),i!==null&&u&4&&Sm(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Sn(r,e),Nn(e),u&512&&(Ht||i===null||Dr(i,i.return)),e.flags&32){h=e.stateNode;try{jo(h,"")}catch(Ee){ct(e,e.return,Ee)}}u&4&&e.stateNode!=null&&(h=e.memoizedProps,Sm(e,h,i!==null?i.memoizedProps:h)),u&1024&&(km=!0);break;case 6:if(Sn(r,e),Nn(e),u&4){if(e.stateNode===null)throw Error(o(162));u=e.memoizedProps,i=e.stateNode;try{i.nodeValue=u}catch(Ee){ct(e,e.return,Ee)}}break;case 3:if(gu=null,h=br,br=pu(r.containerInfo),Sn(r,e),br=h,Nn(e),u&4&&i!==null&&i.memoizedState.isDehydrated)try{Jo(r.containerInfo)}catch(Ee){ct(e,e.return,Ee)}km&&(km=!1,nb(e));break;case 4:u=br,br=pu(e.stateNode.containerInfo),Sn(r,e),Nn(e),br=u;break;case 12:Sn(r,e),Nn(e);break;case 31:Sn(r,e),Nn(e),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,eu(e,u)));break;case 13:Sn(r,e),Nn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(nu=It()),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,eu(e,u)));break;case 22:h=e.memoizedState!==null;var z=i!==null&&i.memoizedState!==null,J=la,le=Ht;if(la=J||h,Ht=le||z,Sn(r,e),Ht=le,la=J,Nn(e),u&8192)e:for(r=e.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(i===null||z||la||Ht||Hs(e)),i=null,r=e;;){if(r.tag===5||r.tag===26){if(i===null){z=i=r;try{if(x=z.stateNode,h)j=x.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{A=z.stateNode;var he=z.memoizedProps.style,ee=he!=null&&he.hasOwnProperty("display")?he.display:null;A.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(Ee){ct(z,z.return,Ee)}}}else if(r.tag===6){if(i===null){z=r;try{z.stateNode.nodeValue=h?"":z.memoizedProps}catch(Ee){ct(z,z.return,Ee)}}}else if(r.tag===18){if(i===null){z=r;try{var ne=z.stateNode;h?Fb(ne,!0):Fb(z.stateNode,!1)}catch(Ee){ct(z,z.return,Ee)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===e)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=e.updateQueue,u!==null&&(i=u.retryQueue,i!==null&&(u.retryQueue=null,eu(e,i))));break;case 19:Sn(r,e),Nn(e),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,eu(e,u)));break;case 30:break;case 21:break;default:Sn(r,e),Nn(e)}}function Nn(e){var r=e.flags;if(r&2){try{for(var i,u=e.return;u!==null;){if(qv(u)){i=u;break}u=u.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var h=i.stateNode,x=Nm(e);Jc(e,x,h);break;case 5:var j=i.stateNode;i.flags&32&&(jo(j,""),i.flags&=-33);var A=Nm(e);Jc(e,A,j);break;case 3:case 4:var z=i.stateNode.containerInfo,J=Nm(e);Em(e,J,z);break;default:throw Error(o(161))}}catch(le){ct(e,e.return,le)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function nb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var r=e;nb(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),e=e.sibling}}function ua(e,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Xv(e,r.alternate,r),r=r.sibling}function Hs(e){for(e=e.child;e!==null;){var r=e;switch(r.tag){case 0:case 11:case 14:case 15:Ya(4,r,r.return),Hs(r);break;case 1:Dr(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&Fv(r,r.return,i),Hs(r);break;case 27:xl(r.stateNode);case 26:case 5:Dr(r,r.return),Hs(r);break;case 22:r.memoizedState===null&&Hs(r);break;case 30:Hs(r);break;default:Hs(r)}e=e.sibling}}function da(e,r,i){for(i=i&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,h=e,x=r,j=x.flags;switch(x.tag){case 0:case 11:case 15:da(h,x,i),il(4,x);break;case 1:if(da(h,x,i),u=x,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(J){ct(u,u.return,J)}if(u=x,h=u.updateQueue,h!==null){var A=u.stateNode;try{var z=h.shared.hiddenCallbacks;if(z!==null)for(h.shared.hiddenCallbacks=null,h=0;h<z.length;h++)D1(z[h],A)}catch(J){ct(u,u.return,J)}}i&&j&64&&Vv(x),ll(x,x.return);break;case 27:Kv(x);case 26:case 5:da(h,x,i),i&&u===null&&j&4&&Yv(x),ll(x,x.return);break;case 12:da(h,x,i);break;case 31:da(h,x,i),i&&j&4&&Jv(h,x);break;case 13:da(h,x,i),i&&j&4&&eb(h,x);break;case 22:x.memoizedState===null&&da(h,x,i),ll(x,x.return);break;case 30:break;default:da(h,x,i)}r=r.sibling}}function Tm(e,r){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(e=r.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Ki(i))}function Mm(e,r){e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&Ki(e))}function yr(e,r,i,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)rb(e,r,i,u),r=r.sibling}function rb(e,r,i,u){var h=r.flags;switch(r.tag){case 0:case 11:case 15:yr(e,r,i,u),h&2048&&il(9,r);break;case 1:yr(e,r,i,u);break;case 3:yr(e,r,i,u),h&2048&&(e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&Ki(e)));break;case 12:if(h&2048){yr(e,r,i,u),e=r.stateNode;try{var x=r.memoizedProps,j=x.id,A=x.onPostCommit;typeof A=="function"&&A(j,r.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){ct(r,r.return,z)}}else yr(e,r,i,u);break;case 31:yr(e,r,i,u);break;case 13:yr(e,r,i,u);break;case 23:break;case 22:x=r.stateNode,j=r.alternate,r.memoizedState!==null?x._visibility&2?yr(e,r,i,u):cl(e,r):x._visibility&2?yr(e,r,i,u):(x._visibility|=2,Ho(e,r,i,u,(r.subtreeFlags&10256)!==0||!1)),h&2048&&Tm(j,r);break;case 24:yr(e,r,i,u),h&2048&&Mm(r.alternate,r);break;default:yr(e,r,i,u)}}function Ho(e,r,i,u,h){for(h=h&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var x=e,j=r,A=i,z=u,J=j.flags;switch(j.tag){case 0:case 11:case 15:Ho(x,j,A,z,h),il(8,j);break;case 23:break;case 22:var le=j.stateNode;j.memoizedState!==null?le._visibility&2?Ho(x,j,A,z,h):cl(x,j):(le._visibility|=2,Ho(x,j,A,z,h)),h&&J&2048&&Tm(j.alternate,j);break;case 24:Ho(x,j,A,z,h),h&&J&2048&&Mm(j.alternate,j);break;default:Ho(x,j,A,z,h)}r=r.sibling}}function cl(e,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=e,u=r,h=u.flags;switch(u.tag){case 22:cl(i,u),h&2048&&Tm(u.alternate,u);break;case 24:cl(i,u),h&2048&&Mm(u.alternate,u);break;default:cl(i,u)}r=r.sibling}}var ul=8192;function Go(e,r,i){if(e.subtreeFlags&ul)for(e=e.child;e!==null;)ab(e,r,i),e=e.sibling}function ab(e,r,i){switch(e.tag){case 26:Go(e,r,i),e.flags&ul&&e.memoizedState!==null&&u3(i,br,e.memoizedState,e.memoizedProps);break;case 5:Go(e,r,i);break;case 3:case 4:var u=br;br=pu(e.stateNode.containerInfo),Go(e,r,i),br=u;break;case 22:e.memoizedState===null&&(u=e.alternate,u!==null&&u.memoizedState!==null?(u=ul,ul=16777216,Go(e,r,i),ul=u):Go(e,r,i));break;default:Go(e,r,i)}}function sb(e){var r=e.alternate;if(r!==null&&(e=r.child,e!==null)){r.child=null;do r=e.sibling,e.sibling=null,e=r;while(e!==null)}}function dl(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var u=r[i];Xt=u,ib(u,e)}sb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ob(e),e=e.sibling}function ob(e){switch(e.tag){case 0:case 11:case 15:dl(e),e.flags&2048&&Ya(9,e,e.return);break;case 3:dl(e);break;case 12:dl(e);break;case 22:var r=e.stateNode;e.memoizedState!==null&&r._visibility&2&&(e.return===null||e.return.tag!==13)?(r._visibility&=-3,tu(e)):dl(e);break;default:dl(e)}}function tu(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var u=r[i];Xt=u,ib(u,e)}sb(e)}for(e=e.child;e!==null;){switch(r=e,r.tag){case 0:case 11:case 15:Ya(8,r,r.return),tu(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,tu(r));break;default:tu(r)}e=e.sibling}}function ib(e,r){for(;Xt!==null;){var i=Xt;switch(i.tag){case 0:case 11:case 15:Ya(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:Ki(i.memoizedState.cache)}if(u=i.child,u!==null)u.return=i,Xt=u;else e:for(i=e;Xt!==null;){u=Xt;var h=u.sibling,x=u.return;if(Zv(u),u===i){Xt=null;break e}if(h!==null){h.return=x,Xt=h;break e}Xt=x}}}var N4={getCacheForType:function(e){var r=sn(Ut),i=r.data.get(e);return i===void 0&&(i=e(),r.data.set(e,i)),i},cacheSignal:function(){return sn(Ut).controller.signal}},E4=typeof WeakMap=="function"?WeakMap:Map,ot=0,xt=null,Ge=null,We=0,lt=0,Bn=null,qa=!1,Vo=!1,Rm=!1,fa=0,_t=0,Ka=0,Gs=0,Am=0,$n=0,Fo=0,fl=null,En=null,_m=!1,nu=0,lb=0,ru=1/0,au=null,Wa=null,Yt=0,Xa=null,Yo=null,ma=0,Dm=0,Om=null,cb=null,ml=0,Lm=null;function Hn(){return(ot&2)!==0&&We!==0?We&-We:P.T!==null?$m():W()}function ub(){if($n===0)if((We&536870912)===0||Je){var e=Oa;Oa<<=1,(Oa&3932160)===0&&(Oa=262144),$n=e}else $n=536870912;return e=In.current,e!==null&&(e.flags|=32),$n}function kn(e,r,i){(e===xt&&(lt===2||lt===9)||e.cancelPendingCommit!==null)&&(qo(e,0),Za(e,We,$n,!1)),Ft(e,i),((ot&2)===0||e!==xt)&&(e===xt&&((ot&2)===0&&(Gs|=i),_t===4&&Za(e,We,$n,!1)),Or(e))}function db(e,r,i){if((ot&6)!==0)throw Error(o(327));var u=!i&&(r&127)===0&&(r&e.expiredLanes)===0||Oe(e,r),h=u?M4(e,r):Pm(e,r,!0),x=u;do{if(h===0){Vo&&!u&&Za(e,r,0,!1);break}else{if(i=e.current.alternate,x&&!k4(i)){h=Pm(e,r,!1),x=!1;continue}if(h===2){if(x=r,e.errorRecoveryDisabledLanes&x)var j=0;else j=e.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){r=j;e:{var A=e;h=fl;var z=A.current.memoizedState.isDehydrated;if(z&&(qo(A,j).flags|=256),j=Pm(A,j,!1),j!==2){if(Rm&&!z){A.errorRecoveryDisabledLanes|=x,Gs|=x,h=4;break e}x=En,En=h,x!==null&&(En===null?En=x:En.push.apply(En,x))}h=j}if(x=!1,h!==2)continue}}if(h===1){qo(e,0),Za(e,r,0,!0);break}e:{switch(u=e,x=h,x){case 0:case 1:throw Error(o(345));case 4:if((r&4194048)!==r)break;case 6:Za(u,r,$n,!qa);break e;case 2:En=null;break;case 3:case 5:break;default:throw Error(o(329))}if((r&62914560)===r&&(h=nu+300-It(),10<h)){if(Za(u,r,$n,!qa),La(u,0,!0)!==0)break e;ma=r,u.timeoutHandle=Hb(fb.bind(null,u,i,En,au,_m,r,$n,Gs,Fo,qa,x,"Throttled",-0,0),h);break e}fb(u,i,En,au,_m,r,$n,Gs,Fo,qa,x,null,-0,0)}}break}while(!0);Or(e)}function fb(e,r,i,u,h,x,j,A,z,J,le,he,ee,ne){if(e.timeoutHandle=-1,he=r.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qr},ab(r,x,he);var Ee=(x&62914560)===x?nu-It():(x&4194048)===x?lb-It():0;if(Ee=d3(he,Ee),Ee!==null){ma=x,e.cancelPendingCommit=Ee(yb.bind(null,e,r,x,i,u,h,j,A,z,le,he,null,ee,ne)),Za(e,x,j,!J);return}}yb(e,r,x,i,u,h,j,A,z)}function k4(e){for(var r=e;;){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 h=i[u],x=h.getSnapshot;h=h.value;try{if(!zn(x(),h))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Za(e,r,i,u){r&=~Am,r&=~Gs,e.suspendedLanes|=r,e.pingedLanes&=~r,u&&(e.warmLanes|=r),u=e.expirationTimes;for(var h=r;0<h;){var x=31-Mt(h),j=1<<x;u[x]=-1,h&=~j}i!==0&&Jn(e,i,r)}function su(){return(ot&6)===0?(pl(0),!1):!0}function zm(){if(Ge!==null){if(lt===0)var e=Ge.return;else e=Ge,na=Os=null,Qf(e),Po=null,Xi=0,e=Ge;for(;e!==null;)Gv(e.alternate,e),e=e.return;Ge=null}}function qo(e,r){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,q4(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ma=0,zm(),xt=e,Ge=i=ea(e.current,null),We=r,lt=0,Bn=null,qa=!1,Vo=Oe(e,r),Rm=!1,Fo=$n=Am=Gs=Ka=_t=0,En=fl=null,_m=!1,(r&8)!==0&&(r|=r&32);var u=e.entangledLanes;if(u!==0)for(e=e.entanglements,u&=r;0<u;){var h=31-Mt(u),x=1<<h;r|=e[h],u&=~x}return fa=r,Ec(),i}function mb(e,r){Ue=null,P.H=al,r===zo||r===Oc?(r=M1(),lt=3):r===Bf?(r=M1(),lt=4):lt=r===pm?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Bn=r,Ge===null&&(_t=1,Kc(e,rr(r,e.current)))}function pb(){var e=In.current;return e===null?!0:(We&4194048)===We?ir===null:(We&62914560)===We||(We&536870912)!==0?e===ir:!1}function hb(){var e=P.H;return P.H=al,e===null?al:e}function gb(){var e=P.A;return P.A=N4,e}function ou(){_t=4,qa||(We&4194048)!==We&&In.current!==null||(Vo=!0),(Ka&134217727)===0&&(Gs&134217727)===0||xt===null||Za(xt,We,$n,!1)}function Pm(e,r,i){var u=ot;ot|=2;var h=hb(),x=gb();(xt!==e||We!==r)&&(au=null,qo(e,r)),r=!1;var j=_t;e:do try{if(lt!==0&&Ge!==null){var A=Ge,z=Bn;switch(lt){case 8:zm(),j=6;break e;case 3:case 2:case 9:case 6:In.current===null&&(r=!0);var J=lt;if(lt=0,Bn=null,Ko(e,A,z,J),i&&Vo){j=0;break e}break;default:J=lt,lt=0,Bn=null,Ko(e,A,z,J)}}T4(),j=_t;break}catch(le){mb(e,le)}while(!0);return r&&e.shellSuspendCounter++,na=Os=null,ot=u,P.H=h,P.A=x,Ge===null&&(xt=null,We=0,Ec()),j}function T4(){for(;Ge!==null;)xb(Ge)}function M4(e,r){var i=ot;ot|=2;var u=hb(),h=gb();xt!==e||We!==r?(au=null,ru=It()+500,qo(e,r)):Vo=Oe(e,r);e:do try{if(lt!==0&&Ge!==null){r=Ge;var x=Bn;t:switch(lt){case 1:lt=0,Bn=null,Ko(e,r,x,1);break;case 2:case 9:if(k1(x)){lt=0,Bn=null,vb(r);break}r=function(){lt!==2&<!==9||xt!==e||(lt=7),Or(e)},x.then(r,r);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:k1(x)?(lt=0,Bn=null,vb(r)):(lt=0,Bn=null,Ko(e,r,x,7));break;case 5:var j=null;switch(Ge.tag){case 26:j=Ge.memoizedState;case 5:case 27:var A=Ge;if(j?ry(j):A.stateNode.complete){lt=0,Bn=null;var z=A.sibling;if(z!==null)Ge=z;else{var J=A.return;J!==null?(Ge=J,iu(J)):Ge=null}break t}}lt=0,Bn=null,Ko(e,r,x,5);break;case 6:lt=0,Bn=null,Ko(e,r,x,6);break;case 8:zm(),_t=6;break e;default:throw Error(o(462))}}R4();break}catch(le){mb(e,le)}while(!0);return na=Os=null,P.H=u,P.A=h,ot=i,Ge!==null?0:(xt=null,We=0,Ec(),_t)}function R4(){for(;Ge!==null&&!Xn();)xb(Ge)}function xb(e){var r=$v(e.alternate,e,fa);e.memoizedProps=e.pendingProps,r===null?iu(e):Ge=r}function vb(e){var r=e,i=r.alternate;switch(r.tag){case 15:case 0:r=Lv(i,r,r.pendingProps,r.type,void 0,We);break;case 11:r=Lv(i,r,r.pendingProps,r.type.render,r.ref,We);break;case 5:Qf(r);default:Gv(i,r),r=Ge=g1(r,fa),r=$v(i,r,fa)}e.memoizedProps=e.pendingProps,r===null?iu(e):Ge=r}function Ko(e,r,i,u){na=Os=null,Qf(r),Po=null,Xi=0;var h=r.return;try{if(v4(e,h,r,i,We)){_t=1,Kc(e,rr(i,e.current)),Ge=null;return}}catch(x){if(h!==null)throw Ge=h,x;_t=1,Kc(e,rr(i,e.current)),Ge=null;return}r.flags&32768?(Je||u===1?e=!0:Vo||(We&536870912)!==0?e=!1:(qa=e=!0,(u===2||u===9||u===3||u===6)&&(u=In.current,u!==null&&u.tag===13&&(u.flags|=16384))),bb(r,e)):iu(r)}function iu(e){var r=e;do{if((r.flags&32768)!==0){bb(r,qa);return}e=r.return;var i=w4(r.alternate,r,fa);if(i!==null){Ge=i;return}if(r=r.sibling,r!==null){Ge=r;return}Ge=r=e}while(r!==null);_t===0&&(_t=5)}function bb(e,r){do{var i=j4(e.alternate,e);if(i!==null){i.flags&=32767,Ge=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=i}while(e!==null);_t=6,Ge=null}function yb(e,r,i,u,h,x,j,A,z){e.cancelPendingCommit=null;do lu();while(Yt!==0);if((ot&6)!==0)throw Error(o(327));if(r!==null){if(r===e.current)throw Error(o(177));if(x=r.lanes|r.childLanes,x|=Nf,Rt(e,i,x,j,A,z),e===xt&&(Ge=xt=null,We=0),Yo=r,Xa=e,ma=i,Dm=x,Om=h,cb=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,O4(Da,function(){return Nb(),null})):(e.callbackNode=null,e.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=P.T,P.T=null,h=Z.p,Z.p=2,j=ot,ot|=4;try{C4(e,r,i)}finally{ot=j,Z.p=h,P.T=u}}Yt=1,wb(),jb(),Cb()}}function wb(){if(Yt===1){Yt=0;var e=Xa,r=Yo,i=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||i){i=P.T,P.T=null;var u=Z.p;Z.p=2;var h=ot;ot|=4;try{tb(r,e);var x=Wm,j=i1(e.containerInfo),A=x.focusedElem,z=x.selectionRange;if(j!==A&&A&&A.ownerDocument&&o1(A.ownerDocument.documentElement,A)){if(z!==null&&yf(A)){var J=z.start,le=z.end;if(le===void 0&&(le=J),"selectionStart"in A)A.selectionStart=J,A.selectionEnd=Math.min(le,A.value.length);else{var he=A.ownerDocument||document,ee=he&&he.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),Ee=A.textContent.length,Le=Math.min(z.start,Ee),gt=z.end===void 0?Le:Math.min(z.end,Ee);!ne.extend&&Le>gt&&(j=gt,gt=Le,Le=j);var F=s1(A,Le),U=s1(A,gt);if(F&&U&&(ne.rangeCount!==1||ne.anchorNode!==F.node||ne.anchorOffset!==F.offset||ne.focusNode!==U.node||ne.focusOffset!==U.offset)){var Q=he.createRange();Q.setStart(F.node,F.offset),ne.removeAllRanges(),Le>gt?(ne.addRange(Q),ne.extend(U.node,U.offset)):(Q.setEnd(U.node,U.offset),ne.addRange(Q))}}}}for(he=[],ne=A;ne=ne.parentNode;)ne.nodeType===1&&he.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<he.length;A++){var de=he[A];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}yu=!!Km,Wm=Km=null}finally{ot=h,Z.p=u,P.T=i}}e.current=r,Yt=2}}function jb(){if(Yt===2){Yt=0;var e=Xa,r=Yo,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=P.T,P.T=null;var u=Z.p;Z.p=2;var h=ot;ot|=4;try{Xv(e,r.alternate,r)}finally{ot=h,Z.p=u,P.T=i}}Yt=3}}function Cb(){if(Yt===4||Yt===3){Yt=0,Zn();var e=Xa,r=Yo,i=ma,u=cb;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Yt=5:(Yt=0,Yo=Xa=null,Sb(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(Wa=null),vo(i),r=r.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(gr,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=P.T,h=Z.p,Z.p=2,P.T=null;try{for(var x=e.onRecoverableError,j=0;j<u.length;j++){var A=u[j];x(A.value,{componentStack:A.stack})}}finally{P.T=r,Z.p=h}}(ma&3)!==0&&lu(),Or(e),h=e.pendingLanes,(i&261930)!==0&&(h&42)!==0?e===Lm?ml++:(ml=0,Lm=e):ml=0,pl(0)}}function Sb(e,r){(e.pooledCacheLanes&=r)===0&&(r=e.pooledCache,r!=null&&(e.pooledCache=null,Ki(r)))}function lu(){return wb(),jb(),Cb(),Nb()}function Nb(){if(Yt!==5)return!1;var e=Xa,r=Dm;Dm=0;var i=vo(ma),u=P.T,h=Z.p;try{Z.p=32>i?32:i,P.T=null,i=Om,Om=null;var x=Xa,j=ma;if(Yt=0,Yo=Xa=null,ma=0,(ot&6)!==0)throw Error(o(331));var A=ot;if(ot|=4,ob(x.current),rb(x,x.current,j,i),ot=A,pl(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(gr,x)}catch{}return!0}finally{Z.p=h,P.T=u,Sb(e,r)}}function Eb(e,r,i){r=rr(i,r),r=mm(e.stateNode,r,2),e=Ga(e,r,2),e!==null&&(Ft(e,2),Or(e))}function ct(e,r,i){if(e.tag===3)Eb(e,e,i);else for(;r!==null;){if(r.tag===3){Eb(r,e,i);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Wa===null||!Wa.has(u))){e=rr(i,e),i=kv(2),u=Ga(r,i,2),u!==null&&(Tv(i,u,r,e),Ft(u,2),Or(u));break}}r=r.return}}function Im(e,r,i){var u=e.pingCache;if(u===null){u=e.pingCache=new E4;var h=new Set;u.set(r,h)}else h=u.get(r),h===void 0&&(h=new Set,u.set(r,h));h.has(i)||(Rm=!0,h.add(i),e=A4.bind(null,e,r,i),r.then(e,e))}function A4(e,r,i){var u=e.pingCache;u!==null&&u.delete(r),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,xt===e&&(We&i)===i&&(_t===4||_t===3&&(We&62914560)===We&&300>It()-nu?(ot&2)===0&&qo(e,0):Am|=i,Fo===We&&(Fo=0)),Or(e)}function kb(e,r){r===0&&(r=it()),e=As(e,r),e!==null&&(Ft(e,r),Or(e))}function _4(e){var r=e.memoizedState,i=0;r!==null&&(i=r.retryLane),kb(e,i)}function D4(e,r){var i=0;switch(e.tag){case 31:case 13:var u=e.stateNode,h=e.memoizedState;h!==null&&(i=h.retryLane);break;case 19:u=e.stateNode;break;case 22:u=e.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(r),kb(e,i)}function O4(e,r){return _n(e,r)}var cu=null,Wo=null,Um=!1,uu=!1,Bm=!1,Qa=0;function Or(e){e!==Wo&&e.next===null&&(Wo===null?cu=Wo=e:Wo=Wo.next=e),uu=!0,Um||(Um=!0,z4())}function pl(e,r){if(!Bm&&uu){Bm=!0;do for(var i=!1,u=cu;u!==null;){if(e!==0){var h=u.pendingLanes;if(h===0)var x=0;else{var j=u.suspendedLanes,A=u.pingedLanes;x=(1<<31-Mt(42|e)+1)-1,x&=h&~(j&~A),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(i=!0,Ab(u,x))}else x=We,x=La(u,u===xt?x:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(x&3)===0||Oe(u,x)||(i=!0,Ab(u,x));u=u.next}while(i);Bm=!1}}function L4(){Tb()}function Tb(){uu=Um=!1;var e=0;Qa!==0&&Y4()&&(e=Qa);for(var r=It(),i=null,u=cu;u!==null;){var h=u.next,x=Mb(u,r);x===0?(u.next=null,i===null?cu=h:i.next=h,h===null&&(Wo=i)):(i=u,(e!==0||(x&3)!==0)&&(uu=!0)),u=h}Yt!==0&&Yt!==5||pl(e),Qa!==0&&(Qa=0)}function Mb(e,r){for(var i=e.suspendedLanes,u=e.pingedLanes,h=e.expirationTimes,x=e.pendingLanes&-62914561;0<x;){var j=31-Mt(x),A=1<<j,z=h[j];z===-1?((A&i)===0||(A&u)!==0)&&(h[j]=tt(A,r)):z<=r&&(e.expiredLanes|=A),x&=~A}if(r=xt,i=We,i=La(e,e===r?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),u=e.callbackNode,i===0||e===r&&(lt===2||lt===9)||e.cancelPendingCommit!==null)return u!==null&&u!==null&&wn(u),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Oe(e,i)){if(r=i&-i,r===e.callbackPriority)return r;switch(u!==null&&wn(u),vo(i)){case 2:case 8:i=Dn;break;case 32:i=Da;break;case 268435456:i=Qn;break;default:i=Da}return u=Rb.bind(null,e),i=_n(i,u),e.callbackPriority=r,e.callbackNode=i,r}return u!==null&&u!==null&&wn(u),e.callbackPriority=2,e.callbackNode=null,2}function Rb(e,r){if(Yt!==0&&Yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(lu()&&e.callbackNode!==i)return null;var u=We;return u=La(e,e===xt?u:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),u===0?null:(db(e,u,r),Mb(e,It()),e.callbackNode!=null&&e.callbackNode===i?Rb.bind(null,e):null)}function Ab(e,r){if(lu())return null;db(e,r,!0)}function z4(){K4(function(){(ot&6)!==0?_n(nn,L4):Tb()})}function $m(){if(Qa===0){var e=Oo;e===0&&(e=Kr,Kr<<=1,(Kr&261888)===0&&(Kr=256)),Qa=e}return Qa}function _b(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:vc(""+e)}function Db(e,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,e.id&&i.setAttribute("form",e.id),r.parentNode.insertBefore(i,r),e=new FormData(e),i.parentNode.removeChild(i),e}function P4(e,r,i,u,h){if(r==="submit"&&i&&i.stateNode===h){var x=_b((h[Re]||null).action),j=u.submitter;j&&(r=(r=j[Re]||null)?_b(r.formAction):j.getAttribute("formAction"),r!==null&&(x=r,j=null));var A=new jc("action","action",null,u,h);e.push({event:A,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Qa!==0){var z=j?Db(h,j):new FormData(h);im(i,{pending:!0,data:z,method:h.method,action:x},null,z)}}else typeof x=="function"&&(A.preventDefault(),z=j?Db(h,j):new FormData(h),im(i,{pending:!0,data:z,method:h.method,action:x},x,z))},currentTarget:h}]})}}for(var Hm=0;Hm<Sf.length;Hm++){var Gm=Sf[Hm],I4=Gm.toLowerCase(),U4=Gm[0].toUpperCase()+Gm.slice(1);vr(I4,"on"+U4)}vr(u1,"onAnimationEnd"),vr(d1,"onAnimationIteration"),vr(f1,"onAnimationStart"),vr("dblclick","onDoubleClick"),vr("focusin","onFocus"),vr("focusout","onBlur"),vr(t4,"onTransitionRun"),vr(n4,"onTransitionStart"),vr(r4,"onTransitionCancel"),vr(m1,"onTransitionEnd"),yo("onMouseEnter",["mouseout","mouseover"]),yo("onMouseLeave",["mouseout","mouseover"]),yo("onPointerEnter",["pointerout","pointerover"]),yo("onPointerLeave",["pointerout","pointerover"]),ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ks("onBeforeInput",["compositionend","keypress","textInput","paste"]),ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hl="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(" "),B4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hl));function Ob(e,r){r=(r&4)!==0;for(var i=0;i<e.length;i++){var u=e[i],h=u.event;u=u.listeners;e:{var x=void 0;if(r)for(var j=u.length-1;0<=j;j--){var A=u[j],z=A.instance,J=A.currentTarget;if(A=A.listener,z!==x&&h.isPropagationStopped())break e;x=A,h.currentTarget=J;try{x(h)}catch(le){Nc(le)}h.currentTarget=null,x=z}else for(j=0;j<u.length;j++){if(A=u[j],z=A.instance,J=A.currentTarget,A=A.listener,z!==x&&h.isPropagationStopped())break e;x=A,h.currentTarget=J;try{x(h)}catch(le){Nc(le)}h.currentTarget=null,x=z}}}}function Ve(e,r){var i=r[mt];i===void 0&&(i=r[mt]=new Set);var u=e+"__bubble";i.has(u)||(Lb(r,e,2,!1),i.add(u))}function Vm(e,r,i){var u=0;r&&(u|=4),Lb(i,e,u,r)}var du="_reactListening"+Math.random().toString(36).slice(2);function Fm(e){if(!e[du]){e[du]=!0,Tx.forEach(function(i){i!=="selectionchange"&&(B4.has(i)||Vm(i,!1,e),Vm(i,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[du]||(r[du]=!0,Vm("selectionchange",!1,r))}}function Lb(e,r,i,u){switch(uy(r)){case 2:var h=p3;break;case 8:h=h3;break;default:h=op}i=h.bind(null,r,i,e),h=void 0,!df||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),u?h!==void 0?e.addEventListener(r,i,{capture:!0,passive:h}):e.addEventListener(r,i,!0):h!==void 0?e.addEventListener(r,i,{passive:h}):e.addEventListener(r,i,!1)}function Ym(e,r,i,u,h){var x=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var j=u.tag;if(j===3||j===4){var A=u.stateNode.containerInfo;if(A===h)break;if(j===4)for(j=u.return;j!==null;){var z=j.tag;if((z===3||z===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;A!==null;){if(j=xr(A),j===null)return;if(z=j.tag,z===5||z===6||z===26||z===27){u=x=j;continue e}A=A.parentNode}}u=u.return}Bx(function(){var J=x,le=cf(i),he=[];e:{var ee=p1.get(e);if(ee!==void 0){var ne=jc,Ee=e;switch(e){case"keypress":if(yc(i)===0)break e;case"keydown":case"keyup":ne=D5;break;case"focusin":Ee="focus",ne=hf;break;case"focusout":Ee="blur",ne=hf;break;case"beforeblur":case"afterblur":ne=hf;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=Gx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=w5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=z5;break;case u1:case d1:case f1:ne=S5;break;case m1:ne=I5;break;case"scroll":case"scrollend":ne=b5;break;case"wheel":ne=B5;break;case"copy":case"cut":case"paste":ne=E5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Fx;break;case"toggle":case"beforetoggle":ne=H5}var Le=(r&4)!==0,gt=!Le&&(e==="scroll"||e==="scrollend"),F=Le?ee!==null?ee+"Capture":null:ee;Le=[];for(var U=J,Q;U!==null;){var de=U;if(Q=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||Q===null||F===null||(de=Pi(U,F),de!=null&&Le.push(gl(U,de,Q))),gt)break;U=U.return}0<Le.length&&(ee=new ne(ee,Ee,null,i,le),he.push({event:ee,listeners:Le}))}}if((r&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",ee&&i!==lf&&(Ee=i.relatedTarget||i.fromElement)&&(xr(Ee)||Ee[nt]))break e;if((ne||ee)&&(ee=le.window===le?le:(ee=le.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(Ee=i.relatedTarget||i.toElement,ne=J,Ee=Ee?xr(Ee):null,Ee!==null&&(gt=l(Ee),Le=Ee.tag,Ee!==gt||Le!==5&&Le!==27&&Le!==6)&&(Ee=null)):(ne=null,Ee=J),ne!==Ee)){if(Le=Gx,de="onMouseLeave",F="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(Le=Fx,de="onPointerLeave",F="onPointerEnter",U="pointer"),gt=ne==null?ee:zi(ne),Q=Ee==null?ee:zi(Ee),ee=new Le(de,U+"leave",ne,i,le),ee.target=gt,ee.relatedTarget=Q,de=null,xr(le)===J&&(Le=new Le(F,U+"enter",Ee,i,le),Le.target=Q,Le.relatedTarget=gt,de=Le),gt=de,ne&&Ee)t:{for(Le=$4,F=ne,U=Ee,Q=0,de=F;de;de=Le(de))Q++;de=0;for(var Ae=U;Ae;Ae=Le(Ae))de++;for(;0<Q-de;)F=Le(F),Q--;for(;0<de-Q;)U=Le(U),de--;for(;Q--;){if(F===U||U!==null&&F===U.alternate){Le=F;break t}F=Le(F),U=Le(U)}Le=null}else Le=null;ne!==null&&zb(he,ee,ne,Le,!1),Ee!==null&>!==null&&zb(he,gt,Ee,Le,!0)}}e:{if(ee=J?zi(J):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var rt=Jx;else if(Zx(ee))if(e1)rt=Q5;else{rt=X5;var ke=W5}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?J&&of(J.elementType)&&(rt=Jx):rt=Z5;if(rt&&(rt=rt(e,J))){Qx(he,rt,i,le);break e}ke&&ke(e,ee,J),e==="focusout"&&J&&ee.type==="number"&&J.memoizedProps.value!=null&&sf(ee,"number",ee.value)}switch(ke=J?zi(J):window,e){case"focusin":(Zx(ke)||ke.contentEditable==="true")&&(Eo=ke,wf=J,Fi=null);break;case"focusout":Fi=wf=Eo=null;break;case"mousedown":jf=!0;break;case"contextmenu":case"mouseup":case"dragend":jf=!1,l1(he,i,le);break;case"selectionchange":if(e4)break;case"keydown":case"keyup":l1(he,i,le)}var $e;if(xf)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else No?Wx(e,i)&&(Xe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Xe="onCompositionStart");Xe&&(Yx&&i.locale!=="ko"&&(No||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&No&&($e=$x()):(za=le,ff="value"in za?za.value:za.textContent,No=!0)),ke=fu(J,Xe),0<ke.length&&(Xe=new Vx(Xe,e,null,i,le),he.push({event:Xe,listeners:ke}),$e?Xe.data=$e:($e=Xx(i),$e!==null&&(Xe.data=$e)))),($e=V5?F5(e,i):Y5(e,i))&&(Xe=fu(J,"onBeforeInput"),0<Xe.length&&(ke=new Vx("onBeforeInput","beforeinput",null,i,le),he.push({event:ke,listeners:Xe}),ke.data=$e)),P4(he,e,J,i,le)}Ob(he,r)})}function gl(e,r,i){return{instance:e,listener:r,currentTarget:i}}function fu(e,r){for(var i=r+"Capture",u=[];e!==null;){var h=e,x=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||x===null||(h=Pi(e,i),h!=null&&u.unshift(gl(e,h,x)),h=Pi(e,r),h!=null&&u.push(gl(e,h,x))),e.tag===3)return u;e=e.return}return[]}function $4(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zb(e,r,i,u,h){for(var x=r._reactName,j=[];i!==null&&i!==u;){var A=i,z=A.alternate,J=A.stateNode;if(A=A.tag,z!==null&&z===u)break;A!==5&&A!==26&&A!==27||J===null||(z=J,h?(J=Pi(i,x),J!=null&&j.unshift(gl(i,J,z))):h||(J=Pi(i,x),J!=null&&j.push(gl(i,J,z)))),i=i.return}j.length!==0&&e.push({event:r,listeners:j})}var H4=/\r\n?/g,G4=/\u0000|\uFFFD/g;function Pb(e){return(typeof e=="string"?e:""+e).replace(H4,`
|
||
`).replace(G4,"")}function Ib(e,r){return r=Pb(r),Pb(e)===r}function ht(e,r,i,u,h,x){switch(i){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||jo(e,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&jo(e,""+u);break;case"className":gc(e,"class",u);break;case"tabIndex":gc(e,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":gc(e,i,u);break;case"style":Ix(e,u,x);break;case"data":if(r!=="object"){gc(e,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||i!=="href")){e.removeAttribute(i);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(i);break}u=vc(""+u),e.setAttribute(i,u);break;case"action":case"formAction":if(typeof u=="function"){e.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 x=="function"&&(i==="formAction"?(r!=="input"&&ht(e,r,"name",h.name,h,null),ht(e,r,"formEncType",h.formEncType,h,null),ht(e,r,"formMethod",h.formMethod,h,null),ht(e,r,"formTarget",h.formTarget,h,null)):(ht(e,r,"encType",h.encType,h,null),ht(e,r,"method",h.method,h,null),ht(e,r,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(i);break}u=vc(""+u),e.setAttribute(i,u);break;case"onClick":u!=null&&(e.onclick=Qr);break;case"onScroll":u!=null&&Ve("scroll",e);break;case"onScrollEnd":u!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(h.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":e.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"){e.removeAttribute("xlink:href");break}i=vc(""+u),e.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"?e.setAttribute(i,""+u):e.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"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":u===!0?e.setAttribute(i,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(i,u):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?e.setAttribute(i,u):e.removeAttribute(i);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?e.removeAttribute(i):e.setAttribute(i,u);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),hc(e,"popover",u);break;case"xlinkActuate":Zr(e,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Zr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Zr(e,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Zr(e,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Zr(e,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Zr(e,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Zr(e,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Zr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Zr(e,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":hc(e,"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=x5.get(i)||i,hc(e,i,u))}}function qm(e,r,i,u,h,x){switch(i){case"style":Ix(e,u,x);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(o(61));if(i=u.__html,i!=null){if(h.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof u=="string"?jo(e,u):(typeof u=="number"||typeof u=="bigint")&&jo(e,""+u);break;case"onScroll":u!=null&&Ve("scroll",e);break;case"onScrollEnd":u!=null&&Ve("scrollend",e);break;case"onClick":u!=null&&(e.onclick=Qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mx.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(h=i.endsWith("Capture"),r=i.slice(2,h?i.length-7:void 0),x=e[Re]||null,x=x!=null?x[i]:null,typeof x=="function"&&e.removeEventListener(r,x,h),typeof u=="function")){typeof x!="function"&&x!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(r,u,h);break e}i in e?e[i]=u:u===!0?e.setAttribute(i,""):hc(e,i,u)}}}function ln(e,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var u=!1,h=!1,x;for(x in i)if(i.hasOwnProperty(x)){var j=i[x];if(j!=null)switch(x){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:ht(e,r,x,j,i,null)}}h&&ht(e,r,"srcSet",i.srcSet,i,null),u&&ht(e,r,"src",i.src,i,null);return;case"input":Ve("invalid",e);var A=x=j=h=null,z=null,J=null;for(u in i)if(i.hasOwnProperty(u)){var le=i[u];if(le!=null)switch(u){case"name":h=le;break;case"type":j=le;break;case"checked":z=le;break;case"defaultChecked":J=le;break;case"value":x=le;break;case"defaultValue":A=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,r));break;default:ht(e,r,u,le,i,null)}}Ox(e,x,A,z,J,j,h,!1);return;case"select":Ve("invalid",e),u=j=x=null;for(h in i)if(i.hasOwnProperty(h)&&(A=i[h],A!=null))switch(h){case"value":x=A;break;case"defaultValue":j=A;break;case"multiple":u=A;default:ht(e,r,h,A,i,null)}r=x,i=j,e.multiple=!!u,r!=null?wo(e,!!u,r,!1):i!=null&&wo(e,!!u,i,!0);return;case"textarea":Ve("invalid",e),x=h=u=null;for(j in i)if(i.hasOwnProperty(j)&&(A=i[j],A!=null))switch(j){case"value":u=A;break;case"defaultValue":h=A;break;case"children":x=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(o(91));break;default:ht(e,r,j,A,i,null)}zx(e,u,h,x);return;case"option":for(z in i)if(i.hasOwnProperty(z)&&(u=i[z],u!=null))switch(z){case"selected":e.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:ht(e,r,z,u,i,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(u=0;u<hl.length;u++)Ve(hl[u],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in i)if(i.hasOwnProperty(J)&&(u=i[J],u!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:ht(e,r,J,u,i,null)}return;default:if(of(r)){for(le in i)i.hasOwnProperty(le)&&(u=i[le],u!==void 0&&qm(e,r,le,u,i,void 0));return}}for(A in i)i.hasOwnProperty(A)&&(u=i[A],u!=null&&ht(e,r,A,u,i,null))}function V4(e,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 h=null,x=null,j=null,A=null,z=null,J=null,le=null;for(ne in i){var he=i[ne];if(i.hasOwnProperty(ne)&&he!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":z=he;default:u.hasOwnProperty(ne)||ht(e,r,ne,null,u,he)}}for(var ee in u){var ne=u[ee];if(he=i[ee],u.hasOwnProperty(ee)&&(ne!=null||he!=null))switch(ee){case"type":x=ne;break;case"name":h=ne;break;case"checked":J=ne;break;case"defaultChecked":le=ne;break;case"value":j=ne;break;case"defaultValue":A=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,r));break;default:ne!==he&&ht(e,r,ee,ne,u,he)}}af(e,j,A,z,J,le,x,h);return;case"select":ne=j=A=ee=null;for(x in i)if(z=i[x],i.hasOwnProperty(x)&&z!=null)switch(x){case"value":break;case"multiple":ne=z;default:u.hasOwnProperty(x)||ht(e,r,x,null,u,z)}for(h in u)if(x=u[h],z=i[h],u.hasOwnProperty(h)&&(x!=null||z!=null))switch(h){case"value":ee=x;break;case"defaultValue":A=x;break;case"multiple":j=x;default:x!==z&&ht(e,r,h,x,u,z)}r=A,i=j,u=ne,ee!=null?wo(e,!!i,ee,!1):!!u!=!!i&&(r!=null?wo(e,!!i,r,!0):wo(e,!!i,i?[]:"",!1));return;case"textarea":ne=ee=null;for(A in i)if(h=i[A],i.hasOwnProperty(A)&&h!=null&&!u.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:ht(e,r,A,null,u,h)}for(j in u)if(h=u[j],x=i[j],u.hasOwnProperty(j)&&(h!=null||x!=null))switch(j){case"value":ee=h;break;case"defaultValue":ne=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(o(91));break;default:h!==x&&ht(e,r,j,h,u,x)}Lx(e,ee,ne);return;case"option":for(var Ee in i)if(ee=i[Ee],i.hasOwnProperty(Ee)&&ee!=null&&!u.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:ht(e,r,Ee,null,u,ee)}for(z in u)if(ee=u[z],ne=i[z],u.hasOwnProperty(z)&&ee!==ne&&(ee!=null||ne!=null))switch(z){case"selected":e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:ht(e,r,z,ee,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 Le in i)ee=i[Le],i.hasOwnProperty(Le)&&ee!=null&&!u.hasOwnProperty(Le)&&ht(e,r,Le,null,u,ee);for(J in u)if(ee=u[J],ne=i[J],u.hasOwnProperty(J)&&ee!==ne&&(ee!=null||ne!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,r));break;default:ht(e,r,J,ee,u,ne)}return;default:if(of(r)){for(var gt in i)ee=i[gt],i.hasOwnProperty(gt)&&ee!==void 0&&!u.hasOwnProperty(gt)&&qm(e,r,gt,void 0,u,ee);for(le in u)ee=u[le],ne=i[le],!u.hasOwnProperty(le)||ee===ne||ee===void 0&&ne===void 0||qm(e,r,le,ee,u,ne);return}}for(var F in i)ee=i[F],i.hasOwnProperty(F)&&ee!=null&&!u.hasOwnProperty(F)&&ht(e,r,F,null,u,ee);for(he in u)ee=u[he],ne=i[he],!u.hasOwnProperty(he)||ee===ne||ee==null&&ne==null||ht(e,r,he,ee,u,ne)}function Ub(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function F4(){if(typeof performance.getEntriesByType=="function"){for(var e=0,r=0,i=performance.getEntriesByType("resource"),u=0;u<i.length;u++){var h=i[u],x=h.transferSize,j=h.initiatorType,A=h.duration;if(x&&A&&Ub(j)){for(j=0,A=h.responseEnd,u+=1;u<i.length;u++){var z=i[u],J=z.startTime;if(J>A)break;var le=z.transferSize,he=z.initiatorType;le&&Ub(he)&&(z=z.responseEnd,j+=le*(z<A?1:(A-J)/(z-J)))}if(--u,r+=8*(x+j)/(h.duration/1e3),e++,10<e)break}}if(0<e)return r/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Km=null,Wm=null;function mu(e){return e.nodeType===9?e:e.ownerDocument}function Bb(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $b(e,r){if(e===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&r==="foreignObject"?0:e}function Xm(e,r){return e==="textarea"||e==="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 Zm=null;function Y4(){var e=window.event;return e&&e.type==="popstate"?e===Zm?!1:(Zm=e,!0):(Zm=null,!1)}var Hb=typeof setTimeout=="function"?setTimeout:void 0,q4=typeof clearTimeout=="function"?clearTimeout:void 0,Gb=typeof Promise=="function"?Promise:void 0,K4=typeof queueMicrotask=="function"?queueMicrotask:typeof Gb<"u"?function(e){return Gb.resolve(null).then(e).catch(W4)}:Hb;function W4(e){setTimeout(function(){throw e})}function Ja(e){return e==="head"}function Vb(e,r){var i=r,u=0;do{var h=i.nextSibling;if(e.removeChild(i),h&&h.nodeType===8)if(i=h.data,i==="/$"||i==="/&"){if(u===0){e.removeChild(h),Jo(r);return}u--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")u++;else if(i==="html")xl(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,xl(i);for(var x=i.firstChild;x;){var j=x.nextSibling,A=x.nodeName;x[mn]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&x.rel.toLowerCase()==="stylesheet"||i.removeChild(x),x=j}}else i==="body"&&xl(e.ownerDocument.body);i=h}while(i);Jo(r)}function Fb(e,r){var i=e;e=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(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=u}while(i)}function Qm(e){var r=e.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":Qm(i),Wr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function X4(e,r,i,u){for(;e.nodeType===1;){var h=i;if(e.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(u){if(!e[mn])switch(r){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(x=e.getAttribute("rel"),x==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(x!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(x=e.getAttribute("src"),(x!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&x&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(r==="input"&&e.type==="hidden"){var x=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===x)return e}else return e;if(e=lr(e.nextSibling),e===null)break}return null}function Z4(e,r,i){if(r==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=lr(e.nextSibling),e===null))return null;return e}function Yb(e,r){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=lr(e.nextSibling),e===null))return null;return e}function Jm(e){return e.data==="$?"||e.data==="$~"}function ep(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Q4(e,r){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=r;else if(e.data!=="$?"||i.readyState!=="loading")r();else{var u=function(){r(),i.removeEventListener("DOMContentLoaded",u)};i.addEventListener("DOMContentLoaded",u),e._reactRetry=u}}function lr(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return e}var tp=null;function qb(e){e=e.nextSibling;for(var r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(r===0)return lr(e.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}e=e.nextSibling}return null}function Kb(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return e;r--}else i!=="/$"&&i!=="/&"||r++}e=e.previousSibling}return null}function Wb(e,r,i){switch(r=mu(i),e){case"html":if(e=r.documentElement,!e)throw Error(o(452));return e;case"head":if(e=r.head,!e)throw Error(o(453));return e;case"body":if(e=r.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function xl(e){for(var r=e.attributes;r.length;)e.removeAttributeNode(r[0]);Wr(e)}var cr=new Map,Xb=new Set;function pu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var pa=Z.d;Z.d={f:J4,r:e3,D:t3,C:n3,L:r3,m:a3,X:o3,S:s3,M:i3};function J4(){var e=pa.f(),r=su();return e||r}function e3(e){var r=Xr(e);r!==null&&r.tag===5&&r.type==="form"?mv(r):pa.r(e)}var Xo=typeof document>"u"?null:document;function Zb(e,r,i){var u=Xo;if(u&&typeof r=="string"&&r){var h=tr(r);h='link[rel="'+e+'"][href="'+h+'"]',typeof i=="string"&&(h+='[crossorigin="'+i+'"]'),Xb.has(h)||(Xb.add(h),e={rel:e,crossOrigin:i,href:r},u.querySelector(h)===null&&(r=u.createElement("link"),ln(r,"link",e),Wt(r),u.head.appendChild(r)))}}function t3(e){pa.D(e),Zb("dns-prefetch",e,null)}function n3(e,r){pa.C(e,r),Zb("preconnect",e,r)}function r3(e,r,i){pa.L(e,r,i);var u=Xo;if(u&&e&&r){var h='link[rel="preload"][as="'+tr(r)+'"]';r==="image"&&i&&i.imageSrcSet?(h+='[imagesrcset="'+tr(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(h+='[imagesizes="'+tr(i.imageSizes)+'"]')):h+='[href="'+tr(e)+'"]';var x=h;switch(r){case"style":x=Zo(e);break;case"script":x=Qo(e)}cr.has(x)||(e=b({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:e,as:r},i),cr.set(x,e),u.querySelector(h)!==null||r==="style"&&u.querySelector(vl(x))||r==="script"&&u.querySelector(bl(x))||(r=u.createElement("link"),ln(r,"link",e),Wt(r),u.head.appendChild(r)))}}function a3(e,r){pa.m(e,r);var i=Xo;if(i&&e){var u=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+tr(u)+'"][href="'+tr(e)+'"]',x=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Qo(e)}if(!cr.has(x)&&(e=b({rel:"modulepreload",href:e},r),cr.set(x,e),i.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(bl(x)))return}u=i.createElement("link"),ln(u,"link",e),Wt(u),i.head.appendChild(u)}}}function s3(e,r,i){pa.S(e,r,i);var u=Xo;if(u&&e){var h=bo(u).hoistableStyles,x=Zo(e);r=r||"default";var j=h.get(x);if(!j){var A={loading:0,preload:null};if(j=u.querySelector(vl(x)))A.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":r},i),(i=cr.get(x))&&np(e,i);var z=j=u.createElement("link");Wt(z),ln(z,"link",e),z._p=new Promise(function(J,le){z.onload=J,z.onerror=le}),z.addEventListener("load",function(){A.loading|=1}),z.addEventListener("error",function(){A.loading|=2}),A.loading|=4,hu(j,r,u)}j={type:"stylesheet",instance:j,count:1,state:A},h.set(x,j)}}}function o3(e,r){pa.X(e,r);var i=Xo;if(i&&e){var u=bo(i).hoistableScripts,h=Qo(e),x=u.get(h);x||(x=i.querySelector(bl(h)),x||(e=b({src:e,async:!0},r),(r=cr.get(h))&&rp(e,r),x=i.createElement("script"),Wt(x),ln(x,"link",e),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(h,x))}}function i3(e,r){pa.M(e,r);var i=Xo;if(i&&e){var u=bo(i).hoistableScripts,h=Qo(e),x=u.get(h);x||(x=i.querySelector(bl(h)),x||(e=b({src:e,async:!0,type:"module"},r),(r=cr.get(h))&&rp(e,r),x=i.createElement("script"),Wt(x),ln(x,"link",e),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(h,x))}}function Qb(e,r,i,u){var h=(h=xe.current)?pu(h):null;if(!h)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=Zo(i.href),i=bo(h).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"){e=Zo(i.href);var x=bo(h).hoistableStyles,j=x.get(e);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(e,j),(x=h.querySelector(vl(e)))&&!x._p&&(j.instance=x,j.state.loading=5),cr.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},cr.set(e,i),x||l3(h,e,i,j.state))),r&&u===null)throw Error(o(528,""));return j}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=Qo(i),i=bo(h).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,e))}}function Zo(e){return'href="'+tr(e)+'"'}function vl(e){return'link[rel="stylesheet"]['+e+"]"}function Jb(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function l3(e,r,i,u){e.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=e.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),ln(r,"link",i),Wt(r),e.head.appendChild(r))}function Qo(e){return'[src="'+tr(e)+'"]'}function bl(e){return"script[async]"+e}function ey(e,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var u=e.querySelector('style[data-href~="'+tr(i.href)+'"]');if(u)return r.instance=u,Wt(u),u;var h=b({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return u=(e.ownerDocument||e).createElement("style"),Wt(u),ln(u,"style",h),hu(u,i.precedence,e),r.instance=u;case"stylesheet":h=Zo(i.href);var x=e.querySelector(vl(h));if(x)return r.state.loading|=4,r.instance=x,Wt(x),x;u=Jb(i),(h=cr.get(h))&&np(u,h),x=(e.ownerDocument||e).createElement("link"),Wt(x);var j=x;return j._p=new Promise(function(A,z){j.onload=A,j.onerror=z}),ln(x,"link",u),r.state.loading|=4,hu(x,i.precedence,e),r.instance=x;case"script":return x=Qo(i.src),(h=e.querySelector(bl(x)))?(r.instance=h,Wt(h),h):(u=i,(h=cr.get(x))&&(u=b({},i),rp(u,h)),e=e.ownerDocument||e,h=e.createElement("script"),Wt(h),ln(h,"link",u),e.head.appendChild(h),r.instance=h);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,hu(u,i.precedence,e));return r.instance}function hu(e,r,i){for(var u=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,x=h,j=0;j<u.length;j++){var A=u[j];if(A.dataset.precedence===r)x=A;else if(x!==h)break}x?x.parentNode.insertBefore(e,x.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(e,r.firstChild))}function np(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.title==null&&(e.title=r.title)}function rp(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.integrity==null&&(e.integrity=r.integrity)}var gu=null;function ty(e,r,i){if(gu===null){var u=new Map,h=gu=new Map;h.set(i,u)}else h=gu,u=h.get(i),u||(u=new Map,h.set(i,u));if(u.has(e))return u;for(u.set(e,null),i=i.getElementsByTagName(e),h=0;h<i.length;h++){var x=i[h];if(!(x[mn]||x[ye]||e==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var j=x.getAttribute(r)||"";j=e+j;var A=u.get(j);A?A.push(x):u.set(j,[x])}}return u}function ny(e,r,i){e=e.ownerDocument||e,e.head.insertBefore(i,r==="title"?e.querySelector("head > title"):null)}function c3(e,r,i){if(i===1||r.itemProp!=null)return!1;switch(e){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 e=r.disabled,typeof r.precedence=="string"&&e==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 ry(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function u3(e,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 h=Zo(u.href),x=r.querySelector(vl(h));if(x){r=x._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(e.count++,e=xu.bind(e),r.then(e,e)),i.state.loading|=4,i.instance=x,Wt(x);return}x=r.ownerDocument||r,u=Jb(u),(h=cr.get(h))&&np(u,h),x=x.createElement("link"),Wt(x);var j=x;j._p=new Promise(function(A,z){j.onload=A,j.onerror=z}),ln(x,"link",u),i.instance=x}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=xu.bind(e),r.addEventListener("load",i),r.addEventListener("error",i))}}var ap=0;function d3(e,r){return e.stylesheets&&e.count===0&&bu(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var u=setTimeout(function(){if(e.stylesheets&&bu(e,e.stylesheets),e.unsuspend){var x=e.unsuspend;e.unsuspend=null,x()}},6e4+r);0<e.imgBytes&&ap===0&&(ap=62500*F4());var h=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bu(e,e.stylesheets),e.unsuspend)){var x=e.unsuspend;e.unsuspend=null,x()}},(e.imgBytes>ap?50:800)+r);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vu=null;function bu(e,r){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vu=new Map,r.forEach(f3,e),vu=null,xu.call(e))}function f3(e,r){if(!(r.state.loading&4)){var i=vu.get(e);if(i)var u=i.get(null);else{i=new Map,vu.set(e,i);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<h.length;x++){var j=h[x];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(i.set(j.dataset.precedence,j),u=j)}u&&i.set(null,u)}h=r.instance,j=h.getAttribute("data-precedence"),x=i.get(j)||u,x===u&&i.set(null,h),i.set(j,h),this.count++,u=xu.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),x?x.parentNode.insertBefore(h,x.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),r.state.loading|=4}}var yl={$$typeof:T,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function m3(e,r,i,u,h,x,j,A,z){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=x,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function ay(e,r,i,u,h,x,j,A,z,J,le,he){return e=new m3(e,r,i,j,z,J,le,he,A),r=1,x===!0&&(r|=24),x=Pn(3,null,null,r),e.current=x,x.stateNode=e,r=Pf(),r.refCount++,e.pooledCache=r,r.refCount++,x.memoizedState={element:u,isDehydrated:i,cache:r},$f(x),e}function sy(e){return e?(e=Mo,e):Mo}function oy(e,r,i,u,h,x){h=sy(h),u.context===null?u.context=h:u.pendingContext=h,u=Ha(r),u.payload={element:i},x=x===void 0?null:x,x!==null&&(u.callback=x),i=Ga(e,u,r),i!==null&&(kn(i,e,r),Qi(i,e,r))}function iy(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<r?i:r}}function sp(e,r){iy(e,r),(e=e.alternate)&&iy(e,r)}function ly(e){if(e.tag===13||e.tag===31){var r=As(e,67108864);r!==null&&kn(r,e,67108864),sp(e,67108864)}}function cy(e){if(e.tag===13||e.tag===31){var r=Hn();r=xo(r);var i=As(e,r);i!==null&&kn(i,e,r),sp(e,r)}}var yu=!0;function p3(e,r,i,u){var h=P.T;P.T=null;var x=Z.p;try{Z.p=2,op(e,r,i,u)}finally{Z.p=x,P.T=h}}function h3(e,r,i,u){var h=P.T;P.T=null;var x=Z.p;try{Z.p=8,op(e,r,i,u)}finally{Z.p=x,P.T=h}}function op(e,r,i,u){if(yu){var h=ip(u);if(h===null)Ym(e,r,u,wu,i),dy(e,u);else if(x3(h,e,r,i,u))u.stopPropagation();else if(dy(e,u),r&4&&-1<g3.indexOf(e)){for(;h!==null;){var x=Xr(h);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var j=Kt(x.pendingLanes);if(j!==0){var A=x;for(A.pendingLanes|=2,A.entangledLanes|=2;j;){var z=1<<31-Mt(j);A.entanglements[1]|=z,j&=~z}Or(x),(ot&6)===0&&(ru=It()+500,pl(0))}}break;case 31:case 13:A=As(x,2),A!==null&&kn(A,x,2),su(),sp(x,2)}if(x=ip(u),x===null&&Ym(e,r,u,wu,i),x===h)break;h=x}h!==null&&u.stopPropagation()}else Ym(e,r,u,null,i)}}function ip(e){return e=cf(e),lp(e)}var wu=null;function lp(e){if(wu=null,e=xr(e),e!==null){var r=l(e);if(r===null)e=null;else{var i=r.tag;if(i===13){if(e=d(r),e!==null)return e;e=null}else if(i===31){if(e=m(r),e!==null)return e;e=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null)}}return wu=e,null}function uy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(po()){case nn:return 2;case Dn:return 8;case Da:case ho:return 32;case Qn:return 268435456;default:return 32}default:return 32}}var cp=!1,es=null,ts=null,ns=null,wl=new Map,jl=new Map,rs=[],g3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function dy(e,r){switch(e){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":wl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":jl.delete(r.pointerId)}}function Cl(e,r,i,u,h,x){return e===null||e.nativeEvent!==x?(e={blockedOn:r,domEventName:i,eventSystemFlags:u,nativeEvent:x,targetContainers:[h]},r!==null&&(r=Xr(r),r!==null&&ly(r)),e):(e.eventSystemFlags|=u,r=e.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),e)}function x3(e,r,i,u,h){switch(r){case"focusin":return es=Cl(es,e,r,i,u,h),!0;case"dragenter":return ts=Cl(ts,e,r,i,u,h),!0;case"mouseover":return ns=Cl(ns,e,r,i,u,h),!0;case"pointerover":var x=h.pointerId;return wl.set(x,Cl(wl.get(x)||null,e,r,i,u,h)),!0;case"gotpointercapture":return x=h.pointerId,jl.set(x,Cl(jl.get(x)||null,e,r,i,u,h)),!0}return!1}function fy(e){var r=xr(e.target);if(r!==null){var i=l(r);if(i!==null){if(r=i.tag,r===13){if(r=d(i),r!==null){e.blockedOn=r,oe(e.priority,function(){cy(i)});return}}else if(r===31){if(r=m(i),r!==null){e.blockedOn=r,oe(e.priority,function(){cy(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ju(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var i=ip(e.nativeEvent);if(i===null){i=e.nativeEvent;var u=new i.constructor(i.type,i);lf=u,i.target.dispatchEvent(u),lf=null}else return r=Xr(i),r!==null&&ly(r),e.blockedOn=i,!1;r.shift()}return!0}function my(e,r,i){ju(e)&&i.delete(r)}function v3(){cp=!1,es!==null&&ju(es)&&(es=null),ts!==null&&ju(ts)&&(ts=null),ns!==null&&ju(ns)&&(ns=null),wl.forEach(my),jl.forEach(my)}function Cu(e,r){e.blockedOn===r&&(e.blockedOn=null,cp||(cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,v3)))}var Su=null;function py(e){Su!==e&&(Su=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Su===e&&(Su=null);for(var r=0;r<e.length;r+=3){var i=e[r],u=e[r+1],h=e[r+2];if(typeof u!="function"){if(lp(u||i)===null)continue;break}var x=Xr(i);x!==null&&(e.splice(r,3),r-=3,im(x,{pending:!0,data:h,method:i.method,action:u},u,h))}}))}function Jo(e){function r(z){return Cu(z,e)}es!==null&&Cu(es,e),ts!==null&&Cu(ts,e),ns!==null&&Cu(ns,e),wl.forEach(r),jl.forEach(r);for(var i=0;i<rs.length;i++){var u=rs[i];u.blockedOn===e&&(u.blockedOn=null)}for(;0<rs.length&&(i=rs[0],i.blockedOn===null);)fy(i),i.blockedOn===null&&rs.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(u=0;u<i.length;u+=3){var h=i[u],x=i[u+1],j=h[Re]||null;if(typeof x=="function")j||py(i);else if(j){var A=null;if(x&&x.hasAttribute("formAction")){if(h=x,j=x[Re]||null)A=j.formAction;else if(lp(h)!==null)continue}else A=j.action;typeof A=="function"?i[u+1]=A:(i.splice(u,3),u-=3),py(i)}}}function hy(){function e(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(j){return h=j})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),u||setTimeout(i,20)}function i(){if(!u&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){u=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function up(e){this._internalRoot=e}Nu.prototype.render=up.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(o(409));var i=r.current,u=Hn();oy(i,u,e,r,null,null)},Nu.prototype.unmount=up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;oy(e.current,2,null,e,null,null),su(),r[nt]=null}};function Nu(e){this._internalRoot=e}Nu.prototype.unstable_scheduleHydration=function(e){if(e){var r=W();e={blockedOn:null,target:e,priority:r};for(var i=0;i<rs.length&&r!==0&&r<rs[i].priority;i++);rs.splice(i,0,e),i===0&&fy(e)}};var gy=n.version;if(gy!=="19.2.8")throw Error(o(527,gy,"19.2.8"));Z.findDOMNode=function(e){var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(r),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var b3={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eu.isDisabled&&Eu.supportsFiber)try{gr=Eu.inject(b3),Tt=Eu}catch{}}return Nl.createRoot=function(e,r){if(!c(e))throw Error(o(299));var i=!1,u="",h=Cv,x=Sv,j=Nv;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(j=r.onRecoverableError)),r=ay(e,1,!1,null,null,i,u,null,h,x,j,hy),e[nt]=r.current,Fm(e),new up(r)},Nl.hydrateRoot=function(e,r,i){if(!c(e))throw Error(o(299));var u=!1,h="",x=Cv,j=Sv,A=Nv,z=null;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(j=i.onCaughtError),i.onRecoverableError!==void 0&&(A=i.onRecoverableError),i.formState!==void 0&&(z=i.formState)),r=ay(e,1,!0,r,i??null,u,h,z,x,j,A,hy),r.context=sy(null),i=r.current,u=Hn(),u=xo(u),h=Ha(u),h.callback=null,Ga(i,h,u),i=u,r.current.lanes=i,Ft(r,i),Or(r),e[nt]=r.current,Fm(e),new Nu(r)},Nl.version="19.2.8",Nl}var Ry;function A3(){if(Ry)return pp.exports;Ry=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),pp.exports=R3(),pp.exports}var _3=A3();/**
|
||
* react-router v7.18.2
|
||
*
|
||
* 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 Zh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,i2=/^[\\/]{2}/;function D3(t,n){return n+t.replace(/\\/g,"/")}var Ay="popstate";function _y(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function O3(t={}){function n(o,c){var g;let l=(g=c.state)==null?void 0:g.masked,{pathname:d,search:m,hash:p}=l||o.location;return Qp("",{pathname:d,search:m,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default",l?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,c){return typeof c=="string"?c:Il(c)}return z3(n,a,null,t)}function Nt(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function fr(t,n){if(!t){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function L3(){return Math.random().toString(36).substring(2,10)}function Dy(t,n){return{usr:t.state,key:t.key,idx:n,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Qp(t,n,a=null,o,c){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof n=="string"?vi(n):n,state:a,key:n&&n.key||o||L3(),mask:c}}function Il({pathname:t="/",search:n="",hash:a=""}){return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(t+=a.charAt(0)==="#"?a:"#"+a),t}function vi(t){let n={};if(t){let a=t.indexOf("#");a>=0&&(n.hash=t.substring(a),t=t.substring(0,a));let o=t.indexOf("?");o>=0&&(n.search=t.substring(o),t=t.substring(0,o)),t&&(n.pathname=t)}return n}function z3(t,n,a,o={}){let{window:c=document.defaultView,v5Compat:l=!1}=o,d=c.history,m="POP",p=null,g=v();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function v(){return(d.state||{idx:null}).idx}function b(){m="POP";let E=v(),k=E==null?null:E-g;g=E,p&&p({action:m,location:S.location,delta:k})}function w(E,k){m="PUSH";let N=_y(E)?E:Qp(S.location,E,k);g=v()+1;let T=Dy(N,g),M=S.createHref(N.mask||N);try{d.pushState(T,"",M)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;c.location.assign(M)}l&&p&&p({action:m,location:S.location,delta:1})}function y(E,k){m="REPLACE";let N=_y(E)?E:Qp(S.location,E,k);g=v();let T=Dy(N,g),M=S.createHref(N.mask||N);d.replaceState(T,"",M),l&&p&&p({action:m,location:S.location,delta:0})}function C(E){return P3(c,E)}let S={get action(){return m},get location(){return t(c,d)},listen(E){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Ay,b),p=E,()=>{c.removeEventListener(Ay,b),p=null}},createHref(E){return n(c,E)},createURL:C,encodeLocation(E){let k=C(E);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:w,replace:y,go(E){return d.go(E)}};return S}function P3(t,n,a=!1){let o="http://localhost";t&&(o=t.location.origin!=="null"?t.location.origin:t.location.href),Nt(o,"No window.location.(origin|href) available to create URL");let c=typeof n=="string"?n:Il(n);return c=c.replace(/ $/,"%20"),!a&&i2.test(c)&&(c=o+c),new URL(c,o)}function l2(t,n,a="/"){return I3(t,n,a,!1)}function I3(t,n,a,o,c){let l=typeof n=="string"?vi(n):n,d=Na(l.pathname||"/",a);if(d==null)return null;let m=U3(t),p=null,g=X3(d);for(let v=0;p==null&&v<m.length;++v)p=W3(m[v],g,o);return p}function U3(t){let n=c2(t);return B3(n),n}function c2(t,n=[],a=[],o="",c=!1){let l=(d,m,p=c,g)=>{let v={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(o)&&p)return;Nt(v.relativePath.startsWith(o),`Absolute route path "${v.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(o.length)}let b=Cr([o,v.relativePath]),w=a.concat(v);d.children&&d.children.length>0&&(Nt(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),c2(d.children,n,w,b,p)),!(d.path==null&&!d.index)&&n.push({path:b,score:q3(b,d.index),routesMeta:w.map((y,C)=>{let[S,E]=f2(y.relativePath,y.caseSensitive,C===w.length-1);return{...y,matcher:S,compiledParams:E}})})};return t.forEach((d,m)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))l(d,m);else for(let g of u2(d.path))l(d,m,!0,g)}),n}function u2(t){let n=t.split("/");if(n.length===0)return[];let[a,...o]=n,c=a.endsWith("?"),l=a.replace(/\?$/,"");if(o.length===0)return c?[l,""]:[l];let d=u2(o.join("/")),m=[];return m.push(...d.map(p=>p===""?l:[l,p].join("/"))),c&&m.push(...d),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function B3(t){t.sort((n,a)=>n.score!==a.score?a.score-n.score:K3(n.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var $3=/^:[\w-]+$/,H3=3,G3=2,V3=1,F3=10,Y3=-2,Oy=t=>t==="*";function q3(t,n){let a=t.split("/"),o=a.length;return a.some(Oy)&&(o+=Y3),n&&(o+=G3),a.filter(c=>!Oy(c)).reduce((c,l)=>c+($3.test(l)?H3:l===""?V3:F3),o)}function K3(t,n){return t.length===n.length&&t.slice(0,-1).every((o,c)=>o===n[c])?t[t.length-1]-n[n.length-1]:0}function W3(t,n,a=!1){let{routesMeta:o}=t,c={},l="/",d=[];for(let m=0;m<o.length;++m){let p=o[m],g=m===o.length-1,v=l==="/"?n:n.slice(l.length)||"/",b={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},w=p.matcher&&p.compiledParams?d2(b,v,p.matcher,p.compiledParams):rd(b,v),y=p.route;if(!w&&g&&a&&!o[o.length-1].route.index&&(w=rd({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},v)),!w)return null;Object.assign(c,w.params),d.push({params:c,pathname:Cr([l,w.pathname]),pathnameBase:J3(Cr([l,w.pathnameBase])),route:y}),w.pathnameBase!=="/"&&(l=Cr([l,w.pathnameBase]))}return d}function rd(t,n){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[a,o]=f2(t.path,t.caseSensitive,t.end);return d2(t,n,a,o)}function d2(t,n,a,o){let c=n.match(a);if(!c)return null;let l=c[0],d=l.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:o.reduce((g,{paramName:v,isOptional:b},w)=>{if(v==="*"){let C=m[w]||"";d=l.slice(0,l.length-C.length).replace(/(.)\/+$/,"$1")}const y=m[w];return b&&!y?g[v]=void 0:g[v]=(y||"").replace(/%2F/g,"/"),g},{}),pathname:l,pathnameBase:d,pattern:t}}function f2(t,n=!1,a=!0){fr(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],c="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,p,g,v)=>{if(o.push({paramName:m,isOptional:p!=null}),p){let b=v.charAt(g+d.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),c+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?c+="\\/*$":t!==""&&t!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,n?void 0:"i"),o]}function X3(t){try{return t.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return fr(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),t}}function Na(t,n){if(n==="/")return t;if(!t.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,o=t.charAt(a);return o&&o!=="/"?null:t.slice(a)||"/"}function Z3(t,n="/"){let{pathname:a,search:o="",hash:c=""}=typeof t=="string"?vi(t):t,l;return a?(a=m2(a),a.startsWith("/")?l=Ly(a.substring(1),"/"):l=Ly(a,n)):l=n,{pathname:l,search:eN(o),hash:tN(c)}}function Ly(t,n){let a=ad(n).split("/");return t.split("/").forEach(c=>{c===".."?a.length>1&&a.pop():c!=="."&&a.push(c)}),a.length>1?a.join("/"):"/"}function vp(t,n,a,o){return`Cannot include a '${t}' 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 Q3(t){return t.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function Qh(t){let n=Q3(t);return n.map((a,o)=>o===n.length-1?a.pathname:a.pathnameBase)}function xd(t,n,a,o=!1){let c;typeof t=="string"?c=vi(t):(c={...t},Nt(!c.pathname||!c.pathname.includes("?"),vp("?","pathname","search",c)),Nt(!c.pathname||!c.pathname.includes("#"),vp("#","pathname","hash",c)),Nt(!c.search||!c.search.includes("#"),vp("#","search","hash",c)));let l=t===""||c.pathname==="",d=l?"/":c.pathname,m;if(d==null)m=a;else{let b=n.length-1;if(!o&&d.startsWith("..")){let w=d.split("/");for(;w[0]==="..";)w.shift(),b-=1;c.pathname=w.join("/")}m=b>=0?n[b]:"/"}let p=Z3(c,m),g=d&&d!=="/"&&d.endsWith("/"),v=(l||d===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(g||v)&&(p.pathname+="/"),p}var m2=t=>t.replace(/[\\/]{2,}/g,"/"),Cr=t=>m2(t.join("/")),ad=t=>t.replace(/\/+$/,""),J3=t=>ad(t).replace(/^\/*/,"/"),eN=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,tN=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,nN=class{constructor(t,n,a,o=!1){this.status=t,this.statusText=n||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function rN(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function aN(t){let n=t.map(a=>a.route.path).filter(Boolean);return Cr(n)||"/"}var p2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function h2(t,n){let a=t;if(typeof a!="string"||!Zh.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,c=!1;if(p2)try{let l=new URL(window.location.href),d=i2.test(a)?new URL(D3(a,l.protocol)):new URL(a),m=Na(d.pathname,n);d.origin===l.origin&&m!=null?a=m+d.search+d.hash:c=!0}catch{fr(!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:c,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var g2=["POST","PUT","PATCH","DELETE"];new Set(g2);var sN=["GET",...g2];new Set(sN);var oN=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function iN(t){try{return oN.includes(new URL(t).protocol)}catch{return!1}}var bi=f.createContext(null);bi.displayName="DataRouter";var vd=f.createContext(null);vd.displayName="DataRouterState";var x2=f.createContext(!1);function lN(){return f.useContext(x2)}var v2=f.createContext({isTransitioning:!1});v2.displayName="ViewTransition";var cN=f.createContext(new Map);cN.displayName="Fetchers";var uN=f.createContext(null);uN.displayName="Await";var qn=f.createContext(null);qn.displayName="Navigation";var Jl=f.createContext(null);Jl.displayName="Location";var Er=f.createContext({outlet:null,matches:[],isDataRoute:!1});Er.displayName="Route";var Jh=f.createContext(null);Jh.displayName="RouteError";var b2="REACT_ROUTER_ERROR",dN="REDIRECT",fN="ROUTE_ERROR_RESPONSE";function mN(t){if(t.startsWith(`${b2}:${dN}:{`))try{let n=JSON.parse(t.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 pN(t){if(t.startsWith(`${b2}:${fN}:{`))try{let n=JSON.parse(t.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new nN(n.status,n.statusText,n.data)}catch{}}function hN(t,{relative:n}={}){Nt(yi(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=f.useContext(qn),{hash:c,pathname:l,search:d}=ec(t,{relative:n}),m=l;return a!=="/"&&(m=l==="/"?a:Cr([a,l])),o.createHref({pathname:m,search:d,hash:c})}function yi(){return f.useContext(Jl)!=null}function Kn(){return Nt(yi(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(Jl).location}var y2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function w2(t){f.useContext(qn).static||f.useLayoutEffect(t)}function ao(){let{isDataRoute:t}=f.useContext(Er);return t?RN():gN()}function gN(){Nt(yi(),"useNavigate() may be used only in the context of a <Router> component.");let t=f.useContext(bi),{basename:n,navigator:a}=f.useContext(qn),{matches:o}=f.useContext(Er),{pathname:c}=Kn(),l=JSON.stringify(Qh(o)),d=f.useRef(!1);return w2(()=>{d.current=!0}),f.useCallback((p,g={})=>{if(fr(d.current,y2),!d.current)return;if(typeof p=="number"){a.go(p);return}let v=xd(p,JSON.parse(l),c,g.relative==="path");t==null&&n!=="/"&&(v.pathname=v.pathname==="/"?n:Cr([n,v.pathname])),(g.replace?a.replace:a.push)(v,g.state,g)},[n,a,l,c,t])}var xN=f.createContext(null);function vN(t){let n=f.useContext(Er).outlet;return f.useMemo(()=>n&&f.createElement(xN.Provider,{value:t},n),[n,t])}function ec(t,{relative:n}={}){let{matches:a}=f.useContext(Er),{pathname:o}=Kn(),c=JSON.stringify(Qh(a));return f.useMemo(()=>xd(t,JSON.parse(c),o,n==="path"),[t,c,o,n])}function bN(t,n){return j2(t,n)}function j2(t,n,a){var E;Nt(yi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=f.useContext(qn),{matches:c}=f.useContext(Er),l=c[c.length-1],d=l?l.params:{},m=l?l.pathname:"/",p=l?l.pathnameBase:"/",g=l&&l.route;{let k=g&&g.path||"";S2(m,!g||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${k}">) 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="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let v=Kn(),b;if(n){let k=typeof n=="string"?vi(n):n;Nt(p==="/"||((E=k.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 "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=v;let w=b.pathname||"/",y=w;if(p!=="/"){let k=p.replace(/^\//,"").split("/");y="/"+w.replace(/^\//,"").split("/").slice(k.length).join("/")}let C=a&&a.state.matches.length?a.state.matches.map(k=>Object.assign(k,{route:a.manifest[k.route.id]||k.route})):l2(t,{pathname:y});fr(g||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),fr(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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=SN(C&&C.map(k=>Object.assign({},k,{params:Object.assign({},d,k.params),pathname:Cr([p,o.encodeLocation?o.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:Cr([p,o.encodeLocation?o.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,a);return n&&S?f.createElement(Jl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},S):S}function yN(){let t=MN(),n=rN(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},l={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),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:l},"ErrorBoundary")," or"," ",f.createElement("code",{style:l},"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:c},a):null,d)}var wN=f.createElement(yN,null),C2=class extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){this.props.onError?this.props.onError(t,n):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const a=pN(t.digest);a&&(t=a)}let n=t!==void 0?f.createElement(Er.Provider,{value:this.props.routeContext},f.createElement(Jh.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?f.createElement(jN,{error:t},n):n}};C2.contextType=x2;var bp=new WeakMap;function jN({children:t,error:n}){let{basename:a}=f.useContext(qn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=mN(n.digest);if(o){let c=bp.get(n);if(c)throw c;let l=h2(o.location,a),d=l.absoluteURL||l.to;if(iN(d))throw new Error("Invalid redirect location");if(p2&&!bp.get(n))if(l.isExternal||o.reloadDocument)window.location.href=d;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:o.replace}));throw bp.set(n,m),m}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return t}function CN({routeContext:t,match:n,children:a}){let o=f.useContext(bi);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(Er.Provider,{value:t},a)}function SN(t,n=[],a){let o=a==null?void 0:a.state;if(t==null){if(!o)return null;if(o.errors)t=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let c=t,l=o==null?void 0:o.errors;if(l!=null){let v=c.findIndex(b=>b.route.id&&(l==null?void 0:l[b.route.id])!==void 0);Nt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),c=c.slice(0,Math.min(c.length,v+1))}let d=!1,m=-1;if(a&&o){d=o.renderFallback;for(let v=0;v<c.length;v++){let b=c[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=v),b.route.id){let{loaderData:w,errors:y}=o,C=b.route.loader&&!w.hasOwnProperty(b.route.id)&&(!y||y[b.route.id]===void 0);if(b.route.lazy||C){a.isStatic&&(d=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let p=a==null?void 0:a.onError,g=o&&p?(v,b)=>{var w,y;p(v,{location:o.location,params:((y=(w=o.matches)==null?void 0:w[0])==null?void 0:y.params)??{},pattern:aN(o.matches),errorInfo:b})}:void 0;return c.reduceRight((v,b,w)=>{let y,C=!1,S=null,E=null;o&&(y=l&&b.route.id?l[b.route.id]:void 0,S=b.route.errorElement||wN,d&&(m<0&&w===0?(S2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,E=null):m===w&&(C=!0,E=b.route.hydrateFallbackElement||null)));let k=n.concat(c.slice(0,w+1)),N=()=>{let T;return y?T=S:C?T=E:b.route.Component?T=f.createElement(b.route.Component,null):b.route.element?T=b.route.element:T=v,f.createElement(CN,{match:b,routeContext:{outlet:v,matches:k,isDataRoute:o!=null},children:T})};return o&&(b.route.ErrorBoundary||b.route.errorElement||w===0)?f.createElement(C2,{location:o.location,revalidation:o.revalidation,component:S,error:y,children:N(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:g}):N()},null)}function eg(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function NN(t){let n=f.useContext(bi);return Nt(n,eg(t)),n}function EN(t){let n=f.useContext(vd);return Nt(n,eg(t)),n}function kN(t){let n=f.useContext(Er);return Nt(n,eg(t)),n}function tg(t){let n=kN(t),a=n.matches[n.matches.length-1];return Nt(a.route.id,`${t} can only be used on routes that contain a unique "id"`),a.route.id}function TN(){return tg("useRouteId")}function MN(){var o;let t=f.useContext(Jh),n=EN("useRouteError"),a=tg("useRouteError");return t!==void 0?t:(o=n.errors)==null?void 0:o[a]}function RN(){let{router:t}=NN("useNavigate"),n=tg("useNavigate"),a=f.useRef(!1);return w2(()=>{a.current=!0}),f.useCallback(async(c,l={})=>{fr(a.current,y2),a.current&&(typeof c=="number"?await t.navigate(c):await t.navigate(c,{fromRouteId:n,...l}))},[t,n])}var zy={};function S2(t,n,a){!n&&!zy[t]&&(zy[t]=!0,fr(!1,a))}f.memo(AN);function AN({routes:t,manifest:n,future:a,state:o,isStatic:c,onError:l}){return j2(t,void 0,{manifest:n,state:o,isStatic:c,onError:l})}function ya({to:t,replace:n,state:a,relative:o}){Nt(yi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=f.useContext(qn);fr(!c,"<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:l}=f.useContext(Er),{pathname:d}=Kn(),m=ao(),p=xd(t,Qh(l),d,o==="path"),g=JSON.stringify(p);return f.useEffect(()=>{m(JSON.parse(g),{replace:n,state:a,relative:o})},[m,g,o,n,a]),null}function _N(t){return vN(t.context)}function cn(t){Nt(!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 DN({basename:t="/",children:n=null,location:a,navigationType:o="POP",navigator:c,static:l=!1,useTransitions:d}){Nt(!yi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=t.replace(/^\/*/,"/"),p=f.useMemo(()=>({basename:m,navigator:c,static:l,useTransitions:d,future:{}}),[m,c,l,d]);typeof a=="string"&&(a=vi(a));let{pathname:g="/",search:v="",hash:b="",state:w=null,key:y="default",mask:C}=a,S=f.useMemo(()=>{let E=Na(g,m);return E==null?null:{location:{pathname:E,search:v,hash:b,state:w,key:y,mask:C},navigationType:o}},[m,g,v,b,w,y,o,C]);return fr(S!=null,`<Router basename="${m}"> is not able to match the URL "${g}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:f.createElement(qn.Provider,{value:p},f.createElement(Jl.Provider,{children:n,value:S}))}function Py({children:t,location:n}){return bN(Jp(t),n)}function Jp(t,n=[]){let a=[];return f.Children.forEach(t,(o,c)=>{if(!f.isValidElement(o))return;let l=[...n,c];if(o.type===f.Fragment){a.push.apply(a,Jp(o.props.children,l));return}Nt(o.type===cn,`[${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>`),Nt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||l.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=Jp(o.props.children,l)),a.push(d)}),a}var Fu="get",Yu="application/x-www-form-urlencoded";function bd(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function ON(t){return bd(t)&&t.tagName.toLowerCase()==="button"}function LN(t){return bd(t)&&t.tagName.toLowerCase()==="form"}function zN(t){return bd(t)&&t.tagName.toLowerCase()==="input"}function PN(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function IN(t,n){return t.button===0&&(!n||n==="_self")&&!PN(t)}function eh(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((n,a)=>{let o=t[a];return n.concat(Array.isArray(o)?o.map(c=>[a,c]):[[a,o]])},[]))}function UN(t,n){let a=eh(t);return n&&n.forEach((o,c)=>{a.has(c)||n.getAll(c).forEach(l=>{a.append(c,l)})}),a}var ku=null;function BN(){if(ku===null)try{new FormData(document.createElement("form"),0),ku=!1}catch{ku=!0}return ku}var $N=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function yp(t){return t!=null&&!$N.has(t)?(fr(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yu}"`),null):t}function HN(t,n){let a,o,c,l,d;if(LN(t)){let m=t.getAttribute("action");o=m?Na(m,n):null,a=t.getAttribute("method")||Fu,c=yp(t.getAttribute("enctype"))||Yu,l=new FormData(t)}else if(ON(t)||zN(t)&&(t.type==="submit"||t.type==="image")){let m=t.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=t.getAttribute("formaction")||m.getAttribute("action");if(o=p?Na(p,n):null,a=t.getAttribute("formmethod")||m.getAttribute("method")||Fu,c=yp(t.getAttribute("formenctype"))||yp(m.getAttribute("enctype"))||Yu,l=new FormData(m,t),!BN()){let{name:g,type:v,value:b}=t;if(v==="image"){let w=g?`${g}.`:"";l.append(`${w}x`,"0"),l.append(`${w}y`,"0")}else g&&l.append(g,b)}}else{if(bd(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Fu,o=null,c=Yu,d=t}return l&&c==="text/plain"&&(d=l,l=void 0),{action:o,method:a.toLowerCase(),encType:c,formData:l,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ng(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function N2(t,n,a,o){let c=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return a?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:n&&Na(c.pathname,n)==="/"?c.pathname=`${ad(n)}/_root.${o}`:c.pathname=`${ad(c.pathname)}.${o}`,c}async function GN(t,n){if(t.id in n)return n[t.id];try{let a=await import(t.module);return n[t.id]=a,a}catch(a){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function VN(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function FN(t,n,a){let o=await Promise.all(t.map(async c=>{let l=n.routes[c.route.id];if(l){let d=await GN(l,a);return d.links?d.links():[]}return[]}));return WN(o.flat(1).filter(VN).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Iy(t,n,a,o,c,l){let d=(p,g)=>a[g]?p.route.id!==a[g].route.id:!0,m=(p,g)=>{var v;return a[g].pathname!==p.pathname||((v=a[g].route.path)==null?void 0:v.endsWith("*"))&&a[g].params["*"]!==p.params["*"]};return l==="assets"?n.filter((p,g)=>d(p,g)||m(p,g)):l==="data"?n.filter((p,g)=>{var b;let v=o.routes[p.route.id];if(!v||!v.hasLoader)return!1;if(d(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let w=p.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((b=a[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function YN(t,n,{includeHydrateFallback:a}={}){return qN(t.map(o=>{let c=n.routes[o.route.id];if(!c)return[];let l=[c.module];return c.clientActionModule&&(l=l.concat(c.clientActionModule)),c.clientLoaderModule&&(l=l.concat(c.clientLoaderModule)),a&&c.hydrateFallbackModule&&(l=l.concat(c.hydrateFallbackModule)),c.imports&&(l=l.concat(c.imports)),l}).flat(1))}function qN(t){return[...new Set(t)]}function KN(t){let n={},a=Object.keys(t).sort();for(let o of a)n[o]=t[o];return n}function WN(t,n){let a=new Set;return new Set(n),t.reduce((o,c)=>{let l=JSON.stringify(KN(c));return a.has(l)||(a.add(l),o.push({key:l,link:c})),o},[])}function rg(){let t=f.useContext(bi);return ng(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function XN(){let t=f.useContext(vd);return ng(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var ag=f.createContext(void 0);ag.displayName="FrameworkContext";function yd(){let t=f.useContext(ag);return ng(t,"You must render this element inside a <HydratedRouter> element"),t}function ZN(t,n){let a=f.useContext(ag),[o,c]=f.useState(!1),[l,d]=f.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:v,onTouchStart:b}=n,w=f.useRef(null);f.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let S=k=>{k.forEach(N=>{d(N.isIntersecting)})},E=new IntersectionObserver(S,{threshold:.5});return w.current&&E.observe(w.current),()=>{E.disconnect()}}},[t]),f.useEffect(()=>{if(o){let S=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(S)}}},[o]);let y=()=>{c(!0)},C=()=>{c(!1),d(!1)};return a?t!=="intent"?[l,w,{}]:[l,w,{onFocus:El(m,y),onBlur:El(p,C),onMouseEnter:El(g,y),onMouseLeave:El(v,C),onTouchStart:El(b,y)}]:[!1,w,{}]}function El(t,n){return a=>{t&&t(a),a.defaultPrevented||n(a)}}function QN({page:t,...n}){let a=lN(),{nonce:o}=yd(),{router:c}=rg(),l=f.useMemo(()=>l2(c.routes,t,c.basename),[c.routes,t,c.basename]);return l?(n.nonce==null&&o&&(n={...n,nonce:o}),a?f.createElement(e8,{page:t,matches:l,...n}):f.createElement(t8,{page:t,matches:l,...n})):null}function JN(t){let{manifest:n,routeModules:a}=yd(),[o,c]=f.useState([]);return f.useEffect(()=>{let l=!1;return FN(t,n,a).then(d=>{l||c(d)}),()=>{l=!0}},[t,n,a]),o}function e8({page:t,matches:n,...a}){let o=Kn(),{future:c}=yd(),{basename:l}=rg(),d=f.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let m=N2(t,l,c.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let v of n)typeof v.route.shouldRevalidate=="function"?p=!0:g.push(v.route.id);return p&&g.length>0&&m.searchParams.set("_routes",g.join(",")),[m.pathname+m.search]},[l,c.v8_trailingSlashAwareDataRequests,t,o,n]);return f.createElement(f.Fragment,null,d.map(m=>f.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...a})))}function t8({page:t,matches:n,...a}){let o=Kn(),{future:c,manifest:l,routeModules:d}=yd(),{basename:m}=rg(),{loaderData:p,matches:g}=XN(),v=f.useMemo(()=>Iy(t,n,g,l,o,"data"),[t,n,g,l,o]),b=f.useMemo(()=>Iy(t,n,g,l,o,"assets"),[t,n,g,l,o]),w=f.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let S=new Set,E=!1;if(n.forEach(N=>{var M;let T=l.routes[N.route.id];!T||!T.hasLoader||(!v.some(_=>_.route.id===N.route.id)&&N.route.id in p&&((M=d[N.route.id])!=null&&M.shouldRevalidate)||T.hasClientLoader?E=!0:S.add(N.route.id))}),S.size===0)return[];let k=N2(t,m,c.v8_trailingSlashAwareDataRequests,"data");return E&&S.size>0&&k.searchParams.set("_routes",n.filter(N=>S.has(N.route.id)).map(N=>N.route.id).join(",")),[k.pathname+k.search]},[m,c.v8_trailingSlashAwareDataRequests,p,o,l,v,n,t,d]),y=f.useMemo(()=>YN(b,l),[b,l]),C=JN(b);return f.createElement(f.Fragment,null,w.map(S=>f.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...a})),y.map(S=>f.createElement("link",{key:S,rel:"modulepreload",href:S,...a})),C.map(({key:S,link:E})=>f.createElement("link",{key:S,nonce:a.nonce,...E,crossOrigin:E.crossOrigin??a.crossOrigin})))}function n8(...t){return n=>{t.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var r8=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{r8&&(window.__reactRouterVersion="7.18.2")}catch{}function a8({basename:t,children:n,useTransitions:a,window:o}){let c=f.useRef();c.current==null&&(c.current=O3({window:o,v5Compat:!0}));let l=c.current,[d,m]=f.useState({action:l.action,location:l.location}),p=f.useCallback(g=>{a===!1?m(g):f.startTransition(()=>m(g))},[a]);return f.useLayoutEffect(()=>l.listen(p),[l,p]),f.createElement(DN,{basename:t,children:n,location:d.location,navigationType:d.action,navigator:l,useTransitions:a})}var Jt=f.forwardRef(function({onClick:n,discover:a="render",prefetch:o="none",relative:c,reloadDocument:l,replace:d,mask:m,state:p,target:g,to:v,preventScrollReset:b,viewTransition:w,defaultShouldRevalidate:y,...C},S){let{basename:E,navigator:k,useTransitions:N}=f.useContext(qn),T=typeof v=="string"&&Zh.test(v),M=h2(v,E);v=M.to;let _=hN(v,{relative:c}),R=Kn(),L=null;if(m){let se=xd(m,[],R.mask?R.mask.pathname:"/",!0);E!=="/"&&(se.pathname=se.pathname==="/"?E:Cr([E,se.pathname])),L=k.createHref(se)}let[te,K,I]=ZN(o,C),G=i8(v,{replace:d,mask:m,state:p,target:g,preventScrollReset:b,relative:c,viewTransition:w,defaultShouldRevalidate:y,useTransitions:N});function Y(se){n&&n(se),se.defaultPrevented||G(se)}let ce=!(M.isExternal||l),fe=f.createElement("a",{...C,...I,href:(ce?L:void 0)||M.absoluteURL||_,onClick:ce?Y:n,ref:n8(S,K),target:g,"data-discover":!T&&a==="render"?"true":void 0});return te&&!T?f.createElement(f.Fragment,null,fe,f.createElement(QN,{page:_})):fe});Jt.displayName="Link";var th=f.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:o="",end:c=!1,style:l,to:d,viewTransition:m,children:p,...g},v){let b=ec(d,{relative:g.relative}),w=Kn(),y=f.useContext(vd),{navigator:C,basename:S}=f.useContext(qn),E=y!=null&&f8(b)&&m===!0,k=C.encodeLocation?C.encodeLocation(b).pathname:b.pathname,N=w.pathname,T=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;a||(N=N.toLowerCase(),T=T?T.toLowerCase():null,k=k.toLowerCase()),T&&S&&(T=Na(T,S)||T);const M=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let _=N===k||!c&&N.startsWith(k)&&N.charAt(M)==="/",R=T!=null&&(T===k||!c&&T.startsWith(k)&&T.charAt(k.length)==="/"),L={isActive:_,isPending:R,isTransitioning:E},te=_?n:void 0,K;typeof o=="function"?K=o(L):K=[o,_?"active":null,R?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let I=typeof l=="function"?l(L):l;return f.createElement(Jt,{...g,"aria-current":te,className:K,ref:v,style:I,to:d,viewTransition:m},typeof p=="function"?p(L):p)});th.displayName="NavLink";var s8=f.forwardRef(({discover:t="render",fetcherKey:n,navigate:a,reloadDocument:o,replace:c,state:l,method:d=Fu,action:m,onSubmit:p,relative:g,preventScrollReset:v,viewTransition:b,defaultShouldRevalidate:w,...y},C)=>{let{useTransitions:S}=f.useContext(qn),E=u8(),k=d8(m,{relative:g}),N=d.toLowerCase()==="get"?"get":"post",T=typeof m=="string"&&Zh.test(m),M=_=>{if(p&&p(_),_.defaultPrevented)return;_.preventDefault();let R=_.nativeEvent.submitter,L=(R==null?void 0:R.getAttribute("formmethod"))||d,te=()=>E(R||_.currentTarget,{fetcherKey:n,method:L,navigate:a,replace:c,state:l,relative:g,preventScrollReset:v,viewTransition:b,defaultShouldRevalidate:w});S&&a!==!1?f.startTransition(()=>te()):te()};return f.createElement("form",{ref:C,method:N,action:k,onSubmit:o?p:M,...y,"data-discover":!T&&t==="render"?"true":void 0})});s8.displayName="Form";function o8(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function E2(t){let n=f.useContext(bi);return Nt(n,o8(t)),n}function i8(t,{target:n,replace:a,mask:o,state:c,preventScrollReset:l,relative:d,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let v=ao(),b=Kn(),w=ec(t,{relative:d});return f.useCallback(y=>{if(IN(y,n)){y.preventDefault();let C=a!==void 0?a:Il(b)===Il(w),S=()=>v(t,{replace:C,mask:o,state:c,preventScrollReset:l,relative:d,viewTransition:m,defaultShouldRevalidate:p});g?f.startTransition(()=>S()):S()}},[b,v,w,a,o,c,n,t,l,d,m,p,g])}function wd(t){fr(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(eh(t)),a=f.useRef(!1),o=Kn(),c=f.useMemo(()=>UN(o.search,a.current?null:n.current),[o.search]),l=ao(),d=f.useCallback((m,p)=>{const g=eh(typeof m=="function"?m(new URLSearchParams(c)):m);a.current=!0,l("?"+g,p)},[l,c]);return[c,d]}var l8=0,c8=()=>`__${String(++l8)}__`;function u8(){let{router:t}=E2("useSubmit"),{basename:n}=f.useContext(qn),a=TN(),o=t.fetch,c=t.navigate;return f.useCallback(async(l,d={})=>{let{action:m,method:p,encType:g,formData:v,body:b}=HN(l,n);if(d.navigate===!1){let w=d.fetcherKey||c8();await o(w,a,d.action||m,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:b,formMethod:d.method||p,formEncType:d.encType||g,flushSync:d.flushSync})}else await c(d.action||m,{defaultShouldRevalidate:d.defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:b,formMethod:d.method||p,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:a,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,c,n,a])}function d8(t,{relative:n}={}){let{basename:a}=f.useContext(qn),o=f.useContext(Er);Nt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),l={...ec(t||".",{relative:n})},d=Kn();if(t==null){l.search=d.search;let m=new URLSearchParams(l.search),p=m.getAll("index");if(p.some(v=>v==="")){m.delete("index"),p.filter(b=>b).forEach(b=>m.append("index",b));let v=m.toString();l.search=v?`?${v}`:""}}return(!t||t===".")&&c.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(l.pathname=l.pathname==="/"?a:Cr([a,l.pathname])),Il(l)}function f8(t,{relative:n}={}){let a=f.useContext(v2);Nt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=E2("useViewTransitionState"),c=ec(t,{relative:n});if(!a.isTransitioning)return!1;let l=Na(a.currentLocation.pathname,o)||a.currentLocation.pathname,d=Na(a.nextLocation.pathname,o)||a.nextLocation.pathname;return rd(c.pathname,d)!=null||rd(c.pathname,l)!=null}var so=o2();const m8=s2(so),sg=[["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"}]],og=[["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"}]],ig=[["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"}]],k2=[["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"}]],p8=[["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"}]],T2=[["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"}]],lg=[["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"}]],Uy=[["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"}]],cg=[["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"}]],va=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],jd=[["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"}]],h8=[["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"}]],ds=[["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"}]],g8=[["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"}]],M2=[["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"}]],R2=[["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"}]],A2=[["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"}]],x8=[["path",{d:"M3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682C3 18.364 3 16.2426 3 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 12H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 7.5L17 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M7.125 7.5H7M7.25 7.5C7.25 7.63807 7.13807 7.75 7 7.75C6.86193 7.75 6.75 7.63807 6.75 7.5C6.75 7.36193 6.86193 7.25 7 7.25C7.13807 7.25 7.25 7.36193 7.25 7.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M11 16.5L17 16.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.125 16.5H7M7.25 16.5C7.25 16.6381 7.13807 16.75 7 16.75C6.86193 16.75 6.75 16.6381 6.75 16.5C6.75 16.3619 6.86193 16.25 7 16.25C7.13807 16.25 7.25 16.3619 7.25 16.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],wi=[["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"}]],Cd=[["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"}]],v8=[["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"}]],Ul=[["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"}]],Sd=[["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"}]],b8=[["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"}]],y8=[["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"}]],w8=[["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"}]],By=[["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"}]],Nd=[["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"}]],_2=[["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"}]],j8=[["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"}]],C8=[["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:"M7.32936 1.85194C7.32936 1.85194 9.54861 1.58797 9.867 1.90156C10.1124 2.14335 9.867 4.36134 9.867 4.36134M9.867 1.90156L6.89808 4.84002M4.6477 9.59694C4.6477 9.59694 2.42845 9.86092 2.11005 9.54732C1.86463 9.30553 2.11005 7.08754 2.11005 7.08754M2.11005 9.54732L5.07898 6.60886",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],ug=[["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"}]],S8=[["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"}]],N8=[["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"}]],dg=[["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"}]],E8=[["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"}]],D2=[["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"}]],k8=[["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"}]],nh=[["path",{d:"M12 4V20M20 12H4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],ur=[["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"}]],T8=[["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"}]],ji=[["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"}]],M8=[["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"}]],R8=[["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"}]],qs=[["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"}]],qu=[["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"}]],A8=[["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"}]],_8=[["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"}]],D8=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],is=[["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"}]],O8=[["path",{d:"M18 14C18 14 13.5811 19 12 19C10.4188 19 6 14 6 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 9.99996C18 9.99996 13.5811 5.00001 12 5C10.4188 4.99999 6 10 6 10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],rh=[["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"}]],L8=[["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 Te(t,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 c=new AbortController,l=window.setTimeout(()=>c.abort(),O2);let d;try{d=await fetch(t,{...n,headers:a,credentials:"include",signal:c.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(l)}const m=await d.json().catch(()=>({}));if(!d.ok)throw new Error(m.error||`Request failed (${d.status})`);return m}function z8(t,n){return n!=="supportbot"?t:t.replace(/^(\s*Token:\s*)["'][^"']*["']/m,'$1"BOT_TOKEN"')}const Ne={me:()=>Te("/api/auth/me"),logout:()=>Te("/api/auth/logout",{method:"POST"}),health:()=>Te("/api/health"),stats:()=>Te("/api/stats"),getAlerts:()=>Te("/api/alerts"),getGuildStatus:()=>Te("/api/guild/status"),getGuildResources:(t=!1)=>Te(`/api/guild/resources${t?"?refresh=1":""}`),leaveGuild:t=>Te(`/api/guild/${t}/leave`,{method:"POST"}),listConfigs:()=>["supportbot","ticket-panel","commands","messages","supportbot-ai"],getConfigRaw:t=>Te(`/api/configs/${t}`),saveConfigRaw:(t,n)=>Te("/api/configs/raw",{method:"PUT",body:JSON.stringify({filename:t,content:n})}),getConfigJson:t=>Te(`/api/configs/json/${t}`),updateConfigFields:t=>Te("/api/configs/update-fields/multi",{method:"POST",body:JSON.stringify(t)}),checkForUpdates:()=>Te("/api/system/update-check"),runUpdate:(t,n,a)=>Te("/api/system/update",{method:"POST",body:JSON.stringify({repoId:t,version:n,url:a})}),reloadConfigs:t=>Te("/api/system/reload-configs",{method:"POST",body:JSON.stringify(t?{file:t}:{})}),getLogsMeta:()=>Te("/api/system/logs/meta"),getLogs:t=>{var o;const n=new URLSearchParams;(o=t.types)!=null&&o.length&&n.set("types",t.types.join(",")),t.cursor&&Object.keys(t.cursor).length>0&&n.set("cursor",JSON.stringify(t.cursor)),t.tail!=null&&n.set("tail",String(t.tail));const a=n.toString();return Te(`/api/system/logs${a?`?${a}`:""}`)},listTranscripts:()=>Te("/api/system/transcripts"),listOpenTickets:()=>Te("/api/system/tickets/open"),createTicket:t=>Te("/api/system/tickets/create",{method:"POST",body:JSON.stringify(t)}),getTicketMessages:t=>Te(`/api/system/tickets/${encodeURIComponent(t)}/messages`),sendTicketReply:(t,n,a,o)=>Te(`/api/system/tickets/${encodeURIComponent(t)}/reply`,{method:"POST",body:JSON.stringify({message:n,staffName:a,attachments:o})}),deleteTicketMessage:(t,n)=>Te(`/api/system/tickets/${encodeURIComponent(t)}/messages/${encodeURIComponent(n)}`,{method:"DELETE"}),editTicketMessage:(t,n,a)=>Te(`/api/system/tickets/${encodeURIComponent(t)}/messages/${encodeURIComponent(n)}`,{method:"PATCH",body:JSON.stringify({content:a})}),closeTicket:(t,n)=>Te(`/api/system/tickets/${encodeURIComponent(t)}/close`,{method:"POST",body:JSON.stringify({reason:n})}),getTranscript:t=>Te(`/api/system/transcripts/${t}`),getTranscriptSettings:()=>Te("/api/system/transcript-settings"),updateTranscriptSettings:t=>Te("/api/system/transcript-settings",{method:"PUT",body:JSON.stringify(t)}),deleteTranscript:t=>Te(`/api/system/transcripts/${encodeURIComponent(t)}`,{method:"DELETE"}),purgeTranscripts:()=>Te("/api/system/transcripts/purge",{method:"POST"}),getBranding:()=>Te("/api/branding"),updateBranding:t=>Te("/api/branding",{method:"PUT",body:JSON.stringify(t)}),uploadBrandingFavicon:t=>Te("/api/branding/favicon",{method:"POST",body:JSON.stringify({dataUrl:t})}),removeBrandingFavicon:()=>Te("/api/branding/favicon",{method:"DELETE"}),resetBranding:()=>Te("/api/branding/reset",{method:"POST"}),getTranscriptTemplate:()=>Te("/api/system/transcript-template"),saveTranscriptTemplate:t=>Te("/api/system/transcript-template",{method:"PUT",body:JSON.stringify(t)}),previewTranscriptTemplate:async t=>{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(t),signal:n.signal});if(!o.ok)throw new Error(`Preview failed (${o.status})`);return await o.text()}finally{window.clearTimeout(a)}},getNotifications:()=>Te("/api/notifications"),markNotificationsRead:t=>Te("/api/notifications/read",{method:"POST",body:JSON.stringify({ids:t})}),dismissNotification:t=>Te(`/api/notifications/${t}`,{method:"DELETE"}),listDashboardUsers:()=>Te("/api/dashboard-users"),addDashboardUser:t=>Te("/api/dashboard-users",{method:"POST",body:JSON.stringify(t)}),updateDashboardUser:(t,n)=>Te(`/api/dashboard-users/${t}`,{method:"PATCH",body:JSON.stringify(n)}),removeDashboardUser:t=>Te(`/api/dashboard-users/${t}`,{method:"DELETE"}),listGroups:()=>Te("/api/dashboard-groups"),createGroup:t=>Te("/api/dashboard-groups",{method:"POST",body:JSON.stringify(t)}),updateGroup:(t,n)=>Te(`/api/dashboard-groups/${t}`,{method:"PUT",body:JSON.stringify(n)}),deleteGroup:t=>Te(`/api/dashboard-groups/${t}`,{method:"DELETE"}),getAddonsCatalog:()=>Te("/api/addons/catalog"),getAddonsInstalled:()=>Te("/api/addons/installed"),listAddonConfigs:()=>Te("/api/addons/configs"),installAddon:t=>Te("/api/addons/install",{method:"POST",body:JSON.stringify({name:t})}),getAddonConfigJson:t=>Te(`/api/addons/configs/json/${encodeURIComponent(t)}`),saveAddonConfig:(t,n)=>Te("/api/addons/configs",{method:"PUT",body:JSON.stringify({filename:t,data:n})}),buildAddon:t=>Te("/api/addons/build",{method:"POST",body:JSON.stringify(t)}),getSetupStatus:()=>Te("/api/setup/status"),validateSetup:t=>Te("/api/setup/validate",{method:"POST",body:JSON.stringify(t)}),resetDashboard:()=>Te("/api/setup/reset",{method:"POST"}),completeSetup:t=>Te("/api/setup/complete",{method:"POST",body:JSON.stringify(t)})};function fg(t){const n=Math.floor(t/86400),a=Math.floor(t%86400/3600),o=Math.floor(t%3600/60);return n>0?`${n}d ${a}h`:a>0?`${a}h ${o}m`:`${o}m`}const L2=["supportbot","ticket-panel","commands","messages","supportbot-ai"],$y={owner:"Owner",admin:"Admin",moderator:"Moderator",editor:"Editor",viewer:"Viewer",custom:"Custom"},P8={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 Mn(t,n){var c,l,d;if(!t)return!1;if(n==="overview")return t.overview;if(n==="tickets")return t.tickets??t.overview;if(n==="logs")return t.logs;if(n==="transcripts")return t.transcripts;if(n==="rawYaml"||n==="configs.raw_yaml"||n==="configs.rawYaml")return!!(t.rawYaml??((c=t.configs)==null?void 0:c.rawYaml)??!1);if(n==="settings.view")return t.settings.view;if(n==="settings.update")return t.settings.update;if(n==="users.view")return t.users.view;if(n==="users.manage")return t.users.manage;const a=n.match(/^configs\.([a-z0-9-]+)\.view$/);if(a){const m=a[1];return!!((l=t.configs[m])!=null&&l.view)}const o=n.match(/^configs\.([a-z0-9-]+)\.edit$/);if(o){const m=o[1];return!!((d=t.configs[m])!=null&&d.edit)}return!1}function sd(t,n){return Mn(t,`configs.${n}.view`)}function z2(t,n){return Mn(t,`configs.${n}.edit`)}function I8(t){return L2.some(n=>sd(t,n))}function Ku(t,n){return L2.reduce((a,o)=>(a[o]={view:t,edit:n},a),{})}function Hy(t=!0,n=!0){return{overview:!0,tickets:!0,logs:!0,transcripts:!0,rawYaml:t,settings:{view:!0,update:!0},configs:Ku(!0,!0),users:{view:!0,manage:n}}}function ls(t,n){switch(t){case"owner":return Hy(!0,!0);case"admin":return Hy(!1,!1);case"moderator":return{overview:!0,tickets:!0,logs:!0,transcripts:!0,rawYaml:!1,settings:{view:!0,update:!1},configs:Ku(!0,!1),users:{view:!1,manage:!1}};case"editor":return{overview:!0,tickets:!0,logs:!0,transcripts:!1,rawYaml:!1,settings:{view:!0,update:!1},configs:Ku(!0,!0),users:{view:!1,manage:!1}};case"viewer":return{overview:!0,tickets:!0,logs:!0,transcripts:!0,rawYaml:!1,settings:{view:!0,update:!1},configs:Ku(!0,!1),users:{view:!1,manage:!1}};case"custom":return n??ls("viewer");default:return ls("viewer")}}function P2(t){return t.globalName||t.username}function mg(t){return Mn(t,"overview")?"/":Mn(t,"logs")?"/logs":I8(t)?"/configs?file=supportbot":Mn(t,"transcripts")?"/transcripts":Mn(t,"settings.view")?"/settings":Mn(t,"users.view")?"/users":"/login"}const I2=f.createContext(null),Tu="nexus_impersonate_group";function U8({children:t}){const[n,a]=f.useState(null),[o,c]=f.useState([]),[l,d]=f.useState(!0),[m,p]=f.useState(()=>typeof window<"u"?sessionStorage.getItem(Tu):null),g=f.useCallback(async()=>{var _;try{const[R,L]=await Promise.all([Ne.me(),Ne.listGroups().catch(()=>({data:{groups:[]}}))]);return R.data?(a(R.data),(_=L.data)!=null&&_.groups&&c(L.data.groups),!0):(a(null),!1)}catch{return a(null),!1}},[]);f.useEffect(()=>{g().finally(()=>d(!1))},[g]);const v=f.useCallback(()=>{window.location.href="/api/auth/discord"},[]),b=f.useCallback(async()=>{try{typeof window<"u"&&sessionStorage.removeItem(Tu),p(null),await Ne.logout()}finally{a(null)}},[]),w=f.useCallback(_=>{typeof window<"u"&&sessionStorage.setItem(Tu,_),p(_)},[]),y=f.useCallback(()=>{typeof window<"u"&&sessionStorage.removeItem(Tu),p(null)},[]),C=f.useMemo(()=>o.find(_=>_.id===m)||null,[o,m]),S=!!(m&&C),E=f.useMemo(()=>S&&C?C.permissions:(n==null?void 0:n.permissions)??null,[S,C,n]),k=f.useCallback(_=>Mn(E,_),[E]),N=f.useCallback(_=>sd(E,_),[E]),T=f.useCallback(_=>z2(E,_),[E]),M=f.useMemo(()=>({user:n,permissions:E,isAuthenticated:!!n,loading:l,availableGroups:o,isImpersonating:S,impersonatedGroup:C,impersonateGroup:w,stopImpersonation:y,loginWithDiscord:v,logout:b,refreshSession:g,hasPermission:k,canViewConfig:N,canEditConfig:T}),[n,E,l,o,S,C,w,y,v,b,g,k,N,T]);return s.jsx(I2.Provider,{value:M,children:t})}function qt(){const t=f.useContext(I2);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}const Gy="supportbot-dashboard-favicon";function wp(t){t.pageTitle&&(document.title=t.pageTitle);let n=document.getElementById(Gy);if(t.faviconUrl){const a=`${t.faviconUrl}${t.updatedAt?`?v=${t.updatedAt}`:""}`;n||(n=document.createElement("link"),n.id=Gy,n.rel="icon",document.head.appendChild(n)),n.href=a}else n&&n.remove()}const jp={title:"SupportBot",pageTitle:"SupportBot Dashboard",hasFavicon:!1,faviconUrl:null,updatedAt:null},U2=f.createContext(null);function B8({children:t}){const[n,a]=f.useState(jp),[o,c]=f.useState(!0),l=f.useCallback(async()=>{try{const p=await Ne.getBranding();p.data&&(a(p.data),wp(p.data))}catch{a(jp),wp(jp)}finally{c(!1)}},[]);f.useEffect(()=>{l()},[l]);const d=f.useCallback(p=>{a(p),wp(p)},[]),m=f.useMemo(()=>({branding:n,loading:o,refreshBranding:l,setBrandingLocal:d}),[n,o,l,d]);return s.jsx(U2.Provider,{value:m,children:t})}function Ed(){const t=f.useContext(U2);if(!t)throw new Error("useBranding must be used within BrandingProvider");return t}const B2=f.createContext(null);function $8({children:t}){const[n,a]=f.useState(null),[o,c]=f.useState(!0),[l,d]=f.useState(""),m=f.useCallback(async()=>{try{const g=await Ne.stats();g.data?(a(g.data),d("")):g.error&&d(g.error)}catch(g){d(g instanceof Error?g.message:"Failed to load stats")}finally{c(!1)}},[]);f.useEffect(()=>{m();const g=setInterval(m,3e4);return()=>clearInterval(g)},[m]);const p=f.useMemo(()=>({stats:n,loading:o,error:l,refresh:m}),[n,o,l,m]);return s.jsx(B2.Provider,{value:p,children:t})}function kd(){const t=f.useContext(B2);if(!t)throw new Error("useBotStats must be used within BotStatsProvider");return t}function $2(){const t=Kn(),[n,a]=f.useState([]),[o,c]=f.useState(!0),l=f.useCallback(async()=>{try{const d=await Ne.listAddonConfigs();a(d.data??[])}catch{a([])}finally{c(!1)}},[]);return f.useEffect(()=>{l()},[l,t.pathname]),{files:n,loading:o,refresh:l}}const ah="addon:";function _l(t){return`${ah}${t}`}function H8(t){return t?t.startsWith(ah)?{type:"addon",file:t.slice(ah.length)}:{type:"main",file:t}:null}function H2(t){return t.replace(/\.(yml|yaml|json)$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,n=>n.toUpperCase())}const G8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},G2=f.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:a,absoluteStrokeWidth:o=!1,className:c="",altIcon:l,showAlt:d=!1,icon:m,primaryColor:p,secondaryColor:g,disableSecondaryOpacity:v=!1,...b},w)=>{const y=a!==void 0?o?Number(a)*24/Number(n):a:void 0,C=y!==void 0?{strokeWidth:y,stroke:"currentColor"}:{},S={ref:w,...G8,width:n,height:n,color:p||t,className:c,...C,...b},k=[...d&&l?l:m].sort(([,N],[,T])=>{const M=N.opacity!==void 0;return T.opacity!==void 0?1:M?-1:0}).map(([N,T])=>{const M=T.opacity!==void 0,_=M&&!v?T.opacity:void 0,R=g?{...T.stroke!==void 0?{stroke:M?g:p||t}:{fill:M?g:p||t}}:{};return f.createElement(N,{...T,...C,...R,opacity:_,key:T.key})});return f.createElement("svg",S,k)});G2.displayName="HugeiconsIcon";function V2(t){var n,a,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var c=t.length;for(n=0;n<c;n++)t[n]&&(a=V2(t[n]))&&(o&&(o+=" "),o+=a)}else for(a in t)t[a]&&(o&&(o+=" "),o+=a);return o}function F2(){for(var t,n,a=0,o="",c=arguments.length;a<c;a++)(t=arguments[a])&&(n=V2(t))&&(o&&(o+=" "),o+=n);return o}const pg="-",V8=t=>{const n=Y8(t),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:d=>{const m=d.split(pg);return m[0]===""&&m.length!==1&&m.shift(),Y2(m,n)||F8(d)},getConflictingClassGroupIds:(d,m)=>{const p=a[d]||[];return m&&o[d]?[...p,...o[d]]:p}}},Y2=(t,n)=>{var d;if(t.length===0)return n.classGroupId;const a=t[0],o=n.nextPart.get(a),c=o?Y2(t.slice(1),o):void 0;if(c)return c;if(n.validators.length===0)return;const l=t.join(pg);return(d=n.validators.find(({validator:m})=>m(l)))==null?void 0:d.classGroupId},Vy=/^\[(.+)\]$/,F8=t=>{if(Vy.test(t)){const n=Vy.exec(t)[1],a=n==null?void 0:n.substring(0,n.indexOf(":"));if(a)return"arbitrary.."+a}},Y8=t=>{const{theme:n,prefix:a}=t,o={nextPart:new Map,validators:[]};return K8(Object.entries(t.classGroups),a).forEach(([l,d])=>{sh(d,o,l,n)}),o},sh=(t,n,a,o)=>{t.forEach(c=>{if(typeof c=="string"){const l=c===""?n:Fy(n,c);l.classGroupId=a;return}if(typeof c=="function"){if(q8(c)){sh(c(o),n,a,o);return}n.validators.push({validator:c,classGroupId:a});return}Object.entries(c).forEach(([l,d])=>{sh(d,Fy(n,l),a,o)})})},Fy=(t,n)=>{let a=t;return n.split(pg).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},q8=t=>t.isThemeGetter,K8=(t,n)=>n?t.map(([a,o])=>{const c=o.map(l=>typeof l=="string"?n+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([d,m])=>[n+d,m])):l);return[a,c]}):t,W8=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,a=new Map,o=new Map;const c=(l,d)=>{a.set(l,d),n++,n>t&&(n=0,o=a,a=new Map)};return{get(l){let d=a.get(l);if(d!==void 0)return d;if((d=o.get(l))!==void 0)return c(l,d),d},set(l,d){a.has(l)?a.set(l,d):c(l,d)}}},q2="!",X8=t=>{const{separator:n,experimentalParseClassName:a}=t,o=n.length===1,c=n[0],l=n.length,d=m=>{const p=[];let g=0,v=0,b;for(let E=0;E<m.length;E++){let k=m[E];if(g===0){if(k===c&&(o||m.slice(E,E+l)===n)){p.push(m.slice(v,E)),v=E+l;continue}if(k==="/"){b=E;continue}}k==="["?g++:k==="]"&&g--}const w=p.length===0?m:m.substring(v),y=w.startsWith(q2),C=y?w.substring(1):w,S=b&&b>v?b-v:void 0;return{modifiers:p,hasImportantModifier:y,baseClassName:C,maybePostfixModifierPosition:S}};return a?m=>a({className:m,parseClassName:d}):d},Z8=t=>{if(t.length<=1)return t;const n=[];let a=[];return t.forEach(o=>{o[0]==="["?(n.push(...a.sort(),o),a=[]):a.push(o)}),n.push(...a.sort()),n},Q8=t=>({cache:W8(t.cacheSize),parseClassName:X8(t),...V8(t)}),J8=/\s+/,eE=(t,n)=>{const{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:c}=n,l=[],d=t.trim().split(J8);let m="";for(let p=d.length-1;p>=0;p-=1){const g=d[p],{modifiers:v,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:y}=a(g);let C=!!y,S=o(C?w.substring(0,y):w);if(!S){if(!C){m=g+(m.length>0?" "+m:m);continue}if(S=o(w),!S){m=g+(m.length>0?" "+m:m);continue}C=!1}const E=Z8(v).join(":"),k=b?E+q2:E,N=k+S;if(l.includes(N))continue;l.push(N);const T=c(S,C);for(let M=0;M<T.length;++M){const _=T[M];l.push(k+_)}m=g+(m.length>0?" "+m:m)}return m};function tE(){let t=0,n,a,o="";for(;t<arguments.length;)(n=arguments[t++])&&(a=K2(n))&&(o&&(o+=" "),o+=a);return o}const K2=t=>{if(typeof t=="string")return t;let n,a="";for(let o=0;o<t.length;o++)t[o]&&(n=K2(t[o]))&&(a&&(a+=" "),a+=n);return a};function nE(t,...n){let a,o,c,l=d;function d(p){const g=n.reduce((v,b)=>b(v),t());return a=Q8(g),o=a.cache.get,c=a.cache.set,l=m,m(p)}function m(p){const g=o(p);if(g)return g;const v=eE(p,a);return c(p,v),v}return function(){return l(tE.apply(null,arguments))}}const jt=t=>{const n=a=>a[t]||[];return n.isThemeGetter=!0,n},W2=/^\[(?:([a-z-]+):)?(.+)\]$/i,rE=/^\d+\/\d+$/,aE=new Set(["px","full","screen"]),sE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oE=/\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$/,iE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ha=t=>ci(t)||aE.has(t)||rE.test(t),ss=t=>Ci(t,"length",xE),ci=t=>!!t&&!Number.isNaN(Number(t)),Cp=t=>Ci(t,"number",ci),kl=t=>!!t&&Number.isInteger(Number(t)),uE=t=>t.endsWith("%")&&ci(t.slice(0,-1)),He=t=>W2.test(t),os=t=>sE.test(t),dE=new Set(["length","size","percentage"]),fE=t=>Ci(t,dE,X2),mE=t=>Ci(t,"position",X2),pE=new Set(["image","url"]),hE=t=>Ci(t,pE,bE),gE=t=>Ci(t,"",vE),Tl=()=>!0,Ci=(t,n,a)=>{const o=W2.exec(t);return o?o[1]?typeof n=="string"?o[1]===n:n.has(o[1]):a(o[2]):!1},xE=t=>oE.test(t)&&!iE.test(t),X2=()=>!1,vE=t=>lE.test(t),bE=t=>cE.test(t),yE=()=>{const t=jt("colors"),n=jt("spacing"),a=jt("blur"),o=jt("brightness"),c=jt("borderColor"),l=jt("borderRadius"),d=jt("borderSpacing"),m=jt("borderWidth"),p=jt("contrast"),g=jt("grayscale"),v=jt("hueRotate"),b=jt("invert"),w=jt("gap"),y=jt("gradientColorStops"),C=jt("gradientColorStopPositions"),S=jt("inset"),E=jt("margin"),k=jt("opacity"),N=jt("padding"),T=jt("saturate"),M=jt("scale"),_=jt("sepia"),R=jt("skew"),L=jt("space"),te=jt("translate"),K=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",He,n],Y=()=>[He,n],ce=()=>["",ha,ss],fe=()=>["auto",ci,He],se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],re=()=>["","0",He],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[ci,He];return{cacheSize:500,separator:":",theme:{colors:[Tl],spacing:[ha,ss],blur:["none","",os,He],brightness:O(),borderColor:[t],borderRadius:["none","","full",os,He],borderSpacing:Y(),borderWidth:ce(),contrast:O(),grayscale:re(),hueRotate:O(),invert:re(),gap:Y(),gradientColorStops:[t],gradientColorStopPositions:[uE,ss],inset:G(),margin:G(),opacity:O(),padding:Y(),saturate:O(),scale:O(),sepia:re(),skew:O(),space:Y(),translate:Y()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[os]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...se(),He]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",kl,He]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:re()}],shrink:[{shrink:re()}],order:[{order:["first","last","none",kl,He]}],"grid-cols":[{"grid-cols":[Tl]}],"col-start-end":[{col:["auto",{span:["full",kl,He]},He]}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":[Tl]}],"row-start-end":[{row:["auto",{span:[kl,He]},He]}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[w]}],"gap-x":[{"gap-x":[w]}],"gap-y":[{"gap-y":[w]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[E]}],mx:[{mx:[E]}],my:[{my:[E]}],ms:[{ms:[E]}],me:[{me:[E]}],mt:[{mt:[E]}],mr:[{mr:[E]}],mb:[{mb:[E]}],ml:[{ml:[E]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,n]}],"min-w":[{"min-w":[He,n,"min","max","fit"]}],"max-w":[{"max-w":[He,n,"none","full","min","max","fit","prose",{screen:[os]},os]}],h:[{h:[He,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,n,"auto","min","max","fit"]}],"font-size":[{text:["base",os,ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Cp]}],"font-family":[{font:[Tl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",He]}],"line-clamp":[{"line-clamp":["none",ci,Cp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ha,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ha,ss]}],"underline-offset":[{"underline-offset":["auto",ha,He]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...se(),mE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hE]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[m]}],"border-w-x":[{"border-x":[m]}],"border-w-y":[{"border-y":[m]}],"border-w-s":[{"border-s":[m]}],"border-w-e":[{"border-e":[m]}],"border-w-t":[{"border-t":[m]}],"border-w-r":[{"border-r":[m]}],"border-w-b":[{"border-b":[m]}],"border-w-l":[{"border-l":[m]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...P(),"hidden"]}],"divide-x":[{"divide-x":[m]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[m]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:P()}],"border-color":[{border:[c]}],"border-color-x":[{"border-x":[c]}],"border-color-y":[{"border-y":[c]}],"border-color-s":[{"border-s":[c]}],"border-color-e":[{"border-e":[c]}],"border-color-t":[{"border-t":[c]}],"border-color-r":[{"border-r":[c]}],"border-color-b":[{"border-b":[c]}],"border-color-l":[{"border-l":[c]}],"divide-color":[{divide:[c]}],"outline-style":[{outline:["",...P()]}],"outline-offset":[{"outline-offset":[ha,He]}],"outline-w":[{outline:[ha,ss]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ha,ss]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",os,gE]}],"shadow-color":[{shadow:[Tl]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",os,He]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[v]}],invert:[{invert:[b]}],saturate:[{saturate:[T]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",He]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[kl,He]}],"translate-x":[{"translate-x":[te]}],"translate-y":[{"translate-y":[te]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ha,ss,Cp]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},wE=nE(yE);function pe(...t){return wE(F2(t))}function ve({icon:t,className:n,size:a=18,strokeWidth:o=1.75}){return s.jsx(G2,{icon:t,size:a,className:pe("shrink-0",n),strokeWidth:o})}var jE=Object.defineProperty,hg=(t,n)=>jE(t,"name",{value:n,configurable:!0});function oh(t,n){if(typeof t=="function")return t(n);t!=null&&(t.current=n)}hg(oh,"setRef");function Ks(...t){return n=>{let a=!1;const o=t.map(c=>{const l=oh(c,n);return!a&&typeof l=="function"&&(a=!0),l});if(a)return()=>{for(let c=0;c<o.length;c++){const l=o[c];typeof l=="function"?l():oh(t[c],null)}}}}hg(Ks,"composeRefs");function Ie(...t){return f.useCallback(Ks(...t),t)}hg(Ie,"useComposedRefs");var CE=Object.defineProperty,kr=(t,n)=>CE(t,"name",{value:n,configurable:!0});function Nr(t){const n=f.forwardRef((a,o)=>{let{children:c,...l}=a,d=null,m=!1;const p=[];ih(c)&&typeof Mu=="function"&&(c=Mu(c._payload)),f.Children.forEach(c,w=>{var y;if(tw(w)){m=!0;const C=w;let S="child"in C.props?C.props.child:C.props.children;ih(S)&&typeof Mu=="function"&&(S=Mu(S._payload)),d=SE(C,S),p.push((y=d==null?void 0:d.props)==null?void 0:y.children)}else p.push(w)}),d?d=f.cloneElement(d,void 0,p):!m&&f.Children.count(c)===1&&f.isValidElement(c)&&(d=c);const g=d?ew(d):void 0,v=Ie(o,g);if(!d){if(c||c===0)throw new Error(m?kE(t):EE(t));return c}const b=J2(l,d.props??{});return d.type!==f.Fragment&&(b.ref=o?v:g),f.cloneElement(d,b)});return n.displayName=`${t}.Slot`,n}kr(Nr,"createSlot");var Si=Nr("Slot"),Z2=Symbol.for("radix.slottable");function Q2(t){const n=kr(a=>"child"in a?a.children(a.child):a.children,"Slottable");return n.displayName=`${t}.Slottable`,n.__radixId=Z2,n}kr(Q2,"createSlottable");var SE=kr((t,n)=>{if("child"in t.props){const a=t.props.child;return f.isValidElement(a)?f.cloneElement(a,void 0,t.props.children(a.props.children)):null}return f.isValidElement(n)?n:null},"getSlottableElementFromSlottable");function J2(t,n){const a={...n};for(const o in n){const c=t[o],l=n[o];/^on[A-Z]/.test(o)?c&&l?a[o]=(...m)=>{const p=l(...m);return c(...m),p}:c&&(a[o]=c):o==="style"?a[o]={...c,...l}:o==="className"&&(a[o]=[c,l].filter(Boolean).join(" "))}return{...t,...a}}kr(J2,"mergeProps");function ew(t){var o,c;let n=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?t.ref:(n=(c=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:c.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}kr(ew,"getElementRef");function tw(t){return f.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Z2}kr(tw,"isSlottable");var NE=Symbol.for("react.lazy");function ih(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===NE&&"_payload"in t&&nw(t._payload)}kr(ih,"isLazyComponent");function nw(t){return typeof t=="object"&&t!==null&&"then"in t}kr(nw,"isPromiseLike");var EE=kr(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),kE=kr(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Mu=xi[" use ".trim().toString()];const Yy=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,qy=F2,Ni=(t,n)=>a=>{var o;if((n==null?void 0:n.variants)==null)return qy(t,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:c,defaultVariants:l}=n,d=Object.keys(c).map(g=>{const v=a==null?void 0:a[g],b=l==null?void 0:l[g];if(v===null)return null;const w=Yy(v)||Yy(b);return c[g][w]}),m=a&&Object.entries(a).reduce((g,v)=>{let[b,w]=v;return w===void 0||(g[b]=w),g},{}),p=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((g,v)=>{let{class:b,className:w,...y}=v;return Object.entries(y).every(C=>{let[S,E]=C;return Array.isArray(E)?E.includes({...l,...m}[S]):{...l,...m}[S]===E})?[...g,b,w]:g},[]);return qy(t,d,p,a==null?void 0:a.class,a==null?void 0:a.className)},TE=Ni("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"}}),ue=f.forwardRef(({className:t,variant:n,size:a,asChild:o=!1,...c},l)=>{const d=o?Si:"button";return s.jsx(d,{className:pe(TE({variant:n,size:a,className:t})),ref:l,...c})});ue.displayName="Button";var ME=Object.defineProperty,Ei=(t,n)=>ME(t,"name",{value:n,configurable:!0}),rw=!!(typeof window<"u"&&window.document&&window.document.createElement);function je(t,n,{checkForDefaultPrevented:a=!0}={}){return Ei(function(c){if(t==null||t(c),a===!1||!c||!c.defaultPrevented)return n==null?void 0:n(c)},"handleEvent")}Ei(je,"composeEventHandlers");function RE(t){var n;if(!rw)throw new Error("Cannot access window outside of the DOM");return((n=t==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)??window}Ei(RE,"getOwnerWindow");function lh(t){if(!rw)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Ei(lh,"getOwnerDocument");function aw(t,n=!1){const{activeElement:a}=lh(t);if(!(a!=null&&a.nodeName))return null;if(sw(a)&&a.contentDocument)return aw(a.contentDocument.body,n);if(n){const o=a.getAttribute("aria-activedescendant");if(o){const c=lh(a).getElementById(o);if(c)return c}}return a}Ei(aw,"getActiveElement");function sw(t){return t.tagName==="IFRAME"}Ei(sw,"isFrame");var AE=Object.defineProperty,dr=(t,n)=>AE(t,"name",{value:n,configurable:!0});function _E(t,n){const a=f.createContext(n);a.displayName=t+"Context";const o=dr(l=>{const{children:d,...m}=l,p=f.useMemo(()=>m,Object.values(m));return s.jsx(a.Provider,{value:p,children:d})},"Provider");o.displayName=t+"Provider";function c(l,d={}){const{optional:m=!1}=d,p=f.useContext(a);if(p)return p;if(n!==void 0)return n;if(!m)throw new Error(`\`${l}\` must be used within \`${t}\``)}return dr(c,"useContext"),[o,c]}dr(_E,"createContext");function yn(t,n=[]){let a=[];function o(l,d){const m=f.createContext(d);m.displayName=l+"Context";const p=a.length;a=[...a,d];const g=dr(b=>{var k;const{scope:w,children:y,...C}=b,S=((k=w==null?void 0:w[t])==null?void 0:k[p])||m,E=f.useMemo(()=>C,Object.values(C));return s.jsx(S.Provider,{value:E,children:y})},"Provider");g.displayName=l+"Provider";function v(b,w,y={}){var k;const{optional:C=!1}=y,S=((k=w==null?void 0:w[t])==null?void 0:k[p])||m,E=f.useContext(S);if(E)return E;if(d!==void 0)return d;if(!C)throw new Error(`\`${b}\` must be used within \`${l}\``)}return dr(v,"useContext"),[g,v]}dr(o,"createContext");const c=dr(()=>{const l=a.map(d=>f.createContext(d));return dr(function(m){const p=(m==null?void 0:m[t])||l;return f.useMemo(()=>({[`__scope${t}`]:{...m,[t]:p}}),[m,p])},"useScope")},"createScope");return c.scopeName=t,[o,ow(c,...n)]}dr(yn,"createContextScope");function ow(...t){const n=t[0];if(t.length===1)return n;const a=dr(()=>{const o=t.map(c=>({useScope:c(),scopeName:c.scopeName}));return dr(function(l){const d=o.reduce((m,{useScope:p,scopeName:g})=>{const b=p(l)[`__scope${g}`];return{...m,...b}},{});return f.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])},"useComposedScopes")},"createScope");return a.scopeName=n.scopeName,a}dr(ow,"composeContextScopes");var Ct=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},DE=Object.defineProperty,OE=(t,n)=>DE(t,"name",{value:n,configurable:!0}),Ky=xi[" useEffectEvent ".trim().toString()],Wy=xi[" useInsertionEffect ".trim().toString()];function iw(t){if(typeof Ky=="function")return Ky(t);const n=f.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Wy=="function"?Wy(()=>{n.current=t}):Ct(()=>{n.current=t}),f.useMemo(()=>((...a)=>{var o;return(o=n.current)==null?void 0:o.call(n,...a)}),[])}OE(iw,"useEffectEvent");var LE=Object.defineProperty,tc=(t,n)=>LE(t,"name",{value:n,configurable:!0}),zE=xi[" useInsertionEffect ".trim().toString()]||Ct;function Hr({prop:t,defaultProp:n,onChange:a=tc(()=>{},"onChange"),caller:o}){const[c,l,d]=lw({defaultProp:n,onChange:a}),m=t!==void 0,p=m?t:c,g=f.useCallback(v=>{var b;if(m){const w=cw(v)?v(t):v;w!==t&&((b=d.current)==null||b.call(d,w))}else l(v)},[m,t,l,d]);return[p,g]}tc(Hr,"useControllableState");function lw({defaultProp:t,onChange:n}){const[a,o]=f.useState(t),c=f.useRef(a),l=f.useRef(n);return zE(()=>{l.current=n},[n]),f.useEffect(()=>{var d;c.current!==a&&((d=l.current)==null||d.call(l,a),c.current=a)},[a,c]),[a,o,l]}tc(lw,"useUncontrolledState");function cw(t){return typeof t=="function"}tc(cw,"isFunction");var Xy=Symbol("RADIX:SYNC_STATE");function PE(t,n,a,o){const{prop:c,defaultProp:l,onChange:d,caller:m}=n,p=c!==void 0,g=iw(d),v=[{...a,state:l}];o&&v.push(o);const[b,w]=f.useReducer((E,k)=>{if(k.type===Xy)return{...E,state:k.state};const N=t(E,k);return p&&!Object.is(N.state,E.state)&&g(N.state),N},...v),y=b.state,C=f.useRef(y);f.useEffect(()=>{C.current!==y&&(C.current=y,p||g(y))},[y,C,p]);const S=f.useMemo(()=>c!==void 0?{...b,state:c}:b,[b,c]);return f.useEffect(()=>{p&&!Object.is(c,b.state)&&w({type:Xy,state:c})},[c,b.state,p]),[S,w]}tc(PE,"useControllableStateReducer");var IE=Object.defineProperty,UE=(t,n)=>IE(t,"name",{value:n,configurable:!0}),BE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Me=BE.reduce((t,n)=>{const a=Nr(`Primitive.${n}`),o=f.forwardRef((c,l)=>{const{asChild:d,...m}=c,p=d?a:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(p,{...m,ref:l})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});function gg(t,n){t&&so.flushSync(()=>t.dispatchEvent(n))}UE(gg,"dispatchDiscreteCustomEvent");var $E=Object.defineProperty,Qt=(t,n)=>$E(t,"name",{value:n,configurable:!0});function Td(t){const n=t+"CollectionProvider",[a,o]=yn(n),[c,l]=a(n,{collectionRef:{current:null},itemMap:new Map}),d=Qt(S=>{const{scope:E,children:k}=S,N=f.useRef(null),T=f.useRef(new Map).current;return s.jsx(c,{scope:E,itemMap:T,collectionRef:N,children:k})},"CollectionProvider");d.displayName=n;const m=t+"CollectionSlot",p=Nr(m),g=f.forwardRef((S,E)=>{const{scope:k,children:N}=S,T=l(m,k),M=Ie(E,T.collectionRef);return s.jsx(p,{ref:M,children:N})});g.displayName=m;const v=t+"CollectionItemSlot",b="data-radix-collection-item",w=Nr(v),y=f.forwardRef((S,E)=>{const{scope:k,children:N,...T}=S,M=f.useRef(null),_=Ie(E,M),R=l(v,k);return f.useEffect(()=>(R.itemMap.set(M,{ref:M,...T}),()=>void R.itemMap.delete(M))),s.jsx(w,{[b]:"",ref:_,children:N})});y.displayName=v;function C(S){const E=l(t+"CollectionConsumer",S);return f.useCallback(()=>{const N=E.collectionRef.current;if(!N)return[];const T=Array.from(N.querySelectorAll(`[${b}]`));return Array.from(E.itemMap.values()).sort((R,L)=>T.indexOf(R.ref.current)-T.indexOf(L.ref.current))},[E.collectionRef,E.itemMap])}return Qt(C,"useCollection"),[{Provider:d,Slot:g,ItemSlot:y},C,o]}Qt(Td,"createCollection");var Zy=new WeakMap,Gt,Vn,Sp=(Vn=class extends Map{constructor(a){super(a);yy(this,Gt);dp(this,Gt,[...super.keys()]),Zy.set(this,!0)}set(a,o){return Zy.get(this)&&(this.has(a)?pn(this,Gt)[pn(this,Gt).indexOf(a)]=a:pn(this,Gt).push(a)),super.set(a,o),this}insert(a,o,c){const l=this.has(o),d=pn(this,Gt).length,m=xg(a);let p=m>=0?m:d+m;const g=p<0||p>=d?-1:p;if(g===this.size||l&&g===this.size-1||g===-1)return this.set(o,c),this;const v=this.size+(l?0:1);m<0&&p++;const b=[...pn(this,Gt)];let w,y=!1;for(let C=p;C<v;C++)if(p===C){let S=b[C];b[C]===o&&(S=b[C+1]),l&&this.delete(o),w=this.get(S),this.set(o,c)}else{!y&&b[C-1]===o&&(y=!0);const S=b[y?C:C-1],E=w;w=this.get(S),this.delete(S),this.set(S,E)}return this}with(a,o,c){const l=new Vn(this);return l.insert(a,o,c),l}before(a){const o=pn(this,Gt).indexOf(a)-1;if(!(o<0))return this.entryAt(o)}setBefore(a,o,c){const l=pn(this,Gt).indexOf(a);return l===-1?this:this.insert(l,o,c)}after(a){let o=pn(this,Gt).indexOf(a);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(a,o,c){const l=pn(this,Gt).indexOf(a);return l===-1?this:this.insert(l+1,o,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return dp(this,Gt,[]),super.clear()}delete(a){const o=super.delete(a);return o&&pn(this,Gt).splice(pn(this,Gt).indexOf(a),1),o}deleteAt(a){const o=this.keyAt(a);return o!==void 0?this.delete(o):!1}at(a){const o=Wu(pn(this,Gt),a);if(o!==void 0)return this.get(o)}entryAt(a){const o=Wu(pn(this,Gt),a);if(o!==void 0)return[o,this.get(o)]}indexOf(a){return pn(this,Gt).indexOf(a)}keyAt(a){return Wu(pn(this,Gt),a)}from(a,o){const c=this.indexOf(a);if(c===-1)return;let l=c+o;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(a,o){const c=this.indexOf(a);if(c===-1)return;let l=c+o;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(a,o){let c=0;for(const l of this){if(Reflect.apply(a,o,[l,c,this]))return l;c++}}findIndex(a,o){let c=0;for(const l of this){if(Reflect.apply(a,o,[l,c,this]))return c;c++}return-1}filter(a,o){const c=[];let l=0;for(const d of this)Reflect.apply(a,o,[d,l,this])&&c.push(d),l++;return new Vn(c)}map(a,o){const c=[];let l=0;for(const d of this)c.push([d[0],Reflect.apply(a,o,[d,l,this])]),l++;return new Vn(c)}reduce(...a){const[o,c]=a;let l=0,d=c??this.at(0);for(const m of this)l===0&&a.length===1?d=m:d=Reflect.apply(o,this,[d,m,l,this]),l++;return d}reduceRight(...a){const[o,c]=a;let l=c??this.at(-1);for(let d=this.size-1;d>=0;d--){const m=this.at(d);d===this.size-1&&a.length===1?l=m:l=Reflect.apply(o,this,[l,m,d,this])}return l}toSorted(a){const o=[...this.entries()].sort(a);return new Vn(o)}toReversed(){const a=new Vn;for(let o=this.size-1;o>=0;o--){const c=this.keyAt(o),l=this.get(c);a.set(c,l)}return a}toSpliced(...a){const o=[...this.entries()];return o.splice(...a),new Vn(o)}slice(a,o){const c=new Vn;let l=this.size-1;if(a===void 0)return c;a<0&&(a=a+this.size),o!==void 0&&o>0&&(l=o-1);for(let d=a;d<=l;d++){const m=this.keyAt(d),p=this.get(m);c.set(m,p)}return c}every(a,o){let c=0;for(const l of this){if(!Reflect.apply(a,o,[l,c,this]))return!1;c++}return!0}some(a,o){let c=0;for(const l of this){if(Reflect.apply(a,o,[l,c,this]))return!0;c++}return!1}},Gt=new WeakMap,Qt(Vn,"OrderedDict"),Vn);function Wu(t,n){if("at"in Array.prototype)return Array.prototype.at.call(t,n);const a=uw(t,n);return a===-1?void 0:t[a]}Qt(Wu,"at");function uw(t,n){const a=t.length,o=xg(n),c=o>=0?o:a+o;return c<0||c>=a?-1:c}Qt(uw,"toSafeIndex");function xg(t){return t!==t||t===0?0:Math.trunc(t)}Qt(xg,"toSafeInteger");function HE(t){const n=t+"CollectionProvider",[a,o]=yn(n),[c,l]=a(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Sp,setItemMap:Qt(()=>{},"setItemMap")}),d=Qt(({state:T,...M})=>T?s.jsx(p,{...M,state:T}):s.jsx(m,{...M}),"CollectionProvider");d.displayName=n;const m=Qt(T=>{const M=E();return s.jsx(p,{...T,state:M})},"CollectionInit");m.displayName=n+"Init";const p=Qt(T=>{const{scope:M,children:_,state:R}=T,L=f.useRef(null),[te,K]=f.useState(null),I=Ie(L,K),[G,Y]=R;return f.useEffect(()=>{if(!te)return;const ce=mw(()=>{});return ce.observe(te,{childList:!0,subtree:!0}),()=>{ce.disconnect()}},[te]),s.jsx(c,{scope:M,itemMap:G,setItemMap:Y,collectionRef:I,collectionRefObject:L,collectionElement:te,children:_})},"CollectionProviderImpl");p.displayName=n+"Impl";const g=t+"CollectionSlot",v=Nr(g),b=f.forwardRef((T,M)=>{const{scope:_,children:R}=T,L=l(g,_),te=Ie(M,L.collectionRef);return s.jsx(v,{ref:te,children:R})});b.displayName=g;const w=t+"CollectionItemSlot",y="data-radix-collection-item",C=Nr(w),S=f.forwardRef((T,M)=>{const{scope:_,children:R,...L}=T,te=f.useRef(null),[K,I]=f.useState(null),G=Ie(M,te,I),Y=l(w,_),{setItemMap:ce}=Y,fe=f.useRef(L);dw(fe.current,L)||(fe.current=L);const se=fe.current;return f.useEffect(()=>{const P=se;return ce(Z=>K?Z.has(K)?Z.set(K,{...P,element:K}).toSorted(ch):(Z.set(K,{...P,element:K}),Z.toSorted(ch)):Z),()=>{ce(Z=>!K||!Z.has(K)?Z:(Z.delete(K),new Sp(Z)))}},[K,se,ce]),s.jsx(C,{[y]:"",ref:G,children:R})});S.displayName=w;function E(){return f.useState(new Sp)}Qt(E,"useInitCollection");function k(T){const{itemMap:M}=l(t+"CollectionConsumer",T);return M}return Qt(k,"useCollection"),[{Provider:d,Slot:b,ItemSlot:S},{createCollectionScope:o,useCollection:k,useInitCollection:E}]}Qt(HE,"createCollection");function dw(t,n){if(t===n)return!0;if(typeof t!="object"||typeof n!="object"||t==null||n==null)return!1;const a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(const c of a)if(!Object.prototype.hasOwnProperty.call(n,c)||t[c]!==n[c])return!1;return!0}Qt(dw,"shallowEqual");function fw(t,n){return!!(n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Qt(fw,"isElementPreceding");function ch(t,n){return!t[1].element||!n[1].element?0:fw(t[1].element,n[1].element)?-1:1}Qt(ch,"sortByDocumentPosition");function mw(t){return new MutationObserver(a=>{for(const o of a)if(o.type==="childList"){t();return}})}Qt(mw,"getChildListObserver");var GE=Object.defineProperty,VE=(t,n)=>GE(t,"name",{value:n,configurable:!0}),FE=f.createContext(void 0);function ki(t){const n=f.useContext(FE);return t||n||"ltr"}VE(ki,"useDirection");var YE=Object.defineProperty,qE=(t,n)=>YE(t,"name",{value:n,configurable:!0});function Vt(t){const n=f.useRef(t);return f.useEffect(()=>{n.current=t}),f.useMemo(()=>((...a)=>{var o;return(o=n.current)==null?void 0:o.call(n,...a)}),[])}qE(Vt,"useCallbackRef");var KE=Object.defineProperty,Zt=(t,n)=>KE(t,"name",{value:n,configurable:!0}),uh="dismissableLayer.update",WE="dismissableLayer.pointerDownOutside",XE="dismissableLayer.focusOutside",Qy,pw=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nc=f.forwardRef(Zt(function(n,a){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:m,onInteractOutside:p,onDismiss:g,...v}=n,b=f.useContext(pw),[w,y]=f.useState(null),C=(w==null?void 0:w.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=f.useState({}),E=Ie(a,y),k=Array.from(b.layers),[N]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),T=N?k.indexOf(N):-1,M=w?k.indexOf(w):-1,_=b.layersWithOutsidePointerEventsDisabled.size>0,R=M>=T,L=f.useRef(!1),te=gw(Y=>{d==null||d(Y),p==null||p(Y),Y.defaultPrevented||g==null||g()},{ownerDocument:C,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:L,dismissableSurfaces:b.dismissableSurfaces,shouldHandlePointerDownOutside:f.useCallback(Y=>{if(!(Y instanceof Node))return!1;const ce=[...b.branches].some(fe=>fe.contains(Y));return R&&!ce},[b.branches,R])}),K=xw(Y=>{if(c&&L.current)return;const ce=Y.target;[...b.branches].some(se=>se.contains(ce))||(m==null||m(Y),p==null||p(Y),Y.defaultPrevented||g==null||g())},C),I=w?M===k.length-1:!1,G=Vt(Y=>{Y.key==="Escape"&&(l==null||l(Y),!Y.defaultPrevented&&g&&(Y.preventDefault(),g()))});return f.useEffect(()=>{if(I)return C.addEventListener("keydown",G,{capture:!0}),()=>C.removeEventListener("keydown",G,{capture:!0})},[C,I,G]),f.useEffect(()=>{if(w)return o&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(Qy=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(w)),b.layers.add(w),dh(),()=>{o&&(b.layersWithOutsidePointerEventsDisabled.delete(w),b.layersWithOutsidePointerEventsDisabled.size===0&&(C.body.style.pointerEvents=Qy))}},[w,C,o,b]),f.useEffect(()=>()=>{w&&(b.layers.delete(w),b.layersWithOutsidePointerEventsDisabled.delete(w),dh())},[w,b]),f.useEffect(()=>{const Y=Zt(()=>S({}),"handleUpdate");return document.addEventListener(uh,Y),()=>document.removeEventListener(uh,Y)},[]),s.jsx(Me.div,{...v,ref:E,style:{pointerEvents:_?R?"auto":"none":void 0,...n.style},onFocusCapture:je(n.onFocusCapture,K.onFocusCapture),onBlurCapture:je(n.onBlurCapture,K.onBlurCapture),onPointerDownCapture:je(n.onPointerDownCapture,te.onPointerDownCapture)})},"DismissableLayer"));function hw(){const t=f.useContext(pw),[n,a]=f.useState(null);return f.useEffect(()=>{if(n)return t.dismissableSurfaces.add(n),()=>{t.dismissableSurfaces.delete(n)}},[n,t.dismissableSurfaces]),a}Zt(hw,"useDismissableLayerSurface");var ZE=Zt(()=>!0,"IS_TRUE");function gw(t,n){const{ownerDocument:a=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:l,shouldHandlePointerDownOutside:d=ZE}=n,m=Vt(t),p=f.useRef(!1),g=f.useRef(!1),v=f.useRef(new Map),b=f.useRef(()=>{});return f.useEffect(()=>{function w(){g.current=!1,c.current=!1,v.current.clear()}Zt(w,"resetOutsideInteraction");function y(){return Array.from(v.current.values()).some(Boolean)}Zt(y,"isOutsideInteractionIntercepted");function C(T){if(!g.current)return;const M=T.target;M instanceof Node&&[...l].some(R=>R.contains(M))||v.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{g.current&&b.current()},0)}Zt(C,"handleInteractionCapture");function S(T){g.current&&v.current.set(T.type,!1)}Zt(S,"handleInteractionBubble");const E=Zt(T=>{if(T.target&&!p.current){let M=function(){a.removeEventListener("click",b.current);const R=y();w(),R||vg(WE,m,_,{discrete:!0})};if(Zt(M,"handleAndDispatchPointerDownOutsideEvent"),!d(T.target)){a.removeEventListener("click",b.current),w(),p.current=!1;return}const _={originalEvent:T};g.current=!0,c.current=o&&T.button===0,v.current.clear(),!o||T.button!==0?M():(a.removeEventListener("click",b.current),b.current=M,a.addEventListener("click",b.current,{once:!0}))}else a.removeEventListener("click",b.current),w();p.current=!1},"handlePointerDown"),k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of k)a.addEventListener(T,C,!0),a.addEventListener(T,S);const N=window.setTimeout(()=>{a.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(N),a.removeEventListener("pointerdown",E),a.removeEventListener("click",b.current);for(const T of k)a.removeEventListener(T,C,!0),a.removeEventListener(T,S)}},[a,m,o,c,l,d]),{onPointerDownCapture:Zt(()=>p.current=!0,"onPointerDownCapture")}}Zt(gw,"usePointerDownOutside");function xw(t,n=globalThis==null?void 0:globalThis.document){const a=Vt(t),o=f.useRef(!1);return f.useEffect(()=>{const c=Zt(l=>{l.target&&!o.current&&vg(XE,a,{originalEvent:l},{discrete:!1})},"handleFocus");return n.addEventListener("focusin",c),()=>n.removeEventListener("focusin",c)},[n,a]),{onFocusCapture:Zt(()=>o.current=!0,"onFocusCapture"),onBlurCapture:Zt(()=>o.current=!1,"onBlurCapture")}}Zt(xw,"useFocusOutside");function dh(){const t=new CustomEvent(uh);document.dispatchEvent(t)}Zt(dh,"dispatchUpdate");function vg(t,n,a,{discrete:o}){const c=a.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:a});n&&c.addEventListener(t,n,{once:!0}),o?gg(c,l):c.dispatchEvent(l)}Zt(vg,"handleAndDispatchCustomEvent");var QE=Object.defineProperty,bg=(t,n)=>QE(t,"name",{value:n,configurable:!0}),Ru=0,Lr=null;function JE(t){return Ti(),t.children}bg(JE,"FocusGuards");function Ti(){f.useEffect(()=>{Lr||(Lr={start:fh(),end:fh()});const{start:t,end:n}=Lr;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==n&&document.body.insertAdjacentElement("beforeend",n),Ru++,()=>{Ru===1&&(Lr==null||Lr.start.remove(),Lr==null||Lr.end.remove(),Lr=null),Ru=Math.max(0,Ru-1)}},[])}bg(Ti,"useFocusGuards");function fh(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}bg(fh,"createFocusGuard");var e6=Object.defineProperty,bn=(t,n)=>e6(t,"name",{value:n,configurable:!0}),Np="focusScope.autoFocusOnMount",Ep="focusScope.autoFocusOnUnmount",Jy={bubbles:!1,cancelable:!0},Md=f.forwardRef(bn(function(n,a){const{loop:o=!1,trapped:c=!1,onMountAutoFocus:l,onUnmountAutoFocus:d,...m}=n,[p,g]=f.useState(null),v=Vt(l),b=Vt(d),w=f.useRef(null),y=Ie(a,g),C=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(c){let E=function(M){if(C.paused||!p)return;const _=M.target;p.contains(_)?w.current=_:ba(w.current,{select:!0})},k=function(M){if(C.paused||!p)return;const _=M.relatedTarget;_!==null&&(p.contains(_)||ba(w.current,{select:!0}))},N=function(M){if(document.activeElement===document.body)for(const R of M)R.removedNodes.length>0&&ba(p)};bn(E,"handleFocusIn"),bn(k,"handleFocusOut"),bn(N,"handleMutations"),document.addEventListener("focusin",E),document.addEventListener("focusout",k);const T=new MutationObserver(N);return p&&T.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",k),T.disconnect()}}},[c,p,C.paused]),f.useEffect(()=>{if(p){e0.add(C);const E=document.activeElement;if(!p.contains(E)){const N=new CustomEvent(Np,Jy);p.addEventListener(Np,v),p.dispatchEvent(N),N.defaultPrevented||(vw(Cw(yg(p)),{select:!0}),document.activeElement===E&&ba(p))}return()=>{p.removeEventListener(Np,v),setTimeout(()=>{const N=new CustomEvent(Ep,Jy);p.addEventListener(Ep,b),p.dispatchEvent(N),N.defaultPrevented||ba(E??document.body,{select:!0}),p.removeEventListener(Ep,b),e0.remove(C)},0)}}},[p,v,b,C]);const S=f.useCallback(E=>{if(!o&&!c||C.paused)return;const k=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,N=document.activeElement;if(k&&N){const T=E.currentTarget,[M,_]=bw(T);M&&_?!E.shiftKey&&N===_?(E.preventDefault(),o&&ba(M,{select:!0})):E.shiftKey&&N===M&&(E.preventDefault(),o&&ba(_,{select:!0})):N===T&&E.preventDefault()}},[o,c,C.paused]);return s.jsx(Me.div,{tabIndex:-1,...m,ref:y,onKeyDown:S})},"FocusScope"));function vw(t,{select:n=!1}={}){const a=document.activeElement;for(const o of t)if(ba(o,{select:n}),document.activeElement!==a)return}bn(vw,"focusFirst");function bw(t){const n=yg(t),a=mh(n,t),o=mh(n.reverse(),t);return[a,o]}bn(bw,"getTabbableEdges");function yg(t){const n=[],a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:bn(o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)n.push(a.currentNode);return n}bn(yg,"getTabbableCandidates");function mh(t,n){const a=typeof n.checkVisibility=="function"&&n.checkVisibility({checkVisibilityCSS:!0});for(const o of t)if(!(a?!o.checkVisibility({checkVisibilityCSS:!0}):yw(o,{upTo:n})))return o}bn(mh,"findVisible");function yw(t,{upTo:n}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(n!==void 0&&t===n)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}bn(yw,"isHidden");function ww(t){return t instanceof HTMLInputElement&&"select"in t}bn(ww,"isSelectableInput");function ba(t,{select:n=!1}={}){if(t&&t.focus){const a=document.activeElement;t.focus({preventScroll:!0}),t!==a&&ww(t)&&n&&t.select()}}bn(ba,"focus");var e0=jw();function jw(){let t=[];return{add(n){const a=t[0];n!==a&&(a==null||a.pause()),t=ph(t,n),t.unshift(n)},remove(n){var a;t=ph(t,n),(a=t[0])==null||a.resume()}}}bn(jw,"createFocusScopesStack");function ph(t,n){const a=[...t],o=a.indexOf(n);return o!==-1&&a.splice(o,1),a}bn(ph,"arrayRemove");function Cw(t){return t.filter(n=>n.tagName!=="A")}bn(Cw,"removeLinks");var t6=Object.defineProperty,n6=(t,n)=>t6(t,"name",{value:n,configurable:!0}),r6=xi[" useId ".trim().toString()]||(()=>{}),a6=0;function tn(t){const[n,a]=f.useState(r6());return Ct(()=>{t||a(o=>o??String(a6++))},[t]),t||(n?`radix-${n}`:"")}n6(tn,"useId");const s6=["top","right","bottom","left"],fs=Math.min,wa=Math.max,od=Math.round,Au=Math.floor,ja=t=>({x:t,y:t}),o6={left:"right",right:"left",bottom:"top",top:"bottom"};function Sw(t,n,a){return wa(t,fs(n,a))}function Ea(t,n){return typeof t=="function"?t(n):t}function ms(t){return t.split("-")[0]}function Mi(t){return t.split("-")[1]}function wg(t){return t==="x"?"y":"x"}function jg(t){return t==="y"?"height":"width"}function Ir(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function Cg(t){return wg(Ir(t))}function i6(t,n,a){a===void 0&&(a=!1);const o=Mi(t),c=Cg(t),l=jg(c);let d=c==="x"?o===(a?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(d=id(d)),[d,id(d)]}function l6(t){const n=id(t);return[hh(t),n,hh(n)]}function hh(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const t0=["left","right"],n0=["right","left"],c6=["top","bottom"],u6=["bottom","top"];function d6(t,n,a){switch(t){case"top":case"bottom":return a?n?n0:t0:n?t0:n0;case"left":case"right":return n?c6:u6;default:return[]}}function f6(t,n,a,o){const c=Mi(t);let l=d6(ms(t),a==="start",o);return c&&(l=l.map(d=>d+"-"+c),n&&(l=l.concat(l.map(hh)))),l}function id(t){const n=ms(t);return o6[n]+t.slice(n.length)}function m6(t){var n,a,o,c;return{top:(n=t.top)!=null?n:0,right:(a=t.right)!=null?a:0,bottom:(o=t.bottom)!=null?o:0,left:(c=t.left)!=null?c:0}}function Nw(t){return typeof t!="number"?m6(t):{top:t,right:t,bottom:t,left:t}}function ld(t){const{x:n,y:a,width:o,height:c}=t;return{width:o,height:c,top:a,left:n,right:n+o,bottom:a+c,x:n,y:a}}function r0(t,n,a){let{reference:o,floating:c}=t;const l=Ir(n),d=Cg(n),m=jg(d),p=ms(n),g=l==="y",v=o.x+o.width/2-c.width/2,b=o.y+o.height/2-c.height/2,w=o[m]/2-c[m]/2;let y;switch(p){case"top":y={x:v,y:o.y-c.height};break;case"bottom":y={x:v,y:o.y+o.height};break;case"right":y={x:o.x+o.width,y:b};break;case"left":y={x:o.x-c.width,y:b};break;default:y={x:o.x,y:o.y}}const C=Mi(n);return C&&(y[d]+=w*(C==="end"?1:-1)*(a&&g?-1:1)),y}async function p6(t,n){var a;n===void 0&&(n={});const{x:o,y:c,platform:l,rects:d,elements:m,strategy:p}=t,{boundary:g="clippingAncestors",rootBoundary:v="viewport",elementContext:b="floating",altBoundary:w=!1,padding:y=0}=Ea(n,t),C=Nw(y),E=m[w?b==="floating"?"reference":"floating":b],k=ld(await l.getClippingRect({element:(a=await(l.isElement==null?void 0:l.isElement(E)))==null||a?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(m.floating)),boundary:g,rootBoundary:v,strategy:p})),N=b==="floating"?{x:o,y:c,width:d.floating.width,height:d.floating.height}:d.reference,T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(m.floating)),M=await(l.isElement==null?void 0:l.isElement(T))&&await(l.getScale==null?void 0:l.getScale(T))||{x:1,y:1},_=ld(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:N,offsetParent:T,strategy:p}):N);return{top:(k.top-_.top+C.top)/M.y,bottom:(_.bottom-k.bottom+C.bottom)/M.y,left:(k.left-_.left+C.left)/M.x,right:(_.right-k.right+C.right)/M.x}}const h6=50,g6=async(t,n,a)=>{const{placement:o="bottom",strategy:c="absolute",middleware:l=[],platform:d}=a,m=d.detectOverflow?d:{...d,detectOverflow:p6},p=await(d.isRTL==null?void 0:d.isRTL(n));let g=await d.getElementRects({reference:t,floating:n,strategy:c}),{x:v,y:b}=r0(g,o,p),w=o,y=0;const C={};for(let S=0;S<l.length;S++){const E=l[S];if(!E)continue;const{name:k,fn:N}=E,{x:T,y:M,data:_,reset:R}=await N({x:v,y:b,initialPlacement:o,placement:w,strategy:c,middlewareData:C,rects:g,platform:m,elements:{reference:t,floating:n}});v=T??v,b=M??b,C[k]={...C[k],..._},R&&y<h6&&(y++,typeof R=="object"&&(R.placement&&(w=R.placement),R.rects&&(g=R.rects===!0?await d.getElementRects({reference:t,floating:n,strategy:c}):R.rects),{x:v,y:b}=r0(g,w,p)),S=-1)}return{x:v,y:b,placement:w,strategy:c,middlewareData:C}},x6=t=>({name:"arrow",options:t,async fn(n){const{x:a,y:o,placement:c,rects:l,platform:d,elements:m,middlewareData:p}=n,{element:g,padding:v=0}=Ea(t,n)||{};if(g==null)return{};const b=Nw(v),w={x:a,y:o},y=Cg(c),C=jg(y),S=await d.getDimensions(g),E=y==="y",k=E?"top":"left",N=E?"bottom":"right",T=E?"clientHeight":"clientWidth",M=l.reference[C]+l.reference[y]-w[y]-l.floating[C],_=w[y]-l.reference[y],R=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g));let L=R?R[T]:0;(!L||!await(d.isElement==null?void 0:d.isElement(R)))&&(L=m.floating[T]||l.floating[C]);const te=M/2-_/2,K=L/2-S[C]/2-1,I=fs(b[k],K),G=fs(b[N],K),Y=L-S[C]-G,ce=L/2-S[C]/2+te,fe=Sw(I,ce,Y),se=!p.arrow&&Mi(c)!=null&&ce!==fe&&l.reference[C]/2-(ce<I?I:G)-S[C]/2<0,P=se?ce<I?ce-I:ce-Y:0;return{[y]:w[y]+P,data:{[y]:fe,centerOffset:ce-fe-P,...se&&{alignmentOffset:P}},reset:se}}}),v6=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var a,o;const{placement:c,middlewareData:l,rects:d,initialPlacement:m,platform:p,elements:g}=n,{mainAxis:v=!0,crossAxis:b=!0,fallbackPlacements:w,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...E}=Ea(t,n);if((a=l.arrow)!=null&&a.alignmentOffset)return{};const k=ms(c),N=Ir(m),T=ms(m)===m,M=await(p.isRTL==null?void 0:p.isRTL(g.floating)),_=w||(T||!S?[id(m)]:l6(m)),R=C!=="none";!w&&R&&_.push(...f6(m,S,C,M));const L=[m,..._],te=await p.detectOverflow(n,E),K=[];let I=((o=l.flip)==null?void 0:o.overflows)||[];if(v&&K.push(te[k]),b){const fe=i6(c,d,M);K.push(te[fe[0]],te[fe[1]])}if(I=[...I,{placement:c,overflows:K}],!K.every(fe=>fe<=0)){var G,Y;const fe=(((G=l.flip)==null?void 0:G.index)||0)+1,se=L[fe];if(se&&(!(b==="alignment"?N!==Ir(se):!1)||I.every(ae=>Ir(ae.placement)===N?ae.overflows[0]>0:!0)))return{data:{index:fe,overflows:I},reset:{placement:se}};let P=(Y=I.filter(Z=>Z.overflows[0]<=0).sort((Z,ae)=>Z.overflows[1]-ae.overflows[1])[0])==null?void 0:Y.placement;if(!P)switch(y){case"bestFit":{var ce;const Z=(ce=I.filter(ae=>{if(R){const re=Ir(ae.placement);return re===N||re==="y"}return!0}).map(ae=>[ae.placement,ae.overflows.filter(re=>re>0).reduce((re,V)=>re+V,0)]).sort((ae,re)=>ae[1]-re[1])[0])==null?void 0:ce[0];Z&&(P=Z);break}case"initialPlacement":P=m;break}if(c!==P)return{reset:{placement:P}}}return{}}}};function a0(t,n){return{top:t.top-n.height,right:t.right-n.width,bottom:t.bottom-n.height,left:t.left-n.width}}function s0(t){return s6.some(n=>t[n]>=0)}const b6=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(n){const{rects:a,platform:o}=n,{strategy:c="referenceHidden",...l}=Ea(t,n);switch(c){case"referenceHidden":{const d=await o.detectOverflow(n,{...l,elementContext:"reference"}),m=a0(d,a.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:s0(m)}}}case"escaped":{const d=await o.detectOverflow(n,{...l,altBoundary:!0}),m=a0(d,a.floating);return{data:{escapedOffsets:m,escaped:s0(m)}}}default:return{}}}}},Ew=new Set(["left","top"]);async function y6(t,n){const{placement:a,platform:o,elements:c}=t,l=await(o.isRTL==null?void 0:o.isRTL(c.floating)),d=ms(a),m=Mi(a),p=Ir(a)==="y",g=Ew.has(d)?-1:1,v=l&&p?-1:1,b=Ea(n,t);let{mainAxis:w,crossAxis:y,alignmentAxis:C}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return m&&typeof C=="number"&&(y=m==="end"?C*-1:C),p?{x:y*v,y:w*g}:{x:w*g,y:y*v}}const w6=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var a,o;const{x:c,y:l,placement:d,middlewareData:m}=n,p=await y6(n,t);return d===((a=m.offset)==null?void 0:a.placement)&&(o=m.arrow)!=null&&o.alignmentOffset?{}:{x:c+p.x,y:l+p.y,data:{...p,placement:d}}}}},j6=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:a,y:o,placement:c,platform:l}=n,{mainAxis:d=!0,crossAxis:m=!1,limiter:p={fn:N=>{let{x:T,y:M}=N;return{x:T,y:M}}},...g}=Ea(t,n),v={x:a,y:o},b=await l.detectOverflow(n,g),w=Ir(c),y=wg(w);let C=v[y],S=v[w];const E=(N,T)=>Sw(T+b[N==="y"?"top":"left"],T,T-b[N==="y"?"bottom":"right"]);d&&(C=E(y,C)),m&&(S=E(w,S));const k=p.fn({...n,[y]:C,[w]:S});return{...k,data:{x:k.x-a,y:k.y-o,enabled:{[y]:d,[w]:m}}}}}},C6=function(t){return t===void 0&&(t={}),{options:t,fn(n){var a,o;const{x:c,y:l,placement:d,rects:m,middlewareData:p}=n,{offset:g=0,mainAxis:v=!0,crossAxis:b=!0}=Ea(t,n),w={x:c,y:l},y=Ir(d),C=wg(y);let S=w[C],E=w[y];const k=Ea(g,n),N=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:(a=k.mainAxis)!=null?a:0,crossAxis:(o=k.crossAxis)!=null?o:0};if(v){const _=C==="y"?"height":"width",R=m.reference[C]-m.floating[_]+N.mainAxis,L=m.reference[C]+m.reference[_]-N.mainAxis;S<R?S=R:S>L&&(S=L)}if(b){var T,M;const _=C==="y"?"width":"height",R=Ew.has(ms(d)),L=m.reference[y]-m.floating[_]+(R&&((T=p.offset)==null?void 0:T[y])||0)+(R?0:N.crossAxis),te=m.reference[y]+m.reference[_]+(R?0:((M=p.offset)==null?void 0:M[y])||0)-(R?N.crossAxis:0);E<L?E=L:E>te&&(E=te)}return{[C]:S,[y]:E}}}},S6=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){const{placement:a,rects:o,platform:c,elements:l}=n,{apply:d=()=>{},...m}=Ea(t,n),p=await c.detectOverflow(n,m),g=ms(a),v=Mi(a),b=Ir(a)==="y",{width:w,height:y}=o.floating;let C,S;g==="top"||g==="bottom"?(C=g,S=v===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(S=g,C=v==="end"?"top":"bottom");const E=y-p.top-p.bottom,k=w-p.left-p.right,N=fs(y-p[C],E),T=fs(w-p[S],k),M=n.middlewareData.shift,_=!M;let R=N,L=T;M!=null&&M.enabled.x&&(L=k),M!=null&&M.enabled.y&&(R=E),_&&!v&&(b?L=w-2*wa(p.left,p.right):R=y-2*wa(p.top,p.bottom)),await d({...n,availableWidth:L,availableHeight:R});const te=await c.getDimensions(l.floating);return w!==te.width||y!==te.height?{reset:{rects:!0}}:{}}}};function Rd(){return typeof window<"u"}function Ri(t){return kw(t)?(t.nodeName||"").toLowerCase():"#document"}function Rn(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Ma(t){var n;return(n=(kw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function kw(t){return Rd()?t instanceof Node||t instanceof Rn(t).Node:!1}function Gr(t){return Rd()?t instanceof Element||t instanceof Rn(t).Element:!1}function js(t){return Rd()?t instanceof HTMLElement||t instanceof Rn(t).HTMLElement:!1}function o0(t){return!Rd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Rn(t).ShadowRoot}function Ad(t){const{overflow:n,overflowX:a,overflowY:o,display:c}=Vr(t);return/auto|scroll|overlay|hidden|clip/.test(n+o+a)&&c!=="inline"&&c!=="contents"}function N6(t){return/^(table|td|th)$/.test(Ri(t))}function _d(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const E6=/transform|translate|scale|rotate|perspective|filter/,k6=/paint|layout|strict|content/,Vs=t=>!!t&&t!=="none";let kp;function Sg(t){const n=Gr(t)?Vr(t):t;return Vs(n.transform)||Vs(n.translate)||Vs(n.scale)||Vs(n.rotate)||Vs(n.perspective)||!Ng()&&(Vs(n.backdropFilter)||Vs(n.filter))||E6.test(n.willChange||"")||k6.test(n.contain||"")}function T6(t){let n=Ws(t);for(;js(n)&&!Bl(n);){if(Sg(n))return n;if(_d(n))return null;n=Ws(n)}return null}function Ng(){return kp==null&&(kp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),kp}function Bl(t){return/^(html|body|#document)$/.test(Ri(t))}function Vr(t){return Rn(t).getComputedStyle(t)}function Dd(t){return Gr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ws(t){if(Ri(t)==="html")return t;const n=t.assignedSlot||t.parentNode||o0(t)&&t.host||Ma(t);return o0(n)?n.host:n}function Tw(t){const n=Ws(t);return Bl(n)?(t.ownerDocument||t).body:js(n)&&Ad(n)?n:Tw(n)}function $l(t,n,a){var o;n===void 0&&(n=[]),a===void 0&&(a=!0);const c=Tw(t),l=c===((o=t.ownerDocument)==null?void 0:o.body),d=Rn(c);if(l){const m=gh(d);return n.concat(d,d.visualViewport||[],Ad(c)?c:[],m&&a?$l(m):[])}else return n.concat(c,$l(c,[],a))}function gh(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Mw(t){const n=Vr(t);let a=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const c=js(t),l=c?t.offsetWidth:a,d=c?t.offsetHeight:o,m=od(a)!==l||od(o)!==d;return m&&(a=l,o=d),{width:a,height:o,$:m}}function Eg(t){return Gr(t)?t:t.contextElement}function ui(t){const n=Eg(t);if(!js(n))return ja(1);const a=n.getBoundingClientRect(),{width:o,height:c,$:l}=Mw(n);let d=(l?od(a.width):a.width)/o,m=(l?od(a.height):a.height)/c;return(!d||!Number.isFinite(d))&&(d=1),(!m||!Number.isFinite(m))&&(m=1),{x:d,y:m}}const M6=ja(0);function Rw(t){const n=Rn(t);return!Ng()||!n.visualViewport?M6:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function R6(t,n,a){return n===void 0&&(n=!1),!!a&&n&&a===Rn(t)}function Xs(t,n,a,o){n===void 0&&(n=!1),a===void 0&&(a=!1);const c=t.getBoundingClientRect(),l=Eg(t);let d=ja(1);n&&(o?Gr(o)&&(d=ui(o)):d=ui(t));const m=R6(l,a,o)?Rw(l):ja(0);let p=(c.left+m.x)/d.x,g=(c.top+m.y)/d.y,v=c.width/d.x,b=c.height/d.y;if(l&&o){const w=Rn(l),y=Gr(o)?Rn(o):o;let C=w,S=gh(C);for(;S&&y!==C;){const E=ui(S),k=S.getBoundingClientRect(),N=Vr(S),T=k.left+(S.clientLeft+parseFloat(N.paddingLeft))*E.x,M=k.top+(S.clientTop+parseFloat(N.paddingTop))*E.y;p*=E.x,g*=E.y,v*=E.x,b*=E.y,p+=T,g+=M,C=Rn(S),S=gh(C)}}return ld({width:v,height:b,x:p,y:g})}function Od(t,n){const a=Dd(t).scrollLeft;return n?n.left+a:Xs(Ma(t)).left+a}function Aw(t,n){const a=t.getBoundingClientRect(),o=a.left+n.scrollLeft-Od(t,a),c=a.top+n.scrollTop;return{x:o,y:c}}function A6(t){let{elements:n,rect:a,offsetParent:o,strategy:c}=t;const l=c==="fixed",d=Ma(o),m=n?_d(n.floating):!1;if(o===d||m&&l)return a;let p={scrollLeft:0,scrollTop:0},g=ja(1);const v=ja(0),b=js(o);if((b||!l)&&((Ri(o)!=="body"||Ad(d))&&(p=Dd(o)),b)){const y=Xs(o);g=ui(o),v.x=y.x+o.clientLeft,v.y=y.y+o.clientTop}const w=d&&!b&&!l?Aw(d,p):ja(0);return{width:a.width*g.x,height:a.height*g.y,x:a.x*g.x-p.scrollLeft*g.x+v.x+w.x,y:a.y*g.y-p.scrollTop*g.y+v.y+w.y}}function _6(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function D6(t){const n=Dd(t),a=t.ownerDocument.body,o=wa(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),c=wa(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let l=-n.scrollLeft+Od(t);const d=-n.scrollTop;return Vr(a).direction==="rtl"&&(l+=wa(t.clientWidth,a.clientWidth)-o),{width:o,height:c,x:l,y:d}}const O6=25;function L6(t,n,a){a===void 0&&(a="viewport");const o=a==="layoutViewport",c=Rn(t),l=Ma(t),d=c.visualViewport;let m=l.clientWidth,p=l.clientHeight,g=0,v=0;if(d){const w=!Ng()||n==="fixed";o?w||(g=-d.offsetLeft,v=-d.offsetTop):(m=d.width,p=d.height,w&&(g=d.offsetLeft,v=d.offsetTop))}if(Od(l)<=0){const w=l.ownerDocument,y=w.body,C=getComputedStyle(y),S=w.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,E=Math.abs(l.clientWidth-y.clientWidth-S),k=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;k<=O6&&(m-=k)}return{width:m,height:p,x:g,y:v}}function z6(t,n){const a=Xs(t,!0,n==="fixed"),o=a.top+t.clientTop,c=a.left+t.clientLeft,l=ui(t),d=t.clientWidth*l.x,m=t.clientHeight*l.y,p=c*l.x,g=o*l.y;return{width:d,height:m,x:p,y:g}}function i0(t,n,a){let o;if(n==="viewport"||n==="layoutViewport")o=L6(t,a,n);else if(n==="document")o=D6(Ma(t));else if(Gr(n))o=z6(n,a);else{const c=Rw(t);o={x:n.x-c.x,y:n.y-c.y,width:n.width,height:n.height}}return ld(o)}function P6(t,n){const a=n.get(t);if(a)return a;let o=$l(t,[],!1).filter(m=>Gr(m)&&Ri(m)!=="body"),c=null;const l=Vr(t).position==="fixed";let d=l?Ws(t):t;for(;Gr(d)&&!Bl(d);){const m=Vr(d),p=Sg(d),g=c?c.position:l?"fixed":"";!p&&(g==="fixed"||g==="absolute"&&m.position==="static")?o=o.filter(b=>b!==d):c=m,d=Ws(d)}return n.set(t,o),o}function I6(t){let{element:n,boundary:a,rootBoundary:o,strategy:c}=t;const d=[...a==="clippingAncestors"?_d(n)?[]:P6(n,this._c):[].concat(a),o],m=i0(n,d[0],c);let p=m.top,g=m.right,v=m.bottom,b=m.left;for(let w=1;w<d.length;w++){const y=i0(n,d[w],c);p=wa(y.top,p),g=fs(y.right,g),v=fs(y.bottom,v),b=wa(y.left,b)}return{width:g-b,height:v-p,x:b,y:p}}function U6(t){const{width:n,height:a}=Mw(t);return{width:n,height:a}}function B6(t,n,a){const o=js(n),c=Ma(n),l=a==="fixed",d=Xs(t,!0,l,n);let m={scrollLeft:0,scrollTop:0};const p=ja(0);if((o||!l)&&((Ri(n)!=="body"||Ad(c))&&(m=Dd(n)),o)){const w=Xs(n,!0,l,n);p.x=w.x+n.clientLeft,p.y=w.y+n.clientTop}!o&&c&&(p.x=Od(c));const g=c&&!o&&!l?Aw(c,m):ja(0),v=d.left+m.scrollLeft-p.x-g.x,b=d.top+m.scrollTop-p.y-g.y;return{x:v,y:b,width:d.width,height:d.height}}function Tp(t){return Vr(t).position==="static"}function l0(t,n){if(!js(t)||Vr(t).position==="fixed")return null;if(n)return n(t);let a=t.offsetParent;return Ma(t)===a&&(a=a.ownerDocument.body),a}function _w(t,n){const a=Rn(t);if(_d(t))return a;if(!js(t)){let c=Ws(t);for(;c&&!Bl(c);){if(Gr(c)&&!Tp(c))return c;c=Ws(c)}return a}let o=l0(t,n);for(;o&&N6(o)&&Tp(o);)o=l0(o,n);return o&&Bl(o)&&Tp(o)&&!Sg(o)?a:o||T6(t)||a}const $6=async function(t){const n=this.getOffsetParent||_w,a=this.getDimensions,o=await a(t.floating);return{reference:B6(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function H6(t){return Vr(t).direction==="rtl"}const G6={convertOffsetParentRelativeRectToViewportRelativeRect:A6,getDocumentElement:Ma,getClippingRect:I6,getOffsetParent:_w,getElementRects:$6,getClientRects:_6,getDimensions:U6,getScale:ui,isElement:Gr,isRTL:H6};function Dw(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function V6(t,n,a){let o=null,c;const l=Ma(t);function d(){var v;clearTimeout(c),(v=o)==null||v.disconnect(),o=null}function m(v,b){v===void 0&&(v=!1),b===void 0&&(b=1),d();const w=t.getBoundingClientRect(),{left:y,top:C,width:S,height:E}=w;if(v||n(),!S||!E)return;const k=Au(C),N=Au(l.clientWidth-(y+S)),T=Au(l.clientHeight-(C+E)),M=Au(y),R={rootMargin:-k+"px "+-N+"px "+-T+"px "+-M+"px",threshold:wa(0,fs(1,b))||1};let L=!0;function te(K){const I=K[0].intersectionRatio;if(!Dw(w,t.getBoundingClientRect()))return m();if(I!==b){if(!L)return m();I?m(!1,I):c=setTimeout(()=>{m(!1,1e-7)},1e3)}L=!1}try{o=new IntersectionObserver(te,{...R,root:l.ownerDocument})}catch{o=new IntersectionObserver(te,R)}o.observe(t)}const p=Rn(t),g=()=>m(a);return p.addEventListener("resize",g),m(!0),()=>{p.removeEventListener("resize",g),d()}}function F6(t,n,a,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:l=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,g=Eg(t),v=c||l?[...g?$l(g):[],...n?$l(n):[]]:[];v.forEach(k=>{c&&k.addEventListener("scroll",a),l&&k.addEventListener("resize",a)});const b=g&&m?V6(g,a,l):null;let w=-1,y=null;d&&(y=new ResizeObserver(k=>{let[N]=k;N&&N.target===g&&y&&n&&(y.unobserve(n),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var T;(T=y)==null||T.observe(n)})),a()}),g&&!p&&y.observe(g),n&&y.observe(n));let C,S=p?Xs(t):null;p&&E();function E(){const k=Xs(t);S&&!Dw(S,k)&&a(),S=k,C=requestAnimationFrame(E)}return a(),()=>{var k;v.forEach(N=>{c&&N.removeEventListener("scroll",a),l&&N.removeEventListener("resize",a)}),b==null||b(),(k=y)==null||k.disconnect(),y=null,p&&cancelAnimationFrame(C)}}const Y6=w6,q6=j6,K6=v6,W6=S6,X6=b6,c0=x6,Z6=C6,Q6=(t,n,a)=>{const o=new Map,c=a??{},l={...G6,...c.platform,_c:o};return g6(t,n,{...c,platform:l})};var J6=typeof document<"u",ek=function(){},Xu=J6?f.useLayoutEffect:ek;function cd(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="function"&&t.toString()===n.toString())return!0;let a,o,c;if(t&&n&&typeof t=="object"){if(Array.isArray(t)){if(a=t.length,a!==n.length)return!1;for(o=a;o--!==0;)if(!cd(t[o],n[o]))return!1;return!0}if(c=Object.keys(t),a=c.length,a!==Object.keys(n).length)return!1;for(o=a;o--!==0;)if(!{}.hasOwnProperty.call(n,c[o]))return!1;for(o=a;o--!==0;){const l=c[o];if(!(l==="_owner"&&t.$$typeof)&&!cd(t[l],n[l]))return!1}return!0}return t!==t&&n!==n}function Ow(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function u0(t,n){const a=Ow(t);return Math.round(n*a)/a}function Mp(t){const n=f.useRef(t);return Xu(()=>{n.current=t}),n}function tk(t){t===void 0&&(t={});const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:c,elements:{reference:l,floating:d}={},transform:m=!0,whileElementsMounted:p,open:g}=t,[v,b]=f.useState({x:0,y:0,strategy:a,placement:n,middlewareData:{},isPositioned:!1}),[w,y]=f.useState(o);cd(w,o)||y(o);const[C,S]=f.useState(null),[E,k]=f.useState(null),N=f.useCallback(ae=>{ae!==R.current&&(R.current=ae,S(ae))},[]),T=f.useCallback(ae=>{ae!==L.current&&(L.current=ae,k(ae))},[]),M=l||C,_=d||E,R=f.useRef(null),L=f.useRef(null),te=f.useRef(v),K=p!=null,I=Mp(p),G=Mp(c),Y=Mp(g),ce=f.useCallback(()=>{if(!R.current||!L.current)return;const ae={placement:n,strategy:a,middleware:w};G.current&&(ae.platform=G.current),Q6(R.current,L.current,ae).then(re=>{const V={...re,isPositioned:Y.current!==!1};fe.current&&!cd(te.current,V)&&(te.current=V,so.flushSync(()=>{b(V)}))})},[w,n,a,G,Y]);Xu(()=>{g===!1&&te.current.isPositioned&&(te.current.isPositioned=!1,b(ae=>({...ae,isPositioned:!1})))},[g]);const fe=f.useRef(!1);Xu(()=>(fe.current=!0,()=>{fe.current=!1}),[]),Xu(()=>{if(M&&(R.current=M),_&&(L.current=_),M&&_){if(I.current)return I.current(M,_,ce);ce()}},[M,_,ce,I,K]);const se=f.useMemo(()=>({reference:R,floating:L,setReference:N,setFloating:T}),[N,T]),P=f.useMemo(()=>({reference:M,floating:_}),[M,_]),Z=f.useMemo(()=>{const ae={position:a,left:0,top:0};if(!P.floating)return ae;const re=u0(P.floating,v.x),V=u0(P.floating,v.y);return m?{...ae,transform:"translate("+re+"px, "+V+"px)",...Ow(P.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:re,top:V}},[a,m,P.floating,v.x,v.y]);return f.useMemo(()=>({...v,update:ce,refs:se,elements:P,floatingStyles:Z}),[v,ce,se,P,Z])}const nk=t=>{function n(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:t,fn(a){const{element:o,padding:c}=typeof t=="function"?t(a):t;return o&&n(o)?o.current!=null?c0({element:o.current,padding:c}).fn(a):{}:o?c0({element:o,padding:c}).fn(a):{}}}},rk=(t,n)=>{const a=Y6(t);return{name:a.name,fn:a.fn,options:[t,n]}},ak=(t,n)=>{const a=q6(t);return{name:a.name,fn:a.fn,options:[t,n]}},sk=(t,n)=>({fn:Z6(t).fn,options:[t,n]}),ok=(t,n)=>{const a=K6(t);return{name:a.name,fn:a.fn,options:[t,n]}},ik=(t,n)=>{const a=W6(t);return{name:a.name,fn:a.fn,options:[t,n]}},lk=(t,n)=>{const a=X6(t);return{name:a.name,fn:a.fn,options:[t,n]}},ck=(t,n)=>{const a=nk(t);return{name:a.name,fn:a.fn,options:[t,n]}};var uk=Object.defineProperty,dk=(t,n)=>uk(t,"name",{value:n,configurable:!0});function kg(t){const[n,a]=f.useState(void 0);return Ct(()=>{if(t){a({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const l=c[0];let d,m;if("borderBoxSize"in l){const p=l.borderBoxSize,g=Array.isArray(p)?p[0]:p;d=g.inlineSize,m=g.blockSize}else d=t.offsetWidth,m=t.offsetHeight;a({width:d,height:m})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else a(void 0)},[t]),n}dk(kg,"useSize");var fk=Object.defineProperty,cs=(t,n)=>fk(t,"name",{value:n,configurable:!0}),Lw="Popper",[zw,Cs]=yn(Lw),[mk,Pw]=zw(Lw),pk=cs(t=>{const{__scopePopper:n,children:a}=t,[o,c]=f.useState(null),[l,d]=f.useState(void 0);return s.jsx(mk,{scope:n,anchor:o,onAnchorChange:c,placementState:l,setPlacementState:d,children:a})},"Popper"),hk="PopperAnchor",gk=f.forwardRef(cs(function(n,a){const{__scopePopper:o,virtualRef:c,...l}=n,d=Pw(hk,o),m=f.useRef(null),p=d.onAnchorChange,g=f.useCallback(S=>{m.current=S,S&&p(S)},[p]),v=Ie(a,g),b=f.useRef(null);f.useEffect(()=>{if(!c)return;const S=b.current;b.current=c.current,S!==b.current&&p(b.current)});const w=d.placementState&&Ld(d.placementState),y=w==null?void 0:w[0],C=w==null?void 0:w[1];return c?null:s.jsx(Me.div,{"data-radix-popper-side":y,"data-radix-popper-align":C,...l,ref:v})},"PopperAnchor")),Iw="PopperContent",[xk,zP]=zw(Iw),vk=f.forwardRef(cs(function(n,a){var me,B,ie,we,Ce,ze,Ke;const{__scopePopper:o,side:c="bottom",sideOffset:l=0,align:d="center",alignOffset:m=0,arrowPadding:p=0,avoidCollisions:g=!0,collisionBoundary:v=[],collisionPadding:b=0,sticky:w="partial",hideWhenDetached:y=!1,updatePositionStrategy:C="optimized",onPlaced:S,...E}=n,k=Pw(Iw,o),[N,T]=f.useState(null),M=Ie(a,T),[_,R]=f.useState(null),L=kg(_),te=(L==null?void 0:L.width)??0,K=(L==null?void 0:L.height)??0,I=c+(d!=="center"?"-"+d:""),G=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},Y=Array.isArray(v)?v:[v],ce=Y.length>0,fe={padding:G,boundary:Y.filter(Uw),altBoundary:ce},{refs:se,floatingStyles:P,placement:Z,isPositioned:ae,middlewareData:re}=tk({strategy:"fixed",placement:I,whileElementsMounted:cs((...ft)=>F6(...ft,{animationFrame:C==="always"}),"whileElementsMounted"),elements:{reference:k.anchor},middleware:[rk({mainAxis:l+K,alignmentAxis:m}),g&&ak({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?sk():void 0,...fe}),g&&ok({...fe}),ik({...fe,apply:cs(({elements:ft,rects:Pt,availableWidth:gn,availableHeight:Yr})=>{const{width:_n,height:wn}=Pt.reference,Xn=ft.floating.style;Xn.setProperty("--radix-popper-available-width",`${gn}px`),Xn.setProperty("--radix-popper-available-height",`${Yr}px`),Xn.setProperty("--radix-popper-anchor-width",`${_n}px`),Xn.setProperty("--radix-popper-anchor-height",`${wn}px`)},"apply")}),_&&ck({element:_,padding:p}),bk({arrowWidth:te,arrowHeight:K}),y&&lk({strategy:"referenceHidden",...fe,boundary:ce?fe.boundary:void 0})]}),V=k.setPlacementState;Ct(()=>(V(Z),()=>{V(void 0)}),[Z,V]);const[O,D]=Ld(Z),$=Vt(S);Ct(()=>{ae&&($==null||$())},[ae,$]);const H=(me=re.arrow)==null?void 0:me.x,X=(B=re.arrow)==null?void 0:B.y,xe=((ie=re.arrow)==null?void 0:ie.centerOffset)!==0,[q,ge]=f.useState();return Ct(()=>{N&&ge(window.getComputedStyle(N).zIndex)},[N]),s.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:ae?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[(we=re.transformOrigin)==null?void 0:we.x,(Ce=re.transformOrigin)==null?void 0:Ce.y].join(" "),...((ze=re.hide)==null?void 0:ze.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:s.jsx(xk,{scope:o,placedSide:O,placedAlign:D,onArrowChange:R,arrowX:H,arrowY:X,shouldHideArrow:xe,children:s.jsx(Me.div,{"data-side":O,"data-align":D,...E,ref:M,style:{...E.style,animation:ae?(Ke=E.style)==null?void 0:Ke.animation:"none"}})})})},"PopperContent"));function Uw(t){return t!==null}cs(Uw,"isNotNull");var bk=cs(t=>({name:"transformOrigin",options:t,fn(n){var E,k,N;const{placement:a,rects:o,middlewareData:c}=n,d=((E=c.arrow)==null?void 0:E.centerOffset)!==0,m=d?0:t.arrowWidth,p=d?0:t.arrowHeight,[g,v]=Ld(a),b={start:"0%",center:"50%",end:"100%"}[v],w=(((k=c.arrow)==null?void 0:k.x)??0)+m/2,y=(((N=c.arrow)==null?void 0:N.y)??0)+p/2;let C="",S="";return g==="bottom"?(C=d?b:`${w}px`,S=`${-p}px`):g==="top"?(C=d?b:`${w}px`,S=`${o.floating.height+p}px`):g==="right"?(C=`${-p}px`,S=d?b:`${y}px`):g==="left"&&(C=`${o.floating.width+p}px`,S=d?b:`${y}px`),{data:{x:C,y:S}}}}),"transformOrigin");function Ld(t){const[n,a="center"]=t.split("-");return[n,a]}cs(Ld,"getSideAndAlignFromPlacement");var zd=pk,Pd=gk,Id=vk,yk=Object.defineProperty,wk=(t,n)=>yk(t,"name",{value:n,configurable:!0}),rc=f.forwardRef(wk(function(n,a){var p;const{container:o,...c}=n,[l,d]=f.useState(!1);Ct(()=>d(!0),[]);const m=o||l&&((p=globalThis==null?void 0:globalThis.document)==null?void 0:p.body);return m?so.createPortal(s.jsx(Me.div,{...c,ref:a}),m):null},"Portal")),jk=Object.defineProperty,ka=(t,n)=>jk(t,"name",{value:n,configurable:!0});function Bw(t,n){return f.useReducer((a,o)=>n[a][o]??a,t)}ka(Bw,"useStateMachine");var dn=ka(t=>{const{present:n,children:a}=t,o=$w(n),c=typeof a=="function"?a({present:o.isPresent}):f.Children.only(a),l=Hw(o.ref,Gw(c));return typeof a=="function"||o.isPresent?f.cloneElement(c,{ref:l}):null},"Presence");function $w(t){const[n,a]=f.useState(),o=f.useRef(null),c=f.useRef(t),l=f.useRef("none"),d=f.useRef(void 0),m=t?"mounted":"unmounted",[p,g]=Bw(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{p==="mounted"?(l.current=d.current??ai(o.current),d.current=void 0):l.current="none"},[p]),Ct(()=>{const v=o.current,b=c.current;if(b!==t){const y=l.current,C=ai(v);t?(d.current=C,g("MOUNT")):C==="none"||(v==null?void 0:v.display)==="none"?g("UNMOUNT"):g(b&&y!==C?"ANIMATION_OUT":"UNMOUNT"),c.current=t}},[t,g]),Ct(()=>{if(n){let v;const b=n.ownerDocument.defaultView??window,w=ka(C=>{const E=ai(o.current).includes(CSS.escape(C.animationName));if(C.target===n&&E&&(g("ANIMATION_END"),!c.current)){const k=n.style.animationFillMode;n.style.animationFillMode="forwards",v=b.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=k)})}},"handleAnimationEnd"),y=ka(C=>{C.target===n&&(l.current=ai(o.current))},"handleAnimationStart");return n.addEventListener("animationstart",y),n.addEventListener("animationcancel",w),n.addEventListener("animationend",w),()=>{b.clearTimeout(v),n.removeEventListener("animationstart",y),n.removeEventListener("animationcancel",w),n.removeEventListener("animationend",w)}}else g("ANIMATION_END")},[n,g]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:f.useCallback(v=>{if(v){const b=getComputedStyle(v);o.current=b,d.current=ai(b)}else o.current=null;a(v)},[])}}ka($w,"usePresence");function xh(t,n){if(typeof t=="function")return t(n);t!=null&&(t.current=n)}ka(xh,"setRef");function Hw(...t){const n=f.useRef(t);return n.current=t,f.useCallback(a=>{const o=n.current;let c=!1;const l=o.map(d=>{const m=xh(d,a);return!c&&typeof m=="function"&&(c=!0),m});if(c)return()=>{for(let d=0;d<l.length;d++){const m=l[d];typeof m=="function"?m():xh(o[d],null)}}},[])}ka(Hw,"useStableComposedRefs");function ai(t){return(t==null?void 0:t.animationName)||"none"}ka(ai,"getAnimationName");function Gw(t){var o,c;let n=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,a=n&&"isReactWarning"in n&&n.isReactWarning;return a?t.ref:(n=(c=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:c.get,a=n&&"isReactWarning"in n&&n.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}ka(Gw,"getElementRef");var Ck=Object.defineProperty,Tg=(t,n)=>Ck(t,"name",{value:n,configurable:!0}),Rp=!1;function Vw(){const[t,n]=f.useState(Rp);return f.useEffect(()=>{Rp||(Rp=!0,n(!0))},[]),t}Tg(Vw,"useIsHydrated");var Fw=xi[" useSyncExternalStore ".trim().toString()];function Yw(){return()=>{}}Tg(Yw,"subscribe");function qw(){return Fw(Yw,()=>!0,()=>!1)}Tg(qw,"useIsHydratedModern");var Sk=typeof Fw=="function"?qw:Vw,Nk=Object.defineProperty,oo=(t,n)=>Nk(t,"name",{value:n,configurable:!0}),Ap="rovingFocusGroup.onEntryFocus",Ek={bubbles:!1,cancelable:!0},Ud="RovingFocusGroup",[vh,Kw,kk]=Td(Ud),[Tk,Bd]=yn(Ud,[kk]),[Mk,Rk]=Tk(Ud),Ak=f.forwardRef(oo(function(n,a){return s.jsx(vh.Provider,{scope:n.__scopeRovingFocusGroup,children:s.jsx(vh.Slot,{scope:n.__scopeRovingFocusGroup,children:s.jsx(_k,{...n,ref:a})})})},"RovingFocusGroup")),_k=f.forwardRef(oo(function(n,a){const{__scopeRovingFocusGroup:o,orientation:c,loop:l=!1,dir:d,currentTabStopId:m,defaultCurrentTabStopId:p,onCurrentTabStopIdChange:g,onEntryFocus:v,preventScrollOnEntryFocus:b=!1,...w}=n,y=f.useRef(null),C=Ie(a,y),S=ki(d),[E,k]=Hr({prop:m,defaultProp:p??null,onChange:g,caller:Ud}),[N,T]=f.useState(!1),M=Vt(v),_=Kw(o),R=f.useRef(!1),[L,te]=f.useState(0);return f.useEffect(()=>{const K=y.current;if(K)return K.addEventListener(Ap,M),()=>K.removeEventListener(Ap,M)},[M]),s.jsx(Mk,{scope:o,orientation:c,dir:S,loop:l,currentTabStopId:E,onItemFocus:f.useCallback(K=>k(K),[k]),onItemShiftTab:f.useCallback(()=>T(!0),[]),onFocusableItemAdd:f.useCallback(()=>te(K=>K+1),[]),onFocusableItemRemove:f.useCallback(()=>te(K=>K-1),[]),children:s.jsx(Me.div,{tabIndex:N||L===0?-1:0,"data-orientation":c,...w,ref:C,style:{outline:"none",...n.style},onMouseDown:je(n.onMouseDown,()=>{R.current=!0}),onFocus:je(n.onFocus,K=>{const I=!R.current;if(K.target===K.currentTarget&&I&&!N){const G=new CustomEvent(Ap,Ek);if(K.currentTarget.dispatchEvent(G),!G.defaultPrevented){const Y=_().filter(Z=>Z.focusable),ce=Y.find(Z=>Z.active),fe=Y.find(Z=>Z.id===E),P=[ce,fe,...Y].filter(Boolean).map(Z=>Z.ref.current);Mg(P,b)}}R.current=!1}),onBlur:je(n.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),Dk="RovingFocusGroupItem",Ok=f.forwardRef(oo(function(n,a){const{__scopeRovingFocusGroup:o,focusable:c=!0,active:l=!1,tabStopId:d,children:m,...p}=n,g=tn(),v=d||g,b=Rk(Dk,o),w=b.currentTabStopId===v,y=Kw(o),{onFocusableItemAdd:C,onFocusableItemRemove:S,currentTabStopId:E}=b,k=Sk();return Ct(()=>{if(!(!k||!c))return C(),()=>S()},[k,c,C,S]),f.useEffect(()=>{if(!(k||!c))return C(),()=>S()},[k,c,C,S]),s.jsx(vh.ItemSlot,{scope:o,id:v,focusable:c,active:l,children:s.jsx(Me.span,{tabIndex:w?0:-1,"data-orientation":b.orientation,...p,ref:a,onMouseDown:je(n.onMouseDown,N=>{c?b.onItemFocus(v):N.preventDefault()}),onFocus:je(n.onFocus,()=>b.onItemFocus(v)),onKeyDown:je(n.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){b.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const T=Xw(N,b.orientation,b.dir);if(T!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let _=y().filter(R=>R.focusable).map(R=>R.ref.current);if(T==="last")_.reverse();else if(T==="prev"||T==="next"){T==="prev"&&_.reverse();const R=_.indexOf(N.currentTarget);_=b.loop?Zw(_,R+1):_.slice(R+1)}setTimeout(()=>Mg(_))}}),children:typeof m=="function"?m({isCurrentTabStop:w,hasTabStop:E!=null}):m})})},"RovingFocusGroupItem")),Lk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ww(t,n){return n!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}oo(Ww,"getDirectionAwareKey");function Xw(t,n,a){const o=Ww(t.key,a);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Lk[o]}oo(Xw,"getFocusIntent");function Mg(t,n=!1){const a=document.activeElement;for(const o of t)if(o===a||(o.focus({preventScroll:n}),document.activeElement!==a))return}oo(Mg,"focusFirst");function Zw(t,n){return t.map((a,o)=>t[(n+o)%t.length])}oo(Zw,"wrapArray");var Qw=Ak,Jw=Ok,zk=function(t){if(typeof document>"u")return null;var n=Array.isArray(t)?t[0]:t;return n.ownerDocument.body},ei=new WeakMap,_u=new WeakMap,Du={},_p=0,ej=function(t){return t&&(t.host||ej(t.parentNode))},Pk=function(t,n){return n.map(function(a){if(t.contains(a))return a;var o=ej(a);return o&&t.contains(o)?o:(console.error("aria-hidden",a,"in not contained inside",t,". Doing nothing"),null)}).filter(function(a){return!!a})},Ik=function(t,n,a,o){var c=Pk(n,Array.isArray(t)?t:[t]);Du[a]||(Du[a]=new WeakMap);var l=Du[a],d=[],m=new Set,p=new Set(c),g=function(b){!b||m.has(b)||(m.add(b),g(b.parentNode))};c.forEach(g);var v=function(b){!b||p.has(b)||Array.prototype.forEach.call(b.children,function(w){if(m.has(w))v(w);else try{var y=w.getAttribute(o),C=y!==null&&y!=="false",S=(ei.get(w)||0)+1,E=(l.get(w)||0)+1;ei.set(w,S),l.set(w,E),d.push(w),S===1&&C&&_u.set(w,!0),E===1&&w.setAttribute(a,"true"),C||w.setAttribute(o,"true")}catch(k){console.error("aria-hidden: cannot operate on ",w,k)}})};return v(n),m.clear(),_p++,function(){d.forEach(function(b){var w=ei.get(b)-1,y=l.get(b)-1;ei.set(b,w),l.set(b,y),w||(_u.has(b)||b.removeAttribute(o),_u.delete(b)),y||b.removeAttribute(a)}),_p--,_p||(ei=new WeakMap,ei=new WeakMap,_u=new WeakMap,Du={})}},$d=function(t,n,a){a===void 0&&(a="data-aria-hidden");var o=Array.from(Array.isArray(t)?t:[t]),c=zk(t);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),Ik(o,c,a,"aria-hidden")):function(){return null}},Pr=function(){return Pr=Object.assign||function(n){for(var a,o=1,c=arguments.length;o<c;o++){a=arguments[o];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(n[l]=a[l])}return n},Pr.apply(this,arguments)};function tj(t,n){var a={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(a[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(t);c<o.length;c++)n.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(t,o[c])&&(a[o[c]]=t[o[c]]);return a}function Uk(t,n,a){if(a||arguments.length===2)for(var o=0,c=n.length,l;o<c;o++)(l||!(o in n))&&(l||(l=Array.prototype.slice.call(n,0,o)),l[o]=n[o]);return t.concat(l||Array.prototype.slice.call(n))}var Zu="right-scroll-bar-position",Qu="width-before-scroll-bar",Bk="with-scroll-bars-hidden",$k="--removed-body-scroll-bar-size";function Dp(t,n){return typeof t=="function"?t(n):t&&(t.current=n),t}function Hk(t,n){var a=f.useState(function(){return{value:t,callback:n,facade:{get current(){return a.value},set current(o){var c=a.value;c!==o&&(a.value=o,a.callback(o,c))}}}})[0];return a.callback=n,a.facade}var Gk=typeof window<"u"?f.useLayoutEffect:f.useEffect,d0=new WeakMap;function Vk(t,n){var a=Hk(null,function(o){return t.forEach(function(c){return Dp(c,o)})});return Gk(function(){var o=d0.get(a);if(o){var c=new Set(o),l=new Set(t),d=a.current;c.forEach(function(m){l.has(m)||Dp(m,null)}),l.forEach(function(m){c.has(m)||Dp(m,d)})}d0.set(a,t)},[t]),a}function Fk(t){return t}function Yk(t,n){n===void 0&&(n=Fk);var a=[],o=!1,c={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]:t},useMedium:function(l){var d=n(l,o);return a.push(d),function(){a=a.filter(function(m){return m!==d})}},assignSyncMedium:function(l){for(o=!0;a.length;){var d=a;a=[],d.forEach(l)}a={push:function(m){return l(m)},filter:function(){return a}}},assignMedium:function(l){o=!0;var d=[];if(a.length){var m=a;a=[],m.forEach(l),d=a}var p=function(){var v=d;d=[],v.forEach(l)},g=function(){return Promise.resolve().then(p)};g(),a={push:function(v){d.push(v),g()},filter:function(v){return d=d.filter(v),a}}}};return c}function qk(t){t===void 0&&(t={});var n=Yk(null);return n.options=Pr({async:!0,ssr:!1},t),n}var nj=function(t){var n=t.sideCar,a=tj(t,["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,Pr({},a))};nj.isSideCarExport=!0;function Kk(t,n){return t.useMedium(n),nj}var rj=qk(),Op=function(){},Hd=f.forwardRef(function(t,n){var a=f.useRef(null),o=f.useState({onScrollCapture:Op,onWheelCapture:Op,onTouchMoveCapture:Op}),c=o[0],l=o[1],d=t.forwardProps,m=t.children,p=t.className,g=t.removeScrollBar,v=t.enabled,b=t.shards,w=t.sideCar,y=t.noRelative,C=t.noIsolation,S=t.inert,E=t.allowPinchZoom,k=t.as,N=k===void 0?"div":k,T=t.gapMode,M=tj(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=w,R=Vk([a,n]),L=Pr(Pr({},M),c);return f.createElement(f.Fragment,null,v&&f.createElement(_,{sideCar:rj,removeScrollBar:g,shards:b,noRelative:y,noIsolation:C,inert:S,setCallbacks:l,allowPinchZoom:!!E,lockRef:a,gapMode:T}),d?f.cloneElement(f.Children.only(m),Pr(Pr({},L),{ref:R})):f.createElement(N,Pr({},L,{className:p,ref:R}),m))});Hd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hd.classNames={fullWidth:Qu,zeroRight:Zu};var Wk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Xk(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var n=Wk();return n&&t.setAttribute("nonce",n),t}function Zk(t,n){t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n))}function Qk(t){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(t)}var Jk=function(){var t=0,n=null;return{add:function(a){t==0&&(n=Xk())&&(Zk(n,a),Qk(n)),t++},remove:function(){t--,!t&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},e9=function(){var t=Jk();return function(n,a){f.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&a])}},aj=function(){var t=e9(),n=function(a){var o=a.styles,c=a.dynamic;return t(o,c),null};return n},t9={left:0,top:0,right:0,gap:0},Lp=function(t){return parseInt(t||"",10)||0},n9=function(t){var n=window.getComputedStyle(document.body),a=n[t==="padding"?"paddingLeft":"marginLeft"],o=n[t==="padding"?"paddingTop":"marginTop"],c=n[t==="padding"?"paddingRight":"marginRight"];return[Lp(a),Lp(o),Lp(c)]},r9=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return t9;var n=n9(t),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])}},a9=aj(),di="data-scroll-locked",s9=function(t,n,a,o){var c=t.left,l=t.top,d=t.right,m=t.gap;return a===void 0&&(a="margin"),`
|
||
.`.concat(Bk,` {
|
||
overflow: hidden `).concat(o,`;
|
||
padding-right: `).concat(m,"px ").concat(o,`;
|
||
}
|
||
body[`).concat(di,`] {
|
||
overflow: hidden `).concat(o,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([n&&"position: relative ".concat(o,";"),a==="margin"&&`
|
||
padding-left: `.concat(c,`px;
|
||
padding-top: `).concat(l,`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(Zu,` {
|
||
right: `).concat(m,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(Qu,` {
|
||
margin-right: `).concat(m,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(Zu," .").concat(Zu,` {
|
||
right: 0 `).concat(o,`;
|
||
}
|
||
|
||
.`).concat(Qu," .").concat(Qu,` {
|
||
margin-right: 0 `).concat(o,`;
|
||
}
|
||
|
||
body[`).concat(di,`] {
|
||
`).concat($k,": ").concat(m,`px;
|
||
}
|
||
`)},f0=function(){var t=parseInt(document.body.getAttribute(di)||"0",10);return isFinite(t)?t:0},o9=function(){f.useEffect(function(){return document.body.setAttribute(di,(f0()+1).toString()),function(){var t=f0()-1;t<=0?document.body.removeAttribute(di):document.body.setAttribute(di,t.toString())}},[])},i9=function(t){var n=t.noRelative,a=t.noImportant,o=t.gapMode,c=o===void 0?"margin":o;o9();var l=f.useMemo(function(){return r9(c)},[c]);return f.createElement(a9,{styles:s9(l,!n,c,a?"":"!important")})},bh=!1;if(typeof window<"u")try{var Ou=Object.defineProperty({},"passive",{get:function(){return bh=!0,!0}});window.addEventListener("test",Ou,Ou),window.removeEventListener("test",Ou,Ou)}catch{bh=!1}var ti=bh?{passive:!1}:!1,l9=function(t){return t.tagName==="TEXTAREA"},sj=function(t,n){if(!(t instanceof Element))return!1;var a=window.getComputedStyle(t);return a[n]!=="hidden"&&!(a.overflowY===a.overflowX&&!l9(t)&&a[n]==="visible")},c9=function(t){return sj(t,"overflowY")},u9=function(t){return sj(t,"overflowX")},m0=function(t,n){var a=n.ownerDocument,o=n;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=oj(t,o);if(c){var l=ij(t,o),d=l[1],m=l[2];if(d>m)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},d9=function(t){var n=t.scrollTop,a=t.scrollHeight,o=t.clientHeight;return[n,a,o]},f9=function(t){var n=t.scrollLeft,a=t.scrollWidth,o=t.clientWidth;return[n,a,o]},oj=function(t,n){return t==="v"?c9(n):u9(n)},ij=function(t,n){return t==="v"?d9(n):f9(n)},m9=function(t,n){return t==="h"&&n==="rtl"?-1:1},p9=function(t,n,a,o,c){var l=m9(t,window.getComputedStyle(n).direction),d=l*o,m=a.target,p=n.contains(m),g=!1,v=d>0,b=0,w=0;do{if(!m)break;var y=ij(t,m),C=y[0],S=y[1],E=y[2],k=S-E-l*C;(C||k)&&oj(t,m)&&(b+=k,w+=C);var N=m.parentNode;m=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!p&&m!==document.body||p&&(n.contains(m)||n===m));return(v&&Math.abs(b)<1||!v&&Math.abs(w)<1)&&(g=!0),g},Lu=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},p0=function(t){return[t.deltaX,t.deltaY]},h0=function(t){return t&&"current"in t?t.current:t},h9=function(t,n){return t[0]===n[0]&&t[1]===n[1]},g9=function(t){return`
|
||
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
||
`)},x9=0,ni=[];function v9(t){var n=f.useRef([]),a=f.useRef([0,0]),o=f.useRef(),c=f.useState(x9++)[0],l=f.useState(aj)[0],d=f.useRef(t);f.useEffect(function(){d.current=t},[t]),f.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(c));var S=Uk([t.lockRef.current],(t.shards||[]).map(h0),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(c))})}}},[t.inert,t.lockRef.current,t.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 k=Lu(S),N=a.current,T="deltaX"in S?S.deltaX:N[0]-k[0],M="deltaY"in S?S.deltaY:N[1]-k[1],_,R=S.target,L=Math.abs(T)>Math.abs(M)?"h":"v";if("touches"in S&&L==="h"&&R.type==="range")return!1;var te=window.getSelection(),K=te&&te.anchorNode,I=K?K===R||K.contains(R):!1;if(I)return!1;var G=m0(L,R);if(!G)return!0;if(G?_=L:(_=L==="v"?"h":"v",G=m0(L,R)),!G)return!1;if(!o.current&&"changedTouches"in S&&(T||M)&&(o.current=_),!_)return!0;var Y=o.current||_;return p9(Y,E,S,Y==="h"?T:M)},[]),p=f.useCallback(function(S){var E=S;if(!(!ni.length||ni[ni.length-1]!==l)){var k="deltaY"in E?p0(E):Lu(E),N=n.current.filter(function(_){return _.name===E.type&&(_.target===E.target||E.target===_.shadowParent)&&h9(_.delta,k)})[0];if(N&&N.should){E.cancelable&&E.preventDefault();return}if(!N){var T=(d.current.shards||[]).map(h0).filter(Boolean).filter(function(_){return _.contains(E.target)}),M=T.length>0?m(E,T[0]):!d.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),g=f.useCallback(function(S,E,k,N){var T={name:S,delta:E,target:k,should:N,shadowParent:b9(k)};n.current.push(T),setTimeout(function(){n.current=n.current.filter(function(M){return M!==T})},1)},[]),v=f.useCallback(function(S){a.current=Lu(S),o.current=void 0},[]),b=f.useCallback(function(S){g(S.type,p0(S),S.target,m(S,t.lockRef.current))},[]),w=f.useCallback(function(S){g(S.type,Lu(S),S.target,m(S,t.lockRef.current))},[]);f.useEffect(function(){return ni.push(l),t.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:w}),document.addEventListener("wheel",p,ti),document.addEventListener("touchmove",p,ti),document.addEventListener("touchstart",v,ti),function(){ni=ni.filter(function(S){return S!==l}),document.removeEventListener("wheel",p,ti),document.removeEventListener("touchmove",p,ti),document.removeEventListener("touchstart",v,ti)}},[]);var y=t.removeScrollBar,C=t.inert;return f.createElement(f.Fragment,null,C?f.createElement(l,{styles:g9(c)}):null,y?f.createElement(i9,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function b9(t){for(var n=null;t!==null;)t instanceof ShadowRoot&&(n=t.host,t=t.host),t=t.parentNode;return n}const y9=Kk(rj,v9);var ac=f.forwardRef(function(t,n){return f.createElement(Hd,Pr({},t,{ref:n,sideCar:y9}))});ac.classNames=Hd.classNames;var w9=Object.defineProperty,st=(t,n)=>w9(t,"name",{value:n,configurable:!0}),yh=["Enter"," "],j9=["ArrowDown","PageUp","Home"],lj=["ArrowUp","PageDown","End"],C9=[...j9,...lj],S9={ltr:[...yh,"ArrowRight"],rtl:[...yh,"ArrowLeft"]},N9={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gd="Menu",[Hl,E9,k9]=Td(Gd),[io,cj]=yn(Gd,[k9,Cs,Bd]),Rg=Cs(),uj=Bd(),[T9,lo]=io(Gd),[M9,sc]=io(Gd),R9=st(t=>{const{__scopeMenu:n,open:a=!1,children:o,dir:c,onOpenChange:l,modal:d=!0}=t,m=Rg(n),[p,g]=f.useState(null),v=f.useRef(!1),b=Vt(l),w=ki(c);return f.useEffect(()=>{const y=st(()=>{v.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},"handleKeyDown"),C=st(()=>v.current=!1,"handlePointer");return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),f.useEffect(()=>{if(!a)return;const y=st(()=>b(!1),"handleBlur");return window.addEventListener("blur",y),()=>window.removeEventListener("blur",y)},[a,b]),s.jsx(zd,{...m,children:s.jsx(T9,{scope:n,open:a,onOpenChange:b,content:p,onContentChange:g,children:s.jsx(M9,{scope:n,onClose:f.useCallback(()=>b(!1),[b]),isUsingKeyboardRef:v,dir:w,modal:d,children:o})})})},"Menu"),dj=f.forwardRef(st(function(n,a){const{__scopeMenu:o,...c}=n,l=Rg(o);return s.jsx(Pd,{...l,...c,ref:a})},"MenuAnchor")),fj="MenuPortal",[A9,mj]=io(fj,{forceMount:void 0}),_9=st(t=>{const{__scopeMenu:n,forceMount:a,children:o,container:c}=t,l=lo(fj,n);return s.jsx(A9,{scope:n,forceMount:a,children:s.jsx(dn,{present:a||l.open,children:s.jsx(rc,{asChild:!0,container:c,children:o})})})},"MenuPortal"),Sr="MenuContent",[D9,Ag]=io(Sr),O9=f.forwardRef(st(function(n,a){const o=mj(Sr,n.__scopeMenu),{forceMount:c=o.forceMount,...l}=n,d=lo(Sr,n.__scopeMenu),m=sc(Sr,n.__scopeMenu);return s.jsx(Hl.Provider,{scope:n.__scopeMenu,children:s.jsx(dn,{present:c||d.open,children:s.jsx(Hl.Slot,{scope:n.__scopeMenu,children:m.modal?s.jsx(L9,{...l,ref:a}):s.jsx(z9,{...l,ref:a})})})})},"MenuContent")),L9=f.forwardRef(st(function(n,a){const o=lo(Sr,n.__scopeMenu),c=f.useRef(null),l=Ie(a,c);return f.useEffect(()=>{const d=c.current;if(d)return $d(d)},[]),s.jsx(_g,{...n,ref:l,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:je(n.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),z9=f.forwardRef(st(function(n,a){const o=lo(Sr,n.__scopeMenu);return s.jsx(_g,{...n,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),P9=Nr("MenuContent.ScrollLock"),_g=f.forwardRef(st(function(n,a){const{__scopeMenu:o,loop:c=!1,trapFocus:l,onOpenAutoFocus:d,onCloseAutoFocus:m,disableOutsidePointerEvents:p,onEntryFocus:g,onEscapeKeyDown:v,onPointerDownOutside:b,onFocusOutside:w,onInteractOutside:y,onDismiss:C,disableOutsideScroll:S,...E}=n,k=lo(Sr,o),N=sc(Sr,o),T=Rg(o),M=uj(o),_=E9(o),[R,L]=f.useState(null),te=f.useRef(null),K=Ie(a,te,k.onContentChange),I=f.useRef(0),G=f.useRef(""),Y=f.useRef(0),ce=f.useRef(null),fe=f.useRef("right"),se=f.useRef(0),P=S?ac:f.Fragment,Z=S?{as:P9,allowPinchZoom:!0}:void 0,ae=st(V=>{var ge,me;const O=G.current+V,D=_().filter(B=>!B.disabled),$=document.activeElement,H=(ge=D.find(B=>B.ref.current===$))==null?void 0:ge.textValue,X=D.map(B=>B.textValue),xe=yj(X,O,H),q=(me=D.find(B=>B.textValue===xe))==null?void 0:me.ref.current;st((function B(ie){G.current=ie,window.clearTimeout(I.current),ie!==""&&(I.current=window.setTimeout(()=>B(""),1e3))}),"updateSearch")(O),q&&setTimeout(()=>q.focus())},"handleTypeaheadSearch");f.useEffect(()=>()=>window.clearTimeout(I.current),[]),Ti();const re=f.useCallback(V=>{var D,$;return fe.current===((D=ce.current)==null?void 0:D.side)&&jj(V,($=ce.current)==null?void 0:$.area)},[]);return s.jsx(D9,{scope:o,searchRef:G,onItemEnter:f.useCallback(V=>{re(V)&&V.preventDefault()},[re]),onItemLeave:f.useCallback(V=>{var O;re(V)||((O=te.current)==null||O.focus(),L(null))},[re]),onTriggerLeave:f.useCallback(V=>{re(V)&&V.preventDefault()},[re]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:f.useCallback(V=>{ce.current=V},[]),children:s.jsx(P,{...Z,children:s.jsx(Md,{asChild:!0,trapped:l,onMountAutoFocus:je(d,V=>{var O;V.preventDefault(),(O=te.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:m,children:s.jsx(nc,{asChild:!0,disableOutsidePointerEvents:p,onEscapeKeyDown:v,onPointerDownOutside:b,onFocusOutside:w,onInteractOutside:y,onDismiss:C,children:s.jsx(Qw,{asChild:!0,...M,dir:N.dir,orientation:"vertical",loop:c,currentTabStopId:R,onCurrentTabStopIdChange:L,onEntryFocus:je(g,V=>{N.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Id,{role:"menu","aria-orientation":"vertical","data-state":Og(k.open),"data-radix-menu-content":"",dir:N.dir,...T,...E,ref:K,style:{outline:"none",...E.style},onKeyDown:je(E.onKeyDown,V=>{const D=V.target.closest("[data-radix-menu-content]")===V.currentTarget,$=V.ctrlKey||V.altKey||V.metaKey,H=V.key.length===1;D&&(V.key==="Tab"&&V.preventDefault(),!$&&H&&ae(V.key));const X=te.current;if(V.target!==X||!C9.includes(V.key))return;V.preventDefault();const q=_().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);lj.includes(V.key)&&q.reverse(),vj(q)}),onBlur:je(n.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(I.current),G.current="")}),onPointerMove:je(n.onPointerMove,pi(V=>{const O=V.target,D=se.current!==V.clientX;if(V.currentTarget.contains(O)&&D){const $=V.clientX>se.current?"right":"left";fe.current=$,se.current=V.clientX}}))})})})})})})},"MenuContentImpl")),I9=f.forwardRef(st(function(n,a){const{__scopeMenu:o,...c}=n;return s.jsx(Me.div,{...c,ref:a})},"MenuLabel")),wh="MenuItem",g0="menu.itemSelect",Dg=f.forwardRef(st(function(n,a){const{disabled:o=!1,onSelect:c,...l}=n,d=f.useRef(null),m=sc(wh,n.__scopeMenu),p=Ag(wh,n.__scopeMenu),g=Ie(a,d),v=f.useRef(!1),b=st(()=>{const w=d.current;if(!o&&w){const y=new CustomEvent(g0,{bubbles:!0,cancelable:!0});w.addEventListener(g0,C=>c==null?void 0:c(C),{once:!0}),gg(w,y),y.defaultPrevented?v.current=!1:m.onClose()}},"handleSelect");return s.jsx(pj,{...l,ref:g,disabled:o,onClick:je(n.onClick,b),onPointerDown:w=>{var y;(y=n.onPointerDown)==null||y.call(n,w),v.current=!0},onPointerUp:je(n.onPointerUp,w=>{var y;v.current||(y=w.currentTarget)==null||y.click()}),onKeyDown:je(n.onKeyDown,w=>{o||w.target!==w.currentTarget||p.searchRef.current!==""&&w.key===" "||yh.includes(w.key)&&(w.currentTarget.click(),w.preventDefault())})})},"MenuItem")),pj=f.forwardRef(st(function(n,a){const{__scopeMenu:o,disabled:c=!1,textValue:l,...d}=n,m=Ag(wh,o),p=uj(o),g=f.useRef(null),v=Ie(a,g),[b,w]=f.useState(!1),[y,C]=f.useState("");return f.useEffect(()=>{const S=g.current;S&&C((S.textContent??"").trim())},[d.children]),s.jsx(Hl.ItemSlot,{scope:o,disabled:c,textValue:l??y,children:s.jsx(Jw,{asChild:!0,...p,focusable:!c,children:s.jsx(Me.div,{role:"menuitem","data-highlighted":b?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...d,ref:v,onPointerMove:je(n.onPointerMove,pi(S=>{c?m.onItemLeave(S):(m.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(n.onPointerLeave,pi(S=>m.onItemLeave(S))),onFocus:je(n.onFocus,()=>w(!0)),onBlur:je(n.onBlur,()=>w(!1))})})})},"MenuItemImpl")),U9=f.forwardRef(st(function(n,a){const{checked:o=!1,onCheckedChange:c,...l}=n;return s.jsx(gj,{scope:n.__scopeMenu,checked:o,children:s.jsx(Dg,{role:"menuitemcheckbox","aria-checked":Gl(o)?"mixed":o,...l,ref:a,"data-state":Vd(o),onSelect:je(l.onSelect,()=>c==null?void 0:c(Gl(o)?!0:!o),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),B9="MenuRadioGroup",[PP,$9]=io(B9,{value:void 0,onValueChange:st(()=>{},"onValueChange")}),H9="MenuRadioItem",G9=f.forwardRef(st(function(n,a){const{value:o,...c}=n,l=$9(H9,n.__scopeMenu),d=o===l.value;return s.jsx(gj,{scope:n.__scopeMenu,checked:d,children:s.jsx(Dg,{role:"menuitemradio","aria-checked":d,...c,ref:a,"data-state":Vd(d),onSelect:je(c.onSelect,()=>{var m;return(m=l.onValueChange)==null?void 0:m.call(l,o)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),hj="MenuItemIndicator",[gj,V9]=io(hj,{checked:!1}),F9=f.forwardRef(st(function(n,a){const{__scopeMenu:o,forceMount:c,...l}=n,d=V9(hj,o);return s.jsx(dn,{present:c||Gl(d.checked)||d.checked===!0,children:s.jsx(Me.span,{...l,ref:a,"data-state":Vd(d.checked)})})},"MenuItemIndicator")),Y9=f.forwardRef(st(function(n,a){const{__scopeMenu:o,...c}=n;return s.jsx(Me.div,{role:"separator","aria-orientation":"horizontal",...c,ref:a})},"MenuSeparator")),q9="MenuSub",[IP,xj]=io(q9),zu="MenuSubTrigger",K9=f.forwardRef(st(function(n,a){const o=lo(zu,n.__scopeMenu),c=sc(zu,n.__scopeMenu),l=xj(zu,n.__scopeMenu),d=Ag(zu,n.__scopeMenu),m=f.useRef(null),{pointerGraceTimerRef:p,onPointerGraceIntentChange:g}=d,v={__scopeMenu:n.__scopeMenu},b=f.useCallback(()=>{m.current&&window.clearTimeout(m.current),m.current=null},[]);f.useEffect(()=>b,[b]),f.useEffect(()=>{const y=p.current;return()=>{window.clearTimeout(y),g(null)}},[p,g]);const w=Ie(a,l.onTriggerChange);return s.jsx(dj,{asChild:!0,...v,children:s.jsx(pj,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?l.contentId:void 0,"data-state":Og(o.open),...n,ref:w,onClick:y=>{var C;(C=n.onClick)==null||C.call(n,y),!(n.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:je(n.onPointerMove,pi(y=>{d.onItemEnter(y),!y.defaultPrevented&&!n.disabled&&!o.open&&!m.current&&(d.onPointerGraceIntentChange(null),m.current=window.setTimeout(()=>{o.onOpenChange(!0),b()},100))})),onPointerLeave:je(n.onPointerLeave,pi(y=>{var S,E;b();const C=(S=o.content)==null?void 0:S.getBoundingClientRect();if(C){const k=(E=o.content)==null?void 0:E.dataset.side,N=k==="right",T=N?-5:5,M=C[N?"left":"right"],_=C[N?"right":"left"];d.onPointerGraceIntentChange({area:[{x:y.clientX+T,y:y.clientY},{x:M,y:C.top},{x:_,y:C.top},{x:_,y:C.bottom},{x:M,y:C.bottom}],side:k}),window.clearTimeout(p.current),p.current=window.setTimeout(()=>d.onPointerGraceIntentChange(null),300)}else{if(d.onTriggerLeave(y),y.defaultPrevented)return;d.onPointerGraceIntentChange(null)}})),onKeyDown:je(n.onKeyDown,y=>{var S;n.disabled||y.target!==y.currentTarget||d.searchRef.current!==""&&y.key===" "||S9[c.dir].includes(y.key)&&(o.onOpenChange(!0),(S=o.content)==null||S.focus(),y.preventDefault())})})})},"MenuSubTrigger")),W9="MenuSubContent",X9=f.forwardRef(st(function(n,a){const o=mj(Sr,n.__scopeMenu),{forceMount:c=o.forceMount,align:l="start",...d}=n,m=lo(Sr,n.__scopeMenu),p=sc(Sr,n.__scopeMenu),g=xj(W9,n.__scopeMenu),v=f.useRef(null),b=Ie(a,v);return s.jsx(Hl.Provider,{scope:n.__scopeMenu,children:s.jsx(dn,{present:c||m.open,children:s.jsx(Hl.Slot,{scope:n.__scopeMenu,children:s.jsx(_g,{id:g.contentId,"aria-labelledby":g.triggerId,...d,ref:b,align:l,side:p.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:w=>{var y;p.isUsingKeyboardRef.current&&((y=v.current)==null||y.focus()),w.preventDefault()},onCloseAutoFocus:w=>w.preventDefault(),onFocusOutside:je(n.onFocusOutside,w=>{w.target!==g.trigger&&m.onOpenChange(!1)}),onEscapeKeyDown:je(n.onEscapeKeyDown,w=>{p.onClose(),w.preventDefault()}),onKeyDown:je(n.onKeyDown,w=>{var S;const y=w.currentTarget.contains(w.target),C=N9[p.dir].includes(w.key);y&&C&&(m.onOpenChange(!1),(S=g.trigger)==null||S.focus(),w.preventDefault())})})})})})},"MenuSubContent"));function Og(t){return t?"open":"closed"}st(Og,"getOpenState");function Gl(t){return t==="indeterminate"}st(Gl,"isIndeterminate");function Vd(t){return Gl(t)?"indeterminate":t?"checked":"unchecked"}st(Vd,"getCheckedState");function vj(t){const n=document.activeElement;for(const a of t)if(a===n||(a.focus(),document.activeElement!==n))return}st(vj,"focusFirst");function bj(t,n){return t.map((a,o)=>t[(n+o)%t.length])}st(bj,"wrapArray");function yj(t,n,a){const c=n.length>1&&Array.from(n).every(g=>g===n[0])?n[0]:n,l=a?t.indexOf(a):-1;let d=bj(t,Math.max(l,0));c.length===1&&(d=d.filter(g=>g!==a));const p=d.find(g=>g.toLowerCase().startsWith(c.toLowerCase()));return p!==a?p:void 0}st(yj,"getNextMatch");function wj(t,n){const{x:a,y:o}=t;let c=!1;for(let l=0,d=n.length-1;l<n.length;d=l++){const m=n[l],p=n[d],g=m.x,v=m.y,b=p.x,w=p.y;v>o!=w>o&&a<(b-g)*(o-v)/(w-v)+g&&(c=!c)}return c}st(wj,"isPointInPolygon");function jj(t,n){if(!n)return!1;const a={x:t.clientX,y:t.clientY};return wj(a,n)}st(jj,"isPointerInGraceArea");function pi(t){return n=>n.pointerType==="mouse"?t(n):void 0}st(pi,"whenMouse");var Z9=R9,Q9=dj,J9=_9,eT=O9,tT=I9,nT=Dg,rT=U9,aT=G9,sT=F9,oT=Y9,iT=K9,lT=X9,cT=Object.defineProperty,mr=(t,n)=>cT(t,"name",{value:n,configurable:!0}),Lg="DropdownMenu",[uT,UP]=yn(Lg,[cj]),pr=cj(),[dT,Cj]=uT(Lg),fT=mr(t=>{const{__scopeDropdownMenu:n,children:a,dir:o,open:c,defaultOpen:l,onOpenChange:d,modal:m=!0}=t,p=pr(n),g=f.useRef(null),[v,b]=Hr({prop:c,defaultProp:l??!1,onChange:d,caller:Lg});return s.jsx(dT,{scope:n,triggerId:tn(),triggerRef:g,contentId:tn(),open:v,onOpenChange:b,onOpenToggle:f.useCallback(()=>b(w=>!w),[b]),modal:m,children:s.jsx(Z9,{...p,open:v,onOpenChange:b,dir:o,modal:m,children:a})})},"DropdownMenu"),mT="DropdownMenuTrigger",pT=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,disabled:c=!1,...l}=n,d=Cj(mT,o),m=pr(o),p=Ie(a,d.triggerRef);return s.jsx(Q9,{asChild:!0,...m,children:s.jsx(Me.button,{type:"button",id:d.triggerId,"aria-haspopup":"menu","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":d.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...l,ref:p,onPointerDown:je(n.onPointerDown,g=>{!c&&g.button===0&&g.ctrlKey===!1&&(d.onOpenToggle(),d.open||g.preventDefault())}),onKeyDown:je(n.onKeyDown,g=>{c||(["Enter"," "].includes(g.key)&&d.onOpenToggle(),g.key==="ArrowDown"&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})},"DropdownMenuTrigger")),hT=mr(t=>{const{__scopeDropdownMenu:n,...a}=t,o=pr(n);return s.jsx(J9,{...o,...a})},"DropdownMenuPortal"),gT="DropdownMenuContent",xT=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=Cj(gT,o),d=pr(o),m=f.useRef(!1);return s.jsx(eT,{id:l.contentId,"aria-labelledby":l.triggerId,...d,...c,ref:a,onCloseAutoFocus:je(n.onCloseAutoFocus,p=>{var g;m.current||(g=l.triggerRef.current)==null||g.focus(),m.current=!1,p.preventDefault()}),onInteractOutside:je(n.onInteractOutside,p=>{const g=p.detail.originalEvent,v=g.button===0&&g.ctrlKey===!0,b=g.button===2||v;(!l.modal||b)&&(m.current=!0)}),style:{...n.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)"}})},"DropdownMenuContent")),vT=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=pr(o);return s.jsx(tT,{...l,...c,ref:a})},"DropdownMenuLabel")),bT=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=pr(o);return s.jsx(nT,{...l,...c,ref:a})},"DropdownMenuItem")),yT=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=pr(o);return s.jsx(rT,{...l,...c,ref:a})},"DropdownMenuCheckboxItem")),wT=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=pr(o);return s.jsx(aT,{...l,...c,ref:a})},"DropdownMenuRadioItem")),jT=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=pr(o);return s.jsx(sT,{...l,...c,ref:a})},"DropdownMenuItemIndicator")),CT=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=pr(o);return s.jsx(oT,{...l,...c,ref:a})},"DropdownMenuSeparator")),ST=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=pr(o);return s.jsx(iT,{...l,...c,ref:a})},"DropdownMenuSubTrigger")),NT=f.forwardRef(mr(function(n,a){const{__scopeDropdownMenu:o,...c}=n,l=pr(o);return s.jsx(lT,{...l,...c,ref:a,style:{...n.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)"}})},"DropdownMenuSubContent")),ET=fT,kT=pT,TT=hT,Sj=xT,Nj=vT,Ej=bT,kj=yT,Tj=wT,Mj=jT,Rj=CT,Aj=ST,_j=NT;/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const MT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dj=(...t)=>t.filter((n,a,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===a).join(" ").trim();/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var RT={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 v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const AT=f.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:c="",children:l,iconNode:d,...m},p)=>f.createElement("svg",{ref:p,...RT,width:n,height:n,stroke:t,strokeWidth:o?Number(a)*24/Number(n):a,className:Dj("lucide",c),...m},[...d.map(([g,v])=>f.createElement(g,v)),...Array.isArray(l)?l:[l]]));/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ra=(t,n)=>{const a=f.forwardRef(({className:o,...c},l)=>f.createElement(AT,{ref:l,iconNode:n,className:Dj(`lucide-${MT(t)}`,o),...c}));return a.displayName=`${t}`,a};/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _T=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Oj=Ra("Check",_T);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const DT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Lj=Ra("ChevronDown",DT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const OT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],LT=Ra("ChevronRight",OT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],PT=Ra("ChevronUp",zT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const IT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],x0=Ra("CircleCheck",IT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const UT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],BT=Ra("Circle",UT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],HT=Ra("PanelLeft",$T);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const GT=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],VT=Ra("Search",GT);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const FT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zj=Ra("X",FT),zg=ET,Pg=kT,YT=f.forwardRef(({className:t,inset:n,children:a,...o},c)=>s.jsxs(Aj,{ref:c,className:pe("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",t),...o,children:[a,s.jsx(LT,{className:"ml-auto"})]}));YT.displayName=Aj.displayName;const qT=f.forwardRef(({className:t,...n},a)=>s.jsx(_j,{ref:a,className:pe("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]",t),...n}));qT.displayName=_j.displayName;const Fd=f.forwardRef(({className:t,sideOffset:n=4,...a},o)=>s.jsx(TT,{children:s.jsx(Sj,{ref:o,sideOffset:n,className:pe("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]",t),...a})}));Fd.displayName=Sj.displayName;const Vl=f.forwardRef(({className:t,inset:n,...a},o)=>s.jsx(Ej,{ref:o,className:pe("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",t),...a}));Vl.displayName=Ej.displayName;const KT=f.forwardRef(({className:t,children:n,checked:a,...o},c)=>s.jsxs(kj,{ref:c,className:pe("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",t),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(Mj,{children:s.jsx(Oj,{className:"h-4 w-4"})})}),n]}));KT.displayName=kj.displayName;const WT=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(Tj,{ref:o,className:pe("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",t),...a,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Mj,{children:s.jsx(BT,{className:"h-2 w-2 fill-current"})})}),n]}));WT.displayName=Tj.displayName;const Ig=f.forwardRef(({className:t,inset:n,...a},o)=>s.jsx(Nj,{ref:o,className:pe("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",t),...a}));Ig.displayName=Nj.displayName;const Fl=f.forwardRef(({className:t,...n},a)=>s.jsx(Rj,{ref:a,className:pe("-mx-1 my-1 h-px bg-muted",t),...n}));Fl.displayName=Rj.displayName;const zp=768;function XT(){const[t,n]=f.useState(void 0);return f.useEffect(()=>{const a=window.matchMedia(`(max-width: ${zp-1}px)`),o=()=>{n(window.innerWidth<zp)};return a.addEventListener("change",o),n(window.innerWidth<zp),()=>a.removeEventListener("change",o)},[]),!!t}const De=f.forwardRef(({className:t,type:n,...a},o)=>s.jsx("input",{type:n,className:pe("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",t),ref:o,...a}));De.displayName="Input";var ZT=Object.defineProperty,Pj=(t,n)=>ZT(t,"name",{value:n,configurable:!0}),v0="horizontal",QT=["horizontal","vertical"],JT=f.forwardRef(Pj(function(n,a){const{decorative:o,orientation:c=v0,...l}=n,d=Ij(c)?c:v0,p=o?{role:"none"}:{"aria-orientation":d==="vertical"?d:void 0,role:"separator"};return s.jsx(Me.div,{"data-orientation":d,...p,...l,ref:a})},"Separator"));function Ij(t){return QT.includes(t)}Pj(Ij,"isValidOrientation");var Uj=JT;const Bj=f.forwardRef(({className:t,orientation:n="horizontal",decorative:a=!0,...o},c)=>s.jsx(Uj,{ref:c,decorative:a,orientation:n,className:pe("shrink-0 bg-border",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...o}));Bj.displayName=Uj.displayName;var e7=Object.defineProperty,Wn=(t,n)=>e7(t,"name",{value:n,configurable:!0}),Ug="Dialog",[$j,BP]=yn(Ug),[t7,Tr]=$j(Ug),Bg=Wn(t=>{const{__scopeDialog:n,children:a,open:o,defaultOpen:c,onOpenChange:l,modal:d=!0}=t,m=f.useRef(null),p=f.useRef(null),[g,v]=Hr({prop:o,defaultProp:c??!1,onChange:l,caller:Ug}),[b,w]=f.useState(0),[y,C]=f.useState(0);return s.jsx(t7,{scope:n,triggerRef:m,contentRef:p,contentId:tn(),titleId:tn(),descriptionId:tn(),titlePresent:b>0,descriptionPresent:y>0,setTitleCount:w,setDescriptionCount:C,open:g,onOpenChange:v,onOpenToggle:f.useCallback(()=>v(S=>!S),[v]),modal:d,children:a})},"Dialog"),n7="DialogTrigger",r7=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Tr(n7,o),d=Ie(a,l.triggerRef);return s.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":Kd(l.open),...c,ref:d,onClick:je(n.onClick,l.onOpenToggle)})},"DialogTrigger")),Hj="DialogPortal",[a7,Gj]=$j(Hj,{forceMount:void 0}),$g=Wn(t=>{const{__scopeDialog:n,forceMount:a,children:o,container:c}=t,l=Tr(Hj,n);return s.jsx(a7,{scope:n,forceMount:a,children:f.Children.map(o,d=>s.jsx(dn,{present:a||l.open,children:s.jsx(rc,{asChild:!0,container:c,children:d})}))})},"DialogPortal"),jh="DialogOverlay",oc=f.forwardRef(Wn(function(n,a){const o=Gj(jh,n.__scopeDialog),{forceMount:c=o.forceMount,...l}=n,d=Tr(jh,n.__scopeDialog);return d.modal?s.jsx(dn,{present:c||d.open,children:s.jsx(o7,{...l,ref:a})}):null},"DialogOverlay")),s7=Nr("DialogOverlay.RemoveScroll"),o7=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Tr(jh,o),d=hw(),m=Ie(a,d);return s.jsx(ac,{as:s7,allowPinchZoom:!0,shards:[l.contentRef],children:s.jsx(Me.div,{"data-state":Kd(l.open),...c,ref:m,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),Yl="DialogContent",ic=f.forwardRef(Wn(function(n,a){const o=Gj(Yl,n.__scopeDialog),{forceMount:c=o.forceMount,...l}=n,d=Tr(Yl,n.__scopeDialog);return s.jsx(dn,{present:c||d.open,children:d.modal?s.jsx(i7,{...l,ref:a}):s.jsx(l7,{...l,ref:a})})},"DialogContent")),i7=f.forwardRef(Wn(function(n,a){const o=Tr(Yl,n.__scopeDialog),c=f.useRef(null),l=Ie(a,o.contentRef,c);return f.useEffect(()=>{const d=c.current;if(d)return $d(d)},[]),s.jsx(Vj,{...n,ref:l,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:je(n.onCloseAutoFocus,d=>{var m;d.preventDefault(),(m=o.triggerRef.current)==null||m.focus()}),onPointerDownOutside:je(n.onPointerDownOutside,d=>{const m=d.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0;(m.button===2||p)&&d.preventDefault()}),onFocusOutside:je(n.onFocusOutside,d=>d.preventDefault())})},"DialogContentModal")),l7=f.forwardRef(Wn(function(n,a){const o=Tr(Yl,n.__scopeDialog),c=f.useRef(!1),l=f.useRef(!1);return s.jsx(Vj,{...n,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,p;(m=n.onCloseAutoFocus)==null||m.call(n,d),d.defaultPrevented||(c.current||(p=o.triggerRef.current)==null||p.focus(),d.preventDefault()),c.current=!1,l.current=!1},onInteractOutside:d=>{var g,v;(g=n.onInteractOutside)==null||g.call(n,d),d.defaultPrevented||(c.current=!0,d.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const m=d.target;((v=o.triggerRef.current)==null?void 0:v.contains(m))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.current&&d.preventDefault()}})},"DialogContentNonModal")),Vj=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:d,...m}=n,p=Tr(Yl,o);return Ti(),s.jsx(s.Fragment,{children:s.jsx(Md,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:l,onUnmountAutoFocus:d,children:s.jsx(nc,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionPresent?p.descriptionId:void 0,"aria-labelledby":p.titlePresent?p.titleId:void 0,"data-state":Kd(p.open),...m,ref:a,deferPointerDownOutside:!0,onDismiss:()=>p.onOpenChange(!1)})})})},"DialogContentImpl")),c7="DialogTitle",Yd=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Tr(c7,o),{setTitleCount:d}=l;return Ct(()=>(d(m=>m+1),()=>d(m=>m-1)),[d]),s.jsx(Me.h2,{id:l.titleId,...c,ref:a})},"DialogTitle")),u7="DialogDescription",qd=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Tr(u7,o),{setDescriptionCount:d}=l;return Ct(()=>(d(m=>m+1),()=>d(m=>m-1)),[d]),s.jsx(Me.p,{id:l.descriptionId,...c,ref:a})},"DialogDescription")),d7="DialogClose",Fj=f.forwardRef(Wn(function(n,a){const{__scopeDialog:o,...c}=n,l=Tr(d7,o);return s.jsx(Me.button,{type:"button",...c,ref:a,onClick:je(n.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function Kd(t){return t?"open":"closed"}Wn(Kd,"getState");const Yj=Bg,f7=$g,qj=f.forwardRef(({className:t,...n},a)=>s.jsx(oc,{className:pe("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",t),...n,ref:a}));qj.displayName=oc.displayName;const m7=Ni("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"}}),Hg=f.forwardRef(({side:t="right",className:n,children:a,...o},c)=>s.jsxs(f7,{children:[s.jsx(qj,{}),s.jsxs(ic,{ref:c,className:pe(m7({side:t}),n),...o,children:[s.jsxs(Fj,{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(zj,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));Hg.displayName=ic.displayName;const Gg=({className:t,...n})=>s.jsx("div",{className:pe("flex flex-col space-y-2 text-center sm:text-left",t),...n});Gg.displayName="SheetHeader";const Vg=f.forwardRef(({className:t,...n},a)=>s.jsx(Yd,{ref:a,className:pe("text-lg font-semibold text-foreground",t),...n}));Vg.displayName=Yd.displayName;const Fg=f.forwardRef(({className:t,...n},a)=>s.jsx(qd,{ref:a,className:pe("text-sm text-muted-foreground",t),...n}));Fg.displayName=qd.displayName;function Be({className:t,...n}){return s.jsx("div",{className:pe("animate-pulse rounded-md bg-primary/10",t),...n})}var p7=Object.defineProperty,h7=(t,n)=>p7(t,"name",{value:n,configurable:!0}),Kj=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"}),g7=f.forwardRef(h7(function(n,a){return s.jsx(Me.span,{...n,ref:a,style:{...Kj,...n.style}})},"VisuallyHidden")),x7=g7,v7=Object.defineProperty,en=(t,n)=>v7(t,"name",{value:n,configurable:!0}),[Yg,$P]=yn("Tooltip",[Cs]),qg=Cs(),b7="TooltipProvider",y7=700,Ch="tooltip.open",[w7,Kg]=Yg(b7),j7=en(t=>{const{__scopeTooltip:n,delayDuration:a=y7,skipDelayDuration:o=300,disableHoverableContent:c=!1,children:l}=t,d=f.useRef(!0),m=f.useRef(!1),p=f.useRef(0);return f.useEffect(()=>{const g=p.current;return()=>window.clearTimeout(g)},[]),s.jsx(w7,{scope:n,isOpenDelayedRef:d,delayDuration:a,onOpen:f.useCallback(()=>{o<=0||(window.clearTimeout(p.current),d.current=!1)},[o]),onClose:f.useCallback(()=>{o<=0||(window.clearTimeout(p.current),p.current=window.setTimeout(()=>d.current=!0,o))},[o]),isPointerInTransitRef:m,onPointerInTransitChange:f.useCallback(g=>{m.current=g},[]),disableHoverableContent:c,children:l})},"TooltipProvider"),Sh="Tooltip",[C7,lc]=Yg(Sh),S7=en(t=>{const{__scopeTooltip:n,children:a,open:o,defaultOpen:c,onOpenChange:l,disableHoverableContent:d,delayDuration:m}=t,p=Kg(Sh,t.__scopeTooltip),g=qg(n),[v,b]=f.useState(null),[w,y]=f.useState(void 0),C=tn(),S=f.useRef(0),E=d??p.disableHoverableContent,k=m??p.delayDuration,N=f.useRef(!1),[T,M]=Hr({prop:o,defaultProp:c??!1,onChange:en(I=>{I?(p.onOpen(),document.dispatchEvent(new CustomEvent(Ch))):p.onClose(),l==null||l(I)},"onChange"),caller:Sh}),_=f.useMemo(()=>T?N.current?"delayed-open":"instant-open":"closed",[T]),R=f.useCallback(()=>{window.clearTimeout(S.current),S.current=0,N.current=!1,M(!0)},[M]),L=f.useCallback(()=>{window.clearTimeout(S.current),S.current=0,M(!1)},[M]),te=f.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{N.current=!0,M(!0),S.current=0},k)},[k,M]);f.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const K=w??C;return s.jsx(zd,{...g,children:s.jsx(C7,{scope:n,contentId:K,setContentId:y,open:T,stateAttribute:_,trigger:v,onTriggerChange:b,onTriggerEnter:f.useCallback(()=>{p.isOpenDelayedRef.current?te():R()},[p.isOpenDelayedRef,te,R]),onTriggerLeave:f.useCallback(()=>{E?L():(window.clearTimeout(S.current),S.current=0)},[L,E]),onOpen:R,onClose:L,disableHoverableContent:E,children:a})})},"Tooltip"),b0="TooltipTrigger",N7=f.forwardRef(en(function(n,a){const{__scopeTooltip:o,...c}=n,l=lc(b0,o),d=Kg(b0,o),m=qg(o),p=f.useRef(null),g=Ie(a,p,l.onTriggerChange),v=f.useRef(!1),b=f.useRef(!1),w=f.useCallback(()=>v.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",w),[w]),s.jsx(Pd,{asChild:!0,...m,children:s.jsx(Me.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...c,ref:g,onPointerMove:je(n.onPointerMove,y=>{y.pointerType!=="touch"&&!b.current&&!d.isPointerInTransitRef.current&&(l.onTriggerEnter(),b.current=!0)}),onPointerLeave:je(n.onPointerLeave,()=>{l.onTriggerLeave(),b.current=!1}),onPointerDown:je(n.onPointerDown,()=>{l.open&&l.onClose(),v.current=!0,document.addEventListener("pointerup",w,{once:!0})}),onFocus:je(n.onFocus,()=>{v.current||l.onOpen()}),onBlur:je(n.onBlur,l.onClose),onClick:je(n.onClick,l.onClose)})})},"TooltipTrigger")),Wj="TooltipPortal",[E7,k7]=Yg(Wj,{forceMount:void 0}),T7=en(t=>{const{__scopeTooltip:n,forceMount:a,children:o,container:c}=t,l=lc(Wj,n);return s.jsx(E7,{scope:n,forceMount:a,children:s.jsx(dn,{present:a||l.open,children:s.jsx(rc,{asChild:!0,container:c,children:o})})})},"TooltipPortal"),ql="TooltipContent",M7=f.forwardRef(en(function(n,a){const o=k7(ql,n.__scopeTooltip),{forceMount:c=o.forceMount,side:l="top",...d}=n,m=lc(ql,n.__scopeTooltip);return s.jsx(dn,{present:c||m.open,children:m.disableHoverableContent?s.jsx(Xj,{side:l,...d,ref:a}):s.jsx(R7,{side:l,...d,ref:a})})},"TooltipContent")),R7=f.forwardRef(en(function(n,a){const o=lc(ql,n.__scopeTooltip),c=Kg(ql,n.__scopeTooltip),l=f.useRef(null),d=Ie(a,l),[m,p]=f.useState(null),{trigger:g,onClose:v}=o,b=l.current,{onPointerInTransitChange:w}=c,y=f.useCallback(()=>{p(null),w(!1)},[w]),C=f.useCallback((S,E)=>{const k=S.currentTarget,N={x:S.clientX,y:S.clientY},T=Zj(N,k.getBoundingClientRect()),M=Qj(N,T),_=Jj(E.getBoundingClientRect()),R=tC([...M,..._]);p(R),w(!0)},[w]);return f.useEffect(()=>()=>y(),[y]),f.useEffect(()=>{if(g&&b){const S=en(k=>C(k,b),"handleTriggerLeave"),E=en(k=>C(k,g),"handleContentLeave");return g.addEventListener("pointerleave",S),b.addEventListener("pointerleave",E),()=>{g.removeEventListener("pointerleave",S),b.removeEventListener("pointerleave",E)}}},[g,b,C,y]),f.useEffect(()=>{if(m){const S=en(E=>{const k=E.target,N={x:E.clientX,y:E.clientY},T=(g==null?void 0:g.contains(k))||(b==null?void 0:b.contains(k)),M=!eC(N,m);T?y():M&&(y(),v())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[g,b,m,v,y]),s.jsx(Xj,{...n,ref:d})},"TooltipContentHoverable")),A7=Q2("TooltipContent"),Xj=f.forwardRef(en(function(n,a){const{__scopeTooltip:o,children:c,"aria-label":l,id:d,onEscapeKeyDown:m,onPointerDownOutside:p,...g}=n,v=lc(ql,o),b=qg(o),{onClose:w}=v;f.useEffect(()=>(document.addEventListener(Ch,w),()=>document.removeEventListener(Ch,w)),[w]),f.useEffect(()=>{if(v.trigger){const C=en(S=>{S.target instanceof Node&&S.target.contains(v.trigger)&&w()},"handleScroll");return window.addEventListener("scroll",C,{capture:!0}),()=>window.removeEventListener("scroll",C,{capture:!0})}},[v.trigger,w]);const{setContentId:y}=v;return Ct(()=>(y(d),()=>{y(void 0)}),[d,y]),s.jsx(nc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:C=>C.preventDefault(),onDismiss:w,children:s.jsxs(Id,{"data-state":v.stateAttribute,role:l?void 0:"tooltip",id:l?void 0:v.contentId,...b,...g,ref:a,style:{...g.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(A7,{children:c}),l?s.jsx(x7,{id:v.contentId,role:"tooltip",children:l}):null]})})},"TooltipContentImpl"));function Zj(t,n){const a=Math.abs(n.top-t.y),o=Math.abs(n.bottom-t.y),c=Math.abs(n.right-t.x),l=Math.abs(n.left-t.x);switch(Math.min(a,o,c,l)){case l:return"left";case c:return"right";case a:return"top";case o:return"bottom";default:throw new Error("unreachable")}}en(Zj,"getExitSideFromRect");function Qj(t,n,a=5){const o=[];switch(n){case"top":o.push({x:t.x-a,y:t.y+a},{x:t.x+a,y:t.y+a});break;case"bottom":o.push({x:t.x-a,y:t.y-a},{x:t.x+a,y:t.y-a});break;case"left":o.push({x:t.x+a,y:t.y-a},{x:t.x+a,y:t.y+a});break;case"right":o.push({x:t.x-a,y:t.y-a},{x:t.x-a,y:t.y+a});break}return o}en(Qj,"getPaddedExitPoints");function Jj(t){const{top:n,right:a,bottom:o,left:c}=t;return[{x:c,y:n},{x:a,y:n},{x:a,y:o},{x:c,y:o}]}en(Jj,"getPointsFromRect");function eC(t,n){const{x:a,y:o}=t;let c=!1;for(let l=0,d=n.length-1;l<n.length;d=l++){const m=n[l],p=n[d],g=m.x,v=m.y,b=p.x,w=p.y;v>o!=w>o&&a<(b-g)*(o-v)/(w-v)+g&&(c=!c)}return c}en(eC,"isPointInPolygon");function tC(t){const n=t.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),nC(n)}en(tC,"getHull");function nC(t){if(t.length<=1)return t.slice();const n=[];for(let o=0;o<t.length;o++){const c=t[o];for(;n.length>=2;){const l=n[n.length-1],d=n[n.length-2];if((l.x-d.x)*(c.y-d.y)>=(l.y-d.y)*(c.x-d.x))n.pop();else break}n.push(c)}n.pop();const a=[];for(let o=t.length-1;o>=0;o--){const c=t[o];for(;a.length>=2;){const l=a[a.length-1],d=a[a.length-2];if((l.x-d.x)*(c.y-d.y)>=(l.y-d.y)*(c.x-d.x))a.pop();else break}a.push(c)}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)}en(nC,"getHullPresorted");var _7=j7,D7=S7,O7=N7,L7=T7,rC=M7;const aC=_7,z7=D7,P7=O7,sC=f.forwardRef(({className:t,sideOffset:n=4,...a},o)=>s.jsx(L7,{children:s.jsx(rC,{ref:o,sideOffset:n,className:pe("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]",t),...a})}));sC.displayName=rC.displayName;const I7="sidebar_state",U7=3600*24*7,B7="16rem",$7="18rem",H7="3rem",G7="b",oC=f.createContext(null);function Wd(){const t=f.useContext(oC);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const iC=f.forwardRef(({defaultOpen:t=!0,open:n,onOpenChange:a,className:o,style:c,children:l,...d},m)=>{const p=XT(),[g,v]=f.useState(!1),[b,w]=f.useState(t),y=n??b,C=f.useCallback(N=>{const T=typeof N=="function"?N(y):N;a?a(T):w(T),document.cookie=`${I7}=${T}; path=/; max-age=${U7}`},[a,y]),S=f.useCallback(()=>p?v(N=>!N):C(N=>!N),[p,C,v]);f.useEffect(()=>{const N=T=>{T.key===G7&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),S())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[S]);const E=y?"expanded":"collapsed",k=f.useMemo(()=>({state:E,open:y,setOpen:C,isMobile:p,openMobile:g,setOpenMobile:v,toggleSidebar:S}),[E,y,C,p,g,v,S]);return s.jsx(oC.Provider,{value:k,children:s.jsx(aC,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":B7,"--sidebar-width-icon":H7,...c},className:pe("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:m,...d,children:l})})})});iC.displayName="SidebarProvider";const lC=f.forwardRef(({side:t="left",variant:n="sidebar",collapsible:a="offcanvas",className:o,children:c,...l},d)=>{const{isMobile:m,state:p,openMobile:g,setOpenMobile:v}=Wd();return a==="none"?s.jsx("div",{className:pe("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:d,...l,children:c}):m?s.jsx(Yj,{open:g,onOpenChange:v,...l,children:s.jsxs(Hg,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":$7},side:t,children:[s.jsxs(Gg,{className:"sr-only",children:[s.jsx(Vg,{children:"Sidebar"}),s.jsx(Fg,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):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":t,children:[s.jsx("div",{className:pe("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:pe("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="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),...l,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:c})})]})});lC.displayName="Sidebar";const cC=f.forwardRef(({className:t,onClick:n,...a},o)=>{const{toggleSidebar:c}=Wd();return s.jsxs(ue,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:pe("h-7 w-7",t),onClick:l=>{n==null||n(l),c()},...a,children:[s.jsx(HT,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});cC.displayName="SidebarTrigger";const uC=f.forwardRef(({className:t,...n},a)=>{const{toggleSidebar:o}=Wd();return s.jsx("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:pe("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",t),...n})});uC.displayName="SidebarRail";const dC=f.forwardRef(({className:t,...n},a)=>s.jsx("main",{ref:a,className:pe("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",t),...n}));dC.displayName="SidebarInset";const V7=f.forwardRef(({className:t,...n},a)=>s.jsx(De,{ref:a,"data-sidebar":"input",className:pe("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...n}));V7.displayName="SidebarInput";const fC=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"header",className:pe("flex flex-col gap-2 p-2",t),...n}));fC.displayName="SidebarHeader";const F7=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"footer",className:pe("flex flex-col gap-2 p-2",t),...n}));F7.displayName="SidebarFooter";const Y7=f.forwardRef(({className:t,...n},a)=>s.jsx(Bj,{ref:a,"data-sidebar":"separator",className:pe("mx-2 w-auto bg-sidebar-border",t),...n}));Y7.displayName="SidebarSeparator";const mC=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"content",className:pe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...n}));mC.displayName="SidebarContent";const Nh=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"group",className:pe("relative flex w-full min-w-0 flex-col p-2",t),...n}));Nh.displayName="SidebarGroup";const pC=f.forwardRef(({className:t,asChild:n=!1,...a},o)=>{const c=n?Si:"div";return s.jsx(c,{ref:o,"data-sidebar":"group-label",className:pe("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",t),...a})});pC.displayName="SidebarGroupLabel";const q7=f.forwardRef(({className:t,asChild:n=!1,...a},o)=>{const c=n?Si:"button";return s.jsx(c,{ref:o,"data-sidebar":"group-action",className:pe("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",t),...a})});q7.displayName="SidebarGroupAction";const Eh=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"group-content",className:pe("w-full text-sm",t),...n}));Eh.displayName="SidebarGroupContent";const kh=f.forwardRef(({className:t,...n},a)=>s.jsx("ul",{ref:a,"data-sidebar":"menu",className:pe("flex w-full min-w-0 flex-col gap-1",t),...n}));kh.displayName="SidebarMenu";const Th=f.forwardRef(({className:t,...n},a)=>s.jsx("li",{ref:a,"data-sidebar":"menu-item",className:pe("group/menu-item relative",t),...n}));Th.displayName="SidebarMenuItem";const K7=Ni("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"}}),Mh=f.forwardRef(({asChild:t=!1,isActive:n=!1,variant:a="default",size:o="default",tooltip:c,className:l,...d},m)=>{const p=t?Si:"button",{isMobile:g,state:v}=Wd(),b=s.jsx(p,{ref:m,"data-sidebar":"menu-button","data-size":o,"data-active":n,className:pe(K7({variant:a,size:o}),l),...d});return c?(typeof c=="string"&&(c={children:c}),s.jsxs(z7,{children:[s.jsx(P7,{asChild:!0,children:b}),s.jsx(sC,{side:"right",align:"center",hidden:v!=="collapsed"||g,...c})]})):b});Mh.displayName="SidebarMenuButton";const W7=f.forwardRef(({className:t,asChild:n=!1,showOnHover:a=!1,...o},c)=>{const l=n?Si:"button";return s.jsx(l,{ref:c,"data-sidebar":"menu-action",className:pe("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",t),...o})});W7.displayName="SidebarMenuAction";const X7=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,"data-sidebar":"menu-badge",className:pe("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",t),...n}));X7.displayName="SidebarMenuBadge";const Z7=f.forwardRef(({className:t,showIcon:n=!1,...a},o)=>{const c=f.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:o,"data-sidebar":"menu-skeleton",className:pe("flex h-8 items-center gap-2 rounded-md px-2",t),...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":c}})]})});Z7.displayName="SidebarMenuSkeleton";const Q7=f.forwardRef(({className:t,...n},a)=>s.jsx("ul",{ref:a,"data-sidebar":"menu-sub",className:pe("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",t),...n}));Q7.displayName="SidebarMenuSub";const J7=f.forwardRef(({...t},n)=>s.jsx("li",{ref:n,...t}));J7.displayName="SidebarMenuSubItem";const eM=f.forwardRef(({asChild:t=!1,size:n="md",isActive:a,className:o,...c},l)=>{const d=t?Si:"a";return s.jsx(d,{ref:l,"data-sidebar":"menu-sub-button","data-size":n,"data-active":a,className:pe("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),...c})});eM.displayName="SidebarMenuSubButton";const tM=[],nM=[{label:"Overview",items:[{title:"Dashboard",url:"/",icon:A2,end:!0,permission:"overview"},{title:"Console",url:"/logs",icon:M2,permission:"logs"}]},{label:"Access & Logs",items:[{title:"Users",url:"/users",icon:rh,permission:"users.view"},{title:"Groups",url:"/groups",icon:qu,permission:"users.view"},{title:"Tickets",url:"/tickets",icon:is,permission:"overview"},{title:"Transcripts",url:"/transcripts",icon:Ul,permission:"transcripts"}]},{label:"Configuration",items:[{title:"Bot Settings",url:"/configs?file=supportbot",icon:cg},{title:"Ticket Panel",url:"/configs?file=ticket-panel",icon:is},{title:"AI Assistant",url:"/configs?file=supportbot-ai",icon:og},{title:"Messages",url:"/configs?file=messages",icon:ug},{title:"Staff Roles",url:"/configs?file=supportbot&tab=Roles",icon:rh},{title:"Commands",url:"/configs?file=commands",icon:ds}]},{label:"System",items:[{title:"Addons",url:"/addons",icon:dg,permission:"settings.view"},{title:"Addon Builder",url:"/addons/builder",icon:ds,permission:"settings.update"},{title:"Dashboard Settings",url:"/settings",icon:qs,permission:"settings.view"}]}];function y0(t){return new URL(t,"http://x").searchParams.get("file")}function rM(){const{branding:t}=Ed(),{permissions:n}=qt(),{stats:a}=kd(),{files:o}=$2(),[c]=wd(),l=c.get("file"),d=sd(n,"supportbot")&&o.length>0?{label:"Addons",items:o.map(C=>({title:H2(C),url:`/configs?file=${_l(C)}`,icon:dg,end:!1}))}:null,m=tM.filter(C=>!C.permission||Mn(n,C.permission)),p=nM.map(C=>({...C,items:C.items.filter(S=>{if(S.permission)return Mn(n,S.permission);const E=y0(S.url);return E&&S.url.includes("/configs")?sd(n,E):!0})})).filter(C=>C.items.length>0),g=d?[...p,d]:p,[v,b]=f.useState(null);f.useEffect(()=>{let C=!1;return Ne.getGuildResources().then(S=>{!C&&S.data&&b(S.data)}).catch(()=>{}),()=>{C=!0}},[]);const w=(v==null?void 0:v.guildName)||(a?`${a.servers} Server${a.servers===1?"":"s"}`:"Connected Guild"),y=v==null?void 0:v.guildIcon;return s.jsxs(lC,{collapsible:"icon",className:"border-r border-sidebar-border",children:[s.jsxs(fC,{className:"gap-3 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 px-1",children:[t.hasFavicon&&t.faviconUrl?s.jsx("img",{src:`${t.faviconUrl}${t.updatedAt?`?v=${t.updatedAt}`:""}`,alt:"",className:"size-7 shrink-0 rounded-md object-contain"}):null,s.jsx("span",{className:"truncate text-lg font-bold tracking-tight",children:t.title})]}),s.jsxs(zg,{children:[s.jsx(Pg,{asChild:!0,children:s.jsxs(ue,{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 min-w-0",children:[y?s.jsx("img",{src:y,alt:"",className:"size-5 rounded-full object-cover shrink-0"}):s.jsx("div",{className:"size-5 rounded-full bg-primary/20 text-primary flex items-center justify-center text-[10px] font-bold shrink-0",children:w.charAt(0).toUpperCase()}),s.jsx("span",{className:"truncate text-xs font-semibold text-foreground",children:w})]}),s.jsx(ve,{icon:k2,size:14,className:"text-muted-foreground shrink-0 ml-1"})]})}),s.jsxs(Fd,{className:"w-[--radix-dropdown-menu-trigger-width]",children:[s.jsxs(Vl,{disabled:!0,className:"text-xs font-medium",children:["Connected Guild: ",w]}),a?s.jsxs(Vl,{disabled:!0,className:"text-xs text-muted-foreground",children:[a.users.toLocaleString()," members tracked"]}):null]})]})]}),s.jsxs(mC,{className:"px-2",children:[s.jsx(Nh,{children:s.jsx(Eh,{children:s.jsx(kh,{children:m.map(C=>s.jsx(Th,{children:s.jsx(Mh,{asChild:!0,tooltip:C.title,children:s.jsxs(th,{to:C.url,end:C.end,className:({isActive:S})=>pe(S&&"bg-sidebar-accent font-medium"),children:[s.jsx(ve,{icon:C.icon,size:18}),s.jsx("span",{children:C.title})]})})},C.title))})})}),g.map(C=>s.jsxs(Nh,{children:[s.jsx(pC,{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/80",children:C.label}),s.jsx(Eh,{children:s.jsx(kh,{children:C.items.map(S=>{const E=y0(S.url),k=!!E&&l===E&&S.url.includes("/configs");return s.jsx(Th,{children:s.jsx(Mh,{asChild:!0,tooltip:S.title,children:s.jsxs(th,{to:S.url,end:S.end,className:({isActive:N})=>pe((N||k)&&"bg-sidebar-accent font-medium"),children:[s.jsx(ve,{icon:S.icon,size:18}),s.jsx("span",{children:S.title})]})})},`${C.label}-${S.title}`)})})})]},C.label))]}),s.jsx(uC,{})]})}var w0=1,aM=.9,sM=.8,oM=.17,Pp=.1,Ip=.999,iM=.9999,lM=.99,cM=/[\\\/_+.#"@\[\(\{&]/,uM=/[\\\/_+.#"@\[\(\{&]/g,dM=/[\s-]/,hC=/[\s-]/g;function Rh(t,n,a,o,c,l,d){if(l===n.length)return c===t.length?w0:lM;var m=`${c},${l}`;if(d[m]!==void 0)return d[m];for(var p=o.charAt(l),g=a.indexOf(p,c),v=0,b,w,y,C;g>=0;)b=Rh(t,n,a,o,g+1,l+1,d),b>v&&(g===c?b*=w0:cM.test(t.charAt(g-1))?(b*=sM,y=t.slice(c,g-1).match(uM),y&&c>0&&(b*=Math.pow(Ip,y.length))):dM.test(t.charAt(g-1))?(b*=aM,C=t.slice(c,g-1).match(hC),C&&c>0&&(b*=Math.pow(Ip,C.length))):(b*=oM,c>0&&(b*=Math.pow(Ip,g-c))),t.charAt(g)!==n.charAt(l)&&(b*=iM)),(b<Pp&&a.charAt(g-1)===o.charAt(l+1)||o.charAt(l+1)===o.charAt(l)&&a.charAt(g-1)!==o.charAt(l))&&(w=Rh(t,n,a,o,g+1,l+2,d),w*Pp>b&&(b=w*Pp)),b>v&&(v=b),g=a.indexOf(p,g+1);return d[m]=v,v}function j0(t){return t.toLowerCase().replace(hC," ")}function fM(t,n,a){return t=a&&a.length>0?`${t+" "+a.join(" ")}`:t,Rh(t,n,j0(t),j0(n),0,0,{})}var Ml='[cmdk-group=""]',Up='[cmdk-group-items=""]',mM='[cmdk-group-heading=""]',gC='[cmdk-item=""]',C0=`${gC}:not([aria-disabled="true"])`,Ah="cmdk-item-select",si="data-value",pM=(t,n,a)=>fM(t,n,a),xC=f.createContext(void 0),cc=()=>f.useContext(xC),vC=f.createContext(void 0),Wg=()=>f.useContext(vC),bC=f.createContext(void 0),yC=f.forwardRef((t,n)=>{let a=oi(()=>{var D,$;return{search:"",value:($=(D=t.value)!=null?D:t.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=oi(()=>new Set),c=oi(()=>new Map),l=oi(()=>new Map),d=oi(()=>new Set),m=wC(t),{label:p,children:g,value:v,onValueChange:b,filter:w,shouldFilter:y,loop:C,disablePointerSelection:S=!1,vimBindings:E=!0,...k}=t,N=tn(),T=tn(),M=tn(),_=f.useRef(null),R=NM();Zs(()=>{if(v!==void 0){let D=v.trim();a.current.value=D,L.emit()}},[v]),Zs(()=>{R(6,ce)},[]);let L=f.useMemo(()=>({subscribe:D=>(d.current.add(D),()=>d.current.delete(D)),snapshot:()=>a.current,setState:(D,$,H)=>{var X,xe,q,ge;if(!Object.is(a.current[D],$)){if(a.current[D]=$,D==="search")Y(),I(),R(1,G);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let me=document.getElementById(M);me?me.focus():(X=document.getElementById(N))==null||X.focus()}if(R(7,()=>{var me;a.current.selectedItemId=(me=fe())==null?void 0:me.id,L.emit()}),H||R(5,ce),((xe=m.current)==null?void 0:xe.value)!==void 0){let me=$??"";(ge=(q=m.current).onValueChange)==null||ge.call(q,me);return}}L.emit()}},emit:()=>{d.current.forEach(D=>D())}}),[]),te=f.useMemo(()=>({value:(D,$,H)=>{var X;$!==((X=l.current.get(D))==null?void 0:X.value)&&(l.current.set(D,{value:$,keywords:H}),a.current.filtered.items.set(D,K($,H)),R(2,()=>{I(),L.emit()}))},item:(D,$)=>(o.current.add(D),$&&(c.current.has($)?c.current.get($).add(D):c.current.set($,new Set([D]))),R(3,()=>{Y(),I(),a.current.value||G(),L.emit()}),()=>{l.current.delete(D),o.current.delete(D),a.current.filtered.items.delete(D);let H=fe();R(4,()=>{Y(),(H==null?void 0:H.getAttribute("id"))===D&&G(),L.emit()})}),group:D=>(c.current.has(D)||c.current.set(D,new Set),()=>{l.current.delete(D),c.current.delete(D)}),filter:()=>m.current.shouldFilter,label:p||t["aria-label"],getDisablePointerSelection:()=>m.current.disablePointerSelection,listId:N,inputId:M,labelId:T,listInnerRef:_}),[]);function K(D,$){var H,X;let xe=(X=(H=m.current)==null?void 0:H.filter)!=null?X:pM;return D?xe(D,a.current.search,$):0}function I(){if(!a.current.search||m.current.shouldFilter===!1)return;let D=a.current.filtered.items,$=[];a.current.filtered.groups.forEach(X=>{let xe=c.current.get(X),q=0;xe.forEach(ge=>{let me=D.get(ge);q=Math.max(me,q)}),$.push([X,q])});let H=_.current;se().sort((X,xe)=>{var q,ge;let me=X.getAttribute("id"),B=xe.getAttribute("id");return((q=D.get(B))!=null?q:0)-((ge=D.get(me))!=null?ge:0)}).forEach(X=>{let xe=X.closest(Up);xe?xe.appendChild(X.parentElement===xe?X:X.closest(`${Up} > *`)):H.appendChild(X.parentElement===H?X:X.closest(`${Up} > *`))}),$.sort((X,xe)=>xe[1]-X[1]).forEach(X=>{var xe;let q=(xe=_.current)==null?void 0:xe.querySelector(`${Ml}[${si}="${encodeURIComponent(X[0])}"]`);q==null||q.parentElement.appendChild(q)})}function G(){let D=se().find(H=>H.getAttribute("aria-disabled")!=="true"),$=D==null?void 0:D.getAttribute(si);L.setState("value",$||void 0)}function Y(){var D,$,H,X;if(!a.current.search||m.current.shouldFilter===!1){a.current.filtered.count=o.current.size;return}a.current.filtered.groups=new Set;let xe=0;for(let q of o.current){let ge=($=(D=l.current.get(q))==null?void 0:D.value)!=null?$:"",me=(X=(H=l.current.get(q))==null?void 0:H.keywords)!=null?X:[],B=K(ge,me);a.current.filtered.items.set(q,B),B>0&&xe++}for(let[q,ge]of c.current)for(let me of ge)if(a.current.filtered.items.get(me)>0){a.current.filtered.groups.add(q);break}a.current.filtered.count=xe}function ce(){var D,$,H;let X=fe();X&&(((D=X.parentElement)==null?void 0:D.firstChild)===X&&((H=($=X.closest(Ml))==null?void 0:$.querySelector(mM))==null||H.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function fe(){var D;return(D=_.current)==null?void 0:D.querySelector(`${gC}[aria-selected="true"]`)}function se(){var D;return Array.from(((D=_.current)==null?void 0:D.querySelectorAll(C0))||[])}function P(D){let $=se()[D];$&&L.setState("value",$.getAttribute(si))}function Z(D){var $;let H=fe(),X=se(),xe=X.findIndex(ge=>ge===H),q=X[xe+D];($=m.current)!=null&&$.loop&&(q=xe+D<0?X[X.length-1]:xe+D===X.length?X[0]:X[xe+D]),q&&L.setState("value",q.getAttribute(si))}function ae(D){let $=fe(),H=$==null?void 0:$.closest(Ml),X;for(;H&&!X;)H=D>0?CM(H,Ml):SM(H,Ml),X=H==null?void 0:H.querySelector(C0);X?L.setState("value",X.getAttribute(si)):Z(D)}let re=()=>P(se().length-1),V=D=>{D.preventDefault(),D.metaKey?re():D.altKey?ae(1):Z(1)},O=D=>{D.preventDefault(),D.metaKey?P(0):D.altKey?ae(-1):Z(-1)};return f.createElement(Me.div,{ref:n,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:D=>{var $;($=k.onKeyDown)==null||$.call(k,D);let H=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||H))switch(D.key){case"n":case"j":{E&&D.ctrlKey&&V(D);break}case"ArrowDown":{V(D);break}case"p":case"k":{E&&D.ctrlKey&&O(D);break}case"ArrowUp":{O(D);break}case"Home":{D.preventDefault(),P(0);break}case"End":{D.preventDefault(),re();break}case"Enter":{D.preventDefault();let X=fe();if(X){let xe=new Event(Ah);X.dispatchEvent(xe)}}}}},f.createElement("label",{"cmdk-label":"",htmlFor:te.inputId,id:te.labelId,style:kM},p),Xd(t,D=>f.createElement(vC.Provider,{value:L},f.createElement(xC.Provider,{value:te},D))))}),hM=f.forwardRef((t,n)=>{var a,o;let c=tn(),l=f.useRef(null),d=f.useContext(bC),m=cc(),p=wC(t),g=(o=(a=p.current)==null?void 0:a.forceMount)!=null?o:d==null?void 0:d.forceMount;Zs(()=>{if(!g)return m.item(c,d==null?void 0:d.id)},[g]);let v=jC(c,l,[t.value,t.children,l],t.keywords),b=Wg(),w=ps(R=>R.value&&R.value===v.current),y=ps(R=>g||m.filter()===!1?!0:R.search?R.filtered.items.get(c)>0:!0);f.useEffect(()=>{let R=l.current;if(!(!R||t.disabled))return R.addEventListener(Ah,C),()=>R.removeEventListener(Ah,C)},[y,t.onSelect,t.disabled]);function C(){var R,L;S(),(L=(R=p.current).onSelect)==null||L.call(R,v.current)}function S(){b.setState("value",v.current,!0)}if(!y)return null;let{disabled:E,value:k,onSelect:N,forceMount:T,keywords:M,..._}=t;return f.createElement(Me.div,{ref:Ks(l,n),..._,id:c,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!w,"data-disabled":!!E,"data-selected":!!w,onPointerMove:E||m.getDisablePointerSelection()?void 0:S,onClick:E?void 0:C},t.children)}),gM=f.forwardRef((t,n)=>{let{heading:a,children:o,forceMount:c,...l}=t,d=tn(),m=f.useRef(null),p=f.useRef(null),g=tn(),v=cc(),b=ps(y=>c||v.filter()===!1?!0:y.search?y.filtered.groups.has(d):!0);Zs(()=>v.group(d),[]),jC(d,m,[t.value,t.heading,p]);let w=f.useMemo(()=>({id:d,forceMount:c}),[c]);return f.createElement(Me.div,{ref:Ks(m,n),...l,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},a&&f.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:g},a),Xd(t,y=>f.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?g:void 0},f.createElement(bC.Provider,{value:w},y))))}),xM=f.forwardRef((t,n)=>{let{alwaysRender:a,...o}=t,c=f.useRef(null),l=ps(d=>!d.search);return!a&&!l?null:f.createElement(Me.div,{ref:Ks(c,n),...o,"cmdk-separator":"",role:"separator"})}),vM=f.forwardRef((t,n)=>{let{onValueChange:a,...o}=t,c=t.value!=null,l=Wg(),d=ps(g=>g.search),m=ps(g=>g.selectedItemId),p=cc();return f.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),f.createElement(Me.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:c?t.value:d,onChange:g=>{c||l.setState("search",g.target.value),a==null||a(g.target.value)}})}),bM=f.forwardRef((t,n)=>{let{children:a,label:o="Suggestions",...c}=t,l=f.useRef(null),d=f.useRef(null),m=ps(g=>g.selectedItemId),p=cc();return f.useEffect(()=>{if(d.current&&l.current){let g=d.current,v=l.current,b,w=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let y=g.offsetHeight;v.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return w.observe(g),()=>{cancelAnimationFrame(b),w.unobserve(g)}}},[]),f.createElement(Me.div,{ref:Ks(l,n),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":m,"aria-label":o,id:p.listId},Xd(t,g=>f.createElement("div",{ref:Ks(d,p.listInnerRef),"cmdk-list-sizer":""},g)))}),yM=f.forwardRef((t,n)=>{let{open:a,onOpenChange:o,overlayClassName:c,contentClassName:l,container:d,...m}=t;return f.createElement(Bg,{open:a,onOpenChange:o},f.createElement($g,{container:d},f.createElement(oc,{"cmdk-overlay":"",className:c}),f.createElement(ic,{"aria-label":t.label,"cmdk-dialog":"",className:l},f.createElement(yC,{ref:n,...m}))))}),wM=f.forwardRef((t,n)=>ps(a=>a.filtered.count===0)?f.createElement(Me.div,{ref:n,...t,"cmdk-empty":"",role:"presentation"}):null),jM=f.forwardRef((t,n)=>{let{progress:a,children:o,label:c="Loading...",...l}=t;return f.createElement(Me.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},Xd(t,d=>f.createElement("div",{"aria-hidden":!0},d)))}),An=Object.assign(yC,{List:bM,Item:hM,Input:vM,Group:gM,Separator:xM,Dialog:yM,Empty:wM,Loading:jM});function CM(t,n){let a=t.nextElementSibling;for(;a;){if(a.matches(n))return a;a=a.nextElementSibling}}function SM(t,n){let a=t.previousElementSibling;for(;a;){if(a.matches(n))return a;a=a.previousElementSibling}}function wC(t){let n=f.useRef(t);return Zs(()=>{n.current=t}),n}var Zs=typeof window>"u"?f.useEffect:f.useLayoutEffect;function oi(t){let n=f.useRef();return n.current===void 0&&(n.current=t()),n}function ps(t){let n=Wg(),a=()=>t(n.snapshot());return f.useSyncExternalStore(n.subscribe,a,a)}function jC(t,n,a,o=[]){let c=f.useRef(),l=cc();return Zs(()=>{var d;let m=(()=>{var g;for(let v of a){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(g=v.current.textContent)==null?void 0:g.trim():c.current}})(),p=o.map(g=>g.trim());l.value(t,m,p),(d=n.current)==null||d.setAttribute(si,m),c.current=m}),c}var NM=()=>{let[t,n]=f.useState(),a=oi(()=>new Map);return Zs(()=>{a.current.forEach(o=>o()),a.current=new Map},[t]),(o,c)=>{a.current.set(o,c),n({})}};function EM(t){let n=t.type;return typeof n=="function"?n(t.props):"render"in n?n.render(t.props):t}function Xd({asChild:t,children:n},a){return t&&f.isValidElement(n)?f.cloneElement(EM(n),{ref:n.ref},a(n.props.children)):a(n)}var kM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Qs=Bg,TM=r7,MM=$g,CC=f.forwardRef(({className:t,...n},a)=>s.jsx(oc,{ref:a,className:pe("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",t),...n}));CC.displayName=oc.displayName;const hs=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(MM,{children:[s.jsx(CC,{}),s.jsxs(ic,{ref:o,className:pe("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",t),...a,children:[n,s.jsxs(Fj,{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(zj,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hs.displayName=ic.displayName;const gs=({className:t,...n})=>s.jsx("div",{className:pe("flex flex-col space-y-1.5 text-center sm:text-left",t),...n});gs.displayName="DialogHeader";const Js=({className:t,...n})=>s.jsx("div",{className:pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...n});Js.displayName="DialogFooter";const xs=f.forwardRef(({className:t,...n},a)=>s.jsx(Yd,{ref:a,className:pe("text-lg font-semibold leading-none tracking-tight",t),...n}));xs.displayName=Yd.displayName;const vs=f.forwardRef(({className:t,...n},a)=>s.jsx(qd,{ref:a,className:pe("text-sm text-muted-foreground",t),...n}));vs.displayName=qd.displayName;const SC=f.forwardRef(({className:t,...n},a)=>s.jsx(An,{ref:a,className:pe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...n}));SC.displayName=An.displayName;const RM=f.forwardRef(({className:t,...n},a)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(VT,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(An.Input,{ref:a,className:pe("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",t),...n})]}));RM.displayName=An.Input.displayName;const NC=f.forwardRef(({className:t,...n},a)=>s.jsx(An.List,{ref:a,className:pe("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...n}));NC.displayName=An.List.displayName;const EC=f.forwardRef((t,n)=>s.jsx(An.Empty,{ref:n,className:"py-6 text-center text-sm",...t}));EC.displayName=An.Empty.displayName;const kC=f.forwardRef(({className:t,...n},a)=>s.jsx(An.Group,{ref:a,className:pe("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",t),...n}));kC.displayName=An.Group.displayName;const AM=f.forwardRef(({className:t,...n},a)=>s.jsx(An.Separator,{ref:a,className:pe("-mx-1 h-px bg-border",t),...n}));AM.displayName=An.Separator.displayName;const TC=f.forwardRef(({className:t,...n},a)=>s.jsx(An.Item,{ref:a,className:pe("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",t),...n}));TC.displayName=An.Item.displayName;const _M=[{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"}]}],DM=[{value:"Playing",label:"Playing"},{value:"Watching",label:"Watching"},{value:"Listening",label:"Listening"},{value:"Competing",label:"Competing"},{value:"Streaming",label:"Streaming"}],OM=[{value:"Channel",label:"Channel"},{value:"Forum",label:"Forum"}],LM=[{value:"channels",label:"Channels"},{value:"threads",label:"Threads"}],zM=[{value:"description",label:"Channel description"},{value:"embed",label:"Embed"}],ri=[{value:"1",label:"Blurple"},{value:"2",label:"Grey"},{value:"3",label:"Green"},{value:"4",label:"Red"}],PM=[{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:"Database",fields:[{path:"Database.Driver",label:"Database Engine",type:"select",options:[{value:"sqlite",label:"SQLite (Local File)"},{value:"mysql",label:"MySQL / MariaDB"}],description:"Select SQLite for zero-config file storage, or MySQL for external host servers."},{path:"Database.MySQL.Host",label:"MySQL Host",type:"text",placeholder:"127.0.0.1 or localhost",description:"Hostname or IP address of your MySQL database server."},{path:"Database.MySQL.Port",label:"MySQL Port",type:"number",placeholder:"3306"},{path:"Database.MySQL.Database",label:"Database Name",type:"text",placeholder:"supportbot"},{path:"Database.MySQL.User",label:"Database User",type:"text",placeholder:"root"},{path:"Database.MySQL.Password",label:"Database Password",type:"secret",placeholder:"••••••••••••"},{path:"Database.MySQL.ConnectionLimit",label:"Connection Pool Limit",type:"number",placeholder:"10",description:"Maximum simultaneous connections in the MySQL pool (default 10)."},{path:"Database.SQLite.File",label:"SQLite Database File Path",type:"text",placeholder:"./Data/supportbot.db"}]},{title:"Activity",fields:[{path:"Activity.Status",label:"Status text",type:"text"},{path:"Activity.Type",label:"Activity type",type:"select",options:DM},{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:OM},{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:ri},{path:"Suggestions.Buttons.Downvote",label:"Downvote button style",type:"select",options:ri},{path:"Suggestions.Buttons.RemoveVote",label:"Remove vote button style",type:"select",options:ri},{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:LM},{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:zM},{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:ri},{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.Questions.Enabled",label:"Ticket questions",type:"boolean"},{path:"Ticket.Questions.List",label:"Default questions",type:"stringList"}]},{title:"Ticket Departments",description:"Configure ticket department channels, emojis, staff roles, and custom department questions.",fields:[{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"}]},{title:"Ticket Priorities",description:"Configure ticket priority levels and emojis.",fields:[{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"}]},{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:ri},{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:ri},{path:"SelectMenus.Tickets.PanelEmoji",label:"Panel menu emoji",type:"emoji"},{path:"SelectMenus.Tickets.CloseEmoji",label:"Close menu emoji",type:"emoji"}]}],IM=[{value:"openai",label:"OpenAI"},{value:"groq",label:"Groq"},{value:"claude",label:"Claude"}],UM=[{value:"text",label:"Plain text"},{value:"embed",label:"Embed"},{value:"components_v2",label:"Components v2"}],BM=[{value:"channel",label:"Per channel"},{value:"guild",label:"Per server"}],$M=[{title:"General",fields:[{path:"Enabled",label:"AI enabled",type:"boolean"},{path:"General.Provider",label:"Provider",type:"select",options:IM},{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:UM},{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:BM}]},{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"}]}],HM=[{value:"1",label:"Blurple"},{value:"2",label:"Grey"},{value:"3",label:"Green"},{value:"4",label:"Red"}],GM=[{value:"1",label:"Style 1"},{value:"2",label:"Style 2"},{value:"3",label:"Style 3"},{value:"4",label:"Style 4 (classic embed)"}],VM=[{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:GM}]},{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:HM},{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"}]}],_h={supportbot:PM,"ticket-panel":VM,commands:"commands",messages:_M,"supportbot-ai":$M};function FM(t){return t in _h?_h[t]:null}const ii=[{id:"tickets",title:"Ticket panel",description:"Create and manage support tickets with departments, priorities, and AI assistance.",icon:is,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:qs,href:"/configs?file=supportbot",category:"server"},{id:"transcripts",title:"Ticket transcripts",description:"Browse and preview HTML transcripts saved when tickets are closed.",icon:Ul,href:"/transcripts",category:"tickets"},{id:"suggestions",title:"Suggestions",description:"Configure suggestion channels, voting emojis, and forum thread behaviour.",icon:ug,href:"/configs?file=messages",category:"community"},{id:"ai",title:"AI assistant",description:"SupportBot AI mode settings for in-ticket conversational help.",icon:og,href:"/configs?file=supportbot-ai",category:"community"},{id:"commands",title:"Commands",description:"Enable or disable slash commands and customise command permissions.",icon:ds,href:"/configs?file=commands",category:"server"}],YM=[{id:"all",label:"All modules"},{id:"tickets",label:"Tickets"},{id:"community",label:"Community"},{id:"server",label:"Server"}],qM={supportbot:"Bot config","ticket-panel":"Ticket panel",commands:"Commands",messages:"Messages","supportbot-ai":"AI assistant"},KM=[{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 WM(t,n,a){const o=qM[t];for(const c of n)for(const l of c.fields)a.push({id:`setting:${t}:${l.path}`,title:l.label,subtitle:`${o} · ${c.title}`,href:`/configs?file=${t}`,category:"setting",icon:XM(t),keywords:[l.path,l.label,c.title,o,t,l.description??"",l.type].map(d=>d.toLowerCase())})}function XM(t){switch(t){case"supportbot":return qs;case"ticket-panel":return is;case"messages":return ug;case"supportbot-ai":return og;case"commands":return ds;default:return qs}}function ZM(){const t=[{id:"page:dashboard",title:"Dashboard",subtitle:"Overview and module status",href:"/",category:"page",icon:A2,keywords:["home","overview","stats"]},{id:"page:logs",title:"Logs",subtitle:"Live bot console output",href:"/logs",category:"page",icon:M2,keywords:["console","output","errors","warn"]},{id:"page:settings",title:"Settings",subtitle:"Updates and maintenance",href:"/settings",category:"page",icon:qs,keywords:["update","version","software"]},{id:"page:transcripts",title:"Transcripts",subtitle:"Closed ticket transcripts",href:"/transcripts",category:"page",icon:Ul,keywords:["tickets","archive","html"]}];for(const n of ii)t.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(_h))a!=="commands"&&WM(n,a,t);for(const n of KM)t.push({id:`command:${n.key}`,title:n.label,subtitle:`Command · ${n.description}`,href:"/configs?file=commands",category:"command",icon:ds,keywords:[n.key,n.label,n.description,"slash","commands"].map(a=>a.toLowerCase())});return t.push({id:"setting:commands:all",title:"Slash commands",subtitle:"Commands · Enable and configure all commands",href:"/configs?file=commands",category:"setting",icon:ds,keywords:["commands","slash","enable","permissions"]}),t}const QM=ZM(),JM={page:"Pages",module:"Modules",setting:"Settings",command:"Commands"};function eR(t,n=12){const a=t.trim().toLowerCase();return a?QM.map(c=>{let l=0;const d=c.title.toLowerCase(),m=(c.subtitle??"").toLowerCase();d===a?l+=100:d.startsWith(a)?l+=40:d.includes(a)&&(l+=20),m.includes(a)&&(l+=10);for(const p of c.keywords)p===a?l+=15:p.startsWith(a)?l+=8:p.includes(a)&&(l+=4);return{item:c,score:l}}).filter(c=>c.score>0).sort((c,l)=>l.score-c.score).slice(0,n).map(c=>c.item):[]}function tR(t){const n=[],a=["page","module","setting","command"];for(const o of a){const c=t.filter(l=>l.category===o);c.length&&n.push({category:o,label:JM[o],items:c})}return n}function nR({className:t}){const n=ao(),[a,o]=f.useState(""),[c,l]=f.useState(!1),d=f.useRef(null),m=f.useRef(null),p=f.useRef(null),[g,v]=f.useState(null),b=f.useMemo(()=>eR(a,14),[a]),w=f.useMemo(()=>tR(b),[b]),y=c&&a.trim().length>0,C=()=>{const E=p.current;if(!E)return;const k=E.getBoundingClientRect();v({top:k.bottom+6,left:k.left,width:k.width})};f.useLayoutEffect(()=>{if(!y){v(null);return}return C(),window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[y,a]),f.useEffect(()=>{function E(k){var T,M;const N=k.target;(T=d.current)!=null&&T.contains(N)||(M=m.current)!=null&&M.contains(N)||l(!1)}return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]),f.useEffect(()=>{function E(k){var N;k.key==="k"&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),(N=p.current)==null||N.focus(),l(!0))}return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[]);function S(E){var k;n(E.href),o(""),l(!1),(k=p.current)==null||k.blur()}return s.jsxs("div",{ref:d,className:pe("relative w-full max-w-sm",t),children:[s.jsx(ve,{icon:ji,size:16,className:"pointer-events-none absolute left-3 top-1/2 z-10 -translate-y-1/2 text-muted-foreground"}),s.jsx(De,{ref:p,value:a,onChange:E=>{o(E.target.value),l(!0)},onFocus:()=>l(!0),onKeyDown:E=>{var k;E.key==="Escape"&&(l(!1),o(""),(k=p.current)==null||k.blur())},placeholder:"Search modules, configs…",className:"h-9 border-border bg-secondary/50 pl-9",role:"combobox","aria-expanded":y,"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"]}),y&&g?so.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:g.top,left:g.left,width:g.width,zIndex:9999},role:"listbox",children:s.jsx(SC,{shouldFilter:!1,className:"bg-transparent",children:s.jsx(NC,{className:"max-h-[min(360px,50vh)]",children:b.length===0?s.jsxs(EC,{className:"py-8 text-muted-foreground",children:["No results for “",a.trim(),"”"]}):w.map(E=>s.jsx(kC,{heading:E.label,children:E.items.map(k=>s.jsxs(TC,{value:k.id,onSelect:()=>S(k),className:"cursor-pointer gap-3 rounded-lg py-2.5 aria-selected:bg-accent",children:[k.icon?s.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(ve,{icon:k.icon,size:16})}):null,s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate font-medium",children:k.title}),k.subtitle?s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:k.subtitle}):null]})]},k.id))},E.category))})})}),document.body):null]})}var rR=Object.defineProperty,Ta=(t,n)=>rR(t,"name",{value:n,configurable:!0}),MC="Avatar",[aR,HP]=yn(MC),sR=[0,()=>{}],[oR,RC]=aR(MC),AC=f.forwardRef(Ta(function(n,a){const{__scopeAvatar:o,...c}=n,[l,d]=f.useState("idle"),[m,p]=LC();return s.jsx(oR,{scope:o,imageLoadingStatus:l,setImageLoadingStatus:d,imageCount:m,setImageCount:p,children:s.jsx(Me.span,{...c,ref:a})})},"Avatar")),iR="AvatarImage",_C=f.forwardRef(Ta(function(n,a){const{__scopeAvatar:o,src:c,onLoadingStatusChange:l,...d}=n,m=RC(iR,o);m.setImageCount;const p=OC(c,{referrerPolicy:d.referrerPolicy,crossOrigin:d.crossOrigin,loadingStatus:m.imageLoadingStatus,setLoadingStatus:m.setImageLoadingStatus}),g=Vt(b=>{l==null||l(b)}),v=f.useRef(p);return Ct(()=>{const b=v.current;v.current=p,p!==b&&g(p)},[p,g]),p==="loaded"?s.jsx(Me.img,{...d,ref:a,src:c}):null},"AvatarImage")),lR="AvatarFallback",DC=f.forwardRef(Ta(function(n,a){const{__scopeAvatar:o,delayMs:c,...l}=n,d=RC(lR,o),[m,p]=f.useState(c===void 0);return f.useEffect(()=>{if(c!==void 0){const g=window.setTimeout(()=>p(!0),c);return()=>window.clearTimeout(g)}},[c]),m&&d.imageLoadingStatus!=="loaded"?s.jsx(Me.span,{...l,ref:a}):null},"AvatarFallback"));function OC(t,{loadingStatus:n,setLoadingStatus:a,referrerPolicy:o,crossOrigin:c}){return Ct(()=>{if(!t){a("error");return}const l=new window.Image,d=Ta(p=>{const g=p.currentTarget;a(Dh(g))},"handleLoad"),m=Ta(()=>a("error"),"handleError");return l.addEventListener("load",d),l.addEventListener("error",m),o&&(l.referrerPolicy=o),l.crossOrigin=c??null,l.src=t,a(Dh(l)),()=>{l.removeEventListener("load",d),l.removeEventListener("error",m),a("idle")}},[t,c,o,a]),n}Ta(OC,"useImageLoadingStatus");function Dh(t){return t.complete?t.naturalWidth>0?"loaded":"error":"loading"}Ta(Dh,"getImageLoadingStatus");function LC(){return sR}Ta(LC,"useImageCount");function cR(t){}Ta(cR,"useUpdateImageCount");const bs=f.forwardRef(({className:t,...n},a)=>s.jsx(AC,{ref:a,className:pe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...n}));bs.displayName=AC.displayName;const eo=f.forwardRef(({className:t,...n},a)=>s.jsx(_C,{ref:a,className:pe("aspect-square h-full w-full",t),...n}));eo.displayName=_C.displayName;const ys=f.forwardRef(({className:t,...n},a)=>s.jsx(DC,{ref:a,className:pe("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...n}));ys.displayName=DC.displayName;const zC=f.createContext(null);function uR({children:t}){const[n,a]=f.useState([]),[o,c]=f.useState(0),[l,d]=f.useState(!0),m=f.useCallback(async()=>{try{const b=await Ne.getNotifications();b.data&&(a(b.data.items),c(b.data.unreadCount))}catch{}finally{d(!1)}},[]),p=f.useCallback(async()=>{var b;try{const w=await Ne.markNotificationsRead("all");a(y=>y.map(C=>({...C,read:!0}))),c(((b=w.data)==null?void 0:b.unreadCount)??0)}catch{}},[]),g=f.useCallback(async b=>{var w;try{const y=await Ne.dismissNotification(b);a(C=>C.filter(S=>S.id!==b)),c(((w=y.data)==null?void 0:w.unreadCount)??0)}catch{}},[]);f.useEffect(()=>{m();const b=setInterval(m,3e4);return()=>clearInterval(b)},[m]);const v=f.useMemo(()=>({items:n,unreadCount:o,loading:l,refresh:m,markAllRead:p,dismiss:g}),[n,o,l,m,p,g]);return s.jsx(zC.Provider,{value:v,children:t})}function dR(){const t=f.useContext(zC);if(!t)throw new Error("useNotifications must be used within NotificationsProvider");return t}const fR=Ni("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 Fn({className:t,variant:n,...a}){return s.jsx("div",{className:pe(fR({variant:n}),t),...a})}var mR=Object.defineProperty,pR=(t,n)=>mR(t,"name",{value:n,configurable:!0});function ud(t,[n,a]){return Math.min(a,Math.max(n,t))}pR(ud,"clamp");var hR=Object.defineProperty,Fe=(t,n)=>hR(t,"name",{value:n,configurable:!0});function PC(t,n){return f.useReducer((a,o)=>n[a][o]??a,t)}Fe(PC,"useStateMachine");var IC="ScrollArea",[UC,GP]=yn(IC),[gR,hr]=UC(IC),xR=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,type:c="hover",dir:l,scrollHideDelay:d=600,...m}=n,[p,g]=f.useState(null),[v,b]=f.useState(null),[w,y]=f.useState(null),[C,S]=f.useState(null),[E,k]=f.useState(null),[N,T]=f.useState(0),[M,_]=f.useState(0),[R,L]=f.useState(!1),[te,K]=f.useState(!1),I=Ie(a,g),G=ki(l);return s.jsx(gR,{scope:o,type:c,dir:G,scrollHideDelay:d,scrollArea:p,viewport:v,onViewportChange:b,content:w,onContentChange:y,scrollbarX:C,onScrollbarXChange:S,scrollbarXEnabled:R,onScrollbarXEnabledChange:L,scrollbarY:E,onScrollbarYChange:k,scrollbarYEnabled:te,onScrollbarYEnabledChange:K,onCornerWidthChange:T,onCornerHeightChange:_,children:s.jsx(Me.div,{dir:G,...m,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":M+"px",...n.style}})})},"ScrollArea")),vR="ScrollAreaViewport",bR=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,children:c,nonce:l,...d}=n,m=hr(vR,o),p=f.useRef(null),g=Ie(a,p,m.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx(yR,{nonce:l}),s.jsx(Me.div,{"data-radix-scroll-area-viewport":"",...d,ref:g,style:{overflowX:m.scrollbarXEnabled?"scroll":"hidden",overflowY:m.scrollbarYEnabled?"scroll":"hidden",...n.style},children:s.jsx("div",{ref:m.onContentChange,style:{minWidth:"100%",display:"table"},children:c})})]})},"ScrollAreaViewport")),yR=f.memo(Fe(function({nonce:n}){return 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:n})},"ScrollAreaViewportStyle"),(t,n)=>t.nonce===n.nonce),Aa="ScrollAreaScrollbar",BC=f.forwardRef(Fe(function(n,a){const{forceMount:o,...c}=n,l=hr(Aa,n.__scopeScrollArea),{onScrollbarXEnabledChange:d,onScrollbarYEnabledChange:m}=l,p=n.orientation==="horizontal";return f.useEffect(()=>(p?d(!0):m(!0),()=>{p?d(!1):m(!1)}),[p,d,m]),l.type==="hover"?s.jsx(wR,{...c,ref:a,forceMount:o}):l.type==="scroll"?s.jsx(jR,{...c,ref:a,forceMount:o}):l.type==="auto"?s.jsx($C,{...c,ref:a,forceMount:o}):l.type==="always"?s.jsx(Xg,{...c,ref:a,"data-state":"visible"}):null},"ScrollAreaScrollbar")),wR=f.forwardRef(Fe(function(n,a){const{forceMount:o,...c}=n,l=hr(Aa,n.__scopeScrollArea),[d,m]=f.useState(!1);return f.useEffect(()=>{const p=l.scrollArea;let g=0;if(p){const v=Fe(()=>{window.clearTimeout(g),m(!0)},"handlePointerEnter"),b=Fe(()=>{g=window.setTimeout(()=>m(!1),l.scrollHideDelay)},"handlePointerLeave");return p.addEventListener("pointerenter",v),p.addEventListener("pointerleave",b),()=>{window.clearTimeout(g),p.removeEventListener("pointerenter",v),p.removeEventListener("pointerleave",b)}}},[l.scrollArea,l.scrollHideDelay]),s.jsx(dn,{present:o||d,children:s.jsx($C,{"data-state":d?"visible":"hidden",...c,ref:a})})},"ScrollAreaScrollbarHover")),jR=f.forwardRef(Fe(function(n,a){const{forceMount:o,...c}=n,l=hr(Aa,n.__scopeScrollArea),d=n.orientation==="horizontal",m=dc(()=>g("SCROLL_END"),100),[p,g]=PC("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(p==="idle"){const v=window.setTimeout(()=>g("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(v)}},[p,l.scrollHideDelay,g]),f.useEffect(()=>{const v=l.viewport,b=d?"scrollLeft":"scrollTop";if(v){let w=v[b];const y=Fe(()=>{const C=v[b];w!==C&&(g("SCROLL"),m()),w=C},"handleScroll");return v.addEventListener("scroll",y),()=>v.removeEventListener("scroll",y)}},[l.viewport,d,g,m]),s.jsx(dn,{present:o||p!=="hidden",children:s.jsx(Xg,{"data-state":p==="hidden"?"hidden":"visible",...c,ref:a,onPointerEnter:je(n.onPointerEnter,()=>g("POINTER_ENTER")),onPointerLeave:je(n.onPointerLeave,()=>g("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),$C=f.forwardRef(Fe(function(n,a){const o=hr(Aa,n.__scopeScrollArea),{forceMount:c,...l}=n,[d,m]=f.useState(!1),p=n.orientation==="horizontal",g=dc(()=>{if(o.viewport){const v=o.viewport.offsetWidth<o.viewport.scrollWidth,b=o.viewport.offsetHeight<o.viewport.scrollHeight;m(p?v:b)}},10);return to(o.viewport,g),to(o.content,g),s.jsx(dn,{present:c||d,children:s.jsx(Xg,{"data-state":d?"visible":"hidden",...l,ref:a})})},"ScrollAreaScrollbarAuto")),Xg=f.forwardRef(Fe(function(n,a){const{orientation:o="vertical",...c}=n,l=hr(Aa,n.__scopeScrollArea),d=f.useRef(null),m=f.useRef(0),[p,g]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),v=Zg(p.viewport,p.content),b={...c,sizes:p,onSizesChange:g,hasThumb:v>0&&v<1,onThumbChange:Fe(y=>d.current=y,"onThumbChange"),onThumbPointerUp:Fe(()=>m.current=0,"onThumbPointerUp"),onThumbPointerDown:Fe(y=>m.current=y,"onThumbPointerDown")};function w(y,C){return FC(y,m.current,p,C)}return Fe(w,"getScrollPosition"),o==="horizontal"?s.jsx(CR,{...b,ref:a,onThumbPositionChange:()=>{if(l.viewport&&d.current){const y=l.viewport.scrollLeft,C=Lh(y,p,l.dir);d.current.style.transform=`translate3d(${C}px, 0, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollLeft=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollLeft=w(y,l.dir))}}):o==="vertical"?s.jsx(SR,{...b,ref:a,onThumbPositionChange:()=>{if(l.viewport&&d.current){const y=l.viewport.scrollTop,C=Lh(y,p);d.current.style.transform=`translate3d(0, ${C}px, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollTop=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollTop=w(y))}}):null},"ScrollAreaScrollbarVisible")),CR=f.forwardRef(Fe(function(n,a){const{sizes:o,onSizesChange:c,...l}=n,d=hr(Aa,n.__scopeScrollArea),[m,p]=f.useState(),g=f.useRef(null),v=Ie(a,g,d.onScrollbarXChange);return f.useEffect(()=>{g.current&&p(getComputedStyle(g.current))},[g]),s.jsx(GC,{"data-orientation":"horizontal",...l,ref:v,sizes:o,style:{bottom:0,left:d.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:d.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":uc(o)+"px",...n.style},onThumbPointerDown:b=>n.onThumbPointerDown(b.x),onDragScroll:b=>n.onDragScroll(b.x),onWheelScroll:(b,w)=>{if(d.viewport){const y=d.viewport.scrollLeft+b.deltaX;n.onWheelScroll(y),Jg(y,w)&&b.preventDefault()}},onResize:()=>{g.current&&d.viewport&&m&&c({content:d.viewport.scrollWidth,viewport:d.viewport.offsetWidth,scrollbar:{size:g.current.clientWidth,paddingStart:Kl(m.paddingLeft),paddingEnd:Kl(m.paddingRight)}})}})},"ScrollAreaScrollbarX")),SR=f.forwardRef(Fe(function(n,a){const{sizes:o,onSizesChange:c,...l}=n,d=hr(Aa,n.__scopeScrollArea),[m,p]=f.useState(),g=f.useRef(null),v=Ie(a,g,d.onScrollbarYChange);return f.useEffect(()=>{g.current&&p(getComputedStyle(g.current))},[g]),s.jsx(GC,{"data-orientation":"vertical",...l,ref:v,sizes:o,style:{top:0,right:d.dir==="ltr"?0:void 0,left:d.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":uc(o)+"px",...n.style},onThumbPointerDown:b=>n.onThumbPointerDown(b.y),onDragScroll:b=>n.onDragScroll(b.y),onWheelScroll:(b,w)=>{if(d.viewport){const y=d.viewport.scrollTop+b.deltaY;n.onWheelScroll(y),Jg(y,w)&&b.preventDefault()}},onResize:()=>{g.current&&d.viewport&&m&&c({content:d.viewport.scrollHeight,viewport:d.viewport.offsetHeight,scrollbar:{size:g.current.clientHeight,paddingStart:Kl(m.paddingTop),paddingEnd:Kl(m.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[NR,HC]=UC(Aa),GC=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,sizes:c,hasThumb:l,onThumbChange:d,onThumbPointerUp:m,onThumbPointerDown:p,onThumbPositionChange:g,onDragScroll:v,onWheelScroll:b,onResize:w,...y}=n,C=hr(Aa,o),[S,E]=f.useState(null),k=Ie(a,E),N=f.useRef(null),T=f.useRef(""),M=C.viewport,_=c.content-c.viewport,R=Vt(b),L=Vt(g),te=dc(w,10);function K(I){if(N.current){const G=I.clientX-N.current.left,Y=I.clientY-N.current.top;v({x:G,y:Y})}}return Fe(K,"handleDragScroll"),f.useEffect(()=>{const I=Fe(G=>{const Y=G.target;(S==null?void 0:S.contains(Y))&&R(G,_)},"handleWheel");return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[M,S,_,R]),f.useEffect(L,[c,L]),to(S,te),to(C.content,te),s.jsx(NR,{scope:o,scrollbar:S,hasThumb:l,onThumbChange:Vt(d),onThumbPointerUp:Vt(m),onThumbPositionChange:L,onThumbPointerDown:Vt(p),children:s.jsx(Me.div,{...y,ref:k,style:{position:"absolute",...y.style},onPointerDown:je(n.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),N.current=S.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C.viewport&&(C.viewport.style.scrollBehavior="auto"),K(I))}),onPointerMove:je(n.onPointerMove,K),onPointerUp:je(n.onPointerUp,I=>{const G=I.target;G.hasPointerCapture(I.pointerId)&&G.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=T.current,C.viewport&&(C.viewport.style.scrollBehavior=""),N.current=null})})})},"ScrollAreaScrollbarImpl")),Oh="ScrollAreaThumb",ER=f.forwardRef(Fe(function(n,a){const{forceMount:o,...c}=n,l=HC(Oh,n.__scopeScrollArea);return s.jsx(dn,{present:o||l.hasThumb,children:s.jsx(kR,{ref:a,...c})})},"ScrollAreaThumb")),kR=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,style:c,...l}=n,d=hr(Oh,o),m=HC(Oh,o),{onThumbPositionChange:p}=m,g=Ie(a,m.onThumbChange),v=f.useRef(void 0),b=dc(()=>{v.current&&(v.current(),v.current=void 0)},100);return f.useEffect(()=>{const w=d.viewport;if(w){const y=Fe(()=>{if(b(),!v.current){const C=RR(w,p);v.current=C,p()}},"handleScroll");return p(),w.addEventListener("scroll",y),()=>w.removeEventListener("scroll",y)}},[d.viewport,b,p]),s.jsx(Me.div,{"data-state":m.hasThumb?"visible":"hidden",...l,ref:g,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...c},onPointerDownCapture:je(n.onPointerDownCapture,w=>{const C=w.target.getBoundingClientRect(),S=w.clientX-C.left,E=w.clientY-C.top;m.onThumbPointerDown({x:S,y:E})}),onPointerUp:je(n.onPointerUp,m.onThumbPointerUp)})},"ScrollAreaThumbImpl")),VC="ScrollAreaCorner",TR=f.forwardRef(Fe(function(n,a){const o=hr(VC,n.__scopeScrollArea),c=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&c?s.jsx(MR,{...n,ref:a}):null},"ScrollAreaCorner")),MR=f.forwardRef(Fe(function(n,a){const{__scopeScrollArea:o,...c}=n,l=hr(VC,o),[d,m]=f.useState(0),[p,g]=f.useState(0),v=!!(d&&p),{onCornerWidthChange:b,onCornerHeightChange:w}=l;return to(l.scrollbarX,()=>{var C;const y=((C=l.scrollbarX)==null?void 0:C.offsetHeight)||0;l.onCornerHeightChange(y),g(y)}),to(l.scrollbarY,()=>{var C;const y=((C=l.scrollbarY)==null?void 0:C.offsetWidth)||0;l.onCornerWidthChange(y),m(y)}),f.useEffect(()=>()=>{b(0),w(0)},[b,w]),v?s.jsx(Me.div,{...c,ref:a,style:{width:d,height:p,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null},"ScrollAreaCornerImpl"));function Kl(t){return t?parseInt(t,10):0}Fe(Kl,"toInt");function Zg(t,n){const a=t/n;return isNaN(a)?0:a}Fe(Zg,"getThumbRatio");function uc(t){const n=Zg(t.viewport,t.content),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=(t.scrollbar.size-a)*n;return Math.max(o,18)}Fe(uc,"getThumbSize");function FC(t,n,a,o="ltr"){const c=uc(a),l=c/2,d=n||l,m=c-d,p=a.scrollbar.paddingStart+d,g=a.scrollbar.size-a.scrollbar.paddingEnd-m,v=a.content-a.viewport,b=o==="ltr"?[0,v]:[v*-1,0];return Qg([p,g],b)(t)}Fe(FC,"getScrollPositionFromPointer");function Lh(t,n,a="ltr"){const o=uc(n),c=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,l=n.scrollbar.size-c,d=n.content-n.viewport,m=l-o,p=a==="ltr"?[0,d]:[d*-1,0],g=ud(t,p);return Qg([0,d],[0,m])(g)}Fe(Lh,"getThumbOffsetFromScroll");function Qg(t,n){return a=>{if(t[0]===t[1]||n[0]===n[1])return n[0];const o=(n[1]-n[0])/(t[1]-t[0]);return n[0]+o*(a-t[0])}}Fe(Qg,"linearScale");function Jg(t,n){return t>0&&t<n}Fe(Jg,"isScrollingWithinScrollbarBounds");var RR=Fe((t,n=()=>{})=>{let a={left:t.scrollLeft,top:t.scrollTop},o=0;return Fe((function c(){const l={left:t.scrollLeft,top:t.scrollTop},d=a.left!==l.left,m=a.top!==l.top;(d||m)&&n(),a=l,o=window.requestAnimationFrame(c)}),"loop")(),()=>window.cancelAnimationFrame(o)},"addUnlinkedScrollListener");function dc(t,n){const a=Vt(t),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])}Fe(dc,"useDebounceCallback");function to(t,n){const a=Vt(n);Ct(()=>{let o=0;if(t){const c=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(a)});return c.observe(t),()=>{window.cancelAnimationFrame(o),c.unobserve(t)}}},[t,a])}Fe(to,"useResizeObserver");var YC=xR,AR=bR,_R=TR;const fc=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(YC,{ref:o,className:pe("relative overflow-hidden",t),...a,children:[s.jsx(AR,{className:"h-full w-full rounded-[inherit]",children:n}),s.jsx(qC,{}),s.jsx(_R,{})]}));fc.displayName=YC.displayName;const qC=f.forwardRef(({className:t,orientation:n="vertical",...a},o)=>s.jsx(BC,{ref:o,orientation:n,className:pe("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",t),...a,children:s.jsx(ER,{className:"relative flex-1 rounded-full bg-[hsl(240_4%_32%)] transition-colors hover:bg-[hsl(240_4%_44%)]"})}));qC.displayName=BC.displayName;function DR(t){const n=Math.floor((Date.now()-t)/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 OR(t){switch(t){case"error":return"bg-destructive";case"update":return"bg-amber-500";case"bot":return"bg-emerald-500";default:return"bg-primary"}}function LR(){const t=ao(),{items:n,unreadCount:a,loading:o,markAllRead:c,dismiss:l,refresh:d}=dR(),[m,p]=f.useState(!1),g=b=>{p(b),b&&(d(),a>0&&c())},v=b=>{p(!1),b.href&&t(b.href)};return s.jsxs(zg,{open:m,onOpenChange:g,children:[s.jsx(Pg,{asChild:!0,children:s.jsxs(ue,{variant:"ghost",size:"icon",className:"relative size-9 text-muted-foreground","aria-label":"Notifications",children:[s.jsx(ve,{icon:N8,size:18}),a>0&&s.jsx(Fn,{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(Fd,{align:"end",className:"w-80 p-0",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[s.jsx(Ig,{className:"p-0 text-sm font-semibold",children:"Notifications"}),n.length>0&&s.jsx(ue,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:()=>void c(),children:"Mark all read"})]}),s.jsx(Fl,{className:"m-0"}),s.jsx(fc,{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(b=>s.jsxs("li",{className:pe("group flex gap-2 border-b border-border/40 px-3 py-2.5 last:border-0",!b.read&&"bg-primary/5"),children:[s.jsx("span",{className:pe("mt-1.5 size-2 shrink-0 rounded-full",OR(b.type))}),s.jsxs("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:()=>v(b),children:[s.jsx("p",{className:"text-sm font-medium leading-tight",children:b.title}),s.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-2",children:b.message}),s.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground/80",children:DR(b.createdAt)})]}),s.jsx(ue,{variant:"ghost",size:"icon",className:"size-7 shrink-0 opacity-0 group-hover:opacity-100","aria-label":"Dismiss",onClick:w=>{w.stopPropagation(),l(b.id)},children:s.jsx(ve,{icon:va,size:14})})]},b.id))})}),s.jsx(Fl,{className:"m-0"}),s.jsx("div",{className:"p-2",children:s.jsx(ue,{variant:"ghost",size:"sm",className:"w-full text-xs",asChild:!0,children:s.jsx(Jt,{to:"/settings",onClick:()=>p(!1),children:"Open settings (updates)"})})})]})]})}var zR=Object.defineProperty,PR=(t,n)=>zR(t,"name",{value:n,configurable:!0});function KC(t){const n=f.useRef({value:t,previous:t});return f.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}PR(KC,"usePrevious");var IR=Object.defineProperty,et=(t,n)=>IR(t,"name",{value:n,configurable:!0}),UR=[" ","Enter","ArrowUp","ArrowDown"],BR=[" ","Enter"],hi="Select",[Zd,Qd,$R]=Td(hi),[co,VP]=yn(hi,[$R,Cs]),ex=Cs(),[HR,Ss]=co(hi),[GR,VR]=co(hi);function WC(t){const{__scopeSelect:n,children:a,open:o,defaultOpen:c,onOpenChange:l,value:d,defaultValue:m,onValueChange:p,dir:g,name:v,autoComplete:b,disabled:w,required:y,form:C,internal_do_not_use_render:S}=t,E=ex(n),[k,N]=f.useState(null),[T,M]=f.useState(null),[_,R]=f.useState(!1),L=ki(g),[te,K]=Hr({prop:o,defaultProp:c??!1,onChange:l,caller:hi}),[I,G]=Hr({prop:d,defaultProp:m,onChange:p,caller:hi}),Y=f.useRef(null),ce=f.useRef(I);f.useEffect(()=>{const D=C?k==null?void 0:k.ownerDocument.getElementById(C):k==null?void 0:k.form;if(D instanceof HTMLFormElement){const $=et(()=>G(ce.current),"reset");return D.addEventListener("reset",$),()=>D.removeEventListener("reset",$)}},[C,k,G]);const fe=k?!!C||!!k.closest("form"):!0,[se,P]=f.useState(new Set),Z=tn(),ae=Array.from(se).map(D=>D.props.value).join(";"),re=f.useCallback(D=>{P($=>new Set($).add(D))},[]),V=f.useCallback(D=>{P($=>{const H=new Set($);return H.delete(D),H})},[]),O={required:y,trigger:k,onTriggerChange:N,valueNode:T,onValueNodeChange:M,valueNodeHasChildren:_,onValueNodeHasChildrenChange:R,contentId:Z,value:I,onValueChange:G,open:te,onOpenChange:K,dir:L,triggerPointerDownPosRef:Y,disabled:w,name:v,autoComplete:b,form:C,nativeOptions:se,nativeSelectKey:ae,isFormControl:fe};return s.jsx(zd,{...E,children:s.jsx(HR,{scope:n,...O,children:s.jsx(Zd.Provider,{scope:n,children:s.jsx(GR,{scope:n,onNativeOptionAdd:re,onNativeOptionRemove:V,children:oS(S)?S(O):a})})})})}et(WC,"SelectProvider");var FR=et(t=>{const{__scopeSelect:n,children:a,...o}=t;return s.jsx(WC,{__scopeSelect:n,...o,internal_do_not_use_render:({isFormControl:c})=>s.jsxs(s.Fragment,{children:[a,c?s.jsx(pA,{__scopeSelect:n}):null]})})},"Select"),YR="SelectTrigger",XC=f.forwardRef(et(function(n,a){const{__scopeSelect:o,disabled:c=!1,...l}=n,d=ex(o),m=Ss(YR,o),p=m.disabled||c,g=Ie(a,m.onTriggerChange),v=Qd(o),b=f.useRef("touch"),[w,y,C]=nx(E=>{const k=v().filter(M=>!M.disabled),N=k.find(M=>M.value===m.value),T=rx(k,E,N);T!==void 0&&m.onValueChange(T.value)}),S=et(E=>{p||(m.onOpenChange(!0),C()),E&&(m.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})},"handleOpen");return s.jsx(Pd,{asChild:!0,...d,children:s.jsx(Me.button,{type:"button",role:"combobox","aria-controls":m.open?m.contentId:void 0,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:p,"data-disabled":p?"":void 0,"data-placeholder":mc(m.value)?"":void 0,...l,ref:g,onClick:je(l.onClick,E=>{E.currentTarget.focus(),b.current!=="mouse"&&S(E)}),onPointerDown:je(l.onPointerDown,E=>{b.current=E.pointerType;const k=E.target;k.hasPointerCapture(E.pointerId)&&k.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(S(E),E.preventDefault())}),onKeyDown:je(l.onKeyDown,E=>{const k=w.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&y(E.key),!(k&&E.key===" ")&&UR.includes(E.key)&&(S(),E.preventDefault())})})})},"SelectTrigger")),qR="SelectValue",KR=f.forwardRef(et(function(n,a){const{__scopeSelect:o,className:c,style:l,children:d,placeholder:m="",...p}=n,g=Ss(qR,o),{onValueNodeHasChildrenChange:v}=g,b=d!==void 0,w=Ie(a,g.onValueNodeChange);Ct(()=>{v(b)},[v,b]);const y=mc(g.value);return s.jsx(Me.span,{...p,asChild:y?!1:p.asChild,ref:w,style:{pointerEvents:"none"},children:s.jsx(f.Fragment,{children:y?m:d},y?"placeholder":"value")})},"SelectValue")),WR=f.forwardRef(et(function(n,a){const{__scopeSelect:o,children:c,...l}=n;return s.jsx(Me.span,{"aria-hidden":!0,...l,ref:a,children:c||"▼"})},"SelectIcon")),XR="SelectPortal",[ZR,QR]=co(XR,{forceMount:void 0}),JR=et(t=>{const{__scopeSelect:n,forceMount:a,...o}=t;return s.jsx(ZR,{scope:t.__scopeSelect,forceMount:a,children:s.jsx(rc,{asChild:!0,...o})})},"SelectPortal"),no="SelectContent",ZC=f.forwardRef(et(function(n,a){const o=QR(no,n.__scopeSelect),{forceMount:c=o.forceMount,...l}=n,d=Ss(no,n.__scopeSelect),[m,p]=f.useState();return Ct(()=>{p(new DocumentFragment)},[]),s.jsx(dn,{present:c||d.open,children:({present:g})=>g?s.jsx(nA,{...l,ref:a}):s.jsx(eA,{...l,fragment:m})})},"SelectContent")),eA=f.forwardRef(et(function(n,a){const{__scopeSelect:o,children:c,fragment:l}=n;return l?so.createPortal(s.jsx(QC,{scope:o,children:s.jsx(Zd.Slot,{scope:o,children:s.jsx("div",{ref:a,children:c})})}),l):null},"SelectContentFragment")),jr=10,[QC,uo]=co(no),tA=Nr("SelectContent.RemoveScroll"),nA=f.forwardRef(et(function(n,a){const{__scopeSelect:o}=n,{position:c="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:d,onPointerDownOutside:m,side:p,sideOffset:g,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:y,collisionPadding:C,sticky:S,hideWhenDetached:E,avoidCollisions:k,...N}=n,T=Ss(no,o),[M,_]=f.useState(null),[R,L]=f.useState(null),te=Ie(a,_),[K,I]=f.useState(null),[G,Y]=f.useState(null),ce=Qd(o),[fe,se]=f.useState(!1),P=f.useRef(!1);f.useEffect(()=>{if(M)return $d(M)},[M]),Ti();const Z=f.useCallback(ge=>{const[me,...B]=ce().map(Ce=>Ce.ref.current),[ie]=B.slice(-1),we=document.activeElement;for(const Ce of ge)if(Ce===we||(Ce==null||Ce.scrollIntoView({block:"nearest"}),Ce===me&&R&&(R.scrollTop=0),Ce===ie&&R&&(R.scrollTop=R.scrollHeight),Ce==null||Ce.focus(),document.activeElement!==we))return},[ce,R]),ae=f.useCallback(()=>Z([K,M]),[Z,K,M]);f.useEffect(()=>{fe&&ae()},[fe,ae]);const{onOpenChange:re,triggerPointerDownPosRef:V}=T;f.useEffect(()=>{if(M){let ge={x:0,y:0};const me=et(ie=>{var we,Ce;ge={x:Math.abs(Math.round(ie.pageX)-(((we=V.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((Ce=V.current)==null?void 0:Ce.y)??0))}},"handlePointerMove"),B=et(ie=>{ge.x<=10&&ge.y<=10?ie.preventDefault():ie.composedPath().includes(M)||re(!1),document.removeEventListener("pointermove",me),V.current=null},"handlePointerUp");return V.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",B,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",B,{capture:!0})}}},[M,re,V]),f.useEffect(()=>{const ge=et(()=>re(!1),"close");return window.addEventListener("blur",ge),window.addEventListener("resize",ge),()=>{window.removeEventListener("blur",ge),window.removeEventListener("resize",ge)}},[re]);const[O,D]=nx(ge=>{const me=ce().filter(we=>!we.disabled),B=me.find(we=>we.ref.current===document.activeElement),ie=rx(me,ge,B);ie&&setTimeout(()=>{var we;return(we=ie.ref.current)==null?void 0:we.focus()})}),$=f.useCallback((ge,me,B)=>{const ie=!P.current&&!B;(T.value!==void 0&&T.value===me||ie)&&(I(ge),ie&&(P.current=!0))},[T.value]),H=f.useCallback(()=>M==null?void 0:M.focus(),[M]),X=f.useCallback((ge,me,B)=>{const ie=!P.current&&!B;(T.value!==void 0&&T.value===me||ie)&&Y(ge)},[T.value]),xe=c==="popper"?S0:rA,q=xe===S0?{side:p,sideOffset:g,align:v,alignOffset:b,arrowPadding:w,collisionBoundary:y,collisionPadding:C,sticky:S,hideWhenDetached:E,avoidCollisions:k}:{};return s.jsx(QC,{scope:o,content:M,viewport:R,onViewportChange:L,itemRefCallback:$,selectedItem:K,onItemLeave:H,itemTextRefCallback:X,focusSelectedItem:ae,selectedItemText:G,position:c,isPositioned:fe,searchRef:O,children:s.jsx(ac,{as:tA,allowPinchZoom:!0,children:s.jsx(Md,{asChild:!0,trapped:T.open,onMountAutoFocus:ge=>{ge.preventDefault()},onUnmountAutoFocus:je(l,ge=>{var me;(me=T.trigger)==null||me.focus({preventScroll:!0}),ge.preventDefault()}),children:s.jsx(nc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:ge=>ge.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:s.jsx(xe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ge=>ge.preventDefault(),...N,...q,onPlaced:()=>se(!0),ref:te,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:je(N.onKeyDown,ge=>{const me=ge.ctrlKey||ge.altKey||ge.metaKey;if(ge.key==="Tab"&&ge.preventDefault(),!me&&ge.key.length===1&&D(ge.key),["ArrowUp","ArrowDown","Home","End"].includes(ge.key)){let ie=ce().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(ge.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(ge.key)){const we=ge.target,Ce=ie.indexOf(we);ie=ie.slice(Ce+1)}setTimeout(()=>Z(ie)),ge.preventDefault()}})})})})})})},"SelectContentImpl")),rA=f.forwardRef(et(function(n,a){const{__scopeSelect:o,onPlaced:c,...l}=n,d=Ss(no,o),m=uo(no,o),[p,g]=f.useState(null),[v,b]=f.useState(null),w=Ie(a,b),y=Qd(o),C=f.useRef(!1),S=f.useRef(!0),{viewport:E,selectedItem:k,selectedItemText:N,focusSelectedItem:T}=m,M=f.useCallback(()=>{if(d.trigger&&d.valueNode&&p&&v&&E&&k&&N){const te=d.trigger.getBoundingClientRect(),K=v.getBoundingClientRect(),I=d.valueNode.getBoundingClientRect(),G=N.getBoundingClientRect();if(d.dir!=="rtl"){const we=G.left-K.left,Ce=I.left-we,ze=te.left-Ce,Ke=te.width+ze,ft=Math.max(Ke,K.width),Pt=window.innerWidth-jr,gn=ud(Ce,[jr,Math.max(jr,Pt-ft)]);p.style.minWidth=Ke+"px",p.style.left=gn+"px"}else{const we=K.right-G.right,Ce=window.innerWidth-I.right-we,ze=window.innerWidth-te.right-Ce,Ke=te.width+ze,ft=Math.max(Ke,K.width),Pt=window.innerWidth-jr,gn=ud(Ce,[jr,Math.max(jr,Pt-ft)]);p.style.minWidth=Ke+"px",p.style.right=gn+"px"}const Y=y(),ce=window.innerHeight-jr*2,fe=E.scrollHeight,se=window.getComputedStyle(v),P=parseInt(se.borderTopWidth,10),Z=parseInt(se.paddingTop,10),ae=parseInt(se.borderBottomWidth,10),re=parseInt(se.paddingBottom,10),V=P+Z+fe+re+ae,O=Math.min(k.offsetHeight*5,V),D=window.getComputedStyle(E),$=parseInt(D.paddingTop,10),H=parseInt(D.paddingBottom,10),X=te.top+te.height/2-jr,xe=ce-X,q=k.offsetHeight/2,ge=k.offsetTop+q,me=P+Z+ge,B=V-me;if(me<=X){const we=Y.length>0&&k===Y[Y.length-1].ref.current;p.style.bottom="0px";const Ce=v.clientHeight-E.offsetTop-E.offsetHeight,ze=Math.max(xe,q+(we?H:0)+Ce+ae),Ke=me+ze;p.style.height=Ke+"px"}else{const we=Y.length>0&&k===Y[0].ref.current;p.style.top="0px";const ze=Math.max(X,P+E.offsetTop+(we?$:0)+q)+B;p.style.height=ze+"px",E.scrollTop=me-X+E.offsetTop}p.style.margin=`${jr}px 0`,p.style.minHeight=O+"px",p.style.maxHeight=ce+"px",c==null||c(),requestAnimationFrame(()=>C.current=!0)}},[y,d.trigger,d.valueNode,p,v,E,k,N,d.dir,c]);Ct(()=>M(),[M]);const[_,R]=f.useState();Ct(()=>{v&&R(window.getComputedStyle(v).zIndex)},[v]);const L=f.useCallback(te=>{te&&S.current===!0&&(M(),T==null||T(),S.current=!1)},[M,T]);return s.jsx(aA,{scope:o,contentWrapper:p,shouldExpandOnScrollRef:C,onScrollButtonChange:L,children:s.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:s.jsx(Me.div,{...l,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),S0=f.forwardRef(et(function(n,a){const{__scopeSelect:o,align:c="start",collisionPadding:l=jr,...d}=n,m=ex(o);return s.jsx(Id,{...m,...d,ref:a,align:c,collisionPadding:l,style:{boxSizing:"border-box",...d.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)"}})},"SelectPopperPosition")),[aA,tx]=co(no,{}),N0="SelectViewport",sA=f.forwardRef(et(function(n,a){const{__scopeSelect:o,nonce:c,...l}=n,d=uo(N0,o),m=tx(N0,o),p=Ie(a,d.onViewportChange),g=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:c}),s.jsx(Zd.Slot,{scope:o,children:s.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:p,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:je(l.onScroll,v=>{const b=v.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:y}=m;if(y!=null&&y.current&&w){const C=Math.abs(g.current-b.scrollTop);if(C>0){const S=window.innerHeight-jr*2,E=parseFloat(w.style.minHeight),k=parseFloat(w.style.height),N=Math.max(E,k);if(N<S){const T=N+C,M=Math.min(S,T),_=T-M;w.style.height=M+"px",w.style.bottom==="0px"&&(b.scrollTop=_>0?_:0,w.style.justifyContent="flex-end")}}}g.current=b.scrollTop})})})]})},"SelectViewport")),oA="SelectGroup",[FP,iA]=co(oA),lA="SelectLabel",JC=f.forwardRef(et(function(n,a){const{__scopeSelect:o,...c}=n,l=iA(lA,o);return s.jsx(Me.div,{id:l.id,...c,ref:a})},"SelectLabel")),zh="SelectItem",[cA,eS]=co(zh),tS=f.forwardRef(et(function(n,a){const{__scopeSelect:o,value:c,disabled:l=!1,textValue:d,...m}=n,p=Ss(zh,o),g=uo(zh,o),v=p.value===c,[b,w]=f.useState(d??""),[y,C]=f.useState(!1),S=Vt(M=>{var _;return(_=g.itemRefCallback)==null?void 0:_.call(g,M,c,l)}),E=Ie(a,S),k=tn(),N=f.useRef("touch"),T=et(()=>{l||(p.onValueChange(c),p.onOpenChange(!1))},"handleSelect");return s.jsx(cA,{scope:o,value:c,disabled:l,textId:k,isSelected:v,onItemTextChange:f.useCallback(M=>{w(_=>_||((M==null?void 0:M.textContent)??"").trim())},[]),children:s.jsx(Zd.ItemSlot,{scope:o,value:c,disabled:l,textValue:b,children:s.jsx(Me.div,{role:"option","aria-labelledby":k,"data-highlighted":y?"":void 0,"aria-selected":v&&y,"data-state":v?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...m,ref:E,onFocus:je(m.onFocus,()=>C(!0)),onBlur:je(m.onBlur,()=>C(!1)),onClick:je(m.onClick,()=>{N.current!=="mouse"&&T()}),onPointerUp:je(m.onPointerUp,()=>{N.current==="mouse"&&T()}),onPointerDown:je(m.onPointerDown,M=>{N.current=M.pointerType}),onPointerMove:je(m.onPointerMove,M=>{var _;N.current=M.pointerType,l?(_=g.onItemLeave)==null||_.call(g):N.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(m.onPointerLeave,M=>{var _;M.currentTarget===document.activeElement&&((_=g.onItemLeave)==null||_.call(g))}),onKeyDown:je(m.onKeyDown,M=>{var R;l||M.target!==M.currentTarget||((R=g.searchRef)==null?void 0:R.current)!==""&&M.key===" "||(BR.includes(M.key)&&T(),M.key===" "&&M.preventDefault())})})})})},"SelectItem")),Pu="SelectItemText",uA=f.forwardRef(et(function(n,a){const{__scopeSelect:o,className:c,style:l,...d}=n,m=Ss(Pu,o),p=uo(Pu,o),g=eS(Pu,o),v=VR(Pu,o),[b,w]=f.useState(null),y=Vt(T=>{var M;return(M=p.itemTextRefCallback)==null?void 0:M.call(p,T,g.value,g.disabled)}),C=Ie(a,w,g.onItemTextChange,y),S=b==null?void 0:b.textContent,E=f.useMemo(()=>s.jsx("option",{value:g.value,disabled:g.disabled,children:S},g.value),[g.disabled,g.value,S]),{onNativeOptionAdd:k,onNativeOptionRemove:N}=v;return Ct(()=>(k(E),()=>N(E)),[k,N,E]),s.jsxs(s.Fragment,{children:[s.jsx(Me.span,{id:g.textId,...d,ref:C}),g.isSelected&&m.valueNode&&!m.valueNodeHasChildren&&!mc(m.value)?so.createPortal(d.children,m.valueNode):null]})},"SelectItemText")),dA="SelectItemIndicator",fA=f.forwardRef(et(function(n,a){const{__scopeSelect:o,...c}=n;return eS(dA,o).isSelected?s.jsx(Me.span,{"aria-hidden":!0,...c,ref:a}):null},"SelectItemIndicator")),E0="SelectScrollUpButton",nS=f.forwardRef(et(function(n,a){const o=uo(E0,n.__scopeSelect),c=tx(E0,n.__scopeSelect),[l,d]=f.useState(!1),m=Ie(a,c.onScrollButtonChange);return Ct(()=>{if(o.viewport&&o.isPositioned){let p=function(){const v=g.scrollTop>0;d(v)};et(p,"handleScroll");const g=o.viewport;return p(),g.addEventListener("scroll",p),()=>g.removeEventListener("scroll",p)}},[o.viewport,o.isPositioned]),l?s.jsx(aS,{...n,ref:m,onAutoScroll:()=>{const{viewport:p,selectedItem:g}=o;p&&g&&(p.scrollTop=p.scrollTop-g.offsetHeight)}}):null},"SelectScrollUpButton")),k0="SelectScrollDownButton",rS=f.forwardRef(et(function(n,a){const o=uo(k0,n.__scopeSelect),c=tx(k0,n.__scopeSelect),[l,d]=f.useState(!1),m=Ie(a,c.onScrollButtonChange);return Ct(()=>{if(o.viewport&&o.isPositioned){let p=function(){const v=g.scrollHeight-g.clientHeight,b=Math.ceil(g.scrollTop)<v;d(b)};et(p,"handleScroll");const g=o.viewport;return p(),g.addEventListener("scroll",p),()=>g.removeEventListener("scroll",p)}},[o.viewport,o.isPositioned]),l?s.jsx(aS,{...n,ref:m,onAutoScroll:()=>{const{viewport:p,selectedItem:g}=o;p&&g&&(p.scrollTop=p.scrollTop+g.offsetHeight)}}):null},"SelectScrollDownButton")),aS=f.forwardRef(et(function(n,a){const{__scopeSelect:o,onAutoScroll:c,...l}=n,d=uo("SelectScrollButton",o),m=f.useRef(null),p=Qd(o),g=f.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return f.useEffect(()=>()=>g(),[g]),Ct(()=>{var b;const v=p().find(w=>w.ref.current===document.activeElement);(b=v==null?void 0:v.ref.current)==null||b.scrollIntoView({block:"nearest"})},[p]),s.jsx(Me.div,{"aria-hidden":!0,...l,ref:a,style:{flexShrink:0,...l.style},onPointerDown:je(l.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(c,50))}),onPointerMove:je(l.onPointerMove,()=>{var v;(v=d.onItemLeave)==null||v.call(d),m.current===null&&(m.current=window.setInterval(c,50))}),onPointerLeave:je(l.onPointerLeave,()=>{g()})})},"SelectScrollButtonImpl")),sS=f.forwardRef(et(function(n,a){const{__scopeSelect:o,...c}=n;return s.jsx(Me.div,{"aria-hidden":!0,...c,ref:a})},"SelectSeparator")),mA="SelectBubbleInput",pA=f.forwardRef(et(function({__scopeSelect:n,...a},o){const c=Ss(mA,n),{value:l,onValueChange:d,required:m,disabled:p,name:g,autoComplete:v,form:b}=c,{nativeOptions:w,nativeSelectKey:y}=c,C=f.useRef(null),S=Ie(o,C),E=l??"",k=KC(E),N=Array.from(w).some(T=>(T.props.value??"")==="");return f.useEffect(()=>{const T=C.current;if(!T)return;const M=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(M,"value").set;if(k!==E&&R){const L=new Event("change",{bubbles:!0});R.call(T,E),T.dispatchEvent(L)}},[k,E]),s.jsxs(Me.select,{"aria-hidden":!0,required:m,tabIndex:-1,name:g,autoComplete:v,disabled:p,form:b,onChange:T=>d(T.target.value),...a,style:{...Kj,...a.style},ref:S,defaultValue:E,children:[mc(l)&&!N?s.jsx("option",{value:""}):null,Array.from(w)]},y)},"SelectBubbleInput"));function oS(t){return typeof t=="function"}et(oS,"isFunction");function mc(t){return t===""||t===void 0}et(mc,"shouldShowPlaceholder");function nx(t){const n=Vt(t),a=f.useRef(""),o=f.useRef(0),c=f.useCallback(d=>{const m=a.current+d;n(m),et((function p(g){a.current=g,window.clearTimeout(o.current),g!==""&&(o.current=window.setTimeout(()=>p(""),1e3))}),"updateSearch")(m)},[n]),l=f.useCallback(()=>{a.current="",window.clearTimeout(o.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(o.current),[]),[a,c,l]}et(nx,"useTypeaheadSearch");function rx(t,n,a){const c=n.length>1&&Array.from(n).every(g=>g===n[0])?n[0]:n,l=a?t.indexOf(a):-1;let d=iS(t,Math.max(l,0));c.length===1&&(d=d.filter(g=>g!==a));const p=d.find(g=>g.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==a?p:void 0}et(rx,"findNextItem");function iS(t,n){return t.map((a,o)=>t[(n+o)%t.length])}et(iS,"wrapArray");const Ca=FR,Sa=KR,Br=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(XC,{ref:o,className:pe("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",t),...a,children:[n,s.jsx(WR,{asChild:!0,children:s.jsx(Lj,{className:"h-4 w-4 opacity-50"})})]}));Br.displayName=XC.displayName;const lS=f.forwardRef(({className:t,...n},a)=>s.jsx(nS,{ref:a,className:pe("flex cursor-default items-center justify-center py-1",t),...n,children:s.jsx(PT,{className:"h-4 w-4"})}));lS.displayName=nS.displayName;const cS=f.forwardRef(({className:t,...n},a)=>s.jsx(rS,{ref:a,className:pe("flex cursor-default items-center justify-center py-1",t),...n,children:s.jsx(Lj,{className:"h-4 w-4"})}));cS.displayName=rS.displayName;const $r=f.forwardRef(({className:t,children:n,position:a="popper",...o},c)=>s.jsx(JR,{children:s.jsxs(ZC,{ref:c,className:pe("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",t),position:a,...o,children:[s.jsx(lS,{}),s.jsx(sA,{className:pe("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),s.jsx(cS,{})]})}));$r.displayName=ZC.displayName;const hA=f.forwardRef(({className:t,...n},a)=>s.jsx(JC,{ref:a,className:pe("px-2 py-1.5 text-sm font-semibold",t),...n}));hA.displayName=JC.displayName;const vt=f.forwardRef(({className:t,children:n,...a},o)=>s.jsxs(tS,{ref:o,className:pe("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",t),...a,children:[s.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(fA,{children:s.jsx(Oj,{className:"h-4 w-4"})})}),s.jsx(uA,{children:n})]}));vt.displayName=tS.displayName;const gA=f.forwardRef(({className:t,...n},a)=>s.jsx(sS,{ref:a,className:pe("-mx-1 my-1 h-px bg-muted",t),...n}));gA.displayName=sS.displayName;function xA(){const{stats:t}=kd(),{user:n,logout:a,availableGroups:o,isImpersonating:c,impersonatedGroup:l,impersonateGroup:d,stopImpersonation:m,hasPermission:p}=qt();n!=null&&n.isOwner||p("users.manage");const g=(t==null?void 0:t.bot.username)??"SupportBot",v=n?P2(n):g,b=(n==null?void 0:n.avatar)??(t==null?void 0:t.bot.avatar),w=t==null?void 0:t.bot.inviteUrl,y=new Intl.DateTimeFormat("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"}).format(new Date);return s.jsxs(s.Fragment,{children:[c&&l&&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:l.color||"#10B981"}}),s.jsx("span",{className:"font-semibold text-xs text-foreground",children:l.name})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2.5",children:[o.length>1&&s.jsxs(Ca,{value:l.id,onValueChange:C=>d(C),children:[s.jsx(Br,{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(Sa,{})}),s.jsx($r,{className:"border-border bg-card",children:o.map(C=>s.jsx(vt,{value:C.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"size-2 rounded-full shrink-0",style:{backgroundColor:C.color||"#10B981"}}),s.jsx("span",{children:C.name})]})},C.id))})]}),s.jsx(ue,{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(cC,{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:y}),s.jsx(nR,{className:"min-w-0 flex-1"}),s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[w?s.jsx(ue,{variant:"ghost",size:"icon",className:"hidden size-9 text-muted-foreground sm:inline-flex",asChild:!0,children:s.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer","aria-label":"Invite bot to a server",title:"Invite bot to a server",children:s.jsx(ve,{icon:nh,size:18})})}):s.jsx(ue,{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(ve,{icon:nh,size:18})}),s.jsx(LR,{}),s.jsxs(zg,{children:[s.jsx(Pg,{asChild:!0,children:s.jsxs(ue,{variant:"ghost",className:"h-9 gap-2 rounded-full px-2 hover:bg-secondary",children:[s.jsxs(bs,{className:"size-7",children:[s.jsx(eo,{src:b,alt:v}),s.jsx(ys,{className:"bg-primary/20 text-xs text-primary",children:v.slice(0,2).toUpperCase()})]}),s.jsx("span",{className:"hidden max-w-[100px] truncate text-sm font-medium sm:inline",children:v}),s.jsx(ve,{icon:k2,size:16,className:"text-muted-foreground"})]})}),s.jsxs(Fd,{align:"end",className:"w-56",children:[s.jsx(Ig,{children:"Account"}),s.jsx(Fl,{}),n?s.jsxs(Vl,{disabled:!0,className:"text-xs text-muted-foreground",children:[n.username,n.id?` · ${n.id}`:""]}):null,s.jsx(Fl,{}),s.jsx(Vl,{onClick:()=>{a()},children:"Sign out"})]})]})]})]})]})}const T0={error:0,warning:1,info:2};function vA(t){return[...t].sort((n,a)=>{const o=T0[n.severity]??9,c=T0[a.severity]??9;return o!==c?o-c:n.title.localeCompare(a.title)})}function bA(t){const n=new Set;return t.filter(a=>n.has(a.id)?!1:(n.add(a.id),!0))}class yA{constructor(){vy(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([Ne.getAlerts().catch(()=>({data:[]})),this.evaluateClientProviders()]),o=n.data??[];return vA(bA([...o,...a]))}}const wA=new yA,jA={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"}},CA=Ni("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"}}),Ye=f.forwardRef(({className:t,variant:n,...a},o)=>s.jsx("div",{ref:o,role:"alert",className:pe(CA({variant:n}),t),...a}));Ye.displayName="Alert";const uS=f.forwardRef(({className:t,...n},a)=>s.jsx("h5",{ref:a,className:pe("mb-1 font-medium leading-none tracking-tight",t),...n}));uS.displayName="AlertTitle";const qe=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("text-sm [&_p]:leading-relaxed",t),...n}));qe.displayName="AlertDescription";function SA(t){return t==="info"?w8:ig}function NA({alert:t,context:n}){var d,m,p;const a=jA[t.severity],o=((d=t.meta)==null?void 0:d.extraGuilds)??[],c=(m=t.meta)==null?void 0:m.status,l=(p=t.meta)==null?void 0:p.progress;return s.jsxs(Ye,{variant:"destructive",className:`${a.border} ${a.bg} text-foreground`,children:[s.jsx(ve,{icon:SA(t.severity),size:18,className:a.icon}),s.jsx(uS,{className:a.title,children:t.title}),s.jsxs(qe,{className:"space-y-3 text-sm text-muted-foreground",children:[s.jsx("p",{children:t.message}),t.category==="guild"&&c==="missing_config"?s.jsxs("p",{children:["Open"," ",s.jsx(Jt,{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,t.category==="modules"&&l?s.jsxs("p",{className:"text-xs",children:["Progress: ",s.jsx("span",{className:"text-foreground",children:l})]}):null,o.length>0?s.jsx("ul",{className:"space-y-2",children:o.map(g=>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:g.name}),s.jsx("span",{className:"ml-2 font-mono text-xs",children:g.id})]}),n.canLeaveGuild?s.jsxs(ue,{type:"button",size:"sm",variant:"outline",disabled:n.leavingGuildId===g.id,onClick:()=>void n.onLeaveGuild(g.id),children:[s.jsx(ve,{icon:j8,size:14,className:"mr-1.5"}),n.leavingGuildId===g.id?"Leaving…":"Leave server"]}):null]},g.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:[t.action?s.jsx(ue,{asChild:!0,size:"sm",variant:"secondary",children:s.jsx(Jt,{to:t.action.href,children:t.action.label})}):null,t.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 EA=15e3;function kA(){const{hasPermission:t}=qt(),n=t("settings.update"),[a,o]=f.useState([]),[c,l]=f.useState(null),[d,m]=f.useState(""),p=f.useCallback(async()=>{try{const b=await wA.loadAll();o(b),m("")}catch{}},[]);f.useEffect(()=>{p();const b=window.setInterval(()=>void p(),EA);return()=>window.clearInterval(b)},[p]);async function g(b){if(n){l(b),m("");try{await Ne.leaveGuild(b),await p()}catch(w){m(w instanceof Error?w.message:"Could not leave server")}finally{l(null)}}}if(a.length===0)return null;const v={canLeaveGuild:n,onLeaveGuild:g,leavingGuildId:c,actionError:d};return s.jsx("div",{className:"space-y-3",children:a.map(b=>s.jsx(NA,{alert:b,context:v},b.id))})}function TA(){return s.jsx($8,{children:s.jsx(uR,{children:s.jsxs(iC,{children:[s.jsx(rM,{}),s.jsxs(dC,{className:"min-h-svh bg-background",children:[s.jsx(xA,{}),s.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4 md:p-6 lg:p-8",children:[s.jsx(kA,{}),s.jsx(_N,{})]})]})]})})})}const dS=f.createContext(null);function MA({children:t}){const[n,a]=f.useState(null),[o,c]=f.useState(!0),[l,d]=f.useState(""),m=f.useCallback(async()=>{d("");try{const g=await Ne.getSetupStatus();a(g.data??null)}catch(g){d(g instanceof Error?g.message:"Could not load setup status"),a(null)}},[]);f.useEffect(()=>{m().finally(()=>c(!1))},[m]);const p=f.useMemo(()=>({status:n,loading:o,error:l,complete:!!(n!=null&&n.complete),refresh:m}),[n,o,l,m]);return s.jsx(dS.Provider,{value:p,children:t})}function fS(){const t=f.useContext(dS);if(!t)throw new Error("useSetup must be used within SetupProvider");return t}var RA=Object.defineProperty,AA=(t,n)=>RA(t,"name",{value:n,configurable:!0}),_A=f.forwardRef(AA(function(n,a){return s.jsx(Me.label,{...n,ref:a,onMouseDown:o=>{var l;o.target.closest("button, input, select, textarea")||((l=n.onMouseDown)==null||l.call(n,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}})},"Label")),mS=_A;const DA=Ni("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_e=f.forwardRef(({className:t,...n},a)=>s.jsx(mS,{ref:a,className:pe(DA(),t),...n}));_e.displayName=mS.displayName;var OA=Object.defineProperty,ws=(t,n)=>OA(t,"name",{value:n,configurable:!0}),ax="Switch",[LA,YP]=yn(ax),[zA,sx]=LA(ax);function pS(t){const{__scopeSwitch:n,checked:a,children:o,defaultChecked:c,disabled:l,form:d,name:m,onCheckedChange:p,required:g,value:v="on",internal_do_not_use_render:b}=t,[w,y]=Hr({prop:a,defaultProp:c??!1,onChange:p,caller:ax}),[C,S]=f.useState(null),[E,k]=f.useState(null),N=f.useRef(!1),[T,M]=f.useReducer(L=>L+1,0),_=C?!!d||!!C.closest("form"):!0,R={checked:w,setChecked:y,disabled:l,control:C,setControl:S,name:m,form:d,value:v,hasConsumerStoppedPropagationRef:N,userInteractionCount:T,onUserInteraction:M,required:g,defaultChecked:c,isFormControl:_,bubbleInput:E,setBubbleInput:k};return s.jsx(zA,{scope:n,...R,children:gS(b)?b(R):o})}ws(pS,"SwitchProvider");var PA="SwitchTrigger",IA=f.forwardRef(ws(function({__scopeSwitch:n,onClick:a,...o},c){const{control:l,form:d,value:m,disabled:p,checked:g,required:v,setControl:b,setChecked:w,hasConsumerStoppedPropagationRef:y,onUserInteraction:C,isFormControl:S,bubbleInput:E}=sx(PA,n),k=Ie(c,b),N=f.useRef(g);return f.useEffect(()=>{const T=d?l==null?void 0:l.ownerDocument.getElementById(d):l==null?void 0:l.form;if(T instanceof HTMLFormElement){const M=ws(()=>w(N.current),"reset");return T.addEventListener("reset",M),()=>T.removeEventListener("reset",M)}},[l,d,w]),s.jsx(Me.button,{type:"button",role:"switch","aria-checked":g,"aria-required":v,"data-state":ox(g),"data-disabled":p?"":void 0,disabled:p,value:m,...o,ref:k,onClick:je(a,T=>{C(),w(M=>!M),E&&S&&(y.current=T.isPropagationStopped(),y.current||T.stopPropagation())})})},"SwitchTrigger")),hS=f.forwardRef(ws(function(n,a){const{__scopeSwitch:o,name:c,checked:l,defaultChecked:d,required:m,disabled:p,value:g,onCheckedChange:v,form:b,...w}=n;return s.jsx(pS,{__scopeSwitch:o,checked:l,defaultChecked:d,disabled:p,required:m,onCheckedChange:v,name:c,form:b,value:g,internal_do_not_use_render:({isFormControl:y})=>s.jsxs(s.Fragment,{children:[s.jsx(IA,{...w,ref:a,__scopeSwitch:o}),y&&s.jsx(HA,{__scopeSwitch:o})]})})},"Switch")),UA="SwitchThumb",BA=f.forwardRef(ws(function(n,a){const{__scopeSwitch:o,...c}=n,l=sx(UA,o);return s.jsx(Me.span,{"data-state":ox(l.checked),"data-disabled":l.disabled?"":void 0,...c,ref:a})},"SwitchThumb")),$A="SwitchBubbleInput",HA=f.forwardRef(ws(function({__scopeSwitch:n,onClick:a,...o},c){const{control:l,hasConsumerStoppedPropagationRef:d,userInteractionCount:m,checked:p,defaultChecked:g,required:v,disabled:b,name:w,value:y,form:C,bubbleInput:S,setBubbleInput:E}=sx($A,n),k=Ie(c,E),N=kg(l),T=f.useRef(!1),M=f.useRef(p),_=f.useRef(m);f.useEffect(()=>{const L=S;if(!L)return;const te=window.HTMLInputElement.prototype,I=Object.getOwnPropertyDescriptor(te,"checked").set,G=m!==_.current;_.current=m;const Y=M.current!==p;M.current=p;const ce=!(G&&d.current);if(Y&&I){T.current=!G;const fe=new Event("click",{bubbles:ce});I.call(L,p),L.dispatchEvent(fe),T.current=!1}},[S,p,d,m]);const R=f.useRef(p);return s.jsx(Me.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??R.current,required:v,disabled:b,name:w,value:y,form:C,...o,tabIndex:-1,ref:k,onClick:je(a,L=>{T.current&&L.stopPropagation()}),style:{...o.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function gS(t){return typeof t=="function"}ws(gS,"isFunction");function ox(t){return t?"checked":"unchecked"}ws(ox,"getState");const kt=f.forwardRef(({className:t,...n},a)=>s.jsx(hS,{className:pe("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",t),...n,ref:a,children:s.jsx(BA,{className:pe("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")})}));kt.displayName=hS.displayName;const Jd=f.forwardRef(({className:t,...n},a)=>s.jsx("textarea",{className:pe("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",t),ref:a,...n}));Jd.displayName="Textarea";function ef(){return(ef=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o])}return t}).apply(this,arguments)}function xS(t,n){if(t==null)return{};var a,o,c={},l=Object.keys(t);for(o=0;o<l.length;o++)n.indexOf(a=l[o])>=0||(c[a]=t[a]);return c}function Dl(t){var n=f.useRef(t),a=f.useRef(function(o){n.current&&n.current(o)});return n.current=t,a.current}var Wl=function(t,n,a){return n===void 0&&(n=0),a===void 0&&(a=1),t>a?a:t<n?n:t},Ol=function(t){return"touches"in t},Ph=function(t){return t&&t.ownerDocument.defaultView||self},M0=function(t,n,a){var o=t.getBoundingClientRect(),c=Ol(n)?(function(l,d){for(var m=0;m<l.length;m++)if(l[m].identifier===d)return l[m];return l[0]})(n.touches,a):n;return{left:Wl((c.pageX-(o.left+Ph(t).pageXOffset))/o.width),top:Wl((c.pageY-(o.top+Ph(t).pageYOffset))/o.height)}},R0=function(t){!Ol(t)&&t.preventDefault()},vS=be.memo(function(t){var n=t.onMove,a=t.onKey,o=t.onEnd,c=xS(t,["onMove","onKey","onEnd"]),l=f.useRef(null),d=Dl(n),m=Dl(a),p=Dl(o),g=f.useRef(null),v=f.useRef(!1),b=f.useMemo(function(){var E=function(T){R0(T),(Ol(T)?T.touches.length>0:T.buttons>0)&&l.current?d(M0(l.current,T,g.current)):(N(!1),p())},k=function(){N(!1),p()};function N(T){var M=v.current,_=Ph(l.current),R=T?_.addEventListener:_.removeEventListener;R(M?"touchmove":"mousemove",E),R(M?"touchend":"mouseup",k)}return[function(T){var M=T.nativeEvent,_=l.current;if(_&&(R0(M),!(function(L,te){return te&&!Ol(L)})(M,v.current)&&_)){if(Ol(M)){v.current=!0;var R=M.changedTouches||[];R.length&&(g.current=R[0].identifier)}_.focus(),d(M0(_,M,g.current)),N(!0)}},function(T){var M=T.which||T.keyCode;M<37||M>40||(T.preventDefault(),m({left:M===39?.05:M===37?-.05:0,top:M===40?.05:M===38?-.05:0}))},function(T){var M=T.which||T.keyCode;M>=37&&M<=40&&p()},N]},[m,d,p]),w=b[0],y=b[1],C=b[2],S=b[3];return f.useEffect(function(){return S},[S]),be.createElement("div",ef({},c,{onTouchStart:w,onMouseDown:w,className:"react-colorful__interactive",ref:l,onKeyDown:y,onKeyUp:C,tabIndex:0,role:"slider"}))}),ix=function(t){return t.filter(Boolean).join(" ")},bS=function(t){var n=t.color,a=t.left,o=t.top,c=o===void 0?.5:o,l=ix(["react-colorful__pointer",t.className]);return be.createElement("div",{className:l,style:{top:100*c+"%",left:100*a+"%"}},be.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:n}}))},un=function(t,n,a){return n===void 0&&(n=0),a===void 0&&(a=Math.pow(10,n)),Math.round(a*t)/a},GA=function(t){return KA(Ih(t))},Ih=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?un(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?un(parseInt(t.substring(6,8),16)/255,2):1}},VA=function(t){return qA(YA(t))},FA=function(t){var n=t.s,a=t.v,o=t.a,c=(200-n)*a/100;return{h:un(t.h),s:un(c>0&&c<200?n*a/100/(c<=100?c:200-c)*100:0),l:un(c/2),a:un(o,2)}},Uh=function(t){var n=FA(t);return"hsl("+n.h+", "+n.s+"%, "+n.l+"%)"},YA=function(t){var n=t.h,a=t.s,o=t.v,c=t.a;n=n/360*6,a/=100,o/=100;var l=Math.floor(n),d=o*(1-a),m=o*(1-(n-l)*a),p=o*(1-(1-n+l)*a),g=l%6;return{r:un(255*[o,m,d,d,p,o][g]),g:un(255*[p,o,o,m,d,d][g]),b:un(255*[d,d,p,o,o,m][g]),a:un(c,2)}},Iu=function(t){var n=t.toString(16);return n.length<2?"0"+n:n},qA=function(t){var n=t.r,a=t.g,o=t.b,c=t.a,l=c<1?Iu(un(255*c)):"";return"#"+Iu(n)+Iu(a)+Iu(o)+l},KA=function(t){var n=t.r,a=t.g,o=t.b,c=t.a,l=Math.max(n,a,o),d=l-Math.min(n,a,o),m=d?l===n?(a-o)/d:l===a?2+(o-n)/d:4+(n-a)/d:0;return{h:un(60*(m<0?m+6:m)),s:un(l?d/l*100:0),v:un(l/255*100),a:c}},WA=be.memo(function(t){var n=t.hue,a=t.onChange,o=t.onChangeEnd,c=ix(["react-colorful__hue",t.className]);return be.createElement("div",{className:c},be.createElement(vS,{onMove:function(l){a({h:360*l.left})},onKey:function(l){a({h:Wl(n+360*l.left,0,360)})},onEnd:o,"aria-label":"Hue","aria-valuenow":un(n),"aria-valuemax":"360","aria-valuemin":"0"},be.createElement(bS,{className:"react-colorful__hue-pointer",left:n/360,color:Uh({h:n,s:100,v:100,a:1})})))}),XA=be.memo(function(t){var n=t.hsva,a=t.onChange,o=t.onChangeEnd,c={backgroundColor:Uh({h:n.h,s:100,v:100,a:1})};return be.createElement("div",{className:"react-colorful__saturation",style:c},be.createElement(vS,{onMove:function(l){a({s:100*l.left,v:100-100*l.top})},onKey:function(l){a({s:Wl(n.s+100*l.left,0,100),v:Wl(n.v-100*l.top,0,100)})},onEnd:o,"aria-label":"Color","aria-valuetext":"Saturation "+un(n.s)+"%, Brightness "+un(n.v)+"%"},be.createElement(bS,{className:"react-colorful__saturation-pointer",top:1-n.v/100,left:n.s/100,color:Uh(n)})))}),yS=function(t,n){if(t===n)return!0;for(var a in t)if(t[a]!==n[a])return!1;return!0},ZA=function(t,n){return t.toLowerCase()===n.toLowerCase()||yS(Ih(t),Ih(n))};function QA(t,n,a,o){var c=Dl(a),l=Dl(o),d=f.useState(function(){return t.toHsva(n)}),m=d[0],p=d[1],g=f.useRef({color:n,hsva:m}),v=f.useRef(!1);f.useEffect(function(){if(!t.equal(n,g.current.color)){var y=t.toHsva(n);g.current={hsva:y,color:n},p(y),v.current=!1}},[n,t]),f.useEffect(function(){var y;yS(m,g.current.hsva)||t.equal(y=t.fromHsva(m),g.current.color)||(g.current={hsva:m,color:y},c(y),v.current=!0)},[m,t,c]);var b=f.useCallback(function(y){p(function(C){return Object.assign({},C,y)})},[]),w=f.useCallback(function(){v.current&&(v.current=!1,l(g.current.color))},[l]);return[m,b,w]}var JA=typeof window<"u"?f.useLayoutEffect:f.useEffect,e_=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},A0=new WeakMap,t_=function(t){JA(function(){var n=t.current;if(typeof document<"u"&&n){var a=n.getRootNode?n.getRootNode():n.ownerDocument,o=a&&("head"in a||"host"in a)?a:n.ownerDocument;if(!A0.has(o)){var c="head"in o?o.head:o,l=(c.ownerDocument||document).createElement("style");l.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}`;var d=e_();d&&l.setAttribute("nonce",d),A0.set(o,l),c.appendChild(l)}}},[])},n_=function(t){var n=t.className,a=t.colorModel,o=t.color,c=o===void 0?a.defaultColor:o,l=t.onChange,d=t.onChangeEnd,m=xS(t,["className","colorModel","color","onChange","onChangeEnd"]),p=f.useRef(null);t_(p);var g=QA(a,c,l,d),v=g[0],b=g[1],w=g[2],y=ix(["react-colorful",n]);return be.createElement("div",ef({},m,{ref:p,className:y}),be.createElement(XA,{hsva:v,onChange:b,onChangeEnd:w}),be.createElement(WA,{hue:v.h,onChange:b,onChangeEnd:w,className:"react-colorful__last-control"}))},r_={defaultColor:"000",toHsva:GA,fromHsva:function(t){return VA({h:t.h,s:t.s,v:t.v,a:1})},equal:ZA},a_=function(t){return be.createElement(n_,ef({},t,{colorModel:r_}))};function Ur(t,n="#000000"){let a=String(t??"").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(c=>c+c).join("").toLowerCase()}`:/^[0-9a-fA-F]{6}$/.test(o)?`#${o.toLowerCase()}`:n}function Bh(t){const n=String(t??"").trim();return/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(n)||/^[0-9a-fA-F]{6}$/.test(n)}function s_(t){const n=f.useRef(null);return f.useEffect(()=>{t&&(typeof t=="function"?t(n.current):t.current=n.current)}),n}var o_=Object.defineProperty,Ns=(t,n)=>o_(t,"name",{value:n,configurable:!0}),lx="Popover",[wS,qP]=yn(lx,[Cs]),cx=Cs(),[i_,Ai]=wS(lx),l_=Ns(t=>{const{__scopePopover:n,children:a,open:o,defaultOpen:c,onOpenChange:l,modal:d=!1}=t,m=cx(n),p=f.useRef(null),[g,v]=f.useState(!1),[b,w]=Hr({prop:o,defaultProp:c??!1,onChange:l,caller:lx});return s.jsx(zd,{...m,children:s.jsx(i_,{scope:n,contentId:tn(),triggerRef:p,open:b,onOpenChange:w,onOpenToggle:f.useCallback(()=>w(y=>!y),[w]),hasCustomAnchor:g,onCustomAnchorAdd:f.useCallback(()=>v(!0),[]),onCustomAnchorRemove:f.useCallback(()=>v(!1),[]),modal:d,children:a})})},"Popover"),c_="PopoverTrigger",u_=f.forwardRef(Ns(function(n,a){const{__scopePopover:o,...c}=n,l=Ai(c_,o),d=cx(o),m=Ie(a,l.triggerRef),p=s.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":ux(l.open),...c,ref:m,onClick:je(n.onClick,l.onOpenToggle)});return l.hasCustomAnchor?p:s.jsx(Pd,{asChild:!0,...d,children:p})},"PopoverTrigger")),jS="PopoverPortal",[d_,f_]=wS(jS,{forceMount:void 0}),m_=Ns(t=>{const{__scopePopover:n,forceMount:a,children:o,container:c}=t,l=Ai(jS,n);return s.jsx(d_,{scope:n,forceMount:a,children:s.jsx(dn,{present:a||l.open,children:s.jsx(rc,{asChild:!0,container:c,children:o})})})},"PopoverPortal"),Xl="PopoverContent",p_=f.forwardRef(Ns(function(n,a){const o=f_(Xl,n.__scopePopover),{forceMount:c=o.forceMount,...l}=n,d=Ai(Xl,n.__scopePopover);return s.jsx(dn,{present:c||d.open,children:d.modal?s.jsx(g_,{...l,ref:a}):s.jsx(x_,{...l,ref:a})})},"PopoverContent")),h_=Nr("PopoverContent.RemoveScroll"),g_=f.forwardRef(Ns(function(n,a){const o=Ai(Xl,n.__scopePopover),c=f.useRef(null),l=Ie(a,c),d=f.useRef(!1);return f.useEffect(()=>{const m=c.current;if(m)return $d(m)},[]),s.jsx(ac,{as:h_,allowPinchZoom:!0,children:s.jsx(CS,{...n,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(n.onCloseAutoFocus,m=>{var p;m.preventDefault(),d.current||(p=o.triggerRef.current)==null||p.focus()}),onPointerDownOutside:je(n.onPointerDownOutside,m=>{const p=m.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0,v=p.button===2||g;d.current=v},{checkForDefaultPrevented:!1}),onFocusOutside:je(n.onFocusOutside,m=>m.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),x_=f.forwardRef(Ns(function(n,a){const o=Ai(Xl,n.__scopePopover),c=f.useRef(!1),l=f.useRef(!1);return s.jsx(CS,{...n,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,p;(m=n.onCloseAutoFocus)==null||m.call(n,d),d.defaultPrevented||(c.current||(p=o.triggerRef.current)==null||p.focus(),d.preventDefault()),c.current=!1,l.current=!1},onInteractOutside:d=>{var g,v;(g=n.onInteractOutside)==null||g.call(n,d),d.defaultPrevented||(c.current=!0,d.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const m=d.target;((v=o.triggerRef.current)==null?void 0:v.contains(m))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.current&&d.preventDefault()}})},"PopoverContentNonModal")),CS=f.forwardRef(Ns(function(n,a){const{__scopePopover:o,trapFocus:c,onOpenAutoFocus:l,onCloseAutoFocus:d,disableOutsidePointerEvents:m,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:b,...w}=n,y=Ai(Xl,o),C=cx(o);return Ti(),s.jsx(Md,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:l,onUnmountAutoFocus:d,children:s.jsx(nc,{asChild:!0,disableOutsidePointerEvents:m,onInteractOutside:b,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:v,onDismiss:()=>y.onOpenChange(!1),deferPointerDownOutside:!0,children:s.jsx(Id,{"data-state":ux(y.open),role:"dialog",id:y.contentId,...C,...w,ref:a,style:{...w.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)"}})})})},"PopoverContentImpl"));function ux(t){return t?"open":"closed"}Ns(ux,"getState");var v_=l_,b_=u_,y_=m_,SS=p_;const NS=v_,ES=b_,dx=f.forwardRef(({className:t,align:n="center",sideOffset:a=4,...o},c)=>s.jsx(y_,{children:s.jsx(SS,{ref:c,align:n,sideOffset:a,className:pe("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]",t),...o})}));dx.displayName=SS.displayName;const tf=f.forwardRef(({disabled:t,value:n,onChange:a,onBlur:o,name:c,className:l,size:d,...m},p)=>{const g=s_(p),[v,b]=f.useState(!1),[w,y]=f.useState(""),C=f.useMemo(()=>Ur(n,"#ffffff"),[n]),S=v&&w?w:C;function E(k){Bh(k)&&a(Ur(k)),y("")}return s.jsxs(NS,{open:v,onOpenChange:k=>{k||E(w||C),b(k)},children:[s.jsx(ES,{asChild:!0,disabled:t,onBlur:o,children:s.jsx(ue,{...m,type:"button",className:pe("size-10 shrink-0 overflow-hidden rounded-md border border-border p-0 shadow-sm",l),name:c,onClick:()=>b(!0),size:d??"icon",style:{backgroundColor:C},variant:"outline","aria-label":"Pick colour",children:s.jsx("span",{className:"sr-only",children:C})})}),s.jsxs(dx,{className:"w-auto border-border bg-card p-3",align:"start",children:[s.jsx(a_,{className:"color-picker-swatch",color:C,onChange:k=>{y(""),a(Ur(k))}}),s.jsx(De,{ref:g,maxLength:7,value:S,onChange:k=>{const N=k.currentTarget.value;y(N),Bh(N)&&a(Ur(N))},onBlur:()=>E(w||C),onKeyDown:k=>{k.key==="Enter"&&(E(w||C),b(!1))},className:"mt-3 border-border bg-secondary/30 font-mono text-sm uppercase",placeholder:"#000000"})]})]})});tf.displayName="ColorPicker";function w_({value:t,onChange:n,placeholder:a="Add item…"}){const o=Array.isArray(t)?t:[];return s.jsxs("div",{className:"space-y-2",children:[o.map((c,l)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(De,{value:c,onChange:d=>{const m=[...o];m[l]=d.target.value,n(m)},placeholder:a,className:"border-border bg-secondary/30"}),s.jsx(ue,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 text-destructive hover:bg-destructive/10",onClick:()=>n(o.filter((d,m)=>m!==l)),children:s.jsx(ve,{icon:wi,size:16})})]},l)),s.jsxs(ue,{type:"button",variant:"outline",size:"sm",className:"w-full border-dashed border-border",onClick:()=>n([...o,""]),children:[s.jsx(ve,{icon:nh,size:16,className:"mr-2"}),"Add line"]})]})}const Zl="system",fx=[{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"}],_0=new Set(fx.map(t=>t.id));function j_(t){return`https://fonts.googleapis.com/css2?${t.map(a=>`family=${encodeURIComponent(a).replace(/%20/g,"+")}:wght@400;600;700;800`).join("&")}&display=swap`}function C_(){const t="supportbot-google-fonts";if(document.getElementById(t))return;const n=document.createElement("link");n.id=t,n.rel="stylesheet",n.href=j_(fx.map(a=>a.id)),document.head.appendChild(n)}function kS(t){var c;if(!t||typeof t!="string")return"Inter";const n=t.trim();if(n===Zl)return Zl;if(!n.includes(","))return _0.has(n)?n:"Inter";const a=n.match(/^["']?([^"',]+)["']?/),o=(c=a==null?void 0:a[1])==null?void 0:c.trim();return o&&_0.has(o)?o:"Inter"}function Bp(t){return t===Zl?'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif':`"${t}", ui-sans-serif, system-ui, sans-serif`}function S_({field:t,value:n,onChange:a,readOnly:o}){const c=t.path.replace(/\./g,"-"),l=kS(n);return f.useEffect(()=>{C_()},[]),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:c,children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsxs(Ca,{value:l,disabled:o,onValueChange:a,children:[s.jsx(Br,{id:c,className:"border-border bg-secondary/30",style:{fontFamily:Bp(l)},children:s.jsx(Sa,{placeholder:"Choose a font…"})}),s.jsxs($r,{className:"max-h-[min(320px,50vh)]",children:[s.jsx(vt,{value:Zl,style:{fontFamily:Bp(Zl)},children:"System default"}),fx.map(d=>s.jsx(vt,{value:d.id,style:{fontFamily:Bp(d.id)},children:d.label},d.id))]})]})]})}function TS({id:t,label:n,description:a,kind:o,value:c,onChange:l,readOnly:d}){const[m,p]=f.useState(null),[g,v]=f.useState(""),[b,w]=f.useState(!0),[y,C]=f.useState(!1),[S,E]=f.useState("");f.useEffect(()=>{let _=!1;return w(!0),Ne.getGuildResources().then(R=>{_||R.data&&(p(R.data),v(""))}).catch(R=>{_||v(R instanceof Error?R.message:"Could not load server list")}).finally(()=>{_||w(!1)}),()=>{_=!0}},[]);const k=f.useMemo(()=>m?o==="role"?m.roles:o==="category"?m.categories:m.channels:[],[m,o]),N=String(c??""),T=k.find(_=>_.id===N),M=f.useMemo(()=>{if(!S.trim())return k;const _=S.toLowerCase().trim();return k.filter(R=>R.name.toLowerCase().includes(_)||R.id.includes(_))},[k,S]);return s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:t,children:n}),a?s.jsx("p",{className:"text-xs text-muted-foreground",children:a}):null,m?s.jsxs(NS,{open:y,onOpenChange:C,children:[s.jsx(ES,{asChild:!0,children:s.jsxs(ue,{id:t,type:"button",variant:"outline",role:"combobox","aria-expanded":y,disabled:d||b,className:"w-full justify-between border-border bg-secondary/30 text-left font-normal h-10 px-3 hover:bg-secondary/50",children:[s.jsx("span",{className:"truncate",children:T?s.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:"font-medium text-foreground truncate",children:T.name}),s.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:T.id})]}):s.jsx("span",{className:"text-muted-foreground",children:b?"Loading server list…":`Select ${o} from ${m.guildName}…`})}),s.jsx(ve,{icon:O8,size:16,className:"shrink-0 opacity-50 ml-2"})]})}),s.jsxs(dx,{className:"w-[var(--radix-popover-trigger-width)] p-2 bg-popover border-border shadow-2xl rounded-xl flex flex-col gap-2 z-50",children:[s.jsxs("div",{className:"relative flex items-center",children:[s.jsx(ve,{icon:ji,size:14,className:"absolute left-2.5 text-muted-foreground"}),s.jsx(De,{placeholder:`Search ${o}s by name or ID…`,value:S,onChange:_=>E(_.target.value),className:"h-8 pl-8 text-xs border-border bg-secondary/20 focus-visible:ring-1",autoFocus:!0})]}),s.jsx("div",{className:"overflow-y-auto max-h-56 space-y-1 pr-1",children:M.length===0?s.jsxs("div",{className:"p-3 text-center text-xs text-muted-foreground",children:["No ",o,'s found matching "',S,'"']}):M.map(_=>s.jsxs("button",{type:"button",onClick:()=>{l(_.id),C(!1),E("")},className:pe("w-full flex items-center justify-between px-2.5 py-1.5 rounded-lg text-xs transition-colors text-left",_.id===N?"bg-primary/15 text-primary font-semibold border border-primary/20":"hover:bg-secondary/60 text-foreground"),children:[s.jsx("span",{className:"truncate mr-2 font-medium",children:_.name}),s.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:_.id})]},_.id))})]})]}):null,s.jsx(De,{value:N,disabled:d,onChange:_=>l(_.target.value),placeholder:o==="role"?"Role ID (ROLE_ID)":o==="category"?"Category ID":"Channel ID",className:"border-border bg-secondary/30 font-mono text-xs"}),g?s.jsx("p",{className:"text-xs text-amber-500",children:g}):null,!g&&!m&&!b?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Set General.GuildId and invite the bot to pick from a list."}):null]})}var N_=Object.defineProperty,_i=(t,n)=>N_(t,"name",{value:n,configurable:!0}),mx="Tabs",[E_,KP]=yn(mx,[Bd]),MS=Bd(),[k_,px]=E_(mx),T_=f.forwardRef(_i(function(n,a){const{__scopeTabs:o,value:c,onValueChange:l,defaultValue:d,orientation:m="horizontal",dir:p,activationMode:g="automatic",...v}=n,b=ki(p),[w,y]=Hr({prop:c,onChange:l,defaultProp:d??"",caller:mx});return s.jsx(k_,{scope:o,baseId:tn(),value:w,onValueChange:y,orientation:m,dir:b,activationMode:g,children:s.jsx(Me.div,{dir:b,"data-orientation":m,...v,ref:a})})},"Tabs")),M_="TabsList",R_=f.forwardRef(_i(function(n,a){const{__scopeTabs:o,loop:c=!0,...l}=n,d=px(M_,o),m=MS(o);return s.jsx(Qw,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:c,children:s.jsx(Me.div,{role:"tablist","aria-orientation":d.orientation,...l,ref:a})})},"TabsList")),A_="TabsTrigger",__=f.forwardRef(_i(function(n,a){const{__scopeTabs:o,value:c,disabled:l=!1,...d}=n,m=px(A_,o),p=MS(o),g=hx(m.baseId,c),v=gx(m.baseId,c),b=c===m.value;return s.jsx(Jw,{asChild:!0,...p,focusable:!l,active:b,children:s.jsx(Me.button,{type:"button",role:"tab","aria-selected":b,"aria-controls":v,"data-state":b?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:g,...d,ref:a,onMouseDown:je(n.onMouseDown,w=>{!l&&w.button===0&&w.ctrlKey===!1?m.onValueChange(c):w.preventDefault()}),onKeyDown:je(n.onKeyDown,w=>{l||w.target!==w.currentTarget||[" ","Enter"].includes(w.key)&&m.onValueChange(c)}),onFocus:je(n.onFocus,()=>{const w=m.activationMode!=="manual";!b&&!l&&w&&m.onValueChange(c)})})})},"TabsTrigger")),D_="TabsContent",O_=f.forwardRef(_i(function(n,a){const{__scopeTabs:o,value:c,forceMount:l,children:d,...m}=n,p=px(D_,o),g=hx(p.baseId,c),v=gx(p.baseId,c),b=c===p.value,w=f.useRef(b);return f.useEffect(()=>{const y=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(y)},[]),s.jsx(dn,{present:l||b,children:({present:y})=>s.jsx(Me.div,{"data-state":b?"active":"inactive","data-orientation":p.orientation,role:"tabpanel","aria-labelledby":g,hidden:!y,id:v,tabIndex:0,...m,ref:a,style:{...n.style,animationDuration:w.current?"0s":void 0},children:y&&d})})},"TabsContent"));function hx(t,n){return`${t}-trigger-${n}`}_i(hx,"makeTriggerId");function gx(t,n){return`${t}-content-${n}`}_i(gx,"makeContentId");var L_=T_,RS=R_,AS=__,_S=O_;const DS=L_,xx=f.forwardRef(({className:t,...n},a)=>s.jsx(RS,{ref:a,className:pe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...n}));xx.displayName=RS.displayName;const Ys=f.forwardRef(({className:t,...n},a)=>s.jsx(AS,{ref:a,className:pe("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",t),...n}));Ys.displayName=AS.displayName;const $h=f.forwardRef(({className:t,...n},a)=>s.jsx(_S,{ref:a,className:pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...n}));$h.displayName=_S.displayName;function Uu(t){if(typeof t!="string"||!t)throw new Error("expected a non-empty string, got: "+t)}function $p(t){if(typeof t!="number")throw new Error("expected a number, got: "+t)}const z_=1,P_=1,fo="emoji",gi="keyvalue",vx="favorites",I_="tokens",OS="tokens",U_="unicode",LS="count",B_="group",$_="order",zS="group-order",Hh="eTag",dd="url",D0="skinTone",Di="readonly",bx="readwrite",PS="skinUnicodes",H_="skinUnicodes",G_="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",V_="en";function F_(t,n){const a=new Set,o=[];for(const c of t){const l=n(c);a.has(l)||(a.add(l),o.push(c))}return o}function O0(t){return F_(t,n=>n.unicode)}function Y_(t){function n(a,o,c){const l=o?t.createObjectStore(a,{keyPath:o}):t.createObjectStore(a);if(c)for(const[d,[m,p]]of Object.entries(c))l.createIndex(d,m,{multiEntry:p});return l}n(gi),n(fo,U_,{[OS]:[I_,!0],[zS]:[[B_,$_]],[PS]:[H_,!0]}),n(vx,void 0,{[LS]:[""]})}const Gh={},Ju={},fd={};function IS(t,n,a){a.onerror=()=>n(a.error),a.onblocked=()=>n(new Error("IDB blocked")),a.onsuccess=()=>t(a.result)}async function q_(t){const n=await new Promise((a,o)=>{const c=indexedDB.open(t,z_);Gh[t]=c,c.onupgradeneeded=l=>{l.oldVersion<P_&&Y_(c.result)},IS(a,o,c)});return n.onclose=()=>yx(t),n}function K_(t){return Ju[t]||(Ju[t]=q_(t)),Ju[t]}function _a(t,n,a,o){return new Promise((c,l)=>{const d=t.transaction(n,a,{durability:"relaxed"}),m=typeof n=="string"?d.objectStore(n):n.map(g=>d.objectStore(g));let p;o(m,d,g=>{p=g}),d.oncomplete=()=>c(p),d.onerror=()=>l(d.error)})}function yx(t){const n=Gh[t],a=n&&n.result;if(a){a.close();const o=fd[t];if(o)for(const c of o)c()}delete Gh[t],delete Ju[t],delete fd[t]}function W_(t){return new Promise((n,a)=>{yx(t);const o=indexedDB.deleteDatabase(t);IS(n,a,o)})}function X_(t,n){let a=fd[t];a||(a=fd[t]=[]),a.push(n)}const Z_=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 fi(t){return t.split(/[\s_]+/).map(n=>!n.match(/\w/)||Z_.has(n)?n.toLowerCase():n.replace(/[)(:,]/g,"").replace(/’/g,"'").toLowerCase()).filter(Boolean)}const Q_=2;function US(t){return t.filter(Boolean).map(n=>n.toLowerCase()).filter(n=>n.length>=Q_)}function J_(t){return t.map(({annotation:a,emoticon:o,group:c,order:l,shortcodes:d,skins:m,tags:p,emoji:g,version:v})=>{const b=[...new Set(US([...(d||[]).map(fi).flat(),...(p||[]).map(fi).flat(),...fi(a),o]))].sort(),w={annotation:a,group:c,order:l,tags:p,tokens:b,unicode:g,version:v};if(o&&(w.emoticon=o),d&&(w.shortcodes=d),m){w.skinTones=[],w.skinUnicodes=[],w.skinVersions=[];for(const{tone:y,emoji:C,version:S}of m)w.skinTones.push(y),w.skinUnicodes.push(C),w.skinVersions.push(S)}return w})}function BS(t,n,a,o){t[n](a).onsuccess=c=>o&&o(c.target.result)}function ro(t,n,a){BS(t,"get",n,a)}function $S(t,n,a){BS(t,"getAll",n,a)}function wx(t){t.commit&&t.commit()}function eD(t,n){let a=t[0];for(let o=1;o<t.length;o++){const c=t[o];n(a)>n(c)&&(a=c)}return a}function HS(t,n){const a=eD(t,c=>c.length),o=[];for(const c of a)t.some(l=>l.findIndex(d=>n(d)===n(c))===-1)||o.push(c);return o}async function tD(t){return!await jx(t,gi,dd)}async function nD(t,n,a){const[o,c]=await Promise.all([Hh,dd].map(l=>jx(t,gi,l)));return o===a&&c===n}async function rD(t,n){return _a(t,fo,Di,(o,c,l)=>{let d;const m=()=>{o.getAll(d&&IDBKeyRange.lowerBound(d,!0),50).onsuccess=p=>{const g=p.target.result;for(const v of g)if(d=v.unicode,n(v))return l(v);if(g.length<50)return l();m()}};m()})}async function GS(t,n,a,o){try{const c=J_(n);await _a(t,[fo,gi],bx,([l,d],m)=>{let p,g,v=0;function b(){++v===2&&w()}function w(){if(!(p===o&&g===a)){l.clear();for(const y of c)l.put(y);d.put(o,Hh),d.put(a,dd),wx(m)}}ro(d,Hh,y=>{p=y,b()}),ro(d,dd,y=>{g=y,b()})})}finally{}}async function aD(t,n){return _a(t,fo,Di,(a,o,c)=>{const l=IDBKeyRange.bound([n,0],[n+1,0],!1,!0);$S(a.index(zS),l,c)})}async function VS(t,n){const a=US(fi(n));return a.length?_a(t,fo,Di,(o,c,l)=>{const d=[],m=()=>{d.length===a.length&&p()},p=()=>{const g=HS(d,v=>v.unicode);l(g.sort((v,b)=>v.order<b.order?-1:1))};for(let g=0;g<a.length;g++){const v=a[g],b=g===a.length-1?IDBKeyRange.bound(v,v+"",!1,!0):IDBKeyRange.only(v);$S(o.index(OS),b,w=>{d.push(w),m()})}}):[]}async function sD(t,n){const a=await VS(t,n);return a.length?a.filter(o=>(o.shortcodes||[]).map(l=>l.toLowerCase()).includes(n.toLowerCase()))[0]||null:await rD(t,c=>(c.shortcodes||[]).includes(n.toLowerCase()))||null}async function oD(t,n){return _a(t,fo,Di,(a,o,c)=>ro(a,n,l=>{if(l)return c(l);ro(a.index(PS),n,d=>c(d||null))}))}function jx(t,n,a){return _a(t,n,Di,(o,c,l)=>ro(o,a,l))}function iD(t,n,a,o){return _a(t,n,bx,(c,l)=>{c.put(o,a),wx(l)})}function lD(t,n){return _a(t,vx,bx,(a,o)=>ro(a,n,c=>{a.put((c||0)+1,n),wx(o)}))}function cD(t,n,a){return a===0?[]:_a(t,[vx,fo],Di,([o,c],l,d)=>{const m=[];o.index(LS).openCursor(void 0,"prev").onsuccess=p=>{const g=p.target.result;if(!g)return d(m);function v(y){if(m.push(y),m.length===a)return d(m);g.continue()}const b=g.primaryKey,w=n.byName(b);if(w)return v(w);ro(c,b,y=>{if(y)return v(y);g.continue()})}})}const Bu="";function uD(t,n){const a=new Map;for(const c of t){const l=n(c);for(const d of l){let m=a;for(let g=0;g<d.length;g++){const v=d.charAt(g);let b=m.get(v);b||(b=new Map,m.set(v,b)),m=b}let p=m.get(Bu);p||(p=[],m.set(Bu,p)),p.push(c)}}return(c,l)=>{let d=a;for(let g=0;g<c.length;g++){const v=c.charAt(g),b=d.get(v);if(b)d=b;else return[]}if(l)return d.get(Bu)||[];const m=[],p=[d];for(;p.length;){const v=[...p.shift().entries()].sort((b,w)=>b[0]<w[0]?-1:1);for(const[b,w]of v)b===Bu?m.push(...w):p.push(w)}return m}}const dD=["name","url"];function fD(t){const n=t&&Array.isArray(t),a=n&&t.length&&(!t[0]||dD.some(o=>!(o in t[0])));if(!n||a)throw new Error("Custom emojis are in the wrong format")}function L0(t){fD(t);const n=(w,y)=>w.name.toLowerCase()<y.name.toLowerCase()?-1:1,a=t.sort(n),c=uD(t,w=>{const y=new Set;if(w.shortcodes)for(const C of w.shortcodes)for(const S of fi(C))y.add(S);return y}),l=w=>c(w,!0),d=w=>c(w,!1),m=w=>{const y=fi(w),C=y.map((S,E)=>(E<y.length-1?l:d)(S));return HS(C,S=>S.name).sort(n)},p=new Map,g=new Map;for(const w of t){g.set(w.name.toLowerCase(),w);for(const y of w.shortcodes||[])p.set(y.toLowerCase(),w)}return{all:a,search:m,byShortcode:w=>p.get(w.toLowerCase()),byName:w=>g.get(w.toLowerCase())}}const mD=typeof wrappedJSObject<"u";function Rl(t){if(!t)return t;if(mD&&(t=structuredClone(t)),delete t.tokens,t.skinTones){const n=t.skinTones.length;t.skins=Array(n);for(let a=0;a<n;a++)t.skins[a]={tone:t.skinTones[a],unicode:t.skinUnicodes[a],version:t.skinVersions[a]};delete t.skinTones,delete t.skinUnicodes,delete t.skinVersions}return t}function FS(t){t||console.warn("emoji-picker-element is more efficient if the dataSource server exposes an ETag header.")}const pD=["annotation","emoji","group","order","version"];function hD(t){if(!t||!Array.isArray(t)||!t[0]||typeof t[0]!="object"||pD.some(n=>!(n in t[0])))throw new Error("Emoji data is in the wrong format")}function YS(t,n){if(Math.floor(t.status/100)!==2)throw new Error("Failed to fetch: "+n+": "+t.status)}async function gD(t){const n=await fetch(t,{method:"HEAD"});YS(n,t);const a=n.headers.get("etag");return FS(a),a}async function Vh(t){const n=await fetch(t);YS(n,t);const a=n.headers.get("etag");FS(a);const o=await n.json();return hD(o),[a,o]}function xD(t){for(var n="",a=new Uint8Array(t),o=a.byteLength,c=-1;++c<o;)n+=String.fromCharCode(a[c]);return n}function vD(t){for(var n=t.length,a=new ArrayBuffer(n),o=new Uint8Array(a),c=-1;++c<n;)o[c]=t.charCodeAt(c);return a}async function qS(t){const n=JSON.stringify(t);let a=vD(n);const o=await crypto.subtle.digest("SHA-1",a),c=xD(o);return btoa(c)}async function bD(t,n){let a,o=await gD(n);if(!o){const c=await Vh(n);o=c[0],a=c[1],o||(o=await qS(a))}await nD(t,n,o)||(a||(a=(await Vh(n))[1]),await GS(t,a,n,o))}async function yD(t,n){let[a,o]=await Vh(n);a||(a=await qS(o)),await GS(t,o,n,a)}async function wD(t,n){try{await bD(t,n)}catch(a){if(a.name!=="InvalidStateError")throw a}}class jD{constructor({dataSource:n=G_,locale:a=V_,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=L0(o),this._clear=this._clear.bind(this),this._ready=this._init()}async _init(){const n=this._db=await K_(this._dbName);X_(this._dbName,this._clear);const a=this.dataSource;await tD(n)?await yD(n,a):this._lazyUpdate=wD(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 $p(n),await this.ready(),O0(await aD(this._db,n)).map(Rl)}async getEmojiBySearchQuery(n){Uu(n),await this.ready();const a=this._custom.search(n),o=O0(await VS(this._db,n)).map(Rl);return[...a,...o]}async getEmojiByShortcode(n){Uu(n),await this.ready();const a=this._custom.byShortcode(n);return a||Rl(await sD(this._db,n))}async getEmojiByUnicodeOrName(n){Uu(n),await this.ready();const a=this._custom.byName(n);return a||Rl(await oD(this._db,n))}async getPreferredSkinTone(){return await this.ready(),await jx(this._db,gi,D0)||0}async setPreferredSkinTone(n){return $p(n),await this.ready(),iD(this._db,gi,D0,n)}async incrementFavoriteEmojiCount(n){return Uu(n),await this.ready(),lD(this._db,n)}async getTopFavoriteEmoji(n){return $p(n),await this.ready(),(await cD(this._db,this._custom,n)).map(Rl)}set customEmoji(n){this._custom=L0(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 yx(this._dbName)}async delete(){await this._shutdown(),await W_(this._dbName)}}const Fh=[[-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(([t,n,a])=>({id:t,emoji:n,name:a})),Hp=Fh.slice(1),CD=2,z0=6,KS=typeof requestIdleCallback=="function"?requestIdleCallback:setTimeout;function P0(t){return t.unicode.includes("")}const SD={"":17,"":16,"🫨":15.1,"🫠":14,"🥲":13.1,"🥻":12.1,"🥰":11,"🤩":5,"👱♀️":4,"🤣":3,"👁️🗨️":2,"😀":1,"😐️":.7,"😃":.6},ND=1e3,ED="🖐️",kD=8,TD=["😊","😒","❤️","👍️","😍","😂","😭","☺️","😔","😩","😏","💕","🙌","😘"],WS='"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',MD=(t,n)=>t<n?-1:t>n?1:0,I0=(t,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 ${WS}`,o.fillStyle=n,o.scale(.01,.01),o.fillText(t,0,0),o.getImageData(0,0,1,1).data},RD=(t,n)=>{const a=[...t].join(","),o=[...n].join(",");return a===o&&!a.startsWith("0,0,0,")};function AD(t){const n=I0(t,"#000"),a=I0(t,"#fff");return n&&a&&RD(n,a)}function _D(){const t=Object.entries(SD);try{for(const[n,a]of t)if(AD(n))return a}catch{}finally{}return t[0][1]}let Gp;const Vp=()=>(Gp||(Gp=new Promise(t=>KS(()=>t(_D())))),Gp),Yh=new Map,DD="️",OD="\uD83C",LD="",zD=127995,PD=57339;function ID(t,n){if(n===0)return t;const a=t.indexOf(LD);return a!==-1?t.substring(0,a)+String.fromCodePoint(zD+n-1)+t.substring(a):(t.endsWith(DD)&&(t=t.substring(0,t.length-1)),t+OD+String.fromCodePoint(PD+n-1))}function zr(t){t.preventDefault(),t.stopPropagation()}function Fp(t,n,a){return n+=t?-1:1,n<0?n=a.length-1:n>=a.length&&(n=0),n}function XS(t,n){const a=new Set,o=[];for(const c of t){const l=n(c);a.has(l)||(a.add(l),o.push(c))}return o}function UD(t,n){const a=o=>{const c={};for(const l of o)typeof l.tone=="number"&&l.version<=n&&(c[l.tone]=l.unicode);return c};return t.map(({unicode:o,skins:c,shortcodes:l,url:d,name:m,category:p,annotation:g})=>({unicode:o,name:m,shortcodes:l,url:d,category:p,annotation:g,id:o||m,skins:c&&a(c)}))}const ed=requestAnimationFrame;let BD=typeof ResizeObserver=="function";function $D(t,n,a){let o;BD?(o=new ResizeObserver(a),o.observe(t)):ed(a),n.addEventListener("abort",()=>{o&&o.disconnect()})}function U0(t){{const n=document.createRange();return n.selectNode(t.firstChild),n.getBoundingClientRect().width}}const HD="😀";let Yp,Fs;function B0(t,n,a){const o=U0(n);if(!o){if(!Fs){Fs=a.cloneNode(!0);const c=getComputedStyle(a);for(const l of["font-family","line-height","width","height","font-size","display","align-items","justify-content"])Fs.style.setProperty(l,c.getPropertyValue(l),"important")}try{return document.body.appendChild(Fs),Fs.firstChild.nodeValue=t,U0(Fs)}finally{Fs.remove()}}return o}function GD(t,n,a){let o=!0;for(const c of t){const l=a(c);if(!l)continue;typeof Yp>"u"&&(Yp=B0(HD,n,n));const m=B0(c.unicode,l,n)/1.8<Yp;Yh.set(c.unicode,m),m||(o=!1)}return o}function VD(t){return XS(t,n=>n)}function FD(t){t&&(t.scrollTop=0)}function Ll(t,n,a){let o=t.get(n);return o||(o=a(),t.set(n,o)),o}function $0(t){return""+t}function YD(t){const n=document.createElement("template");return n.innerHTML=t,n}const qD=new WeakMap,KD=new WeakMap,WD=Symbol("un-keyed"),XD="replaceChildren"in Element.prototype;function ZD(t,n){XD?t.replaceChildren(...n):(t.innerHTML="",t.append(...n))}function QD(t,n){let a=t.firstChild,o=0;for(;a;){if(n[o]!==a)return!0;a=a.nextSibling,o++}return o!==n.length}function JD(t,n){const{targetNode:a}=n;let{targetParentNode:o}=n,c=!1;o?c=QD(o,t):(c=!0,n.targetNode=void 0,n.targetParentNode=o=a.parentNode),c&&ZD(o,t)}function eO(t,n){for(const a of n){const{targetNode:o,currentExpression:c,binding:{expressionIndex:l,attributeName:d,attributeValuePre:m,attributeValuePost:p}}=a,g=t[l];if(c!==g)if(a.currentExpression=g,d)if(g===null)o.removeAttribute(d);else{const v=m+$0(g)+p;o.setAttribute(d,v)}else{let v;Array.isArray(g)?JD(g,a):g instanceof Element?(v=g,o.replaceWith(v)):o.nodeValue=$0(g),v&&(a.targetNode=v)}}}function tO(t){let n="",a=!1,o=!1,c=-1;const l=new Map,d=[];let m=0;for(let g=0,v=t.length;g<v;g++){const b=t[g];if(n+=b.slice(m),g===v-1)break;for(let N=0;N<b.length;N++)switch(b.charAt(N)){case"<":{b.charAt(N+1)==="/"?d.pop():(a=!0,d.push(++c));break}case">":{a=!1,o=!1;break}case"=":{o=!0;break}}const w=d[d.length-1],y=Ll(l,w,()=>[]);let C,S,E;if(o){const N=/(\S+)="?([^"=]*)$/.exec(b);C=N[1],S=N[2];const T=/^([^">]*)("?)/.exec(t[g+1]);E=T[1],n=n.slice(0,-1*N[0].length),m=T[0].length}else m=0;const k={attributeName:C,attributeValuePre:S,attributeValuePost:E,expressionIndex:g};y.push(k),!a&&!o&&(n+=" ")}return{template:YD(n),elementsToBindings:l}}function H0(t,n,a){for(let o=0;o<t.length;o++){const c=t[o],l=c.attributeName?n:n.firstChild,d={binding:c,targetNode:l,targetParentNode:void 0,currentExpression:void 0};a.push(d)}}function nO(t,n){const a=[];let o;if(n.size===1&&(o=n.get(0)))H0(o,t,a);else{const c=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);let l=t,d=-1;do{const m=n.get(++d);m&&H0(m,l,a)}while(l=c.nextNode())}return a}function rO(t){const{template:n,elementsToBindings:a}=Ll(qD,t,()=>tO(t)),o=n.cloneNode(!0).content.firstElementChild,c=nO(o,a);return function(d){return eO(d,c),o}}function aO(t){const n=Ll(KD,t,()=>new Map);let a=WD;function o(l,...d){const m=Ll(n,l,()=>new Map);return Ll(m,a,()=>rO(l))(d)}function c(l,d,m){return l.map((p,g)=>{const v=a;a=m(p);try{return d(p,g)}finally{a=v}})}return{map:c,html:o}}function sO(t,n,a,o,c,l,d,m,p){const{labelWithSkin:g,titleForEmoji:v,unicodeWithSkin:b}=a,{html:w,map:y}=aO(n);function C(N,T,M){return y(N,(_,R)=>w`<button role="${T?"option":"menuitem"}" aria-selected="${T?R===n.activeSearchItem:null}" aria-label="${g(_,n.currentSkinTone)}" title="${v(_)}" class="${"emoji"+(T&&R===n.activeSearchItem?" active":"")+(_.unicode?"":" custom-emoji")}" id="${`${M}-${_.id}`}" style="${_.unicode?null:`--custom-emoji-background: url(${JSON.stringify(_.url)})`}">${_.unicode?b(_,n.currentSkinTone):""}</button>`,_=>`${M}-${_.id}`)}const E=w`<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">${y(n.skinTones,(N,T)=>w`<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]}">${N}</div>`,N=>N)}</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">${y(n.groups,N=>w`<button role="tab" class="nav-button" aria-controls="tab-${N.id}" aria-label="${n.i18n.categories[N.name]}" aria-selected="${!n.searchMode&&n.currentGroup.id===N.id}" title="${n.i18n.categories[N.name]}" data-group-id="${N.id}"><div class="nav-emoji emoji">${N.emoji}</div></button>`,N=>N.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">${y(n.currentEmojisWithCategories,(N,T)=>w`<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:N.category?N.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(N.emojis.length/n.numColumns)}`}" data-action="updateOnIntersection" role="${n.searchMode?"listbox":"menu"}" aria-labelledby="menu-label-${T}" id="${n.searchMode?"search-results":null}">${C(N.emojis,n.searchMode,"emo")}</div></div>`,N=>N.category)}</div></div><div class="favorites onscreen emoji-menu ${n.message?"gone":""}" role="menu" aria-label="${n.i18n.favoritesLabel}" data-on-click="onEmojiClick">${C(n.currentFavorites,!1,"fav")}</div><button data-ref="baselineEmoji" aria-hidden="true" tabindex="-1" class="abs-pos hidden emoji baseline-emoji">😀</button></section>`,k=(N,T)=>{for(const M of t.querySelectorAll(`[${N}]`))T(M,M.getAttribute(N))};if(p){t.appendChild(E);for(const N of["click","focusout","input","keydown","keyup"])k(`data-on-${N}`,(T,M)=>{T.addEventListener(N,o[M])});k("data-ref",(N,T)=>{l[T]=N}),d.addEventListener("abort",()=>{t.removeChild(E)})}k("data-action",(N,T)=>{let M=m.get(T);M||m.set(T,M=new WeakSet),M.has(N)||(M.add(N),c[T](N))})}const md=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(t);function oO(t){let n=!1,a;const o=new Map,c=new Set;let l;const d=()=>{if(n)return;const g=[...c];c.clear();try{for(const v of g)v()}finally{l=!1,c.size&&(l=!0,md(d))}},m=new Proxy({},{get(g,v){if(a){let b=o.get(v);b||(b=new Set,o.set(v,b)),b.add(a)}return g[v]},set(g,v,b){if(g[v]!==b){g[v]=b;const w=o.get(v);if(w){for(const y of w)c.add(y);l||(l=!0,md(d))}}return!0}}),p=g=>{const v=()=>{const b=a;a=v;try{return g()}finally{a=b}};return v()};return t.addEventListener("abort",()=>{n=!0}),{state:m,createEffect:p}}function qp(t,n,a){if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(!a(t[o],n[o]))return!1;return!0}const G0=new WeakMap;function iO(t,n,a){{const o=t.closest(".tabpanel");let c=G0.get(o);c||(c=new IntersectionObserver(a,{root:o,rootMargin:"50% 0px 50% 0px",threshold:0}),G0.set(o,c),n.addEventListener("abort",()=>{c.disconnect()})),c.observe(t)}}const Kp=[],{assign:$u}=Object;function lO(t,n){const a={},o=new AbortController,c=o.signal,{state:l,createEffect:d}=oO(c),m=new Map;$u(l,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),$u(l,n),$u(l,{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:kD,isRtl:!1,currentGroupIndex:0,groups:Hp,databaseLoaded:!1,activeSearchItemId:void 0}),d(()=>{l.currentGroup!==l.groups[l.currentGroupIndex]&&(l.currentGroup=l.groups[l.currentGroupIndex])});const p=B=>{t.getElementById(B).focus()},g=B=>t.getElementById(`emo-${B.id}`),v=(B,ie)=>{a.rootElement.dispatchEvent(new CustomEvent(B,{detail:ie,bubbles:!0,composed:!0}))},b=(B,ie)=>B.id===ie.id,w=(B,ie)=>{const{category:we,emojis:Ce}=B,{category:ze,emojis:Ke}=ie;return we!==ze?!1:qp(Ce,Ke,b)},y=B=>{qp(l.currentEmojis,B,b)||(l.currentEmojis=B)},C=B=>{l.searchMode!==B&&(l.searchMode=B)},S=B=>{qp(l.currentEmojisWithCategories,B,w)||(l.currentEmojisWithCategories=B)},E=(B,ie)=>ie&&B.skins&&B.skins[ie]||B.unicode,T={labelWithSkin:(B,ie)=>VD([B.name||E(B,ie),B.annotation,...B.shortcodes||Kp].filter(Boolean)).join(", "),titleForEmoji:B=>B.annotation||(B.shortcodes||Kp).join(", "),unicodeWithSkin:E},M={onClickSkinToneButton:X,onEmojiClick:D,onNavClick:ae,onNavKeydown:re,onSearchKeydown:Z,onSkinToneOptionsClick:H,onSkinToneOptionsFocusOut:ge,onSkinToneOptionsKeydown:xe,onSkinToneOptionsKeyup:q,onSearchInput:me},_={calculateEmojiGridStyle:te,updateOnIntersection:K};let R=!0;d(()=>{sO(t,l,T,M,_,a,c,m,R),R=!1}),l.emojiVersion||Vp().then(B=>{B||(l.message=l.i18n.emojiUnsupportedMessage)}),d(()=>{async function B(){let ie=!1;const we=setTimeout(()=>{ie=!0,l.message=l.i18n.loadingMessage},ND);try{await l.database.ready(),l.databaseLoaded=!0}catch(Ce){console.error(Ce),l.message=l.i18n.networkErrorMessage}finally{clearTimeout(we),ie&&(ie=!1,l.message="")}}l.database&&B()}),d(()=>{l.pickerStyle=`
|
||
--num-groups: ${l.groups.length};
|
||
--indicator-opacity: ${l.searchMode?0:1};
|
||
--num-skintones: ${z0};`}),d(()=>{l.customEmoji&&l.database&&L()}),d(()=>{l.customEmoji&&l.customEmoji.length?l.groups!==Fh&&(l.groups=Fh):l.groups!==Hp&&(l.currentGroupIndex&&l.currentGroupIndex--,l.groups=Hp)}),d(()=>{async function B(){l.databaseLoaded&&(l.currentSkinTone=await l.database.getPreferredSkinTone())}B()}),d(()=>{l.skinTones=Array(z0).fill().map((B,ie)=>ID(l.skinToneEmoji,ie))}),d(()=>{l.skinToneButtonText=l.skinTones[l.currentSkinTone]}),d(()=>{l.skinToneButtonLabel=l.i18n.skinToneLabel.replace("{skinTone}",l.i18n.skinTones[l.currentSkinTone])}),d(()=>{async function B(){const{database:ie}=l,we=(await Promise.all(TD.map(Ce=>ie.getEmojiByUnicodeOrName(Ce)))).filter(Boolean);l.defaultFavoriteEmojis=we}l.databaseLoaded&&B()});function L(){const{customEmoji:B,database:ie}=l,we=B||Kp;ie.customEmoji!==we&&(ie.customEmoji=we)}d(()=>{async function B(){L();const{database:ie,defaultFavoriteEmojis:we,numColumns:Ce}=l,ze=await ie.getTopFavoriteEmoji(Ce),Ke=await fe(XS([...ze,...we],ft=>ft.unicode||ft.name).slice(0,Ce));l.currentFavorites=Ke}l.databaseLoaded&&l.defaultFavoriteEmojis&&B()});function te(B){$D(B,c,()=>{{const ie=getComputedStyle(a.rootElement),we=parseInt(ie.getPropertyValue("--num-columns"),10),Ce=ie.getPropertyValue("direction")==="rtl";l.numColumns=we,l.isRtl=Ce}})}function K(B){iO(B,c,ie=>{for(const{target:we,isIntersecting:Ce}of ie)we.classList.toggle("onscreen",Ce)})}d(()=>{async function B(){const{searchText:ie,currentGroup:we,databaseLoaded:Ce,customEmoji:ze}=l;if(!Ce)l.currentEmojis=[],l.searchMode=!1;else if(ie.length>=CD){const Ke=await P(ie);l.searchText===ie&&(y(Ke),C(!0))}else{const{id:Ke}=we;if(Ke!==-1||ze&&ze.length){const ft=await se(Ke);l.currentGroup.id===Ke&&(y(ft),C(!1))}}}B()});const I=()=>{ed(()=>FD(a.tabpanelElement))};d(()=>{const{currentEmojis:B,emojiVersion:ie}=l,we=B.filter(Ce=>Ce.unicode).filter(Ce=>P0(Ce)&&!Yh.has(Ce.unicode));if(!ie&&we.length)y(B),ed(()=>G(we));else{const Ce=ie?B:B.filter(Y);y(Ce),I()}});function G(B){GD(B,a.baselineEmoji,g)?I():l.currentEmojis=[...l.currentEmojis]}function Y(B){return!B.unicode||!P0(B)||Yh.get(B.unicode)}async function ce(B){const ie=l.emojiVersion||await Vp();return B.filter(({version:we})=>!we||we<=ie)}async function fe(B){return UD(B,l.emojiVersion||await Vp())}async function se(B){const ie=B===-1?l.customEmoji:await l.database.getEmojiByGroup(B);return fe(await ce(ie))}async function P(B){return fe(await ce(await l.database.getEmojiBySearchQuery(B)))}d(()=>{}),d(()=>{function B(){const{searchMode:we,currentEmojis:Ce}=l;if(we)return[{category:"",emojis:Ce}];const ze=new Map;for(const Ke of Ce){const ft=Ke.category||"";let Pt=ze.get(ft);Pt||(Pt=[],ze.set(ft,Pt)),Pt.push(Ke)}return[...ze.entries()].map(([Ke,ft])=>({category:Ke,emojis:ft})).sort((Ke,ft)=>l.customCategorySorting(Ke.category,ft.category))}const ie=B();S(ie)}),d(()=>{l.activeSearchItemId=l.activeSearchItem!==-1&&l.currentEmojis[l.activeSearchItem].id}),d(()=>{const{rawSearchText:B}=l;KS(()=>{l.searchText=(B||"").trim(),l.activeSearchItem=-1})});function Z(B){if(!l.searchMode||!l.currentEmojis.length)return;const ie=we=>{zr(B),l.activeSearchItem=Fp(we,l.activeSearchItem,l.currentEmojis)};switch(B.key){case"ArrowDown":return ie(!1);case"ArrowUp":return ie(!0);case"Enter":if(l.activeSearchItem===-1)l.activeSearchItem=0;else return zr(B),O(l.currentEmojis[l.activeSearchItem].id)}}function ae(B){const{target:ie}=B,we=ie.closest(".nav-button");if(!we)return;const Ce=parseInt(we.dataset.groupId,10);a.searchElement.value="",l.rawSearchText="",l.searchText="",l.activeSearchItem=-1,l.currentGroupIndex=l.groups.findIndex(ze=>ze.id===Ce)}function re(B){const{target:ie,key:we}=B,Ce=ze=>{ze&&(zr(B),ze.focus())};switch(we){case"ArrowLeft":return Ce(ie.previousElementSibling);case"ArrowRight":return Ce(ie.nextElementSibling);case"Home":return Ce(ie.parentElement.firstElementChild);case"End":return Ce(ie.parentElement.lastElementChild)}}async function V(B){const ie=await l.database.getEmojiByUnicodeOrName(B),we=[...l.currentEmojis,...l.currentFavorites].find(ze=>ze.id===B),Ce=we.unicode&&E(we,l.currentSkinTone);return await l.database.incrementFavoriteEmojiCount(B),{emoji:ie,skinTone:l.currentSkinTone,...Ce&&{unicode:Ce},...we.name&&{name:we.name}}}async function O(B){const ie=V(B);v("emoji-click-sync",ie),v("emoji-click",await ie)}function D(B){const{target:ie}=B;if(!ie.classList.contains("emoji"))return;zr(B);const we=ie.id.substring(4);O(we)}function $(B){l.currentSkinTone=B,l.skinTonePickerExpanded=!1,p("skintone-button"),v("skin-tone-change",{skinTone:B}),l.database.setPreferredSkinTone(B)}function H(B){const{target:{id:ie}}=B,we=ie&&ie.match(/^skintone-(\d)/);if(!we)return;zr(B);const Ce=parseInt(we[1],10);$(Ce)}function X(B){l.skinTonePickerExpanded=!l.skinTonePickerExpanded,l.activeSkinTone=l.currentSkinTone,l.skinTonePickerExpanded&&(zr(B),ed(()=>p("skintone-list")))}d(()=>{l.skinTonePickerExpanded?a.skinToneDropdown.addEventListener("transitionend",()=>{l.skinTonePickerExpandedAfterAnimation=!0},{once:!0}):l.skinTonePickerExpandedAfterAnimation=!1});function xe(B){if(!l.skinTonePickerExpanded)return;const ie=async we=>{zr(B),l.activeSkinTone=we};switch(B.key){case"ArrowUp":return ie(Fp(!0,l.activeSkinTone,l.skinTones));case"ArrowDown":return ie(Fp(!1,l.activeSkinTone,l.skinTones));case"Home":return ie(0);case"End":return ie(l.skinTones.length-1);case"Enter":return zr(B),$(l.activeSkinTone);case"Escape":return zr(B),l.skinTonePickerExpanded=!1,p("skintone-button")}}function q(B){if(l.skinTonePickerExpanded)switch(B.key){case" ":return zr(B),$(l.activeSkinTone)}}async function ge(B){const{relatedTarget:ie}=B;(!ie||ie.id!=="skintone-list")&&(l.skinTonePickerExpanded=!1)}function me(B){l.rawSearchText=B.target.value}return{$set(B){$u(l,B)},$destroy(){o.abort()}}}const cO="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",uO="en";var dO={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"}},fO=':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 ZS=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],mO=`:host{--emoji-font-family:${WS}}`;class Cx extends HTMLElement{constructor(n){super(),this.attachShadow({mode:"open"});const a=document.createElement("style");a.textContent=fO+mO,this.shadowRoot.appendChild(a),this._ctx={locale:uO,dataSource:cO,skinToneEmoji:ED,customCategorySorting:MD,customEmoji:null,i18n:dO,emojiVersion:null,...n};for(const o of ZS)o!=="database"&&Object.prototype.hasOwnProperty.call(this,o)&&(this._ctx[o]=this[o],delete this[o]);this._dbFlush()}connectedCallback(){V0(this),this._cmp||(this._cmp=lO(this.shadowRoot,this._ctx))}disconnectedCallback(){V0(this),md(()=>{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,(c,l)=>l.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 jD({locale:n,dataSource:a}))}_dbFlush(){md(()=>this._dbCreate())}}const QS={};for(const t of ZS)QS[t]={get(){return t==="database"&&this._dbCreate(),this._ctx[t]},set(n){if(t==="database")throw new Error("database is read-only");this._set(t,n)}};Object.defineProperties(Cx.prototype,QS);function V0(t){t instanceof Cx||Object.setPrototypeOf(t,customElements.get(t.tagName.toLowerCase()).prototype)}customElements.get("emoji-picker")||customElements.define("emoji-picker",Cx);function pO({onPick:t}){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 c=l=>{var p;const d=l.detail,m=(d==null?void 0:d.unicode)??((p=d==null?void 0:d.emoji)==null?void 0:p.unicode);m&&t(m)};return o.addEventListener("emoji-click",c),a.appendChild(o),()=>{o.removeEventListener("emoji-click",c),o.remove()}},[t]),s.jsx("div",{ref:n,className:"unicode-emoji-panel-host overflow-hidden rounded-lg border border-border/50"})}const hO=/^<(a?):([^:>]+):(\d{17,20})>$/;function td(t,n,a=!1){return`${a?"<a":"<"}:${t}:${n}>`}function JS(t){const n=String(t??"").trim();if(!n)return{kind:"empty",value:""};const a=n.match(hO);return a?{kind:"custom",value:n,animated:a[1]==="a",name:a[2],id:a[3]}:{kind:"unicode",value:n}}function e5(t,n=!1){return`https://cdn.discordapp.com/emojis/${t}.${n?"gif":"png"}?size=64`}function gO(t,n=[]){const a=JS(t);if(a.kind==="custom"&&a.id&&!a.name){const o=n.find(c=>c.id===a.id);if(o)return{kind:"custom",value:td(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(c=>c.id===a.id);if(o&&a.value!==td(o.name,o.id,o.animated))return{kind:"custom",value:td(o.name,o.id,o.animated),name:o.name,id:o.id,animated:o.animated}}return a}function xO({value:t,guildEmojis:n,size:a="md"}){const o=gO(t,n),c=a==="lg"?"size-10":"size-7",l=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:e5(o.id,o.animated),alt:o.name??"custom emoji",className:pe(c,"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:pe(l,"leading-none"),title:o.value,children:o.value})}function vO({id:t,label:n,description:a,value:o,onChange:c,readOnly:l}){const[d,m]=f.useState(!1),[p,g]=f.useState("server"),[v,b]=f.useState(null),[w,y]=f.useState(""),[C,S]=f.useState(!1),[E,k]=f.useState(""),N=f.useCallback(async(I=!1)=>{S(!0),y("");try{const G=await Ne.getGuildResources(I);G.data?(b(G.data),Array.isArray(G.data.emojis)||y("Server response is missing emojis. Restart the bot after updating.")):y("No guild data returned.")}catch(G){y(G instanceof Error?G.message:"Could not load server emojis")}finally{S(!1)}},[]);f.useEffect(()=>{d&&N(!0)},[d,N]);const T=f.useMemo(()=>Array.isArray(v==null?void 0:v.emojis)?v.emojis:[],[v]),M=f.useMemo(()=>{const I=E.trim().toLowerCase();return I?T.filter(G=>G.name.toLowerCase().includes(I)):T},[T,E]),_=String(o??""),R=JS(_);function L(I){c(I),m(!1)}function te(I){c(td(I.name,I.id,I.animated)),m(!1)}function K(){c("")}return s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:t,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(xO,{value:o,guildEmojis:T,size:"lg"})}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(ue,{type:"button",variant:"secondary",size:"sm",disabled:l,onClick:()=>m(!0),children:"Choose emoji"}),_?s.jsx(ue,{type:"button",variant:"ghost",size:"sm",disabled:l,onClick:K,children:"Clear"}):null]})]}),s.jsx(Qs,{open:d,onOpenChange:m,children:s.jsxs(hs,{className:"max-h-[min(90vh,720px)] max-w-lg gap-0 overflow-hidden p-0 sm:max-w-xl",children:[s.jsxs(gs,{className:"space-y-1 border-b border-border px-5 py-4",children:[s.jsx(xs,{children:"Choose emoji"}),s.jsxs(vs,{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(DS,{value:p,onValueChange:I=>g(I),className:"flex min-h-0 flex-1 flex-col",children:[s.jsxs(xx,{className:"mx-5 mt-3 grid h-9 w-auto grid-cols-2",children:[s.jsx(Ys,{value:"server",children:"Server"}),s.jsx(Ys,{value:"unicode",children:"All emojis"})]}),s.jsxs($h,{value:"server",className:"mt-0 flex-1 px-5 pb-4 pt-3",children:[s.jsxs("div",{className:"relative mb-3",children:[s.jsx(ve,{icon:ji,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(De,{placeholder:"Search by name…",value:E,onChange:I=>k(I.target.value),className:"h-9 border-border bg-secondary/30 pl-9"})]}),v?s.jsxs("p",{className:"mb-2 text-xs text-muted-foreground",children:[v.guildName," · ",T.length," custom emoji",T.length===1?"":"s"]}):null,s.jsx(fc,{className:"h-[min(50vh,320px)] rounded-lg border border-border/50 bg-secondary/20",children:C?s.jsx("div",{className:"grid grid-cols-6 gap-2 p-3 sm:grid-cols-8",children:Array.from({length:24}).map((I,G)=>s.jsx(Be,{className:"aspect-square rounded-lg"},G))}):w?s.jsxs("div",{className:"space-y-3 p-4 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:w}),s.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>void N(!0),children:"Retry"})]}):M.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:M.map(I=>{const G=R.kind==="custom"&&R.id===I.id;return s.jsx("button",{type:"button",title:`:${I.name}:`,className:pe("flex aspect-square items-center justify-center rounded-lg border border-transparent bg-background/50 transition-colors hover:border-primary/30 hover:bg-accent",G&&"border-primary/50 bg-primary/15 ring-2 ring-primary/30"),onClick:()=>te(I),children:s.jsx("img",{src:I.url??e5(I.id,I.animated),alt:I.name,className:"size-8 object-contain",loading:"lazy"})},I.id)})})})]}),s.jsx($h,{value:"unicode",className:"mt-0 px-5 pb-4 pt-3",children:s.jsx(pO,{onPick:L})})]})]})}),s.jsx(De,{value:_,disabled:l,onChange:I=>c(I.target.value),placeholder:"Unicode or <:name:id>",className:"border-border bg-secondary/30 font-mono text-xs"})]})}const F0="BOT_TOKEN",bO="MODEL_API_KEY";function pd({field:t,value:n,onChange:a,readOnly:o}){const c=t.path.replace(/\./g,"-");if(t.type==="googleFont")return s.jsx(S_,{field:t,value:n,onChange:a,readOnly:o});if(t.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(_e,{htmlFor:c,className:"font-medium",children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null]}),s.jsx(kt,{id:c,checked:!!n,disabled:o,onCheckedChange:a})]});if(t.type==="stringList")return s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsx(w_,{value:Array.isArray(n)?n:[],onChange:a})]});if(t.type==="select"&&t.options)return s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:c,children:t.label}),s.jsxs(Ca,{value:String(n??""),disabled:o,onValueChange:a,children:[s.jsx(Br,{id:c,className:"border-border bg-secondary/30",children:s.jsx(Sa,{placeholder:"Select…"})}),s.jsx($r,{children:t.options.map(d=>s.jsx(vt,{value:d.value,children:d.label},d.value))})]})]});if(t.type==="color"){const d=Ur(String(n??"#000000"));return s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:c,children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsxs("div",{className:"flex gap-2",children:[s.jsx(tf,{value:d,onChange:a}),s.jsx(De,{id:c,value:d,disabled:o,onChange:m=>a(m.target.value),onBlur:m=>a(Ur(m.target.value,d)),className:"border-border bg-secondary/30 font-mono uppercase",placeholder:"#000000",maxLength:7})]})]})}if(t.type==="emoji")return s.jsx(vO,{id:c,label:t.label,description:t.description,value:n,onChange:a,readOnly:o});if(t.type==="discordChannel"||t.type==="discordRole"||t.type==="discordCategory"){const d=t.type==="discordRole"?"role":t.type==="discordCategory"?"category":"channel";return s.jsx(TS,{id:c,label:t.label,description:t.description,kind:d,value:n,onChange:a,readOnly:o})}if(t.type==="secret"){const d=n===F0||n===bO||!n?"":"••••••••••••";return s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:c,children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsx(De,{id:c,type:"password",value:d,disabled:o,placeholder:t.placeholder??"Unchanged if empty",onChange:m=>{const p=m.target.value;a(p||(t.placeholder??F0))},className:"border-border bg-secondary/30"})]})}const l="border-border bg-secondary/30";return t.type==="textarea"?s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:c,children:t.label}),s.jsx(Jd,{id:c,value:String(n??""),disabled:o,onChange:d=>a(d.target.value),className:`min-h-[88px] ${l}`})]}):s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:c,children:t.label}),t.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}):null,s.jsx(De,{id:c,type:t.type==="number"?"number":"text",value:n==null?"":String(n),disabled:o,onChange:d=>a(t.type==="number"?Number(d.target.value):d.target.value),placeholder:t.placeholder??(t.type==="discordId"?"Discord snowflake ID":void 0),className:l})]})}const Ze=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("rounded-xl border border-border bg-card text-card-foreground shadow-none",t),...n}));Ze.displayName="Card";const ut=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("flex flex-col space-y-1.5 p-6",t),...n}));ut.displayName="CardHeader";const dt=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("font-semibold leading-none tracking-tight",t),...n}));dt.displayName="CardTitle";const Ot=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("text-sm text-muted-foreground",t),...n}));Ot.displayName="CardDescription";const Qe=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("p-6 pt-0",t),...n}));Qe.displayName="CardContent";const Sx=f.forwardRef(({className:t,...n},a)=>s.jsx("div",{ref:a,className:pe("flex items-center p-6 pt-0",t),...n}));Sx.displayName="CardFooter";function Y0(t){return t.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function yO(t,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=t.toLowerCase();return/prefix/.test(a)?"text":/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 Nx(t,n=""){const a=[];for(const[o,c]of Object.entries(t)){const l=n?`${n}.${o}`:o;if(Array.isArray(c)){if(c.length>0&&typeof c[0]=="object"&&c[0]!==null&&!Array.isArray(c[0]))continue;a.push({path:l,label:Y0(o),type:"stringList"});continue}if(c&&typeof c=="object"&&Object.keys(c).length>0){a.push(...Nx(c,l));continue}a.push({path:l,label:Y0(o),type:yO(o,c)})}return a}function wO(t){const n=Nx(t);return n.length===0?[{title:"Configuration",fields:[]}]:[{title:"Settings",description:"Values from this addon’s config file.",fields:n}]}function Fr(t,n){const a=n.split(".");let o=t;for(const c of a){if(o==null||typeof o!="object")return;o=o[c]}return o}function Gn(t,n,a){const o=n.split("."),c=structuredClone(t);let l=c;for(let d=0;d<o.length-1;d++){const m=o[d];(l[m]==null||typeof l[m]!="object")&&(l[m]={}),l=l[m]}return l[o[o.length-1]]=a,c}var jO=t=>{switch(t){case"success":return NO;case"info":return kO;case"warning":return EO;case"error":return TO;default:return null}},CO=Array(12).fill(0),SO=({visible:t,className:n})=>be.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":t},be.createElement("div",{className:"sonner-spinner"},CO.map((a,o)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),NO=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),EO=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},be.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"})),kO=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),TO=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),MO=be.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"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),RO=()=>{let[t,n]=be.useState(document.hidden);return be.useEffect(()=>{let a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),t},qh=1,AO=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;let{message:a,...o}=t,c=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:qh++,l=this.toasts.find(m=>m.id===c),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),l?this.toasts=this.toasts.map(m=>m.id===c?(this.publish({...m,...t,id:c,title:a}),{...m,...t,id:c,dismissible:d,title:a}):m):this.addToast({title:a,...o,dismissible:d,id:c}),c},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,dismiss:!0})),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let a;n.loading!==void 0&&(a=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let o=t instanceof Promise?t:t(),c=a!==void 0,l,d=o.then(async p=>{if(l=["resolve",p],be.isValidElement(p))c=!1,this.create({id:a,type:"default",message:p});else if(DO(p)&&!p.ok){c=!1;let g=typeof n.error=="function"?await n.error(`HTTP error! status: ${p.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${p.status}`):n.description;this.create({id:a,type:"error",message:g,description:v})}else if(n.success!==void 0){c=!1;let g=typeof n.success=="function"?await n.success(p):n.success,v=typeof n.description=="function"?await n.description(p):n.description;this.create({id:a,type:"success",message:g,description:v})}}).catch(async p=>{if(l=["reject",p],n.error!==void 0){c=!1;let g=typeof n.error=="function"?await n.error(p):n.error,v=typeof n.description=="function"?await n.description(p):n.description;this.create({id:a,type:"error",message:g,description:v})}}).finally(()=>{var p;c&&(this.dismiss(a),a=void 0),(p=n.finally)==null||p.call(n)}),m=()=>new Promise((p,g)=>d.then(()=>l[0]==="reject"?g(l[1]):p(l[1])).catch(g));return typeof a!="string"&&typeof a!="number"?{unwrap:m}:Object.assign(a,{unwrap:m})},this.custom=(t,n)=>{let a=(n==null?void 0:n.id)||qh++;return this.create({jsx:t(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Tn=new AO,_O=(t,n)=>{let a=(n==null?void 0:n.id)||qh++;return Tn.addToast({title:t,...n,id:a}),a},DO=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",OO=_O,LO=()=>Tn.toasts,zO=()=>Tn.getActiveToasts(),Dt=Object.assign(OO,{success:Tn.success,info:Tn.info,warning:Tn.warning,error:Tn.error,custom:Tn.custom,message:Tn.message,promise:Tn.promise,dismiss:Tn.dismiss,loading:Tn.loading},{getHistory:LO,getToasts:zO});function PO(t,{insertAt:n}={}){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}PO(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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 Hu(t){return t.label!==void 0}var IO=3,UO="32px",BO="16px",q0=4e3,$O=356,HO=14,GO=20,VO=200;function wr(...t){return t.filter(Boolean).join(" ")}function FO(t){let[n,a]=t.split("-"),o=[];return n&&o.push(n),a&&o.push(a),o}var YO=t=>{var n,a,o,c,l,d,m,p,g,v,b;let{invert:w,toast:y,unstyled:C,interacting:S,setHeights:E,visibleToasts:k,heights:N,index:T,toasts:M,expanded:_,removeToast:R,defaultRichColors:L,closeButton:te,style:K,cancelButtonStyle:I,actionButtonStyle:G,className:Y="",descriptionClassName:ce="",duration:fe,position:se,gap:P,loadingIcon:Z,expandByDefault:ae,classNames:re,icons:V,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:D}=t,[$,H]=be.useState(null),[X,xe]=be.useState(null),[q,ge]=be.useState(!1),[me,B]=be.useState(!1),[ie,we]=be.useState(!1),[Ce,ze]=be.useState(!1),[Ke,ft]=be.useState(!1),[Pt,gn]=be.useState(0),[Yr,_n]=be.useState(0),wn=be.useRef(y.duration||fe||q0),Xn=be.useRef(null),Zn=be.useRef(null),It=T===0,po=T+1<=k,nn=y.type,Dn=y.dismissible!==!1,Da=y.className||"",ho=y.descriptionClassName||"",Qn=be.useMemo(()=>N.findIndex(Oe=>Oe.toastId===y.id)||0,[N,y.id]),Es=be.useMemo(()=>{var Oe;return(Oe=y.closeButton)!=null?Oe:te},[y.closeButton,te]),qr=be.useMemo(()=>y.duration||fe||q0,[y.duration,fe]),gr=be.useRef(0),Tt=be.useRef(0),On=be.useRef(0),Mt=be.useRef(null),[Oi,Li]=se.split("-"),go=be.useMemo(()=>N.reduce((Oe,tt,it)=>it>=Qn?Oe:Oe+tt.height,0),[N,Qn]),Kr=RO(),Oa=y.invert||w,Mr=nn==="loading";Tt.current=be.useMemo(()=>Qn*P+go,[Qn,go]),be.useEffect(()=>{wn.current=qr},[qr]),be.useEffect(()=>{ge(!0)},[]),be.useEffect(()=>{let Oe=Zn.current;if(Oe){let tt=Oe.getBoundingClientRect().height;return _n(tt),E(it=>[{toastId:y.id,height:tt,position:y.position},...it]),()=>E(it=>it.filter(rn=>rn.toastId!==y.id))}},[E,y.id]),be.useLayoutEffect(()=>{if(!q)return;let Oe=Zn.current,tt=Oe.style.height;Oe.style.height="auto";let it=Oe.getBoundingClientRect().height;Oe.style.height=tt,_n(it),E(rn=>rn.find(Ft=>Ft.toastId===y.id)?rn.map(Ft=>Ft.toastId===y.id?{...Ft,height:it}:Ft):[{toastId:y.id,height:it,position:y.position},...rn])},[q,y.title,y.description,E,y.id]);let Kt=be.useCallback(()=>{B(!0),gn(Tt.current),E(Oe=>Oe.filter(tt=>tt.toastId!==y.id)),setTimeout(()=>{R(y)},VO)},[y,R,E,Tt]);be.useEffect(()=>{if(y.promise&&nn==="loading"||y.duration===1/0||y.type==="loading")return;let Oe;return _||S||D&&Kr?(()=>{if(On.current<gr.current){let tt=new Date().getTime()-gr.current;wn.current=wn.current-tt}On.current=new Date().getTime()})():wn.current!==1/0&&(gr.current=new Date().getTime(),Oe=setTimeout(()=>{var tt;(tt=y.onAutoClose)==null||tt.call(y,y),Kt()},wn.current)),()=>clearTimeout(Oe)},[_,S,y,nn,D,Kr,Kt]),be.useEffect(()=>{y.delete&&Kt()},[Kt,y.delete]);function La(){var Oe,tt,it;return V!=null&&V.loading?be.createElement("div",{className:wr(re==null?void 0:re.loader,(Oe=y==null?void 0:y.classNames)==null?void 0:Oe.loader,"sonner-loader"),"data-visible":nn==="loading"},V.loading):Z?be.createElement("div",{className:wr(re==null?void 0:re.loader,(tt=y==null?void 0:y.classNames)==null?void 0:tt.loader,"sonner-loader"),"data-visible":nn==="loading"},Z):be.createElement(SO,{className:wr(re==null?void 0:re.loader,(it=y==null?void 0:y.classNames)==null?void 0:it.loader),visible:nn==="loading"})}return be.createElement("li",{tabIndex:0,ref:Zn,className:wr(Y,Da,re==null?void 0:re.toast,(n=y==null?void 0:y.classNames)==null?void 0:n.toast,re==null?void 0:re.default,re==null?void 0:re[nn],(a=y==null?void 0:y.classNames)==null?void 0:a[nn]),"data-sonner-toast":"","data-rich-colors":(o=y.richColors)!=null?o:L,"data-styled":!(y.jsx||y.unstyled||C),"data-mounted":q,"data-promise":!!y.promise,"data-swiped":Ke,"data-removed":me,"data-visible":po,"data-y-position":Oi,"data-x-position":Li,"data-index":T,"data-front":It,"data-swiping":ie,"data-dismissible":Dn,"data-type":nn,"data-invert":Oa,"data-swipe-out":Ce,"data-swipe-direction":X,"data-expanded":!!(_||ae&&q),style:{"--index":T,"--toasts-before":T,"--z-index":M.length-T,"--offset":`${me?Pt:Tt.current}px`,"--initial-height":ae?"auto":`${Yr}px`,...K,...y.style},onDragEnd:()=>{we(!1),H(null),Mt.current=null},onPointerDown:Oe=>{Mr||!Dn||(Xn.current=new Date,gn(Tt.current),Oe.target.setPointerCapture(Oe.pointerId),Oe.target.tagName!=="BUTTON"&&(we(!0),Mt.current={x:Oe.clientX,y:Oe.clientY}))},onPointerUp:()=>{var Oe,tt,it,rn;if(Ce||!Dn)return;Mt.current=null;let Ft=Number(((Oe=Zn.current)==null?void 0:Oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Rt=Number(((tt=Zn.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Jn=new Date().getTime()-((it=Xn.current)==null?void 0:it.getTime()),fn=$==="x"?Ft:Rt,Ln=Math.abs(fn)/Jn;if(Math.abs(fn)>=GO||Ln>.11){gn(Tt.current),(rn=y.onDismiss)==null||rn.call(y,y),xe($==="x"?Ft>0?"right":"left":Rt>0?"down":"up"),Kt(),ze(!0),ft(!1);return}we(!1),H(null)},onPointerMove:Oe=>{var tt,it,rn,Ft;if(!Mt.current||!Dn||((tt=window.getSelection())==null?void 0:tt.toString().length)>0)return;let Rt=Oe.clientY-Mt.current.y,Jn=Oe.clientX-Mt.current.x,fn=(it=t.swipeDirections)!=null?it:FO(se);!$&&(Math.abs(Jn)>1||Math.abs(Rt)>1)&&H(Math.abs(Jn)>Math.abs(Rt)?"x":"y");let Ln={x:0,y:0};$==="y"?(fn.includes("top")||fn.includes("bottom"))&&(fn.includes("top")&&Rt<0||fn.includes("bottom")&&Rt>0)&&(Ln.y=Rt):$==="x"&&(fn.includes("left")||fn.includes("right"))&&(fn.includes("left")&&Jn<0||fn.includes("right")&&Jn>0)&&(Ln.x=Jn),(Math.abs(Ln.x)>0||Math.abs(Ln.y)>0)&&ft(!0),(rn=Zn.current)==null||rn.style.setProperty("--swipe-amount-x",`${Ln.x}px`),(Ft=Zn.current)==null||Ft.style.setProperty("--swipe-amount-y",`${Ln.y}px`)}},Es&&!y.jsx?be.createElement("button",{"aria-label":O,"data-disabled":Mr,"data-close-button":!0,onClick:Mr||!Dn?()=>{}:()=>{var Oe;Kt(),(Oe=y.onDismiss)==null||Oe.call(y,y)},className:wr(re==null?void 0:re.closeButton,(c=y==null?void 0:y.classNames)==null?void 0:c.closeButton)},(l=V==null?void 0:V.close)!=null?l:MO):null,y.jsx||f.isValidElement(y.title)?y.jsx?y.jsx:typeof y.title=="function"?y.title():y.title:be.createElement(be.Fragment,null,nn||y.icon||y.promise?be.createElement("div",{"data-icon":"",className:wr(re==null?void 0:re.icon,(d=y==null?void 0:y.classNames)==null?void 0:d.icon)},y.promise||y.type==="loading"&&!y.icon?y.icon||La():null,y.type!=="loading"?y.icon||(V==null?void 0:V[nn])||jO(nn):null):null,be.createElement("div",{"data-content":"",className:wr(re==null?void 0:re.content,(m=y==null?void 0:y.classNames)==null?void 0:m.content)},be.createElement("div",{"data-title":"",className:wr(re==null?void 0:re.title,(p=y==null?void 0:y.classNames)==null?void 0:p.title)},typeof y.title=="function"?y.title():y.title),y.description?be.createElement("div",{"data-description":"",className:wr(ce,ho,re==null?void 0:re.description,(g=y==null?void 0:y.classNames)==null?void 0:g.description)},typeof y.description=="function"?y.description():y.description):null),f.isValidElement(y.cancel)?y.cancel:y.cancel&&Hu(y.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:y.cancelButtonStyle||I,onClick:Oe=>{var tt,it;Hu(y.cancel)&&Dn&&((it=(tt=y.cancel).onClick)==null||it.call(tt,Oe),Kt())},className:wr(re==null?void 0:re.cancelButton,(v=y==null?void 0:y.classNames)==null?void 0:v.cancelButton)},y.cancel.label):null,f.isValidElement(y.action)?y.action:y.action&&Hu(y.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:y.actionButtonStyle||G,onClick:Oe=>{var tt,it;Hu(y.action)&&((it=(tt=y.action).onClick)==null||it.call(tt,Oe),!Oe.defaultPrevented&&Kt())},className:wr(re==null?void 0:re.actionButton,(b=y==null?void 0:y.classNames)==null?void 0:b.actionButton)},y.action.label):null))};function K0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function qO(t,n){let a={};return[t,n].forEach((o,c)=>{let l=c===1,d=l?"--mobile-offset":"--offset",m=l?BO:UO;function p(g){["top","right","bottom","left"].forEach(v=>{a[`${d}-${v}`]=typeof g=="number"?`${g}px`:g})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(g=>{o[g]===void 0?a[`${d}-${g}`]=m:a[`${d}-${g}`]=typeof o[g]=="number"?`${o[g]}px`:o[g]}):p(m)}),a}var KO=f.forwardRef(function(t,n){let{invert:a,position:o="bottom-right",hotkey:c=["altKey","KeyT"],expand:l,closeButton:d,className:m,offset:p,mobileOffset:g,theme:v="light",richColors:b,duration:w,style:y,visibleToasts:C=IO,toastOptions:S,dir:E=K0(),gap:k=HO,loadingIcon:N,icons:T,containerAriaLabel:M="Notifications",pauseWhenPageIsHidden:_}=t,[R,L]=be.useState([]),te=be.useMemo(()=>Array.from(new Set([o].concat(R.filter(D=>D.position).map(D=>D.position)))),[R,o]),[K,I]=be.useState([]),[G,Y]=be.useState(!1),[ce,fe]=be.useState(!1),[se,P]=be.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=be.useRef(null),ae=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),re=be.useRef(null),V=be.useRef(!1),O=be.useCallback(D=>{L($=>{var H;return(H=$.find(X=>X.id===D.id))!=null&&H.delete||Tn.dismiss(D.id),$.filter(({id:X})=>X!==D.id)})},[]);return be.useEffect(()=>Tn.subscribe(D=>{if(D.dismiss){L($=>$.map(H=>H.id===D.id?{...H,delete:!0}:H));return}setTimeout(()=>{m8.flushSync(()=>{L($=>{let H=$.findIndex(X=>X.id===D.id);return H!==-1?[...$.slice(0,H),{...$[H],...D},...$.slice(H+1)]:[D,...$]})})})}),[]),be.useEffect(()=>{if(v!=="system"){P(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;let D=window.matchMedia("(prefers-color-scheme: dark)");try{D.addEventListener("change",({matches:$})=>{P($?"dark":"light")})}catch{D.addListener(({matches:H})=>{try{P(H?"dark":"light")}catch(X){console.error(X)}})}},[v]),be.useEffect(()=>{R.length<=1&&Y(!1)},[R]),be.useEffect(()=>{let D=$=>{var H,X;c.every(xe=>$[xe]||$.code===xe)&&(Y(!0),(H=Z.current)==null||H.focus()),$.code==="Escape"&&(document.activeElement===Z.current||(X=Z.current)!=null&&X.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[c]),be.useEffect(()=>{if(Z.current)return()=>{re.current&&(re.current.focus({preventScroll:!0}),re.current=null,V.current=!1)}},[Z.current]),be.createElement("section",{ref:n,"aria-label":`${M} ${ae}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},te.map((D,$)=>{var H;let[X,xe]=D.split("-");return R.length?be.createElement("ol",{key:D,dir:E==="auto"?K0():E,tabIndex:-1,ref:Z,className:m,"data-sonner-toaster":!0,"data-theme":se,"data-y-position":X,"data-lifted":G&&R.length>1&&!l,"data-x-position":xe,style:{"--front-toast-height":`${((H=K[0])==null?void 0:H.height)||0}px`,"--width":`${$O}px`,"--gap":`${k}px`,...y,...qO(p,g)},onBlur:q=>{V.current&&!q.currentTarget.contains(q.relatedTarget)&&(V.current=!1,re.current&&(re.current.focus({preventScroll:!0}),re.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||V.current||(V.current=!0,re.current=q.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{ce||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||fe(!0)},onPointerUp:()=>fe(!1)},R.filter(q=>!q.position&&$===0||q.position===D).map((q,ge)=>{var me,B;return be.createElement(YO,{key:q.id,icons:T,index:ge,toast:q,defaultRichColors:b,duration:(me=S==null?void 0:S.duration)!=null?me:w,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:a,visibleToasts:C,closeButton:(B=S==null?void 0:S.closeButton)!=null?B:d,interacting:ce,position:D,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,removeToast:O,toasts:R.filter(ie=>ie.position==q.position),heights:K.filter(ie=>ie.position==q.position),setHeights:I,expandByDefault:l,gap:k,loadingIcon:N,expanded:G,pauseWhenPageIsHidden:_,swipeDirections:t.swipeDirections})})):null}))});async function nd(t){const n=Dt.loading("Saving changes…");try{const a=await t();if(Dt.success("Changes saved",{id:n}),a.botRestart){const o=Dt.loading("Restarting bot…");a.botRestart.success?Dt.success("Bot started",{id:o}):Dt.error(a.botRestart.error??"Could not start bot",{id:o})}return a}catch(a){throw Dt.error(a instanceof Error?a.message:"Save failed",{id:n}),a}}function WO({filename:t}){const{canEditConfig:n}=qt(),a=!n("supportbot"),[o,c]=f.useState(null),[l,d]=f.useState(null),[m,p]=f.useState(!0),[g,v]=f.useState(!1),[b,w]=f.useState(""),[y,C]=f.useState(""),S=f.useCallback(async()=>{p(!0),w(""),C("");try{const _=(await Ne.getAddonConfigJson(t)).data??{};c(_),d(structuredClone(_))}catch(M){w(M instanceof Error?M.message:"Failed to load config")}finally{p(!1)}},[t]);f.useEffect(()=>{S()},[S]);const E=o?wO(o):null;function k(M,_){c(R=>R&&Gn(R,M,_))}async function N(){if(!(a||!o)){v(!0),w(""),C("");try{const M=await nd(()=>Ne.saveAddonConfig(t,o));C(M.message||"Saved."),await S()}catch(M){w(M instanceof Error?M.message:"Save failed")}finally{v(!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(Ye,{variant:"destructive",children:s.jsx(qe,{children:b||"Failed to load"})});const T=l&&JSON.stringify(o)!==JSON.stringify(l);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(ue,{variant:"outline",size:"sm",onClick:S,disabled:m||g,children:"Reload"}),a?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(ue,{size:"sm",onClick:N,disabled:g||!T,children:[s.jsx(ve,{icon:Sd,size:16,className:"mr-1.5"}),g?"Saving…":"Save"]})]}),b?s.jsxs(Ye,{variant:"destructive",children:[s.jsx(ve,{icon:ig,size:18}),s.jsx(qe,{children:b})]}):null,y?s.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(qe,{children:y})}):null,E.map(M=>s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{className:"pb-3",children:[s.jsx(dt,{className:"text-base",children:M.title}),M.description?s.jsx(Ot,{children:M.description}):null]}),s.jsx(Qe,{className:"grid gap-4 sm:grid-cols-2",children:M.fields.map(_=>s.jsx("div",{className:_.type==="textarea"||_.type==="stringList"?"sm:col-span-2":"",children:s.jsx(pd,{field:_,value:Fr(o,_.path),readOnly:a,onChange:R=>k(_.path,R)})},_.path))})]},M.title))]})}function XO(t){return t.startsWith("Ticket.DepartmentSystem.")?"Ticket Departments":t.startsWith("Ticket.PrioritySystem.")?"Ticket Priorities":t.startsWith("Ticket.")?"Tickets":(t.split(".")[0]??"Other").replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,a=>a.toUpperCase())}function ZO(t,n){const a=new Set(t.flatMap(d=>d.fields.map(m=>m.path))),o=Nx(n).filter(d=>!a.has(d.path));if(o.length===0)return t;const c=t.map(d=>({...d,fields:[...d.fields]})),l=new Map;for(const d of o){const m=XO(d.path),p=l.get(m)??[];p.push(d),l.set(m,p)}for(const[d,m]of l.entries()){const p=c.find(g=>g.title.toLowerCase()===d.toLowerCase());p?p.fields.push(...m):c.push({title:d,description:"These options exist in your config file but are not in the main editor sections.",fields:m.sort((g,v)=>g.path.localeCompare(v.path))})}return c}function W0(t,n){(n==null||n>t.length)&&(n=t.length);for(var a=0,o=Array(n);a<n;a++)o[a]=t[a];return o}function QO(t){if(Array.isArray(t))return t}function JO(t,n,a){return(n=oL(n))in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t}function eL(t,n){var a=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(a!=null){var o,c,l,d,m=[],p=!0,g=!1;try{if(l=(a=a.call(t)).next,n!==0)for(;!(p=(o=l.call(a)).done)&&(m.push(o.value),m.length!==n);p=!0);}catch(v){g=!0,c=v}finally{try{if(!p&&a.return!=null&&(d=a.return(),Object(d)!==d))return}finally{if(g)throw c}}return m}}function tL(){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 X0(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),a.push.apply(a,o)}return a}function Z0(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?X0(Object(a),!0).forEach(function(o){JO(t,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):X0(Object(a)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(a,o))})}return t}function nL(t,n){if(t==null)return{};var a,o,c=rL(t,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(o=0;o<l.length;o++)a=l[o],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(c[a]=t[a])}return c}function rL(t,n){if(t==null)return{};var a={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(n.indexOf(o)!==-1)continue;a[o]=t[o]}return a}function aL(t,n){return QO(t)||eL(t,n)||iL(t,n)||tL()}function sL(t,n){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var o=a.call(t,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}function oL(t){var n=sL(t,"string");return typeof n=="symbol"?n:n+""}function iL(t,n){if(t){if(typeof t=="string")return W0(t,n);var a={}.toString.call(t).slice(8,-1);return a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set"?Array.from(t):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?W0(t,n):void 0}}function lL(t,n,a){return n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t}function Q0(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable})),a.push.apply(a,o)}return a}function J0(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Q0(Object(a),!0).forEach(function(o){lL(t,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Q0(Object(a)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(a,o))})}return t}function cL(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return function(o){return n.reduceRight(function(c,l){return l(c)},o)}}function Al(t){return function n(){for(var a=this,o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];return c.length>=t.length?t.apply(this,c):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(c,m))}}}function hd(t){return{}.toString.call(t).includes("Object")}function uL(t){return!Object.keys(t).length}function Ql(t){return typeof t=="function"}function dL(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function fL(t,n){return hd(n)||us("changeType"),Object.keys(n).some(function(a){return!dL(t,a)})&&us("changeField"),n}function mL(t){Ql(t)||us("selectorType")}function pL(t){Ql(t)||hd(t)||us("handlerType"),hd(t)&&Object.values(t).some(function(n){return!Ql(n)})&&us("handlersType")}function hL(t){t||us("initialIsRequired"),hd(t)||us("initialType"),uL(t)&&us("initialContent")}function gL(t,n){throw new Error(t[n]||t.default)}var xL={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"},us=Al(gL)(xL),Gu={changes:fL,selector:mL,handler:pL,initial:hL};function vL(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Gu.initial(t),Gu.handler(n);var a={current:t},o=Al(wL)(a,n),c=Al(yL)(a),l=Al(Gu.changes)(t),d=Al(bL)(a);function m(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(v){return v};return Gu.selector(g),g(a.current)}function p(g){cL(o,c,l,d)(g)}return[m,p]}function bL(t,n){return Ql(n)?n(t.current):n}function yL(t,n){return t.current=J0(J0({},t.current),n),n}function wL(t,n,a){return Ql(n)?n(t.current):Object.keys(a).forEach(function(o){var c;return(c=n[o])===null||c===void 0?void 0:c.call(n,t.current[o])}),a}var jL={create:vL},CL={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function SL(t){return function n(){for(var a=this,o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];return c.length>=t.length?t.apply(this,c):function(){for(var d=arguments.length,m=new Array(d),p=0;p<d;p++)m[p]=arguments[p];return n.apply(a,[].concat(c,m))}}}function NL(t){return{}.toString.call(t).includes("Object")}function EL(t){return t||e2("configIsRequired"),NL(t)||e2("configType"),t.urls?(kL(),{paths:{vs:t.urls.monacoBase}}):t}function kL(){console.warn(t5.deprecation)}function TL(t,n){throw new Error(t[n]||t.default)}var t5={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
|
||
`},e2=SL(TL)(t5),ML={config:EL},RL=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return function(c){return a.reduceRight(function(l,d){return d(l)},c)}};function n5(t,n){return Object.keys(n).forEach(function(a){n[a]instanceof Object&&t[a]&&Object.assign(n[a],n5(t[a],n[a]))}),Z0(Z0({},t),n)}var AL={type:"cancelation",msg:"operation is manually canceled"};function Wp(t){var n=!1,a=new Promise(function(o,c){t.then(function(l){return n?c(AL):o(l)}),t.catch(c)});return a.cancel=function(){return n=!0},a}var _L=["monaco"],DL=jL.create({config:CL,isInitialized:!1,resolve:null,reject:null,monaco:null}),r5=aL(DL,2),pc=r5[0],nf=r5[1];function OL(t){var n=ML.config(t),a=n.monaco,o=nL(n,_L);nf(function(c){return{config:n5(c.config,o),monaco:a}})}function LL(){var t=pc(function(n){var a=n.monaco,o=n.isInitialized,c=n.resolve;return{monaco:a,isInitialized:o,resolve:c}});if(!t.isInitialized){if(nf({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),Wp(Xp);if(window.monaco&&window.monaco.editor)return a5(window.monaco),t.resolve(window.monaco),Wp(Xp);RL(zL,IL)(UL)}return Wp(Xp)}function zL(t){return document.body.appendChild(t)}function PL(t){var n=document.createElement("script");return t&&(n.src=t),n}function IL(t){var n=pc(function(o){var c=o.config,l=o.reject;return{config:c,reject:l}}),a=PL("".concat(n.config.paths.vs,"/loader.js"));return a.onload=function(){return t()},a.onerror=n.reject,a}function UL(){var t=pc(function(a){var o=a.config,c=a.resolve,l=a.reject;return{config:o,resolve:c,reject:l}}),n=window.require;n.config(t.config),n(["vs/editor/editor.main"],function(a){var o=a.m||a;a5(o),t.resolve(o)},function(a){t.reject(a)})}function a5(t){pc().monaco||nf({monaco:t})}function BL(){return pc(function(t){var n=t.monaco;return n})}var Xp=new Promise(function(t,n){return nf({resolve:t,reject:n})}),s5={config:OL,init:LL,__getMonacoInstance:BL},$L={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Zp=$L,HL={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},GL=HL;function VL({children:t}){return be.createElement("div",{style:GL.container},t)}var FL=VL,YL=FL;function qL({width:t,height:n,isEditorReady:a,loading:o,_ref:c,className:l,wrapperProps:d}){return be.createElement("section",{style:{...Zp.wrapper,width:t,height:n},...d},!a&&be.createElement(YL,null,o),be.createElement("div",{ref:c,style:{...Zp.fullWidth,...!a&&Zp.hide},className:l}))}var KL=qL,o5=f.memo(KL);function WL(t){f.useEffect(t,[])}var i5=WL;function XL(t,n,a=!0){let o=f.useRef(!0);f.useEffect(o.current||!a?()=>{o.current=!1}:t,n)}var Yn=XL;function zl(){}function li(t,n,a,o){return ZL(t,o)||QL(t,n,a,o)}function ZL(t,n){return t.editor.getModel(l5(t,n))}function QL(t,n,a,o){return t.editor.createModel(n,a,o?l5(t,o):void 0)}function l5(t,n){return t.Uri.parse(n)}function JL({original:t,modified:n,language:a,originalLanguage:o,modifiedLanguage:c,originalModelPath:l,modifiedModelPath:d,keepCurrentOriginalModel:m=!1,keepCurrentModifiedModel:p=!1,theme:g="light",loading:v="Loading...",options:b={},height:w="100%",width:y="100%",className:C,wrapperProps:S={},beforeMount:E=zl,onMount:k=zl}){let[N,T]=f.useState(!1),[M,_]=f.useState(!0),R=f.useRef(null),L=f.useRef(null),te=f.useRef(null),K=f.useRef(k),I=f.useRef(E),G=f.useRef(!1);i5(()=>{let se=s5.init();return se.then(P=>(L.current=P)&&_(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>R.current?fe():se.cancel()}),Yn(()=>{if(R.current&&L.current){let se=R.current.getOriginalEditor(),P=li(L.current,t||"",o||a||"text",l||"");P!==se.getModel()&&se.setModel(P)}},[l],N),Yn(()=>{if(R.current&&L.current){let se=R.current.getModifiedEditor(),P=li(L.current,n||"",c||a||"text",d||"");P!==se.getModel()&&se.setModel(P)}},[d],N),Yn(()=>{let se=R.current.getModifiedEditor();se.getOption(L.current.editor.EditorOption.readOnly)?se.setValue(n||""):n!==se.getValue()&&(se.executeEdits("",[{range:se.getModel().getFullModelRange(),text:n||"",forceMoveMarkers:!0}]),se.pushUndoStop())},[n],N),Yn(()=>{var se,P;(P=(se=R.current)==null?void 0:se.getModel())==null||P.original.setValue(t||"")},[t],N),Yn(()=>{let{original:se,modified:P}=R.current.getModel();L.current.editor.setModelLanguage(se,o||a||"text"),L.current.editor.setModelLanguage(P,c||a||"text")},[a,o,c],N),Yn(()=>{var se;(se=L.current)==null||se.editor.setTheme(g)},[g],N),Yn(()=>{var se;(se=R.current)==null||se.updateOptions(b)},[b],N);let Y=f.useCallback(()=>{var Z;if(!L.current)return;I.current(L.current);let se=li(L.current,t||"",o||a||"text",l||""),P=li(L.current,n||"",c||a||"text",d||"");(Z=R.current)==null||Z.setModel({original:se,modified:P})},[a,n,c,t,o,l,d]),ce=f.useCallback(()=>{var se;!G.current&&te.current&&(R.current=L.current.editor.createDiffEditor(te.current,{automaticLayout:!0,...b}),Y(),(se=L.current)==null||se.editor.setTheme(g),T(!0),G.current=!0)},[b,g,Y]);f.useEffect(()=>{N&&K.current(R.current,L.current)},[N]),f.useEffect(()=>{!M&&!N&&ce()},[M,N,ce]);function fe(){var P,Z,ae,re;let se=(P=R.current)==null?void 0:P.getModel();m||((Z=se==null?void 0:se.original)==null||Z.dispose()),p||((ae=se==null?void 0:se.modified)==null||ae.dispose()),(re=R.current)==null||re.dispose()}return be.createElement(o5,{width:y,height:w,isEditorReady:N,loading:v,_ref:te,className:C,wrapperProps:S})}var ez=JL;f.memo(ez);function tz(t){let n=f.useRef();return f.useEffect(()=>{n.current=t},[t]),n.current}var nz=tz,Vu=new Map;function rz({defaultValue:t,defaultLanguage:n,defaultPath:a,value:o,language:c,path:l,theme:d="light",line:m,loading:p="Loading...",options:g={},overrideServices:v={},saveViewState:b=!0,keepCurrentModel:w=!1,width:y="100%",height:C="100%",className:S,wrapperProps:E={},beforeMount:k=zl,onMount:N=zl,onChange:T,onValidate:M=zl}){let[_,R]=f.useState(!1),[L,te]=f.useState(!0),K=f.useRef(null),I=f.useRef(null),G=f.useRef(null),Y=f.useRef(N),ce=f.useRef(k),fe=f.useRef(),se=f.useRef(o),P=nz(l),Z=f.useRef(!1),ae=f.useRef(!1);i5(()=>{let O=s5.init();return O.then(D=>(K.current=D)&&te(!1)).catch(D=>(D==null?void 0:D.type)!=="cancelation"&&console.error("Monaco initialization: error:",D)),()=>I.current?V():O.cancel()}),Yn(()=>{var D,$,H,X;let O=li(K.current,t||o||"",n||c||"",l||a||"");O!==((D=I.current)==null?void 0:D.getModel())&&(b&&Vu.set(P,($=I.current)==null?void 0:$.saveViewState()),(H=I.current)==null||H.setModel(O),b&&((X=I.current)==null||X.restoreViewState(Vu.get(l))))},[l],_),Yn(()=>{var O;(O=I.current)==null||O.updateOptions(g)},[g],_),Yn(()=>{!I.current||o===void 0||(I.current.getOption(K.current.editor.EditorOption.readOnly)?I.current.setValue(o):o!==I.current.getValue()&&(ae.current=!0,I.current.executeEdits("",[{range:I.current.getModel().getFullModelRange(),text:o,forceMoveMarkers:!0}]),I.current.pushUndoStop(),ae.current=!1))},[o],_),Yn(()=>{var D,$;let O=(D=I.current)==null?void 0:D.getModel();O&&c&&(($=K.current)==null||$.editor.setModelLanguage(O,c))},[c],_),Yn(()=>{var O;m!==void 0&&((O=I.current)==null||O.revealLine(m))},[m],_),Yn(()=>{var O;(O=K.current)==null||O.editor.setTheme(d)},[d],_);let re=f.useCallback(()=>{var O;if(!(!G.current||!K.current)&&!Z.current){ce.current(K.current);let D=l||a,$=li(K.current,o||t||"",n||c||"",D||"");I.current=(O=K.current)==null?void 0:O.editor.create(G.current,{model:$,automaticLayout:!0,...g},v),b&&I.current.restoreViewState(Vu.get(D)),K.current.editor.setTheme(d),m!==void 0&&I.current.revealLine(m),R(!0),Z.current=!0}},[t,n,a,o,c,l,g,v,b,d,m]);f.useEffect(()=>{_&&Y.current(I.current,K.current)},[_]),f.useEffect(()=>{!L&&!_&&re()},[L,_,re]),se.current=o,f.useEffect(()=>{var O,D;_&&T&&((O=fe.current)==null||O.dispose(),fe.current=(D=I.current)==null?void 0:D.onDidChangeModelContent($=>{ae.current||T(I.current.getValue(),$)}))},[_,T]),f.useEffect(()=>{if(_){let O=K.current.editor.onDidChangeMarkers(D=>{var H;let $=(H=I.current.getModel())==null?void 0:H.uri;if($&&D.find(X=>X.path===$.path)){let X=K.current.editor.getModelMarkers({resource:$});M==null||M(X)}});return()=>{O==null||O.dispose()}}return()=>{}},[_,M]);function V(){var O,D;(O=fe.current)==null||O.dispose(),w?b&&Vu.set(l,I.current.saveViewState()):(D=I.current.getModel())==null||D.dispose(),I.current.dispose()}return be.createElement(o5,{width:y,height:C,isEditorReady:_,loading:p,_ref:G,className:S,wrapperProps:E})}var az=rz,sz=f.memo(az),oz=sz;function iz(t){return t!==null&&typeof t=="object"&&"Command"in t}function lz(t){return Object.entries(t).filter(([,n])=>iz(n)).map(([n,a])=>({key:n,...a}))}function cz({data:t,onChange:n}){const a=lz(t);function o(c,l){const d=t[c];n({...t,[c]:{...d,...l}})}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(c=>s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{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(ve,{icon:ds,size:18})}),s.jsx(dt,{className:"text-base",children:c.key})]}),s.jsxs(Qe,{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(_e,{htmlFor:`${c.key}-enabled`,children:"Enabled"}),s.jsx(kt,{id:`${c.key}-enabled`,checked:c.Enabled!==!1,onCheckedChange:l=>o(c.key,{Enabled:l})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(_e,{children:"Slash command"}),s.jsx(De,{value:c.Command??"",onChange:l=>o(c.key,{Command:l.target.value}),className:"border-border bg-secondary/30 font-mono"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(_e,{children:"Description"}),s.jsx(De,{value:c.Description??"",onChange:l=>o(c.key,{Description:l.target.value}),className:"border-border bg-secondary/30"})]})]})]},c.key))})}function uz(t,n){let a=structuredClone(n);if(t==="supportbot"){const o=Fr(a,"General.Token");o&&o!=="BOT_TOKEN"&&(a=Gn(a,"General.Token","BOT_TOKEN"))}if(t==="supportbot-ai"){const o=Fr(a,"General.Model_API_Key");o&&o!=="MODEL_API_KEY"&&(a=Gn(a,"General.Model_API_Key","MODEL_API_KEY"))}return a}function dz(t,n,a,o){const c={};for(const l of n)for(const d of l.fields){const m=Fr(a,d.path),p=Fr(o,d.path);d.type==="secret"&&(m==="BOT_TOKEN"||m==="MODEL_API_KEY"||m===""||m===void 0)||JSON.stringify(m)!==JSON.stringify(p)&&(c[`${t}:${d.path}`]=m)}return c}function fz(t,n){const a=new Map,o=[];for(const l of t){const d=l.path.split(".");if(d.length>=5&&d[1]==="DepartmentSystem"&&d[2]==="Departments"){const m=d[3],p=a.get(m)??[];p.push(l),a.set(m,p)}else if(d.length>=3){const m=d[1],p=a.get(m)??[];p.push(l),a.set(m,p)}else o.push(l)}if(a.size===0)return{standalone:t,groups:[]};const c=[...a.entries()].map(([l,d])=>{const m=["enabled","name","description","emoji","category","role","channelprefix","defaultpriority","questions"];d.sort((v,b)=>{var E,k;const w=((E=v.path.split(".").pop())==null?void 0:E.toLowerCase())||"",y=((k=b.path.split(".").pop())==null?void 0:k.toLowerCase())||"",C=m.indexOf(w),S=m.indexOf(y);return C!==-1&&S!==-1?C-S:C!==-1?-1:S!==-1?1:w.localeCompare(y)});const p=d.find(v=>v.path.toLowerCase().endsWith(".name")||v.path.toLowerCase().endsWith(".title"));let g="";if(p&&n){const v=Fr(n,p.path);typeof v=="string"&&v.trim()&&(g=v.trim())}return g||(g=l.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,v=>v.toUpperCase())),{key:l,name:g,fields:d}});return{standalone:o,groups:c}}function mz({configFile:t}){const{permissions:n,canEditConfig:a}=qt(),o=Mn(n,"configs.raw_yaml"),c=!a(t),[l,d]=f.useState(null),[m,p]=f.useState(null),[g,v]=f.useState(!0),[b,w]=f.useState(!1),[y,C]=f.useState(""),[S,E]=f.useState(""),[k,N]=f.useState("visual");f.useEffect(()=>{!o&&k==="yaml"&&N("visual")},[o,k]);const[T,M]=f.useState(""),[_,R]=f.useState(""),[L]=wd(),[te,K]=f.useState(()=>L.get("tab")||null),[I,G]=f.useState(!1),[Y,ce]=f.useState(""),[fe,se]=f.useState(""),P=()=>{const q=Y.trim().toLowerCase().replace(/[^a-z0-9_-]/g,"");if(!q||!l)return;const ge=fe.trim()||q,me=`Ticket.DepartmentSystem.Departments.${q}`,B={...l};Gn(B,`${me}.Name`,ge),Gn(B,`${me}.Description`,`Open a ${ge} ticket`),Gn(B,`${me}.Emoji`,"🎫"),Gn(B,`${me}.Category`,"CATEGORY_ID"),Gn(B,`${me}.Role`,"ROLE_ID"),Gn(B,`${me}.ChannelPrefix`,`${q}-`),Gn(B,`${me}.DefaultPriority`,"normal"),Gn(B,`${me}.Questions`,["What do you need assistance with?"]),d(B),G(!1),ce(""),se("")},Z=q=>{if(!l)return;const ge=`Ticket.DepartmentSystem.Departments.${q}`,me=JSON.parse(JSON.stringify(l));if(Object.keys(me).forEach(B=>{(B.startsWith(ge)||B===ge)&&delete me[B]}),me.Ticket&&typeof me.Ticket=="object"){const B=me.Ticket.DepartmentSystem;B&&typeof B=="object"&&B.Departments&&typeof B.Departments=="object"&&delete B.Departments[q]}d(me)},ae=FM(t),re=f.useMemo(()=>!ae||ae==="commands"||!l?ae:ZO(ae,l),[ae,l]);f.useEffect(()=>{var q;if(re&&re!=="commands"){const ge=L.get("tab");if(ge&&re.find(me=>me.title.toLowerCase()===ge.toLowerCase())){const me=re.find(B=>B.title.toLowerCase()===ge.toLowerCase());me&&me.title!==te&&K(me.title)}else(!te||!re.find(me=>me.title===te))&&K(((q=re[0])==null?void 0:q.title)||null)}},[re,te,L]);const V=f.useCallback(async()=>{v(!0),C(""),E("");try{const ge=(await Ne.getConfigJson(t)).data??{},me=uz(t,ge);d(me),p(me);const ie=(await Ne.getConfigRaw(t)).data??"",we=z8(ie,t);M(we),R(we)}catch(q){C(q instanceof Error?q.message:"Failed to load config")}finally{v(!1)}},[t]);f.useEffect(()=>{V()},[V]);function O(q,ge){d(me=>me&&Gn(me,q,ge))}async function D(){if(!(c||T===_)){w(!0),C(""),E("");try{const q=await nd(()=>Ne.saveConfigRaw(t,T));E(q.message||"Config saved."),await V()}catch(q){C(q instanceof Error?q.message:"Save failed")}finally{w(!1)}}}async function $(){if(!(c||!l||!m)){if(k==="yaml"){await D();return}w(!0),C(""),E("");try{if(ae==="commands"){const q={};for(const me of Object.keys(l))JSON.stringify(l[me])!==JSON.stringify(m[me])&&(q[`${t}:${me}`]=l[me]);if(Object.keys(q).length===0){E("No changes to save.");return}const ge=await nd(()=>Ne.updateConfigFields(q));E(ge.message||"")}else if(re&&re!=="commands"){const q=dz(t,re,l,m);if(Object.keys(q).length===0){E("No changes to save.");return}const ge=await nd(()=>Ne.updateConfigFields(q));E(ge.message||"")}await V()}catch(q){C(q instanceof Error?q.message:"Save failed")}finally{w(!1)}}}if(ae===null)return s.jsx(Ye,{children:s.jsx(qe,{children:"No visual editor available for this file."})});if(g)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(!l)return s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:y||"Failed to load"})});const H=m&&JSON.stringify(l)!==JSON.stringify(m),xe=k==="yaml"?T!==_:H;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[o?s.jsxs("div",{className:"flex rounded-lg border border-border p-0.5",children:[s.jsx(ue,{type:"button",variant:k==="visual"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>N("visual"),children:"Visual"}),s.jsx(ue,{type:"button",variant:k==="yaml"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>N("yaml"),children:"YAML"})]}):null,s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[xe?s.jsx("span",{className:"text-xs text-amber-500",children:"Unsaved changes"}):null,s.jsx(ue,{variant:"outline",size:"sm",onClick:V,disabled:g||b,children:"Reload"}),c?s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}):s.jsxs(ue,{size:"sm",onClick:$,disabled:b||!xe,children:[s.jsx(ve,{icon:Sd,size:16,className:"mr-1.5"}),b?"Saving…":"Save"]})]})]}),y?s.jsxs(Ye,{variant:"destructive",children:[s.jsx(ve,{icon:ig,size:18}),s.jsx(qe,{children:y})]}):null,S?s.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(qe,{children:S})}):null,k==="yaml"?s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{className:"pb-3",children:[s.jsx(dt,{className:"text-base",children:"Raw YAML"}),s.jsx(Ot,{children:"Edit the full file. Use this for nested lists (e.g. welcome buttons) or any option not in Visual mode."})]}),s.jsx(Qe,{className:"h-[min(520px,60vh)] overflow-hidden rounded-b-xl border-t border-border p-0",children:s.jsx(oz,{height:"100%",language:"yaml",theme:"vs-dark",value:T,onChange:q=>M(q||""),options:{readOnly:c,minimap:{enabled:!1},fontSize:13,wordWrap:"on",scrollBeyondLastLine:!1,padding:{top:16},tabSize:2}})})]}):ae==="commands"?s.jsx(cz,{data:l,onChange:q=>d(q)}):re&&re!=="commands"?s.jsxs("div",{className:"grid gap-6 lg:grid-cols-[200px_1fr]",children:[s.jsx("nav",{className:"flex flex-col gap-1",children:re.map(q=>s.jsx("button",{onClick:()=>K(q.title),className:pe("text-left px-3 py-2 text-sm rounded-md transition-colors",te===q.title?"bg-primary text-primary-foreground font-medium":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:q.title},q.title))}),s.jsx("div",{className:"min-w-0",children:re.filter(q=>q.title===te).map(q=>s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{className:"pb-3 flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(dt,{className:"text-base",children:q.title}),q.description?s.jsx(Ot,{children:q.description}):null]}),q.title==="Ticket Departments"&&!c&&s.jsxs(ue,{type:"button",size:"sm",variant:"outline",onClick:()=>G(!0),className:"gap-1.5 text-xs h-8 shrink-0",children:[s.jsx(ve,{icon:sg,size:14})," Add Department"]})]}),s.jsx(Qe,{className:"space-y-6",children:(()=>{const{standalone:ge,groups:me}=fz(q.fields,l);return s.jsxs(s.Fragment,{children:[ge.length>0&&s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:ge.map(B=>s.jsx("div",{className:B.type==="textarea"||B.type==="stringList"?"sm:col-span-2":"",children:s.jsx(pd,{field:B,value:Fr(l,B.path),readOnly:c,onChange:ie=>O(B.path,ie)})},B.path))}),me.map(B=>s.jsxs("div",{className:"rounded-xl border border-border bg-card/60 p-4 space-y-4 shadow-sm transition-all hover:border-primary/40",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-border/60 pb-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-semibold text-base text-foreground",children:B.name}),s.jsx("span",{className:"text-xs font-mono px-2.5 py-0.5 rounded-full bg-primary/10 text-primary border border-primary/20 font-medium",children:q.title==="Ticket Departments"?`Ticket.${B.key}`:B.key})]}),q.title==="Ticket Departments"&&B.key!=="DepartmentSystem"&&!c&&s.jsx(ue,{type:"button",size:"sm",variant:"ghost",onClick:()=>Z(B.key),className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",title:"Delete Department",children:s.jsx(ve,{icon:wi,size:14})})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:B.fields.map(ie=>s.jsx("div",{className:ie.type==="textarea"||ie.type==="stringList"?"sm:col-span-2":"",children:s.jsx(pd,{field:ie,value:Fr(l,ie.path),readOnly:c,onChange:we=>O(ie.path,we)})},ie.path))})]},B.key))]})})()})]},q.title))})]}):null,s.jsx(Qs,{open:I,onOpenChange:G,children:s.jsxs(hs,{className:"sm:max-w-[400px]",children:[s.jsxs(gs,{children:[s.jsx(xs,{className:"text-base",children:"Add Ticket Department"}),s.jsx(vs,{className:"text-xs",children:"Create a new support department for ticket creation."})]}),s.jsxs("div",{className:"space-y-3 py-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(_e,{className:"text-xs font-semibold",children:"Department Key (Internal ID)"}),s.jsx(De,{placeholder:"billing",value:Y,onChange:q=>ce(q.target.value.toLowerCase().replace(/[^a-z0-9_-]/g,"")),className:"text-xs font-mono border-border bg-secondary/30"}),s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["e.g. ",s.jsx("code",{children:"billing"}),", ",s.jsx("code",{children:"technical"}),", ",s.jsx("code",{children:"sales"})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(_e,{className:"text-xs font-semibold",children:"Department Display Name"}),s.jsx(De,{placeholder:"Billing & Sales Support",value:fe,onChange:q=>se(q.target.value),className:"text-xs border-border bg-secondary/30"})]})]}),s.jsxs(Js,{className:"gap-2 sm:gap-0",children:[s.jsx(ue,{variant:"outline",size:"sm",onClick:()=>G(!1),className:"text-xs",children:"Cancel"}),s.jsx(ue,{size:"sm",onClick:P,disabled:!Y.trim(),className:"text-xs bg-primary font-semibold",children:"Create Department"})]})]})})]})}const pz=Ne.listConfigs(),hz={supportbot:"Bot config","ticket-panel":"Ticket panel",commands:"Commands",messages:"Messages","supportbot-ai":"AI assistant"};function gz(){var T,M;const{permissions:t,canViewConfig:n}=qt(),{files:a}=$2(),[o,c]=wd(),l=o.get("file"),d=n("supportbot"),m=f.useMemo(()=>pz.filter(_=>n(_)),[n]),p=f.useMemo(()=>d?a:[],[d,a]),g=f.useMemo(()=>[...m,...p.map(_=>_l(_))],[m,p]),v=g[0]??"",[b,w]=f.useState(()=>l&&g.includes(l)?l:v);if(f.useEffect(()=>{l&&g.includes(l)?w(l):g.includes(b)||(w(v),v&&c({file:v}))},[l,g,b,v,c]),g.length===0)return s.jsx(ya,{to:mg(t),replace:!0});const y=H8(b),C=(y==null?void 0:y.type)==="addon",S=C?y.file:null,E=C?H2(S):hz[b]??"Configuration",k=C?!!((T=t==null?void 0:t.configs.supportbot)!=null&&T.edit):t?!!((M=t.configs[b])!=null&&M.edit):!1,N=C?S:`${b}.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:k?`Edit ${N} — changes apply to the running bot without restarting the dashboard.`:`Viewing ${N} — you do not have permission to save changes.`})]}),s.jsx("div",{className:"mt-6",children:C&&S?s.jsx(WO,{filename:S},S):s.jsx(mz,{configFile:b},b)})]})}const xz={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 vz(t){return t?xz[t]||"Sign-in failed. Please try again.":""}function bz(){const{branding:t}=Ed(),{isAuthenticated:n,loading:a,loginWithDiscord:o}=qt(),[c]=wd(),l=f.useMemo(()=>vz(c.get("error")),[c]);return!a&&n?s.jsx(ya,{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(Ze,{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(ut,{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(dt,{className:"bg-gradient-to-br from-white to-white/50 bg-clip-text text-3xl font-extrabold tracking-tight text-transparent",children:t.title||"SupportBot"}),s.jsx(Ot,{className:"mt-2 text-base font-medium text-white/50",children:"Sign in to your dashboard"})]})]}),s.jsxs(Qe,{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"})]})]}),l?s.jsx(Ye,{variant:"destructive",className:"border-red-500/50 bg-red-500/10 text-red-200 backdrop-blur-md",children:s.jsx(qe,{className:"font-medium",children:l})}):null,s.jsxs(ue,{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 mi=[{id:"botToken",title:"Bot token",subtitle:"Connect your Discord bot",icon:cg},{id:"database",title:"Database",subtitle:"SQLite or MySQL engine",icon:x8},{id:"secretKey",title:"Session secret",subtitle:"Secure dashboard logins",icon:M8},{id:"oauth",title:"Discord OAuth",subtitle:"Sign in with Discord",icon:By},{id:"redirectUri",title:"Redirect URL",subtitle:"OAuth callback address",icon:Nd},{id:"owners",title:"Dashboard owners",subtitle:"Who can access this panel",icon:rh},{id:"emeraldApi",title:"Emerald API",subtitle:"One-click addons",icon:By}];function yz(t){return t==="oauth"?"oauth":t==="owners"?"owners":t}function wz({brandingTitle:t,faviconUrl:n,faviconVersion:a,hasFavicon:o,children:c}){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(ve,{icon:cg,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:t})]})]}),c]})})}function jz({currentIndex:t,validation:n}){const a=(t+1)/mi.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 ",t+1," of ",mi.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:mi.map((o,c)=>{var g;const l=yz(o.id),d=(g=n[l])==null?void 0:g.ok,m=c===t,p=c<t;return s.jsxs("div",{className:pe("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:pe("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(ve,{icon:jd,size:18}):s.jsx(ve,{icon:o.icon,size:18})}),s.jsxs("div",{className:"min-w-0 pt-0.5",children:[s.jsx("p",{className:pe("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 Cz({step:t,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(ve,{icon:t.icon,size:20})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold",children:t.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t.subtitle})]})]}),s.jsxs("div",{className:"hidden md:block",children:[s.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:t.title}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t.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 mo({result:t}){var n,a;return t?t.ok?s.jsx(Ye,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:s.jsxs(qe,{className:"space-y-2",children:[t.bot?s.jsxs("p",{children:["Connected as ",s.jsxs("strong",{children:["@",t.bot.username]}),t.applicationId?s.jsxs("span",{className:"text-emerald-600/80 dark:text-emerald-400/80",children:[" ","· App ID ",t.applicationId]}):null]}):null,(n=t.users)!=null&&n.length?s.jsx("ul",{className:"space-y-1",children:t.users.map(o=>s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(ve,{icon:jd,size:14}),o.globalName||o.username,s.jsx("span",{className:"font-mono text-xs opacity-80",children:o.id})]},o.id))}):null,!t.bot&&!((a=t.users)!=null&&a.length)?s.jsx("p",{children:t.warning||"Verified successfully."}):null]})}):s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:t.error})}):null}function Sz({values:t,setValues:n,validation:a,validating:o,onValidate:c}){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(_e,{htmlFor:"botToken",children:"Bot token"}),s.jsx(De,{id:"botToken",type:"password",autoComplete:"off",value:t.botToken,onChange:l=>n({...t,botToken:l.target.value}),placeholder:"MTI…",className:"h-11 font-mono text-sm"})]}),s.jsx(mo,{result:a.botToken}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o||!t.botToken,onClick:c,children:o?"Checking with Discord…":"Verify bot token"})})]})}function Nz({values:t,setValues:n,validation:a,validating:o,onValidate:c,onGenerate:l}){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(_e,{htmlFor:"secretKey",children:"Session secret"}),s.jsx(De,{id:"secretKey",type:"password",autoComplete:"off",value:t.secretKey,onChange:d=>n({...t,secretKey:d.target.value}),className:"h-11 font-mono text-sm"})]}),s.jsx(mo,{result:a.secretKey}),s.jsxs("div",{className:"mt-auto flex flex-wrap gap-2",children:[s.jsx(ue,{type:"button",variant:"outline",onClick:l,children:"Generate secure secret"}),s.jsx(ue,{type:"button",variant:"secondary",disabled:o||!t.secretKey,onClick:c,children:o?"Checking…":"Validate"})]})]})}function Ez({values:t,setValues:n,validation:a,validating:o,onValidate:c}){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(_e,{htmlFor:"clientId",children:"Client ID"}),s.jsx(De,{id:"clientId",value:t.clientId,onChange:l=>n({...t,clientId:l.target.value}),className:"h-11 font-mono text-sm"})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(_e,{htmlFor:"clientSecret",children:"Client Secret"}),s.jsx(De,{id:"clientSecret",type:"password",autoComplete:"off",value:t.clientSecret,onChange:l=>n({...t,clientSecret:l.target.value}),className:"h-11 font-mono text-sm"})]})]}),s.jsx(mo,{result:a.oauth}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o||!t.clientId||!t.clientSecret,onClick:c,children:o?"Checking with Discord…":"Verify OAuth credentials"})})]})}function kz({values:t,setValues:n,validation:a}){async function o(){if(t.redirectUri)try{await navigator.clipboard.writeText(t.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(_e,{htmlFor:"redirectUri",children:"Redirect URI"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(De,{id:"redirectUri",value:t.redirectUri,onChange:c=>n({...t,redirectUri:c.target.value}),className:"h-11 flex-1 font-mono text-xs"}),s.jsx(ue,{type:"button",variant:"outline",size:"icon",className:"size-11 shrink-0",onClick:()=>void o(),title:"Copy URL",children:s.jsx(ve,{icon:R2,size:18})})]})]}),a.redirectUri&&!a.redirectUri.ok?s.jsx(mo,{result:a.redirectUri}):s.jsx(Ye,{className:"border-border bg-secondary",children:s.jsx(qe,{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 Tz({values:t,setValues:n,validation:a,validating:o,onValidate:c}){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(_e,{htmlFor:"owners",children:"Owner user IDs"}),s.jsx(Jd,{id:"owners",value:t.ownerUserIds,onChange:l=>n({...t,ownerUserIds:l.target.value}),placeholder:`829112572816130058
|
||
987654321098765432`,className:"min-h-[120px] font-mono text-sm"})]}),s.jsx(mo,{result:a.owners}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o||!t.ownerUserIds.trim(),onClick:c,children:o?"Checking with Discord…":"Verify owner IDs"})})]})}function Mz({onContinue:t}){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(ve,{icon:jd,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(Ye,{className:"mt-6 text-left",children:s.jsx(qe,{children:"After restarting, sign in with Discord to open the dashboard."})}),s.jsx(ue,{type:"button",size:"lg",className:"mt-8 min-w-[220px]",onClick:t,children:"Continue to sign in"})]})})}function Rz({currentIndex:t,validating:n,saving:a,onBack:o,onNext:c,onFinish:l}){const d=t===mi.length-1;return s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs(ue,{type:"button",variant:"ghost",disabled:t===0||a,onClick:o,children:[s.jsx(ve,{icon:T2,size:18,className:"mr-1"}),"Back"]}),s.jsx("div",{className:"flex flex-1 justify-end gap-2",children:d?s.jsx(ue,{type:"button",size:"lg",disabled:a||n,onClick:l,className:"min-w-[200px]",children:a?"Saving…":"Finish setup"}):s.jsxs(ue,{type:"button",size:"lg",disabled:n||a,onClick:c,children:["Continue",s.jsx(ve,{icon:lg,size:18,className:"ml-1"})]})})]})}function Az({values:t,setValues:n,validation:a,validating:o,onValidate:c}){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(_e,{htmlFor:"emeraldApiKey",children:"Emerald API key (Optional)"}),s.jsx(De,{id:"emeraldApiKey",type:"password",autoComplete:"off",value:t.emeraldApiKey,onChange:l=>n({...t,emeraldApiKey:l.target.value}),placeholder:"em_...",className:"h-11 font-mono text-sm"})]}),s.jsx(mo,{result:a.emeraldApi}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o,onClick:c,children:o?"Checking…":t.emeraldApiKey?"Verify key":"Skip step"})})]})}function _z({values:t,setValues:n,validation:a,validating:o,onValidate:c}){const l=a.database,d=t.dbDriver==="mysql";return s.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[s.jsxs("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Choose your database storage engine. Select ",s.jsx("strong",{children:"SQLite"})," for instant zero-config local storage, or ",s.jsx("strong",{children:"MySQL / MariaDB"})," for external host databases."]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{onClick:()=>n(m=>({...m,dbDriver:"sqlite"})),className:pe("cursor-pointer rounded-xl border p-4 transition-all hover:border-primary",t.dbDriver==="sqlite"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border bg-card"),children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"font-semibold text-foreground",children:"SQLite"}),s.jsx("span",{className:"rounded-full bg-emerald-500/10 px-2.5 py-0.5 text-xs font-medium text-emerald-500",children:"Zero Config"})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Single-file SQL database stored locally at ",s.jsx("code",{className:"font-mono",children:"./Data/supportbot.db"}),". Zero extra setup required."]})]}),s.jsxs("div",{onClick:()=>n(m=>({...m,dbDriver:"mysql"})),className:pe("cursor-pointer rounded-xl border p-4 transition-all hover:border-primary",t.dbDriver==="mysql"?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border bg-card"),children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"font-semibold text-foreground",children:"MySQL / MariaDB"}),s.jsx("span",{className:"rounded-full bg-blue-500/10 px-2.5 py-0.5 text-xs font-medium text-blue-500",children:"External Database"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect to a remote or local MySQL database server."})]})]}),d&&s.jsxs("div",{className:"space-y-4 rounded-xl border border-border bg-card/50 p-4",children:[s.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"MySQL Connection Settings"}),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(_e,{htmlFor:"dbHost",children:"Database Host"}),s.jsx(De,{id:"dbHost",placeholder:"127.0.0.1 or localhost",value:t.dbHost,onChange:m=>n(p=>({...p,dbHost:m.target.value})),className:"h-11 text-sm"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:"dbPort",children:"Port"}),s.jsx(De,{id:"dbPort",placeholder:"3306",value:t.dbPort,onChange:m=>n(p=>({...p,dbPort:m.target.value})),className:"h-11 text-sm font-mono"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:"dbDatabase",children:"Database Name"}),s.jsx(De,{id:"dbDatabase",placeholder:"supportbot",value:t.dbDatabase,onChange:m=>n(p=>({...p,dbDatabase:m.target.value})),className:"h-11 text-sm"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:"dbUser",children:"Database User"}),s.jsx(De,{id:"dbUser",placeholder:"root",value:t.dbUser,onChange:m=>n(p=>({...p,dbUser:m.target.value})),className:"h-11 text-sm font-mono"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:"dbPassword",children:"Password"}),s.jsx(De,{id:"dbPassword",type:"password",placeholder:"••••••••••••",value:t.dbPassword,onChange:m=>n(p=>({...p,dbPassword:m.target.value})),className:"h-11 text-sm font-mono"})]})]})]}),s.jsx(mo,{result:l}),s.jsx("div",{className:"mt-auto",children:s.jsx(ue,{type:"button",variant:"secondary",disabled:o,onClick:c,children:o?"Testing Connection...":"Test Connection & Validate"})})]})}function Dz(){const t=crypto.randomUUID().replace(/-/g,""),n=crypto.randomUUID().replace(/-/g,"");return t+n}function Oz(t){return t.split(/[\s,]+/).map(n=>n.trim()).filter(Boolean)}function t2(t){return t==="oauth"?"oauth":t==="owners"?"owners":t==="database"?"database":t==="emeraldApi"?"emeraldApi":t}function Lz(){const t=ao(),{branding:n}=Ed(),{loading:a,error:o,refresh:c,status:l}=fS(),[d,m]=f.useState(0),[p,g]=f.useState({botToken:"",dbDriver:"sqlite",dbHost:"127.0.0.1",dbPort:"3306",dbUser:"",dbPassword:"",dbDatabase:"supportbot",secretKey:"",clientId:"",clientSecret:"",redirectUri:"",ownerUserIds:"",emeraldApiKey:""}),[v,b]=f.useState({}),[w,y]=f.useState(!1),[C,S]=f.useState(!1),[E,k]=f.useState(""),[N,T]=f.useState(!1),M=mi[d];f.useEffect(()=>{l!=null&&l.suggestedRedirectUri&&!p.redirectUri&&g(G=>({...G,redirectUri:l.suggestedRedirectUri}))},[l==null?void 0:l.suggestedRedirectUri,p.redirectUri]);const _=f.useMemo(()=>({botToken:p.botToken,dbDriver:p.dbDriver,dbHost:p.dbHost,dbPort:p.dbPort,dbUser:p.dbUser,dbPassword:p.dbPassword,dbDatabase:p.dbDatabase,secretKey:p.secretKey,clientId:p.clientId,clientSecret:p.clientSecret,redirectUri:p.redirectUri,ownerUserIds:Oz(p.ownerUserIds),emeraldApiKey:p.emeraldApiKey}),[p]);async function R(){y(!0),k("");try{const G=await Ne.validateSetup(_);return b(Y=>{var ce;return{...Y,...(ce=G.data)==null?void 0:ce.results}}),G.data}catch(G){return k(G instanceof Error?G.message:"Validation failed"),null}finally{y(!1)}}async function L(){var ce,fe;const G=t2(M.id),Y=await R();return!!((fe=(ce=Y==null?void 0:Y.results)==null?void 0:ce[G])!=null&&fe.ok)}async function te(){const G=t2(M.id),Y=v[G];!(Y!=null&&Y.ok)&&!await L()||m(ce=>Math.min(ce+1,mi.length-1))}async function K(){S(!0),k("");try{const G=await R();if(!(G!=null&&G.ok)){k("Fix the steps marked with errors before finishing.");return}await Ne.completeSetup(_),T(!0)}catch(G){k(G instanceof Error?G.message:"Could not save setup")}finally{S(!1)}}function I(){const G={values:p,setValues:g,validation:v,validating:w};switch(M.id){case"botToken":return s.jsx(Sz,{...G,onValidate:()=>void L()});case"database":return s.jsx(_z,{...G,onValidate:()=>void L()});case"secretKey":return s.jsx(Nz,{...G,onGenerate:()=>g(Y=>({...Y,secretKey:Dz()})),onValidate:()=>void L()});case"oauth":return s.jsx(Ez,{...G,onValidate:()=>void L()});case"redirectUri":return s.jsx(kz,{values:p,setValues:g,validation:v});case"owners":return s.jsx(Tz,{...G,onValidate:()=>void L()});case"emeraldApi":return s.jsx(Az,{...G,onValidate:()=>void L()})}}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(wz,{brandingTitle:n.title,faviconUrl:n.faviconUrl,faviconVersion:n.updatedAt??void 0,hasFavicon:n.hasFavicon,children:[o?s.jsx(Ye,{variant:"destructive",className:"mb-6",children:s.jsx(qe,{children:o})}):null,E?s.jsx(Ye,{variant:"destructive",className:"mb-6",children:s.jsx(qe,{children:E})}):null,N?s.jsx(Mz,{onContinue:async()=>{await c(),t("/login",{replace:!0})}}):s.jsxs("div",{className:"grid flex-1 gap-8 lg:grid-cols-[minmax(0,280px)_1fr]",children:[s.jsx(jz,{currentIndex:d,validation:v}),s.jsx(Cz,{step:M,footer:s.jsx(Rz,{currentIndex:d,validating:w,saving:C,onBack:()=>m(G=>Math.max(0,G-1)),onNext:()=>void te(),onFinish:()=>void K()}),children:I()})]})]})}const zz={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 Pz({title:t,icon:n,href:a,badge:o="Configured",status:c="done"}){return s.jsxs(Jt,{to:a,className:pe("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(ve,{icon:n,size:20})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate font-semibold",children:t}),s.jsx("span",{className:pe("mt-1 inline-flex rounded-md px-2 py-0.5 text-[10px] font-semibold",zz[c]),children:o})]})]})}function Iz({percent:t,size:n=128,className:a,trackClassName:o="stroke-white/20",strokeClassName:c="stroke-white"}){const d=2*Math.PI*42,m=Math.min(100,Math.max(0,t)),p=d-m/100*d;return s.jsxs("div",{className:pe("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:c})]}),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 Uz={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 Bz({title:t,subtitle:n,icon:a,href:o,status:c,meta:l="Open in dashboard"}){const d=Uz[c];return s.jsxs(Jt,{to:o,className:pe("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:pe("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:t}),s.jsx("span",{className:pe("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(ve,{icon:a,size:16})}),s.jsx("span",{className:"text-xs text-muted-foreground",children:l})]}),s.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[s.jsx(ve,{icon:Nd,size:14,className:"opacity-60"}),s.jsx(ve,{icon:qs,size:14,className:"opacity-60 group-hover:text-primary"}),s.jsx(ve,{icon:lg,size:14,className:"text-primary opacity-0 transition-opacity group-hover:opacity-100"})]})]})]})}function $z({stats:t}){const n=[{id:"ping",label:"Gateway latency",detail:`${t.bot.ping}ms`,badge:t.bot.ping<200?"Good":"High",badgeClass:t.bot.ping<200?"bg-emerald-500/15 text-emerald-400":"bg-amber-500/15 text-amber-400"},{id:"uptime",label:"Bot uptime",detail:fg(t.bot.uptime),badge:"Live",badgeClass:"bg-primary/20 text-primary"},{id:"ram",label:"Memory usage",detail:`${t.hosting.ram_used} / ${t.hosting.ram_total}`,badge:`${t.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(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[s.jsxs(dt,{className:"text-sm font-semibold",children:["Connected servers (",t.servers,")"]}),s.jsx(ue,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:s.jsx("span",{className:"text-lg leading-none",children:"+"})})]}),s.jsxs(Qe,{className:"pt-0",children:[s.jsxs("div",{className:"flex -space-x-2",children:[Array.from({length:Math.min(6,t.servers)}).map((a,o)=>s.jsxs(bs,{className:"size-9 border-2 border-card ring-0",children:[s.jsx(eo,{src:t.bot.avatar,alt:""}),s.jsx(ys,{className:"bg-primary/25 text-[10px] text-primary",children:String(o+1)})]},o)),t.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:["+",t.servers-6]}):null]}),s.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:[t.users.toLocaleString()," members across your guilds"]})]})]}),s.jsx(Ze,{className:"overflow-hidden border-border bg-secondary",children:s.jsx(Qe,{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(ve,{icon:T8,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(ue,{asChild:!0,size:"sm",className:"w-full",children:s.jsxs(Jt,{to:"/settings",children:[s.jsx(ve,{icon:Cd,size:16,className:"mr-2"}),"Open settings"]})})]})})}),s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(dt,{className:"text-sm font-semibold",children:"System activity"}),s.jsx(ue,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",children:s.jsx("span",{className:"text-base leading-none",children:"⋯"})})]}),s.jsxs(Qe,{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(bs,{className:"size-9",children:[s.jsx(eo,{src:t.bot.avatar,alt:t.bot.username}),s.jsx(ys,{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(ue,{asChild:!0,variant:"ghost",className:"mx-2 mt-1 w-[calc(100%-1rem)] justify-between text-xs text-muted-foreground",children:s.jsxs(Jt,{to:"/system",children:["All system details",s.jsx(ve,{icon:lg,size:14})]})})]})]}),s.jsx(Ze,{className:"border-border bg-card",children:s.jsxs(Qe,{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(ve,{icon:qs,size:18})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"text-sm font-medium",children:["v",t.bot.version]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["CPU ",t.hosting.cpu_load]})]})]})})]})}const c5={todo:"Needs setup",progress:"In progress",done:"Active"};function Kh(t,n,a="Configure module"){const o=n==null?void 0:n[t];return o||{status:"todo",subtitle:a}}function Hz(){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((t,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((t,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 Gz(){const{stats:t,loading:n,error:a}=kd(),[o,c]=f.useState("all"),l=f.useMemo(()=>{if(!t)return 0;const v=t.tickets.total||0;return v===0?100:Math.round(t.tickets.closed/v*100)},[t]),d=f.useMemo(()=>o==="open"||o==="closed"?ii.filter(v=>v.category==="tickets"):o==="all"?ii:ii.filter(v=>v.category===o),[o]);if(n)return s.jsx(Hz,{});if(a||!t)return s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:a||"No stats available"})});const m=t.tickets.open,p=t.tickets.closed,g=t.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(Ze,{className:"overflow-hidden border-border bg-card",children:s.jsxs(Qe,{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(ue,{asChild:!0,size:"sm",className:"rounded-lg px-5",children:s.jsx(Jt,{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(Ze,{className:"overflow-hidden border-border bg-primary text-primary-foreground",children:s.jsxs(Qe,{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:[g," 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(Iz,{percent:l,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(DS,{value:o,onValueChange:v=>c(v),children:s.jsxs(xx,{className:"h-auto flex-wrap rounded-xl bg-secondary/60 p-1",children:[s.jsx(Ys,{value:"all",className:"rounded-lg text-xs data-[state=active]:bg-background data-[state=active]:shadow-sm",children:"All"}),s.jsx(Ys,{value:"open",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Open"}),s.jsx(Ys,{value:"closed",className:"rounded-lg text-xs data-[state=active]:bg-background",children:"Closed"}),YM.filter(v=>v.id!=="all").map(v=>s.jsx(Ys,{value:v.id,className:"rounded-lg text-xs data-[state=active]:bg-background",children:v.label},v.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:is,href:"/tickets",status:"done",meta:"View live tickets"}]:o==="closed"?[{id:"closed-archive",title:"Closed tickets",subtitle:`${p} resolved`,icon:jd,href:"/transcripts",status:"done",meta:"Browse archive"}]:d.map(v=>{const b=Kh(v.id,t.modules,v.description);return{id:v.id,title:v.title,subtitle:b.subtitle,icon:v.icon,href:v.href,status:b.status,meta:b.status==="done"?"View settings":"Configure"}})).map(v=>s.jsx(Bz,{title:v.title,subtitle:v.subtitle,icon:v.icon,href:v.href,status:v.status,meta:v.meta},v.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(Jt,{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:ii.slice(0,4).map(v=>{const b=Kh(v.id,t.modules);return s.jsx(Pz,{title:v.title,icon:v.icon,href:v.href,badge:c5[b.status],status:b.status},v.id)})})]})]}),s.jsx($z,{stats:t})]})}function Vz(){const{permissions:t}=qt();return Mn(t,"overview")?s.jsx(Gz,{}):s.jsx(ya,{to:mg(t),replace:!0})}function ga({permission:t,children:n}){const{loading:a,isAuthenticated:o,permissions:c}=qt();return a?s.jsx("div",{className:"flex flex-1 items-center justify-center py-16 text-sm text-muted-foreground",children:"Loading…"}):o?Mn(c,t)?s.jsx(s.Fragment,{children:n}):s.jsx(ya,{to:mg(c),replace:!0}):s.jsx(ya,{to:"/login",replace:!0})}function Fz(){const{hasPermission:t}=qt(),n=t("settings.update"),a=ao(),[o,c]=f.useState([]),[l,d]=f.useState(""),[m,p]=f.useState(!0),[g,v]=f.useState(""),[b,w]=f.useState(""),[y,C]=f.useState(null),S=f.useCallback(async()=>{p(!0),v("");try{const k=await Ne.getAddonsCatalog();k.data&&(c(k.data.addons),d(k.data.repository))}catch(k){v(k instanceof Error?k.message:"Failed to load addons")}finally{p(!1)}},[]);f.useEffect(()=>{S()},[S]);async function E(k){if(n){C(k.id),w(""),v("");try{const N=await Ne.installAddon(k.id);w(N.message||`${k.name} installed.`),await S();const T=k.configFiles[0];T&&a(`/configs?file=${_l(T)}`)}catch(N){v(N instanceof Error?N.message:"Install failed")}finally{C(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(ue,{variant:"outline",size:"sm",onClick:S,disabled:m,children:[s.jsx(ve,{icon:_2,size:16,className:pe("mr-1.5",m&&"animate-spin")}),"Refresh"]})]}),g?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:g})}):null,b?s.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(qe,{children:b})}):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(k=>s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{className:"pb-2",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs(dt,{className:"flex items-center gap-2 text-lg",children:[s.jsx(ve,{icon:dg,size:20,className:"text-primary"}),k.name]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Fn,{variant:"outline",className:"shrink-0 uppercase tracking-widest text-[10px]",children:k.price===0||!k.price?"Free":`$${k.price}`}),k.installed?s.jsxs(Fn,{variant:"secondary",className:"shrink-0 gap-1",children:[s.jsx(ve,{icon:D8,size:14}),"Installed"]}):null]})]}),s.jsx(Ot,{children:k.description})]}),s.jsxs(Qe,{className:"space-y-2 text-xs text-muted-foreground",children:[k.is_external?s.jsxs("p",{children:["Available on: ",s.jsx("span",{className:"font-medium text-foreground",children:k.external_store||"External Store"})]}):null,k.configFiles&&k.configFiles.length>0?s.jsxs("p",{children:["Config:"," ",k.configFiles.map((N,T)=>s.jsxs("span",{children:[T>0?", ":null,s.jsx(Jt,{to:`/configs?file=${_l(N)}`,className:"font-mono text-primary hover:underline",children:N})]},N))]}):null]}),s.jsxs(Sx,{className:"flex flex-wrap gap-2",children:[k.is_external?s.jsx(ue,{variant:"outline",size:"sm",asChild:!0,children:s.jsx("a",{href:k.repositoryUrl,target:"_blank",rel:"noreferrer",children:"View Store"})}):null,k.installed&&k.configFiles&&k.configFiles[0]?s.jsx(ue,{size:"sm",variant:"secondary",asChild:!0,children:s.jsx(Jt,{to:`/configs?file=${_l(k.configFiles[0])}`,children:"Edit config"})}):null,k.installed?s.jsx(ue,{size:"sm",disabled:!0,variant:"secondary",children:"Installed"}):k.is_external?null:s.jsxs(ue,{size:"sm",disabled:!n||y===k.id,onClick:()=>E(k),children:[s.jsx(ve,{icon:Cd,size:14,className:"mr-1"}),y===k.id?"Installing…":"Install"]})]})]},k.id))})]})]})}function Yz(){const{permissions:t}=qt(),[n,a]=f.useState(!1),[o,c]=f.useState(!1),[l,d]=f.useState(""),[m,p]=f.useState(""),[g,v]=f.useState(""),[b,w]=f.useState("Administrator"),[y,C]=f.useState(""),[S,E]=f.useState(""),[k,N]=f.useState("General"),T=z2(t,"supportbot"),M=async()=>{if(!m.match(/^[a-z0-9_-]+$/i)){Dt.error("Command name can only contain letters, numbers, underscores and dashes.");return}a(!0),c(!1);try{const _=await Ne.buildAddon({name:m.toLowerCase(),description:g||"A custom command",permission:b,embed:{title:y,description:S||"Hello from your custom command!",color:k}});c(!0),d(_.message||"Restart required."),Dt.success(`Addon ${m}.js created successfully!`)}catch(_){Dt.error(_ instanceof Error?_.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(Ye,{className:"border-green-500/20 bg-green-500/10 text-green-600 dark:text-green-400",children:[s.jsx(x0,{className:"h-4 w-4"}),s.jsxs(qe,{className:"ml-2",children:["Successfully built ",s.jsxs("strong",{children:[m,".js"]}),"! ",l]})]}):null,s.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Ze,{children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"Command Details"}),s.jsx(Ot,{children:"Configure how users trigger the command."})]}),s.jsxs(Qe,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Command Name"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"/"}),s.jsx(De,{placeholder:"ping",value:m,onChange:_=>p(_.target.value.replace(/[^a-z0-9_-]/gi,"").toLowerCase())})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Description"}),s.jsx(De,{placeholder:"Replies with a custom embed",value:g,onChange:_=>v(_.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Required Permission"}),s.jsxs(Ca,{value:b,onValueChange:w,children:[s.jsx(Br,{children:s.jsx(Sa,{})}),s.jsxs($r,{children:[s.jsx(vt,{value:"none",children:"@everyone"}),s.jsx(vt,{value:"Administrator",children:"Administrator"}),s.jsx(vt,{value:"ManageMessages",children:"Manage Messages"}),s.jsx(vt,{value:"ManageGuild",children:"Manage Server"})]})]})]})]})]}),s.jsxs(Ze,{children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"Response Embed"}),s.jsx(Ot,{children:"What the bot will reply with."})]}),s.jsxs(Qe,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Embed Title (Optional)"}),s.jsx(De,{placeholder:"Hello!",value:y,onChange:_=>C(_.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Embed Description"}),s.jsx(Jd,{placeholder:"Type your message here...",className:"resize-none",rows:4,value:S,onChange:_=>E(_.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Embed Color"}),s.jsxs(Ca,{value:k,onValueChange:N,children:[s.jsx(Br,{children:s.jsx(Sa,{})}),s.jsxs($r,{children:[s.jsx(vt,{value:"General",children:"Theme General"}),s.jsx(vt,{value:"Success",children:"Theme Success"}),s.jsx(vt,{value:"Warning",children:"Theme Warning"}),s.jsx(vt,{value:"Error",children:"Theme Error"})]})]})]})]})]})]}),s.jsx("div",{className:"space-y-6",children:s.jsxs(Ze,{className:"sticky top-6 border-primary/20",children:[s.jsx(ut,{children:s.jsxs(dt,{className:"text-sm font-medium flex items-center gap-2",children:[s.jsx(ve,{icon:A8,size:16,className:"text-primary"}),"Live Preview"]})}),s.jsx(Qe,{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(x0,{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:[y&&s.jsx("div",{className:"mb-1 font-semibold text-white",children:y}),s.jsx("div",{className:"whitespace-pre-wrap",children:S||"Hello from your custom command!"})]})]})]})})}),s.jsx(Sx,{children:s.jsxs(ue,{className:"w-full gap-2",size:"lg",disabled:!m||n,onClick:M,children:[s.jsx(ve,{icon:ds,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 Ex="supportbot-dashboard-accent",Pl="#45b46c",qz=["--primary","--ring","--chart-1","--sidebar-primary","--sidebar-ring","--accent","--accent-foreground","--sidebar-accent","--sidebar-accent-foreground"];function Kz(t){const n=Ur(t,Pl),a=parseInt(n.slice(1,3),16)/255,o=parseInt(n.slice(3,5),16)/255,c=parseInt(n.slice(5,7),16)/255,l=Math.max(a,o,c),d=Math.min(a,o,c),m=(l+d)/2;let p=0,g=0;if(l!==d){const v=l-d;switch(g=m>.5?v/(2-l-d):v/(l+d),l){case a:p=((o-c)/v+(o<c?6:0))/6;break;case o:p=((c-a)/v+2)/6;break;default:p=((a-o)/v+4)/6;break}}return{h:Math.round(p*360),s:Math.round(g*100),l:Math.round(m*100)}}function xa(t,n,a){return`${t} ${n}% ${a}%`}function u5(t){const n=Ur(t,Pl),{h:a,s:o,l:c}=Kz(n),l=document.documentElement,d=Math.min(Math.max(o,45),85),m=Math.min(Math.max(c,42),62);return l.style.setProperty("--primary",xa(a,d,m)),l.style.setProperty("--ring",xa(a,d,m)),l.style.setProperty("--chart-1",xa(a,d,m)),l.style.setProperty("--sidebar-primary",xa(a,d,m)),l.style.setProperty("--sidebar-ring",xa(a,d,m)),l.style.setProperty("--primary-foreground","0 0% 100%"),l.style.setProperty("--sidebar-primary-foreground","0 0% 100%"),l.style.setProperty("--accent",xa(a,Math.round(d*.64),18)),l.style.setProperty("--accent-foreground",xa(a,Math.min(Math.round(d*1.15),90),78)),l.style.setProperty("--sidebar-accent",xa(a,Math.round(d*.57),14)),l.style.setProperty("--sidebar-accent-foreground",xa(a,Math.min(Math.round(d*1.07),88),82)),n}function Wz(){for(const t of qz)document.documentElement.style.removeProperty(t);document.documentElement.style.removeProperty("--primary-foreground"),document.documentElement.style.removeProperty("--sidebar-primary-foreground")}function d5(){try{const t=localStorage.getItem(Ex);return!t||!Bh(t)?null:Ur(t)}catch{return null}}function n2(t){const n=u5(t);try{localStorage.setItem(Ex,n)}catch{}return n}function Xz(){try{localStorage.removeItem(Ex)}catch{}Wz()}function Zz(){const t=d5();t&&u5(t)}function Qz(t){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(t)})}function Jz({canEdit:t}){const[n,a]=f.useState(!1),[o,c]=f.useState(""),[l,d]=f.useState(!1);async function m(){if(t){a(!0),c("");try{const p=await Ne.resetDashboard();c(p.message||"Dashboard reset successfully."),setTimeout(()=>{window.location.href="/setup"},1500)}catch(p){c(p instanceof Error?p.message:"Reset failed"),a(!1)}}}return t?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(Qs,{open:l,onOpenChange:d,children:[s.jsx(TM,{asChild:!0,children:s.jsx(ue,{type:"button",variant:"destructive",children:"Reset Dashboard"})}),s.jsxs(hs,{children:[s.jsxs(gs,{children:[s.jsx(xs,{children:"Are you absolutely sure?"}),s.jsx(vs,{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(Js,{children:[s.jsx(ue,{variant:"outline",onClick:()=>d(!1),disabled:n,children:"Cancel"}),s.jsx(ue,{variant:"destructive",onClick:()=>void m(),disabled:n,children:n?"Resetting...":"Yes, reset dashboard"})]})]})]})]}):null}function eP({canEdit:t}){const{branding:n,setBrandingLocal:a}=Ed(),o=f.useRef(null),[c,l]=f.useState(n.title),[d,m]=f.useState(n.pageTitle),[p,g]=f.useState(!1),[v,b]=f.useState(!1),[w,y]=f.useState("");f.useEffect(()=>{l(n.title),m(n.pageTitle)},[n.title,n.pageTitle]);const C=n.hasFavicon&&n.faviconUrl?`${n.faviconUrl}${n.updatedAt?`?v=${n.updatedAt}`:""}`:null;async function S(){if(t){g(!0),y("");try{const T=await Ne.updateBranding({title:c,pageTitle:d});T.data&&a(T.data),y(T.message||"Branding saved.")}catch(T){y(T instanceof Error?T.message:"Save failed")}finally{g(!1)}}}async function E(T){if(!(!t||!T)){b(!0),y("");try{const M=await Qz(T),_=await Ne.uploadBrandingFavicon(M);_.data&&a(_.data),y(_.message||"Favicon uploaded.")}catch(M){y(M instanceof Error?M.message:"Upload failed")}finally{b(!1),o.current&&(o.current.value="")}}}async function k(){if(t){b(!0),y("");try{const T=await Ne.removeBrandingFavicon();T.data&&a(T.data),y(T.message||"Favicon removed.")}catch(T){y(T instanceof Error?T.message:"Remove failed")}finally{b(!1)}}}const N=c.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(_e,{htmlFor:"brand-title",children:"Sidebar title"}),s.jsx(De,{id:"brand-title",value:c,disabled:!t,maxLength:64,onChange:T=>l(T.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:"brand-page-title",children:"Browser tab title"}),s.jsx(De,{id:"brand-page-title",value:d,disabled:!t,maxLength:80,onChange:T=>m(T.target.value),className:"border-border bg-secondary/30",placeholder:"SupportBot Dashboard"})]})]}),t?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ue,{type:"button",disabled:p||!N,onClick:()=>void S(),children:p?"Saving…":"Save titles"}),w&&N?s.jsx("span",{className:"text-xs text-muted-foreground",children:w}):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:C?s.jsx("img",{src:C,alt:"Favicon preview",className:"size-full object-contain p-2"}):s.jsx(ve,{icon:y8,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:!t||v,onChange:T=>{var M;return void E(((M=T.target.files)==null?void 0:M[0])??null)}}),s.jsxs("div",{className:"flex flex-col gap-2",children:[t?s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ue,{type:"button",variant:"secondary",disabled:v,onClick:()=>{var T;return(T=o.current)==null?void 0:T.click()},children:v?"Uploading…":"Upload Favicon"}),n.hasFavicon?s.jsx(ue,{type:"button",variant:"destructive",disabled:v,onClick:()=>void k(),children:"Remove"}):null]}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"View only"}),!N&&w?s.jsx("span",{className:"text-xs text-muted-foreground",children:w}):null]})]})]})]})}function tP(){var b,w,y,C,S,E,k,N,T,M,_;const{hasPermission:t}=qt(),n=t("settings.update"),[a,o]=f.useState(!0),[c,l]=f.useState(!1),[d,m]=f.useState(""),[p,g]=f.useState(null);f.useEffect(()=>{Ne.getConfigJson("api").then(R=>{R.data&&g(R.data)}).catch(()=>m("Failed to load API config")).finally(()=>o(!1))},[]);async function v(){var R,L,te,K,I,G,Y,ce,fe,se,P;if(!(!n||!p)){l(!0),m("");try{const Z={"api:API.Port":(R=p.API)==null?void 0:R.Port,"api:API.EmeraldAPIKey":(L=p.API)==null?void 0:L.EmeraldAPIKey,"api:API.TrustProxy":(te=p.API)==null?void 0:te.TrustProxy,"api:API.OAuth.Enabled":(I=(K=p.API)==null?void 0:K.OAuth)==null?void 0:I.Enabled,"api:API.OAuth.ClientId":(Y=(G=p.API)==null?void 0:G.OAuth)==null?void 0:Y.ClientId,"api:API.OAuth.ClientSecret":(fe=(ce=p.API)==null?void 0:ce.OAuth)==null?void 0:fe.ClientSecret,"api:API.OAuth.RedirectUri":(P=(se=p.API)==null?void 0:se.OAuth)==null?void 0:P.RedirectUri};await Ne.updateConfigFields(Z),m("API settings saved and backend restarted.")}catch(Z){m(Z instanceof Error?Z.message:"Save failed")}finally{l(!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(_e,{children:"API Port"}),s.jsx(De,{type:"number",value:((b=p.API)==null?void 0:b.Port)||"",disabled:!n,onChange:R=>g({...p,API:{...p.API,Port:parseInt(R.target.value)||3e3}}),className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Emerald API Key"}),s.jsx(De,{type:"password",value:((w=p.API)==null?void 0:w.EmeraldAPIKey)||"",disabled:!n,onChange:R=>g({...p,API:{...p.API,EmeraldAPIKey:R.target.value}}),className:"border-border bg-secondary/30"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(kt,{checked:((y=p.API)==null?void 0:y.TrustProxy)||!1,disabled:!n,onCheckedChange:R=>g({...p,API:{...p.API,TrustProxy:R}})}),s.jsx(_e,{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(kt,{checked:((S=(C=p.API)==null?void 0:C.OAuth)==null?void 0:S.Enabled)||!1,disabled:!n,onCheckedChange:R=>{var L;return g({...p,API:{...p.API,OAuth:{...(L=p.API)==null?void 0:L.OAuth,Enabled:R}}})}}),s.jsx(_e,{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(_e,{children:"Client ID"}),s.jsx(De,{value:((k=(E=p.API)==null?void 0:E.OAuth)==null?void 0:k.ClientId)||"",disabled:!n,onChange:R=>{var L;return g({...p,API:{...p.API,OAuth:{...(L=p.API)==null?void 0:L.OAuth,ClientId:R.target.value}}})},className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Client Secret"}),s.jsx(De,{type:"password",value:((T=(N=p.API)==null?void 0:N.OAuth)==null?void 0:T.ClientSecret)||"",disabled:!n,onChange:R=>{var L;return g({...p,API:{...p.API,OAuth:{...(L=p.API)==null?void 0:L.OAuth,ClientSecret:R.target.value}}})},className:"border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-2 sm:col-span-2",children:[s.jsx(_e,{children:"Redirect URI"}),s.jsx(De,{value:((_=(M=p.API)==null?void 0:M.OAuth)==null?void 0:_.RedirectUri)||"",disabled:!n,onChange:R=>{var L;return g({...p,API:{...p.API,OAuth:{...(L=p.API)==null?void 0:L.OAuth,RedirectUri:R.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(ue,{type:"button",disabled:c,onClick:()=>void v(),children:c?"Saving…":"Save API Config"}),d?s.jsx("span",{className:"text-xs text-muted-foreground",children:d}):null]}):null]}):null}function nP(){const{hasPermission:t}=qt(),n=t("settings.update"),[a,o]=f.useState(null),[c,l]=f.useState(!0),[d,m]=f.useState(!1),[p,g]=f.useState(""),[v,b]=f.useState(""),[w,y]=f.useState(()=>d5()??Pl),[C,S]=f.useState(""),[E,k]=f.useState("appearance"),N=f.useCallback(async()=>{l(!0),g("");try{const M=await Ne.checkForUpdates();M.data&&o(M.data)}catch(M){g(M instanceof Error?M.message:"Could not check for updates")}finally{l(!1)}},[]);f.useEffect(()=>{N()},[N]);async function T(M){if(M.updateAvailable){m(!0),g(""),b("");try{const _=await Ne.runUpdate(M.id,M.latest,M.zipUrl);b(_.message||"Update installed. Restart your server (stop and run npm start again) to finish applying changes."),await N()}catch(_){g(_ instanceof Error?_.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(ue,{variant:E==="appearance"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>k("appearance"),children:"Appearance"}),s.jsx(ue,{variant:E==="api"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>k("api"),children:"API Config"}),s.jsx(ue,{variant:E==="updates"?"secondary":"ghost",className:"justify-start w-full",onClick:()=>k("updates"),children:"Update Checker"}),n&&s.jsx(ue,{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:()=>k("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(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"Dashboard appearance"}),s.jsx(Ot,{children:"Customise branding for all users, and pick an accent colour for this browser only."})]}),s.jsxs(Qe,{className:"space-y-4",children:[s.jsx(eP,{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(tf,{value:w,onChange:M=>{y(M),n2(M),S("Accent updated.")}}),s.jsx(De,{id:"accent-colour",value:w,onChange:M=>y(M.target.value),onBlur:()=>{const M=Ur(w,Pl);y(M),n2(M),S("Accent updated.")},className:"w-32 border-border bg-secondary/30 font-mono uppercase",maxLength:7})]}),s.jsx(ue,{type:"button",variant:"outline",onClick:()=>{Xz(),y(Pl),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"})]}),C?s.jsx("p",{className:"text-xs text-muted-foreground",children:C}):null]})]})]})}),E==="danger"&&n&&s.jsxs(Ze,{className:"border-destructive/50 bg-destructive/5",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg text-destructive",children:"Danger Zone"}),s.jsx(Ot,{className:"text-destructive/80",children:"Destructive actions that reset or permanently alter your dashboard."})]}),s.jsx(Qe,{children:s.jsx(Jz,{canEdit:n})})]}),E==="api"&&s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"API Configuration"}),s.jsx(Ot,{children:"Configure the internal API settings, Emerald API key, and OAuth."})]}),s.jsx(Qe,{children:s.jsx(tP,{})})]}),E==="updates"&&s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"Software updates"}),s.jsx(Ot,{children:"Manage updates for the bot and dashboard."})]}),s.jsxs(Qe,{className:"space-y-4",children:[c?s.jsx(Be,{className:"h-24 w-full"}):a&&a.length>0?s.jsx("div",{className:"space-y-4",children:a.map(M=>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:M.repository,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:M.name})," ","(",M.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",M.current]})]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Latest: "}),s.jsxs("span",{className:"font-mono font-medium",children:["v",M.latest]})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[M.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."}),M.updateAvailable&&n?s.jsxs(ue,{type:"button",size:"sm",onClick:()=>void T(M),disabled:d,children:[d?s.jsx(ve,{icon:_2,size:16,className:"mr-2 animate-spin"}):s.jsx(ve,{icon:Cd,size:16,className:"mr-2"}),d?"Installing…":"Update now"]}):null,M.updateAvailable&&!n?s.jsx("p",{className:"text-xs text-muted-foreground",children:"You cannot install updates with your role."}):null]})]},M.id))}):null,p?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:p})}):null,v?s.jsx(Ye,{children:s.jsx(qe,{children:v})}):null,s.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:s.jsxs(ue,{type:"button",variant:"outline",onClick:N,disabled:c||d,children:[s.jsx(ve,{icon:ur,size:16,className:"mr-2"}),"Check again"]})})]})]})]})]})]})}function kx(t){const[n,a]=f.useState(!1),o=f.useRef(t);return o.current=t,f.useEffect(()=>{let c=null,l=null;const d=()=>{c=new EventSource("/api/stream"),c.onopen=()=>{a(!0)},c.addEventListener("connected",()=>{a(!0)}),c.addEventListener("metrics",m=>{var p,g;try{const v=JSON.parse(m.data);(g=(p=o.current).onMetrics)==null||g.call(p,v)}catch{}}),c.addEventListener("log",m=>{var p,g;try{const v=JSON.parse(m.data);(g=(p=o.current).onLog)==null||g.call(p,v)}catch{}}),c.addEventListener("ticket_message",m=>{var p,g;try{const v=JSON.parse(m.data);(g=(p=o.current).onTicketMessage)==null||g.call(p,v)}catch{}}),c.addEventListener("ticket_message_deleted",m=>{var p,g;try{const v=JSON.parse(m.data);(g=(p=o.current).onTicketMessageDeleted)==null||g.call(p,v)}catch{}}),c.addEventListener("ticket_message_updated",m=>{var p,g;try{const v=JSON.parse(m.data);(g=(p=o.current).onTicketMessageUpdated)==null||g.call(p,v)}catch{}}),c.addEventListener("ticket_created",m=>{var p,g;try{const v=JSON.parse(m.data);(g=(p=o.current).onTicketCreated)==null||g.call(p,v)}catch{}}),c.addEventListener("ticket_closed",m=>{var p,g;try{const v=JSON.parse(m.data);(g=(p=o.current).onTicketClosed)==null||g.call(p,v)}catch{}}),c.onerror=()=>{a(!1),c==null||c.close(),l=window.setTimeout(d,4e3)}};return d(),()=>{l&&window.clearTimeout(l),c&&c.close()}},[]),{connected:n}}function Et({label:t,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:t}),s.jsx("dd",{className:`text-sm font-medium text-foreground ${a?"font-mono text-xs sm:text-sm":""}`,children:n})]})}const rP={ok:"Healthy",missing_config:"Guild ID not set",not_in_guild:"Not in configured server",extra_guilds:"Extra servers joined",offline:"Bot offline"};function aP(t){return t==="ok"?"text-emerald-500":t==="offline"?"text-destructive":"text-amber-500"}function sP(){var E;const{stats:t,loading:n,error:a,refresh:o}=kd(),[c,l]=f.useState(null),[d,m]=f.useState(null),[p,g]=f.useState(!1),[v,b]=f.useState(null),{connected:w}=kx({onMetrics:k=>{b(k)}}),y=f.useCallback(async()=>{const[k,N]=await Promise.all([Ne.getGuildStatus().catch(()=>null),Ne.health().catch(()=>null)]);k!=null&&k.data&&l(k.data),N!=null&&N.success&&N.data&&m({dashboard:N.data.dashboard,botReady:N.data.botReady,oauthEnabled:N.data.oauthEnabled,setupComplete:N.data.setupComplete})},[]);f.useEffect(()=>{y()},[y]);async function C(){g(!0);try{await Promise.all([o(),y()])}finally{g(!1)}}if(n&&!t)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||!t)return s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:a||"Could not load system details."})});const S=t.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(ue,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2 h-8 px-2 text-muted-foreground",children:s.jsxs(Jt,{to:"/",children:[s.jsx(ve,{icon:T2,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(ue,{type:"button",variant:"outline",disabled:p,onClick:()=>void C(),children:[s.jsx(ve,{icon:ur,size:16,className:"mr-2"}),p?"Refreshing…":"Refresh now"]})]}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"Discord bot"}),s.jsx(Ot,{children:"Connection and identity"})]}),s.jsxs(Qe,{children:[s.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s.jsxs(bs,{className:"size-12",children:[s.jsx(eo,{src:t.bot.avatar,alt:t.bot.username}),s.jsx(ys,{children:"SB"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold",children:t.bot.username}),s.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:t.bot.id})]})]}),s.jsxs("dl",{children:[s.jsx(Et,{label:"Version",value:`v${t.bot.version}`,mono:!0}),s.jsx(Et,{label:"Gateway latency",value:s.jsxs("span",{className:S?"text-emerald-500":"text-amber-500",children:[t.bot.ping," ms"]})}),s.jsx(Et,{label:"Process uptime",value:fg(t.bot.uptime)}),s.jsx(Et,{label:"Connected servers",value:t.servers.toLocaleString()}),s.jsx(Et,{label:"Members tracked",value:t.users.toLocaleString()}),t.bot.inviteUrl?s.jsx(Et,{label:"Invite link",value:s.jsx("a",{href:t.bot.inviteUrl,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"Open in Discord"})}):null]})]})]}),s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(dt,{className:"text-lg",children:"Host machine"}),s.jsx(Ot,{children:"Server resources running this instance"})]}),s.jsxs(Fn,{variant:w?"default":"outline",className:"text-xs",children:[s.jsx("span",{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${w?"bg-emerald-500 animate-pulse":"bg-muted"}`}),w?"Live Stream":"Polling"]})]}),s.jsx(Qe,{children:s.jsxs("dl",{children:[s.jsx(Et,{label:"Memory used",value:v?`${(v.ram_used_mb/1024).toFixed(2)} GB / ${(v.ram_total_mb/1024).toFixed(2)} GB`:`${t.hosting.ram_used} / ${t.hosting.ram_total}`}),s.jsx(Et,{label:"Memory usage",value:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:(v?v.ram_percent:t.hosting.ram_percent)>85?"text-amber-500 font-bold":"text-foreground font-medium",children:[v?v.ram_percent:t.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:`${v?v.ram_percent:t.hosting.ram_percent}%`}})})]})}),s.jsx(Et,{label:"CPU load (1 min avg)",value:v?String(v.cpu_load):t.hosting.cpu_load,mono:!0}),s.jsx(Et,{label:"Host uptime",value:t.hosting.uptime})]})})]}),s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"Tickets"}),s.jsx(Ot,{children:"Database snapshot"})]}),s.jsx(Qe,{children:s.jsxs("dl",{children:[s.jsx(Et,{label:"Total tickets",value:t.tickets.total}),s.jsx(Et,{label:"Open",value:s.jsx("span",{className:"text-primary",children:t.tickets.open})}),s.jsx(Et,{label:"Closed",value:t.tickets.closed}),s.jsx(Et,{label:"Transcripts",value:s.jsx(Jt,{to:"/transcripts",className:"text-primary underline-offset-4 hover:underline",children:"Browse archive"})})]})})]}),s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"Guild health"}),s.jsx(Ot,{children:"Configured server and membership"})]}),s.jsx(Qe,{children:c?s.jsxs("dl",{children:[s.jsx(Et,{label:"Status",value:s.jsx("span",{className:aP(c.status),children:rP[c.status]})}),s.jsx(Et,{label:"Configured guild ID",value:c.configuredGuildId||"Not set",mono:!0}),c.configuredGuild?s.jsx(Et,{label:"Configured server",value:`${c.configuredGuild.name} (${((E=c.configuredGuild.memberCount)==null?void 0:E.toLocaleString())??"?"} members)`}):null,c.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:c.message}):null,c.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:c.extraGuilds.map(k=>s.jsxs("li",{className:"font-mono text-xs",children:[k.name," · ",k.id]},k.id))})]}):null]}):s.jsx(Be,{className:"h-24 w-full"})})]})]}),s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"Dashboard services"}),s.jsx(Ot,{children:"API and authentication"})]}),s.jsx(Qe,{children:d?s.jsxs("dl",{className:"max-w-xl",children:[s.jsx(Et,{label:"Dashboard UI",value:d.dashboard?"Available":"Missing build"}),s.jsx(Et,{label:"Bot connection",value:d.botReady?"Online":"Starting or offline"}),s.jsx(Et,{label:"Discord OAuth",value:d.oauthEnabled?"Configured":"Not configured"}),s.jsx(Et,{label:"Initial setup",value:d.setupComplete?"Complete":"Incomplete"}),s.jsx(Et,{label:"Software updates",value:s.jsx(Jt,{to:"/settings",className:"text-primary underline-offset-4 hover:underline",children:"Open settings"})}),s.jsx(Et,{label:"Logs",value:s.jsx(Jt,{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"})})]}),t.modules?s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-lg",children:"Module setup status"}),s.jsx(Ot,{children:"Which features are configured and active"})]}),s.jsx(Qe,{children:s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:ii.map(k=>{const N=Kh(k.id,t.modules);return s.jsxs(Jt,{to:k.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:k.title}),s.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:N.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:c5[N.status]})]},k.id)})})})]}):null]})}function oP(t){if(!t)return"—";const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}const iP=[{id:"all",label:"All"},{id:"Output",label:"Output"},{id:"Warn",label:"Warn"},{id:"Error",label:"Error"}],lP=["Output","Warn","Error"],cP={Output:"text-foreground/90",Warn:"text-amber-400",Error:"text-rose-400"},uP={Output:"bg-muted text-muted-foreground",Warn:"bg-amber-500/15 text-amber-400",Error:"bg-rose-500/15 text-rose-400"},gd=2e3,dP=2e3;function Wh(t,n){return`${t.type}-${t.timestamp??"na"}-${n}-${t.message.slice(0,32)}`}function fP(t,n,a){const o=a?[]:t,c=new Set(o.map((m,p)=>Wh(m,p))),l=[];for(let m=0;m<n.length;m++){const p=Wh(n[m],m);c.has(p)||(c.add(p),l.push(n[m]))}const d=[...o,...l];return d.length>gd?d.slice(d.length-gd):d}function mP(){const[t,n]=f.useState([]),[a,o]=f.useState(!0),[c,l]=f.useState(""),[d,m]=f.useState(!1),[p,g]=f.useState(!0),[v,b]=f.useState("all"),[w,y]=f.useState(""),[C,S]=f.useState(!0),[E,k]=f.useState(""),N=f.useRef(null),T=f.useRef(null),M=f.useRef(d);M.current=d;const _=f.useMemo(()=>v==="all"?lP:[v],[v]),R=f.useCallback(I=>{M.current||v!=="all"&&I.type!==v||(n(G=>{const Y=[...G,I];return Y.length>gd?Y.slice(Y.length-gd):Y}),S(!0))},[v]);kx({onLog:R});const L=f.useCallback(async I=>{var ce,fe;const G=await Ne.getLogs({types:_,cursor:I?void 0:N.current??void 0,tail:I?500:0}),Y=((ce=G.data)==null?void 0:ce.entries)??[];return N.current=((fe=G.data)==null?void 0:fe.cursor)??{},n(se=>fP(se,Y,I)),Y.length},[_]),te=f.useCallback(async()=>{var I;o(!0),l(""),N.current=null;try{const ce=(((I=(await Ne.getLogsMeta()).data)==null?void 0:I.files)??[]).filter(fe=>fe.file).map(fe=>`${fe.type}: ${fe.file}`).join(" · ");k(ce||"No log files yet — output appears when the bot runs."),await L(!0),S(!0)}catch(G){l(G instanceof Error?G.message:"Failed to load logs"),S(!1)}finally{o(!1)}},[L]);f.useEffect(()=>{te()},[te]),f.useEffect(()=>{if(d||a)return;const I=window.setInterval(async()=>{if(!M.current)try{await L(!1),S(!0),l("")}catch(G){S(!1),l(G instanceof Error?G.message:"Live update failed")}},dP);return()=>window.clearInterval(I)},[d,a,L]),f.useEffect(()=>{if(!p||d)return;const I=T.current;I&&(I.scrollTop=I.scrollHeight)},[t,p,d]);const K=f.useMemo(()=>t.filter(I=>{var Y;if(v!=="all"&&I.type!==v)return!1;if(!w.trim())return!0;const G=w.toLowerCase();return I.message.toLowerCase().includes(G)||(((Y=I.timestamp)==null?void 0:Y.toLowerCase().includes(G))??!1)}),[t,v,w]);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:pe("size-2 rounded-full",C&&!d?"animate-pulse bg-emerald-500":"bg-muted-foreground")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:d?"Paused":C?"Live":"Disconnected"})]})]}),c?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:c})}):null,s.jsxs(Ze,{className:"flex min-h-0 flex-1 flex-col border-border bg-card",children:[s.jsxs(ut,{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(dt,{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(kt,{id:"auto-scroll",checked:p,onCheckedChange:g}),s.jsx(_e,{htmlFor:"auto-scroll",className:"text-xs font-normal",children:"Auto-scroll"})]}),s.jsxs(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>m(I=>!I),children:[s.jsx(ve,{icon:d?k8:E8,size:16,className:"mr-1.5"}),d?"Resume":"Pause"]}),s.jsxs(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{n([]),te()},disabled:a,children:[s.jsx(ve,{icon:ur,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:iP.map(I=>s.jsx(ue,{type:"button",variant:v===I.id?"secondary":"ghost",size:"sm",className:"h-8 rounded-lg text-xs",onClick:()=>b(I.id),children:I.label},I.id))}),s.jsxs("div",{className:"relative flex-1 sm:max-w-xs",children:[s.jsx(ve,{icon:ji,size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(De,{placeholder:"Filter lines…",value:w,onChange:I=>y(I.target.value),className:"h-9 pl-9"})]})]})]}),s.jsx(Qe,{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((I,G)=>s.jsx(Be,{className:"h-4 w-full"},G))}):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((I,G)=>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:oP(I.timestamp)}),s.jsx("span",{className:pe("shrink-0 rounded px-1.5 py-0 text-[10px] font-semibold uppercase",uP[I.type]),children:I.type}),s.jsx("span",{className:pe("min-w-0 flex-1 whitespace-pre-wrap break-words",cP[I.type]),children:I.message||" "})]},Wh(I,G)))})})})]})]})}const pP=[{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; }"}]}],hP=450;function gP(t,n){return n&&t!=="viewer"}function xP(){const{user:t,hasPermission:n}=qt(),a=!gP(t==null?void 0:t.role,n("transcripts")),[o,c]=f.useState(null),[l,d]=f.useState(null),[m,p]=f.useState(!0),[g,v]=f.useState(!1),[b,w]=f.useState(""),[y,C]=f.useState(""),[S,E]=f.useState(""),[k,N]=f.useState(!1),T=f.useRef(null),M=f.useCallback(async()=>{var K;p(!0),w(""),C("");try{const G=(await Ne.getTranscriptTemplate()).data??null;if(G){const Y={...G,Typography:{...G.Typography,FontFamily:kS((K=G.Typography)==null?void 0:K.FontFamily)}};c(Y),d(structuredClone(Y))}}catch(I){w(I instanceof Error?I.message:"Failed to load template")}finally{p(!1)}},[]);f.useEffect(()=>{M()},[M]);const _=f.useCallback(async K=>{N(!0);try{const I=await Ne.previewTranscriptTemplate(K);E(I)}catch{E("<!DOCTYPE html><body style='padding:2rem;font-family:sans-serif'><p>Preview failed to load.</p></body>")}finally{N(!1)}},[]);f.useEffect(()=>{if(o)return T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{_(o)},hP),()=>{T.current&&clearTimeout(T.current)}},[o,_]);function R(K,I){c(G=>G&&Gn(G,K,I))}async function L(){if(!(a||!o)){v(!0),w(""),C("");try{const K=await Ne.saveTranscriptTemplate(o);C(K.message||"Saved."),d(structuredClone(o))}catch(K){w(K instanceof Error?K.message:"Save failed")}finally{v(!1)}}}const te=o&&l&&JSON.stringify(o)!==JSON.stringify(l);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:[te?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(ue,{size:"sm",onClick:L,disabled:g||!te,children:[s.jsx(ve,{icon:Sd,size:16,className:"mr-1.5"}),g?"Saving…":"Save appearance"]})]})]}),b?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:b})}):null,y?s.jsx(Ye,{className:"border-primary/30 bg-primary/10 text-primary",children:s.jsx(qe,{children:y})}):null,s.jsxs("div",{className:"grid min-h-0 gap-4 xl:grid-cols-[minmax(320px,420px)_1fr]",children:[s.jsx(vP,{data:o,readOnly:a,onPatch:R}),s.jsxs(Ze,{className:"flex min-h-[520px] flex-col overflow-hidden border-border bg-card",children:[s.jsxs(ut,{className:"pb-2",children:[s.jsx(dt,{className:"text-base",children:"Live preview"}),s.jsxs(Ot,{children:["Sample ticket with your current settings",k?" · updating…":""]})]}),s.jsx(Qe,{className:"min-h-0 flex-1 p-4 pt-0",children:s.jsx("iframe",{title:"Transcript template preview",srcDoc:S,className:pe("h-[min(640px,calc(100svh-14rem))] w-full rounded-lg border border-border bg-background",k&&"opacity-60"),sandbox:"allow-same-origin"})})]})]})]}):s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:b||"Failed to load template"})})}function vP({data:t,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:pP.map(o=>s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{className:"pb-3",children:[s.jsx(dt,{className:"text-base",children:o.title}),o.description?s.jsx(Ot,{children:o.description}):null]}),s.jsx(Qe,{className:"grid gap-4 sm:grid-cols-2",children:o.fields.map(c=>s.jsx("div",{className:c.type==="textarea"?"sm:col-span-2":"",children:s.jsx(pd,{field:c,value:Fr(t,c.path),readOnly:n,onChange:l=>a(c.path,l)})},c.path))})]},o.title))})}function bP(t,n){return n&&t!=="viewer"}function yP(){const{user:t,hasPermission:n}=qt(),a=!bP(t==null?void 0:t.role,n("transcripts")),[o,c]=f.useState(null),[l,d]=f.useState(!0),[m,p]=f.useState(!1),[g,v]=f.useState(!1),[b,w]=f.useState(""),[y,C]=f.useState(""),S=f.useCallback(async()=>{var N,T,M;d(!0),w(""),C("");try{const R=(await Ne.getTranscriptSettings()).data;R&&c({autoDelete:{enabled:!!((N=R.autoDelete)!=null&&N.enabled),afterDays:((T=R.autoDelete)==null?void 0:T.afterDays)??30},publicAccess:{enabled:!!((M=R.publicAccess)!=null&&M.enabled)}})}catch(_){w(_ instanceof Error?_.message:"Failed to load settings")}finally{d(!1)}},[]);f.useEffect(()=>{S()},[S]);async function E(){if(!(!o||a)){p(!0),w(""),C("");try{const N=await Ne.updateTranscriptSettings(o);N.data&&c({autoDelete:{enabled:N.data.autoDelete.enabled,afterDays:N.data.autoDelete.afterDays},publicAccess:{enabled:N.data.publicAccess.enabled}}),C(N.message??"Settings saved.")}catch(N){w(N instanceof Error?N.message:"Failed to save settings")}finally{p(!1)}}}async function k(){var N,T;if(!a){v(!0),w(""),C("");try{const M=await Ne.purgeTranscripts();C(M.message??((N=M.data)!=null&&N.skipped?"Auto-delete is disabled.":`Removed ${((T=M.data)==null?void 0:T.deleted)??0} transcript(s).`))}catch(M){w(M instanceof Error?M.message:"Purge failed")}finally{v(!1)}}}return l?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(Ye,{children:s.jsx(qe,{children:"You have view-only access. An admin or editor can change these settings."})}):null,b?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:b})}):null,y?s.jsx(Ye,{children:s.jsx(qe,{children:y})}):null,s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-base",children:"Auto-delete"}),s.jsx(Ot,{children:"Remove transcript files automatically after they reach a certain age. The server checks hourly and whenever you open the library."})]}),s.jsxs(Qe,{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:N=>c(T=>T&&{...T,autoDelete:{...T.autoDelete,enabled:N.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(De,{id:"transcript-after-days",type:"number",min:1,max:3650,disabled:a||!o.autoDelete.enabled,value:o.autoDelete.afterDays,onChange:N=>c(T=>T&&{...T,autoDelete:{...T.autoDelete,afterDays:Math.min(3650,Math.max(1,parseInt(N.target.value,10)||1))}}),className:"max-w-[8rem]"})]}),s.jsxs(ue,{type:"button",variant:"outline",size:"sm",disabled:a||g,onClick:()=>void k(),children:[s.jsx(ve,{icon:ur,size:16,className:pe(g&&"animate-spin")}),"Run cleanup now"]})]})]}),s.jsxs(Ze,{className:"border-border bg-card",children:[s.jsxs(ut,{children:[s.jsx(dt,{className:"text-base",children:"Public transcripts"}),s.jsxs(Ot,{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(Qe,{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:N=>c(T=>T&&{...T,publicAccess:{enabled:N.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(ue,{type:"button",disabled:m,onClick:()=>void E(),children:[s.jsx(ve,{icon:Sd,size:16}),m?"Saving…":"Save settings"]})]}):s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:"Could not load transcript settings."})})}function wP(t,n){return n&&t!=="viewer"}function r2(t){return t==null?"":t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function a2(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function jP(){var $;const{user:t,hasPermission:n}=qt(),a=wP(t==null?void 0:t.role,n("transcripts")),[o,c]=f.useState("browse"),[l,d]=f.useState([]),[m,p]=f.useState(null),[g,v]=f.useState(!0),[b,w]=f.useState(""),[y,C]=f.useState(""),[S,E]=f.useState(""),[k,N]=f.useState(0),[T,M]=f.useState(!1),[_,R]=f.useState(!1),[L,te]=f.useState(!1),[K,I]=f.useState(!1),G=f.useCallback(async()=>{v(!0),C("");try{const X=(await Ne.listTranscripts()).data??[];d(X),p(xe=>{var q;return xe&&X.some(ge=>ge.id===xe)?xe:((q=X[0])==null?void 0:q.id)??null})}catch(H){C(H instanceof Error?H.message:"Failed to load transcripts")}finally{v(!1)}},[]);f.useEffect(()=>{G()},[G]),f.useEffect(()=>{o==="browse"&&Ne.getTranscriptSettings().then(H=>{var X,xe;te(!!((xe=(X=H.data)==null?void 0:X.publicAccess)!=null&&xe.enabled))}).catch(()=>te(!1))},[o]);const Y=f.useMemo(()=>{if(!S.trim())return l;const H=S.toLowerCase();return l.filter(X=>X.id.includes(H)||X.filename.toLowerCase().includes(H)||X.ticketName&&X.ticketName.toLowerCase().includes(H))},[l,S]),ce=f.useMemo(()=>l.find(H=>H.id===m)??null,[l,m]),fe=m?`/api/system/transcripts/${encodeURIComponent(m)}/view`:null,se=m?`/api/system/transcripts/${encodeURIComponent(m)}/download`:null,P=m&&L?`${window.location.origin}/transcripts/${encodeURIComponent(m)}`:null;function Z(H){w(""),p(H),N(X=>X+1)}function ae(){fe&&window.open(fe,"_blank","noopener,noreferrer")}function re(){P&&window.open(P,"_blank","noopener,noreferrer")}async function V(){if(P)try{await navigator.clipboard.writeText(P),I(!0),window.setTimeout(()=>I(!1),2e3)}catch{w("Could not copy link to clipboard.")}}async function O(){var X;if(!m||!a)return;const H=((X=ce==null?void 0:ce.ticketName)==null?void 0:X.trim())||`channel ${m}`;if(window.confirm(`Delete the transcript for ${H}? This cannot be undone.`)){R(!0),w("");try{await Ne.deleteTranscript(m),await G()}catch(xe){w(xe instanceof Error?xe.message:"Failed to delete transcript")}finally{R(!1)}}}async function D(){if(!(!se||!ce)){M(!0),w("");try{const H=await fetch(se,{credentials:"include"});if(!H.ok){const ge=await H.json().catch(()=>({}));throw new Error(ge.error||`Download failed (${H.status})`)}const X=await H.blob(),xe=URL.createObjectURL(X),q=document.createElement("a");q.href=xe,q.download=ce.filename,q.click(),URL.revokeObjectURL(xe)}catch(H){w(H instanceof Error?H.message:"Failed to download transcript")}finally{M(!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(ue,{type:"button",variant:o==="browse"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>c("browse"),children:"Library"}),s.jsx(ue,{type:"button",variant:o==="appearance"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>c("appearance"),children:"Appearance"}),s.jsx(ue,{type:"button",variant:o==="settings"?"secondary":"ghost",size:"sm",className:"h-8",onClick:()=>c("settings"),children:"Settings"})]}),o==="browse"?s.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>G(),disabled:g,children:[s.jsx(ve,{icon:ur,size:16,className:pe(g&&"animate-spin")}),"Refresh"]}):null]})]}),o==="appearance"?s.jsx(xP,{}):o==="settings"?s.jsx(yP,{}):s.jsxs(s.Fragment,{children:[y?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:y})}):null,s.jsxs("div",{className:"grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(240px,320px)_1fr]",children:[s.jsxs(Ze,{className:"flex min-h-[420px] flex-col border-border bg-card",children:[s.jsxs(ut,{className:"space-y-3 pb-3",children:[s.jsxs(dt,{className:"text-base font-medium",children:["Saved transcripts",!g&&l.length>0?s.jsxs("span",{className:"ml-2 font-normal text-muted-foreground",children:["(",l.length,")"]}):null]}),s.jsxs("div",{className:"relative",children:[s.jsx(ve,{icon:ji,size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(De,{placeholder:"Search by ticket name or channel ID…",value:S,onChange:H=>E(H.target.value),className:"pl-9"})]})]}),s.jsx(Qe,{className:"min-h-0 flex-1 p-0 pb-4",children:s.jsx(fc,{className:"h-[min(520px,calc(100svh-16rem))] px-4",children:g?s.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((H,X)=>s.jsx(Be,{className:"h-16 w-full rounded-lg"},X))}):Y.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(ve,{icon:Ul,size:32,className:"opacity-40"}),s.jsx("p",{children:l.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:Y.map(H=>{var q;const X=H.id===m,xe=((q=H.ticketName)==null?void 0:q.trim())||`Channel ${H.id}`;return s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>Z(H.id),className:pe("w-full rounded-lg border px-3 py-2.5 text-left transition-colors",X?"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:xe}),s.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[a2(H.createdAt),H.size!=null?` · ${r2(H.size)}`:""]})]})},H.id)})})})})]}),s.jsxs(Ze,{className:"flex min-h-[420px] flex-col overflow-hidden border-border bg-card",children:[s.jsxs(ut,{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(dt,{className:"truncate text-base font-medium",children:ce?(($=ce.ticketName)==null?void 0:$.trim())||`Channel ${ce.id}`:"Preview"}),ce?s.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[a2(ce.createdAt),ce.size!=null?` · ${r2(ce.size)}`:""]}):null]}),s.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2",children:[P?s.jsxs(s.Fragment,{children:[s.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>void V(),children:[s.jsx(ve,{icon:R2,size:16}),K?"Copied":"Copy link"]}),s.jsxs(ue,{variant:"outline",size:"sm",onClick:re,children:[s.jsx(ve,{icon:Nd,size:16}),"Public page"]})]}):null,s.jsxs(ue,{variant:"outline",size:"sm",disabled:!fe,onClick:ae,children:[s.jsx(ve,{icon:p8,size:16}),"Open tab"]}),s.jsxs(ue,{variant:"outline",size:"sm",disabled:!se||T,onClick:()=>void D(),children:[s.jsx(ve,{icon:Cd,size:16}),T?"Saving…":"Download"]}),a?s.jsxs(ue,{variant:"outline",size:"sm",disabled:!m||_,className:"text-destructive hover:text-destructive",onClick:()=>void O(),children:[s.jsx(ve,{icon:wi,size:16}),_?"Deleting…":"Delete"]}):null]})]}),s.jsxs(Qe,{className:"flex min-h-0 flex-1 flex-col gap-2 p-4 pt-0",children:[b?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:b})}):null,ce&&fe?s.jsx("iframe",{title:`Transcript ${ce.id}`,src:fe,className:"min-h-[min(560px,calc(100svh-18rem))] w-full flex-1 rounded-lg border border-border bg-background",sandbox:"allow-same-origin"},k):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(ve,{icon:Ul,size:40,className:"opacity-30"}),s.jsx("p",{children:"Select a transcript from the list to preview it here."})]})]})]})]})]})]})}function CP(){const[t,n]=f.useState([]),[a,o]=f.useState(""),[c,l]=f.useState(!0),[d,m]=f.useState(""),[p,g]=f.useState(!0);f.useEffect(()=>{try{Ne.getConfigJson("supportbot").then(W=>{if(W&&W.data&&typeof W.data=="object"){const oe=Fr(W.data,"Ticket.DepartmentSystem.Enabled");typeof oe=="boolean"&&g(oe)}}).catch(()=>{})}catch{}},[]);const[v,b]=f.useState("all"),[w,y]=f.useState("all"),[C,S]=f.useState(""),E=f.useMemo(()=>{const W=new Set;return Array.isArray(t)&&t.forEach(oe=>{if(oe&&oe.department&&typeof oe.department=="string"){const Se=oe.department.trim().toLowerCase();Se&&W.add(Se)}}),Array.from(W).sort()},[t]),k=f.useMemo(()=>Array.isArray(t)?t.filter(W=>{var oe,Se,ye,Re,nt,mt;if(!W||p&&v!=="all"&&((oe=W.department)==null?void 0:oe.toLowerCase())!==v.toLowerCase()||w!=="all"&&((Se=W.priority)==null?void 0:Se.toLowerCase())!==w.toLowerCase())return!1;if(C.trim()){const bt=C.toLowerCase().trim(),Rr=(ye=W.subject)==null?void 0:ye.toLowerCase().includes(bt),xn=(Re=W.ticket_id)==null?void 0:Re.toLowerCase().includes(bt),mn=(nt=W.user_id)==null?void 0:nt.toLowerCase().includes(bt),Wr=p&&((mt=W.department)==null?void 0:mt.toLowerCase().includes(bt));if(!Rr&&!xn&&!mn&&!Wr)return!1}return!0}):[],[t,p,v,w,C]),[N,T]=f.useState(null),[M,_]=f.useState(!1),[R,L]=f.useState(!1),[te,K]=f.useState([]),[I,G]=f.useState(!1),[Y,ce]=f.useState(""),[fe,se]=f.useState([]),[P,Z]=f.useState(!1),[ae,re]=f.useState(null),[V,O]=f.useState(!1),[D,$]=f.useState(""),[H,X]=f.useState(null),[xe,q]=f.useState(""),[ge,me]=f.useState(!1),[B,ie]=f.useState(null),[we,Ce]=f.useState(""),[ze,Ke]=f.useState(null),[ft,Pt]=f.useState(!1),[gn,Yr]=f.useState("general"),[_n,wn]=f.useState(""),[Xn,Zn]=f.useState(""),[It,po]=f.useState(!1),nn=async()=>{if(!_n.trim()){Dt.error("Please enter a subject or reason for the ticket.");return}po(!0);try{const W=await Ne.createTicket({department:gn,subject:_n.trim(),userId:Xn.trim()||void 0});Dt.success(W.message||"Ticket opened successfully!"),Pt(!1),wn(""),Zn(""),qr()}catch(W){Dt.error(W instanceof Error?W.message:"Failed to open ticket.")}finally{po(!1)}},Dn=W=>{ie(W),Ce("Closed via Web Dashboard"),me(!0)},Da=async()=>{if(!B)return;const W=B.ticket_id;Ke(W);try{await Ne.closeTicket(W,we||"Closed via Web Dashboard"),Dt.success("Ticket closed and transcript saved."),n(oe=>oe.filter(Se=>Se.ticket_id!==W)),(N==null?void 0:N.ticket_id)===W&&(_(!1),L(!1),T(null)),me(!1),ie(null)}catch(oe){Dt.error(oe instanceof Error?oe.message:"Failed to close ticket.")}finally{Ke(null)}},ho=f.useRef(null),Qn=f.useRef(null),Es=()=>{var W;(W=ho.current)==null||W.scrollIntoView({behavior:"smooth"})},qr=f.useCallback(async()=>{l(!0),m("");try{const W=await Ne.listOpenTickets();W.data&&(o(W.data.guildId),n(W.data.tickets.sort((oe,Se)=>Se.created_at-oe.created_at)))}catch(W){m(W instanceof Error?W.message:"Failed to load open tickets")}finally{l(!1)}},[]);f.useEffect(()=>{qr()},[qr]),f.useEffect(()=>{Ne.getGuildResources().then(W=>{W.data&&re(W.data)}).catch(()=>{})},[]);const gr=f.useCallback(W=>{N&&W.ticketId===N.ticket_id&&(K(oe=>oe.some(Se=>Se.id===W.message.id)?oe:[...oe,W.message]),setTimeout(Es,100))},[N]),Tt=f.useCallback(W=>{N&&W.ticketId===N.ticket_id&&K(oe=>oe.filter(Se=>Se.id!==W.messageId))},[N]),On=f.useCallback(W=>{N&&W.ticketId===N.ticket_id&&K(oe=>oe.map(Se=>Se.id===W.messageId?{...Se,content:W.content}:Se))},[N]),Mt=f.useCallback(W=>{n(oe=>oe.some(Se=>Se.ticket_id===W.ticket_id)?oe:[W,...oe]),Dt.info("New Ticket Created",{description:`#${W.ticket_id} - ${W.subject||"No Subject"}`})},[]),Oi=f.useCallback(W=>{n(oe=>oe.filter(Se=>Se.ticket_id!==W.ticket_id)),(N==null?void 0:N.ticket_id)===W.ticket_id&&Dt.warning("Active ticket was closed in Discord.")},[N]);kx({onTicketMessage:gr,onTicketMessageDeleted:Tt,onTicketMessageUpdated:On,onTicketCreated:Mt,onTicketClosed:Oi});const Li=async W=>{var oe;T(W),_(!0),G(!0),K([]),se([]),X(null);try{const Se=await Ne.getTicketMessages(W.ticket_id);(oe=Se.data)!=null&&oe.messages&&(K(Se.data.messages),setTimeout(Es,150))}catch(Se){Dt.error(Se instanceof Error?Se.message:"Failed to fetch messages")}finally{G(!1)}},go=W=>{const oe=Array.from(W.target.files||[]);oe.length&&(oe.forEach(Se=>{const ye=new FileReader;ye.onload=Re=>{var mt;const nt=(mt=Re.target)==null?void 0:mt.result;se(bt=>[...bt,{filename:Se.name,data:nt,previewUrl:Se.type.startsWith("image/")?nt:void 0,sizeMb:(Se.size/1024/1024).toFixed(2)}])},ye.readAsDataURL(Se)}),Qn.current&&(Qn.current.value=""))},Kr=W=>{se(oe=>oe.filter((Se,ye)=>ye!==W))},Oa=async W=>{var ye;if(W.preventDefault(),!Y.trim()&&!fe.length||!N||P)return;const oe=Y.trim(),Se=[...fe];Z(!0),ce(""),se([]),O(!1);try{const Re=await Ne.me().catch(()=>null),nt=((ye=Re==null?void 0:Re.data)==null?void 0:ye.username)||"Staff",mt=await Ne.sendTicketReply(N.ticket_id,oe,nt,Se.map(bt=>({filename:bt.filename,data:bt.data})));mt.data&&(K(bt=>bt.some(Rr=>Rr.id===mt.data.id)?bt:[...bt,{id:mt.data.id,author:mt.data.author,content:mt.data.content,attachments:mt.data.attachments||[],createdAt:mt.data.createdAt}]),setTimeout(Es,100))}catch(Re){Dt.error(Re instanceof Error?Re.message:"Failed to send reply to Discord."),ce(oe),se(Se)}finally{Z(!1)}},Mr=async W=>{if(N)try{await Ne.deleteTicketMessage(N.ticket_id,W),K(oe=>oe.filter(Se=>Se.id!==W)),Dt.success("Message deleted in Discord.")}catch(oe){Dt.error(oe instanceof Error?oe.message:"Failed to delete message.")}},Kt=W=>{X(W.id),q(W.content)},La=()=>{X(null),q("")},Oe=async W=>{if(!(!N||!xe.trim()))try{await Ne.editTicketMessage(N.ticket_id,W,xe.trim()),K(oe=>oe.map(Se=>Se.id===W?{...Se,content:xe.trim()}:Se)),X(null),Dt.success("Message updated in Discord.")}catch(oe){Dt.error(oe instanceof Error?oe.message:"Failed to edit message.")}},tt=W=>{const oe=W.target.value;ce(oe);const Se=W.target.selectionStart||oe.length,ye=oe.slice(0,Se),Re=ye.lastIndexOf("@");if(Re!==-1&&!ye.slice(Re).includes(" ")){const nt=ye.slice(Re+1).toLowerCase();$(nt),O(!0)}else O(!1)},it=(W,oe,Se)=>{const ye=Y.lastIndexOf("@"),Re=Y.slice(0,ye),nt=Se?`<@&${oe}>`:`<@${oe}>`;ce(`${Re}${nt} `),O(!1)},rn=W=>{const oe=Math.floor((Date.now()-W)/1e3);return fg(oe)},Ft=W=>new Date(W).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Rt=W=>{if(!W)return null;const oe=/(```[\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 W.split(oe).map((ye,Re)=>{var Rr;if(!ye)return null;if(ye.startsWith("-# "))return s.jsx("span",{className:"text-xs text-muted-foreground font-medium block my-0.5 opacity-80",children:Rt(ye.slice(3))},Re);if(ye.startsWith("## "))return s.jsx("span",{className:"text-base font-bold text-foreground block my-1 tracking-tight",children:Rt(ye.slice(3))},Re);if(ye.startsWith("### "))return s.jsx("span",{className:"text-sm font-bold text-foreground block my-0.5",children:Rt(ye.slice(4))},Re);if(ye.startsWith("```")&&ye.endsWith("```")&&ye.length>=6){const xn=ye.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:xn})},Re)}if(ye.startsWith("`")&&ye.endsWith("`")&&ye.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:ye.slice(1,-1)},Re);if(ye.startsWith("***")&&ye.endsWith("***")&&ye.length>6)return s.jsx("strong",{className:"font-bold italic",children:Rt(ye.slice(3,-3))},Re);if(ye.startsWith("**")&&ye.endsWith("**")&&ye.length>4)return s.jsx("strong",{className:"font-bold",children:Rt(ye.slice(2,-2))},Re);if(ye.startsWith("__")&&ye.endsWith("__")&&ye.length>4)return s.jsx("span",{className:"underline underline-offset-2",children:Rt(ye.slice(2,-2))},Re);if(ye.startsWith("~~")&&ye.endsWith("~~")&&ye.length>4)return s.jsx("span",{className:"line-through opacity-80",children:Rt(ye.slice(2,-2))},Re);if(ye.startsWith("||")&&ye.endsWith("||")&&ye.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:ye.slice(2,-2)},Re);const nt=ye.match(/^<@!?(\d+)>$/);if(nt){const xn=nt[1],mn=new Map;N&&mn.set(N.user_id,"Ticket Author"),te.forEach(xr=>{var Xr;(Xr=xr.author)!=null&&Xr.id&&mn.set(xr.author.id,xr.author.globalName||xr.author.username)});const Wr=mn.get(xn);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: ${xn}`,children:["@",Wr||"User"]},Re)}const mt=ye.match(/^<@&(\d+)>$/);if(mt){const xn=mt[1],mn=(Rr=ae==null?void 0:ae.roles)==null?void 0:Rr.find(Wr=>Wr.id===xn);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:["@",mn?mn.name:`Role (${xn})`]},Re)}const bt=ye.match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(bt){const xn=bt[1],mn=bt[2];return s.jsx("a",{href:mn,target:"_blank",rel:"noreferrer",className:"text-primary underline hover:opacity-80 break-all",children:xn},Re)}return/^https?:\/\/[^\s]+$/i.test(ye)?/\.(gif|jpe?g|png|webp)(\?[^\s]*)?$/i.test(ye)||/cdn\.discordapp\.com\/(emojis|attachments)\//i.test(ye)||/images\.discordapp\.net\//i.test(ye)||/media\d*\.giphy\.com\//i.test(ye)?s.jsx("span",{className:"block my-1",children:s.jsx("img",{src:ye,alt:"GIF/Image",className:"max-h-64 rounded-lg border border-border object-contain hover:opacity-95 transition-opacity",loading:"lazy"})},Re):s.jsx("a",{href:ye,target:"_blank",rel:"noreferrer",className:"text-primary underline hover:opacity-80 break-all",children:ye},Re):ye})},Jn=W=>!W||W.length===0?null:s.jsx("div",{className:"space-y-2 mt-1",children:W.map(oe=>{var nt,mt,bt;const Se=((nt=oe.contentType)==null?void 0:nt.startsWith("image/"))||/\.(png|jpe?g|gif|webp|svg)$/i.test(oe.name),ye=((mt=oe.contentType)==null?void 0:mt.startsWith("video/"))||/\.(mp4|webm|mov|mkv)$/i.test(oe.name),Re=((bt=oe.contentType)==null?void 0:bt.startsWith("audio/"))||/\.(mp3|wav|ogg|m4a)$/i.test(oe.name);return Se?s.jsx("div",{className:"rounded-lg overflow-hidden border border-border bg-black/40",children:s.jsx("a",{href:oe.url,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:oe.url,alt:oe.name,className:"max-h-80 max-w-full object-contain hover:opacity-95 transition-opacity",loading:"lazy"})})},oe.id):ye?s.jsx("div",{className:"rounded-lg overflow-hidden border border-border bg-black",children:s.jsx("video",{src:oe.url,controls:!0,className:"max-h-80 max-w-full"})},oe.id):Re?s.jsx("div",{className:"p-2 border border-border rounded-lg bg-secondary/20",children:s.jsx("audio",{src:oe.url,controls:!0,className:"w-full h-8"})},oe.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(ve,{icon:Uy,size:16,className:"text-primary shrink-0"}),s.jsx("span",{className:"truncate font-medium",children:oe.name})]}),s.jsx(ue,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 px-2 text-xs",children:s.jsx("a",{href:oe.url,target:"_blank",rel:"noreferrer",download:!0,children:"Download"})})]},oe.id)})}),fn=W=>!W||W.length===0?null:s.jsx("div",{className:"space-y-3 mt-1.5 w-full",children:W.map((oe,Se)=>{var ye,Re,nt,mt;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:oe.color||"#5865F2"},children:[oe.author&&s.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-foreground",children:[oe.author.iconURL&&s.jsx("img",{src:oe.author.iconURL,alt:"",className:"h-4 w-4 rounded-full"}),s.jsx("span",{children:oe.author.name})]}),((ye=oe.thumbnail)==null?void 0:ye.url)&&s.jsx("img",{src:oe.thumbnail.url,alt:"",className:"h-12 w-12 rounded object-cover absolute top-3 right-3 border border-border"}),oe.title&&s.jsx("h4",{className:"font-bold text-sm text-foreground tracking-tight pr-12",children:Rt(oe.title)}),oe.description&&s.jsx("div",{className:"text-muted-foreground whitespace-pre-wrap leading-relaxed pr-12",children:Rt(oe.description)}),oe.fields&&oe.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:oe.fields.map((bt,Rr)=>s.jsxs("div",{className:`space-y-0.5 ${bt.inline?"":"sm:col-span-2"}`,children:[s.jsx("p",{className:"font-semibold text-foreground text-[11px] uppercase tracking-wider",children:bt.name}),s.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:Rt(bt.value)})]},Rr))}),((Re=oe.image)==null?void 0:Re.url)&&s.jsx("div",{className:"rounded-md overflow-hidden border border-border mt-2",children:s.jsx("img",{src:oe.image.url,alt:"",className:"max-h-64 w-full object-cover"})}),(oe.footer||oe.timestamp)&&s.jsxs("div",{className:"flex items-center gap-2 pt-1 border-t border-border/20 text-[10px] text-muted-foreground",children:[((nt=oe.footer)==null?void 0:nt.iconURL)&&s.jsx("img",{src:oe.footer.iconURL,alt:"",className:"h-3.5 w-3.5 rounded-full"}),((mt=oe.footer)==null?void 0:mt.text)&&s.jsx("span",{children:oe.footer.text}),oe.timestamp&&s.jsxs("span",{children:[new Date(oe.timestamp).toLocaleDateString()," ",new Date(oe.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]})]},Se)})}),Ln=W=>{if(!W||W.length===0)return null;const oe=W.map(Se=>({...Se,components:(Se.components||[]).filter(ye=>ye.customId||ye.url||ye.type===2||ye.type===3||ye.type==="BUTTON"||ye.type==="STRING_SELECT")})).filter(Se=>Se.components&&Se.components.length>0);return oe.length===0?null:s.jsx("div",{className:"space-y-2 mt-2.5 w-full",children:oe.map((Se,ye)=>{var Re;return s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:(Re=Se.components)==null?void 0:Re.map((nt,mt)=>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:[nt.emoji&&s.jsx("span",{children:nt.emoji}),s.jsx("span",{children:nt.label||nt.customId||"Button"})]},mt))},ye)})})},xo=()=>s.jsx(fc,{className:"flex-1 p-4 sm:p-6",children:s.jsxs("div",{className:"max-w-4xl mx-auto w-full space-y-4",children:[I?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"})]}):te.length===0?s.jsx("div",{className:"p-12 text-center text-muted-foreground text-sm",children:"No recent messages in this ticket channel."}):te.map(W=>{var oe;return s.jsxs("div",{className:`group flex items-start gap-3 ${W.author.isDashboard?"flex-row-reverse":""}`,children:[s.jsxs(bs,{className:"h-8 w-8 shrink-0",children:[s.jsx(eo,{src:W.author.avatar,alt:W.author.username}),s.jsx(ys,{children:s.jsx(ve,{icon:L8,size:16})})]}),s.jsxs("div",{className:`flex flex-col space-y-1 max-w-[80%] ${W.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:W.author.globalName||W.author.username}),W.author.bot&&s.jsx(Fn,{variant:"secondary",className:"px-1 py-0 text-[10px]",children:"BOT"}),W.author.isDashboard&&s.jsx(Fn,{variant:"default",className:"px-1 py-0 text-[10px]",children:"STAFF"}),s.jsx("span",{children:Ft(W.createdAt)}),s.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-1",children:[s.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:()=>Kt(W),title:"Edit Message",children:s.jsx(ve,{icon:D2,size:12})}),s.jsx(ue,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-destructive",onClick:()=>Mr(W.id),title:"Delete Message",children:s.jsx(ve,{icon:wi,size:12})})]})]}),H===W.id?s.jsxs("div",{className:"flex items-center gap-2 w-full mt-1",children:[s.jsx(De,{value:xe,onChange:Se=>q(Se.target.value),className:"h-8 text-sm",autoFocus:!0}),s.jsx(ue,{size:"sm",className:"h-8 px-2 bg-primary",onClick:()=>Oe(W.id),children:s.jsx(ve,{icon:_8,size:14})}),s.jsx(ue,{size:"sm",variant:"ghost",className:"h-8 px-2",onClick:La,children:s.jsx(ve,{icon:va,size:14})})]}):W.content?s.jsx("div",{className:`rounded-lg px-3.5 py-2.5 text-sm whitespace-pre-wrap ${W.author.isDashboard?"bg-primary text-primary-foreground":"bg-secondary/40 text-secondary-foreground border border-border/50"}`,style:W.containerColor||W.author.bot&&!((oe=W.embeds)!=null&&oe.length)?{borderLeftWidth:"4px",borderLeftColor:W.containerColor||"#5865F2"}:void 0,children:Rt(W.content)}):null,Jn(W.attachments),fn(W.embeds),Ln(W.components)]})]},W.id)}),s.jsx("div",{ref:ho})]})}),vo=()=>{var W;return s.jsxs("div",{className:"p-4 border-t border-border bg-secondary/10 flex flex-col gap-2 relative",children:[fe.length>0&&s.jsx("div",{className:"max-w-4xl mx-auto w-full flex items-center gap-2 flex-wrap mb-1",children:fe.map((oe,Se)=>s.jsxs("div",{className:"flex items-center gap-2 p-1.5 px-3 rounded-lg border border-border bg-secondary text-xs",children:[oe.previewUrl?s.jsx("img",{src:oe.previewUrl,alt:"",className:"h-6 w-6 rounded object-cover"}):s.jsx(ve,{icon:Uy,size:14,className:"text-primary"}),s.jsx("span",{className:"font-medium max-w-[120px] truncate",children:oe.filename}),s.jsxs("span",{className:"text-muted-foreground text-[10px]",children:[oe.sizeMb,"MB"]}),s.jsx("button",{type:"button",onClick:()=>Kr(Se),className:"text-muted-foreground hover:text-destructive ml-1",children:s.jsx(ve,{icon:va,size:12})})]},Se))}),V&&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 (@)"}),N&&s.jsxs("button",{type:"button",onClick:()=>it("Ticket Author",N.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(bs,{className:"h-5 w-5",children:s.jsx(ys,{children:"U"})}),s.jsx("span",{className:"font-medium",children:"Ticket Author"})]}),s.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["@",N.user_id]})]}),(W=ae==null?void 0:ae.roles)==null?void 0:W.filter(oe=>oe.name.toLowerCase().includes(D)).slice(0,5).map(oe=>s.jsxs("button",{type:"button",onClick:()=>it(oe.name,oe.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:["@",oe.name]}),s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"Role"})]},oe.id))]}),s.jsxs("form",{onSubmit:Oa,className:"max-w-4xl mx-auto w-full flex items-center gap-2",children:[s.jsx("input",{type:"file",ref:Qn,multiple:!0,onChange:go,className:"hidden",accept:"image/*,video/*,audio/*,.pdf,.zip,.txt,.json"}),s.jsx(ue,{type:"button",variant:"outline",size:"sm",onClick:()=>{var oe;return(oe=Qn.current)==null?void 0:oe.click()},title:"Attach files or media",className:"h-9 px-2.5",children:s.jsx(ve,{icon:b8,size:16})}),s.jsx(De,{value:Y,onChange:tt,placeholder:"Type a reply... Use @ to tag roles or users",disabled:P||I,className:"flex-1"}),s.jsx(ue,{type:"submit",size:"sm",disabled:P||!Y.trim()&&!fe.length||I,children:P?s.jsx(ve,{icon:ur,size:16,className:"animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(ve,{icon:R8,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("div",{className:"flex items-center gap-2",children:[s.jsxs(ue,{onClick:()=>Pt(!0),className:"gap-2 bg-primary font-semibold text-xs h-9",children:[s.jsx(ve,{icon:is,size:15})," Open Ticket"]}),s.jsxs(ue,{onClick:()=>void qr(),disabled:c,variant:"outline",size:"sm",children:[s.jsx(ve,{icon:ur,size:16,className:c?"animate-spin mr-2":"mr-2"}),"Refresh"]})]})]}),s.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-3 bg-card/60 p-3.5 rounded-xl border border-border/80 shadow-sm",children:[s.jsxs("div",{className:"relative w-full md:w-80",children:[s.jsx(ve,{icon:ji,size:15,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(De,{placeholder:"Search tickets by ID, user, subject...",value:C,onChange:W=>S(W.target.value),className:"pl-9 text-xs h-9 bg-secondary/30 border-border"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 w-full md:w-auto justify-end",children:[p&&s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Department:"}),s.jsxs(Ca,{value:v,onValueChange:b,children:[s.jsx(Br,{className:"text-xs h-9 w-[160px] bg-secondary/30 border-border capitalize",children:s.jsx(Sa,{placeholder:"All Departments"})}),s.jsxs($r,{children:[s.jsx(vt,{value:"all",children:"All Departments"}),E.map(W=>s.jsx(vt,{value:W,className:"capitalize",children:W},W))]})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Priority:"}),s.jsxs(Ca,{value:w,onValueChange:y,children:[s.jsx(Br,{className:"text-xs h-9 w-[140px] bg-secondary/30 border-border capitalize",children:s.jsx(Sa,{placeholder:"All Priorities"})}),s.jsxs($r,{children:[s.jsx(vt,{value:"all",children:"All Priorities"}),s.jsx(vt,{value:"low",children:"Low"}),s.jsx(vt,{value:"medium",children:"Medium / Normal"}),s.jsx(vt,{value:"high",children:"High"}),s.jsx(vt,{value:"urgent",children:"Urgent"})]})]})]}),(v!=="all"||w!=="all"||C.trim())&&s.jsx(ue,{variant:"ghost",size:"sm",onClick:()=>{b("all"),y("all"),S("")},className:"h-9 text-xs text-muted-foreground hover:text-foreground px-2",children:"Reset"})]})]}),s.jsx(Ze,{className:"border-border bg-card",children:s.jsx(Qe,{className:"p-0",children:c?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(Ye,{variant:"destructive",children:s.jsx(qe,{children:d})})}):k.length===0?s.jsxs("div",{className:"p-12 text-center text-muted-foreground space-y-2",children:[s.jsx("p",{children:"No open tickets found matching your filter criteria."}),(v!=="all"||w!=="all"||C.trim())&&s.jsx(ue,{variant:"outline",size:"sm",onClick:()=>{b("all"),y("all"),S("")},className:"text-xs mt-2",children:"Clear Filters"})]}):s.jsx("div",{className:"divide-y divide-border",children:k.map(W=>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:W.subject||"Untitled Ticket"}),s.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:["#",W.ticket_id]}),p&&W.department&&s.jsx(Fn,{variant:"outline",className:"text-xs capitalize",children:W.department}),s.jsxs(Fn,{variant:W.priority==="high"?"destructive":W.priority==="medium"?"secondary":"outline",className:"text-xs capitalize",children:[W.priority," priority"]})]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["User ID: ",s.jsx("span",{className:"font-mono",children:W.user_id}),W.description&&` • ${W.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(ve,{icon:h8,size:14,className:"mr-1.5"}),rn(W.created_at)]}),s.jsxs(ue,{variant:"default",size:"sm",onClick:()=>Li(W),className:"bg-primary text-primary-foreground hover:bg-primary/90",children:[s.jsx(ve,{icon:g8,size:16,className:"mr-2"}),"Live Chat"]}),s.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>Dn(W),disabled:ze===W.ticket_id,children:[ze===W.ticket_id?s.jsx(ve,{icon:ur,size:14,className:"animate-spin mr-1.5"}):s.jsx(ve,{icon:va,size:14,className:"mr-1.5"}),"Close"]}),a&&s.jsx(ue,{variant:"secondary",size:"sm",asChild:!0,children:s.jsx("a",{href:`https://discord.com/channels/${a}/${W.ticket_id}`,target:"_blank",rel:"noreferrer",children:s.jsx(ve,{icon:Nd,size:16})})})]})]},W.ticket_id))})})}),M&&R&&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:W=>{W.target===W.currentTarget&&L(!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:(N==null?void 0:N.subject)||"Ticket Live Chat"}),s.jsxs(Fn,{variant:"outline",className:"font-mono text-xs shrink-0",children:["#",N==null?void 0:N.ticket_id]}),(N==null?void 0:N.department)&&s.jsx(Fn,{variant:"secondary",className:"text-xs capitalize shrink-0",children:N.department})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[N&&s.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>Dn(N),disabled:ze===N.ticket_id,className:"h-8 px-2.5 text-xs",children:[ze===N.ticket_id?s.jsx(ve,{icon:ur,size:14,className:"animate-spin mr-1.5"}):s.jsx(ve,{icon:va,size:14,className:"mr-1.5"}),"Close Ticket"]}),s.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>L(!1),className:"h-8 px-3 text-xs flex items-center gap-1.5",children:[s.jsx(ve,{icon:S8,size:14}),s.jsx("span",{children:"Collapse"})]}),s.jsx(ue,{variant:"ghost",size:"icon",onClick:()=>{_(!1),L(!1)},className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:s.jsx(ve,{icon:va,size:18})})]})]}),(N==null?void 0:N.description)&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]}),xo(),vo()]})}),M&&!R&&s.jsx(Yj,{open:M,onOpenChange:_,children:s.jsxs(Hg,{side:"right",className:"w-full sm:max-w-xl p-0 flex flex-col h-full bg-card",children:[s.jsxs(Gg,{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(Vg,{className:"text-base font-bold truncate",children:(N==null?void 0:N.subject)||"Ticket Live Chat"}),s.jsxs(Fn,{variant:"outline",className:"font-mono text-xs shrink-0",children:["#",N==null?void 0:N.ticket_id]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[N&&s.jsxs(ue,{variant:"destructive",size:"sm",onClick:()=>Dn(N),disabled:ze===N.ticket_id,className:"h-7 px-2 text-xs",children:[ze===N.ticket_id?s.jsx(ve,{icon:ur,size:13,className:"animate-spin mr-1"}):s.jsx(ve,{icon:va,size:13,className:"mr-1"}),"Close"]}),s.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>L(!0),className:"h-7 px-2 text-xs flex items-center gap-1",title:"Open in Full View",children:[s.jsx(ve,{icon:C8,size:13}),s.jsx("span",{children:"Full View"})]})]})]}),(N==null?void 0:N.description)&&s.jsx(Fg,{className:"text-xs text-muted-foreground truncate",children:N.description})]}),xo(),vo()]})}),s.jsx(Qs,{open:ge,onOpenChange:me,children:s.jsxs(hs,{className:"sm:max-w-md bg-card border-border rounded-xl",children:[s.jsxs(gs,{children:[s.jsxs(xs,{className:"text-lg font-bold flex items-center gap-2",children:[s.jsx(ve,{icon:va,className:"text-destructive",size:20}),"Close Ticket #",B==null?void 0:B.ticket_id]}),s.jsx(vs,{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(De,{value:we,onChange:W=>Ce(W.target.value),placeholder:"e.g. Issue resolved by support team",className:"text-sm"})]}),s.jsxs(Js,{className:"gap-2 sm:gap-0 mt-2",children:[s.jsx(ue,{variant:"outline",size:"sm",onClick:()=>me(!1),disabled:!!ze,children:"Cancel"}),s.jsxs(ue,{variant:"destructive",size:"sm",onClick:Da,disabled:!!ze,children:[ze?s.jsx(ve,{icon:ur,size:14,className:"animate-spin mr-1.5"}):s.jsx(ve,{icon:va,size:14,className:"mr-1.5"}),"Confirm Close"]})]})]})}),s.jsx(Qs,{open:ft,onOpenChange:Pt,children:s.jsxs(hs,{className:"sm:max-w-[450px]",children:[s.jsxs(gs,{children:[s.jsxs(xs,{className:"text-base flex items-center gap-2",children:[s.jsx(ve,{icon:is,size:18,className:"text-primary"}),"Open Direct Ticket"]}),s.jsx(vs,{className:"text-xs",children:"Select a support department to create a new ticket channel in Discord immediately."})]}),s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(_e,{className:"text-xs font-semibold",children:"Department"}),s.jsxs(Ca,{value:gn,onValueChange:Yr,children:[s.jsx(Br,{className:"text-xs border-border bg-secondary/30",children:s.jsx(Sa,{})}),s.jsxs($r,{children:[s.jsx(vt,{value:"general",children:"🎫 General Support"}),s.jsx(vt,{value:"purchase",children:"💳 Purchase & Billing Support"}),s.jsx(vt,{value:"reports",children:"🚨 Player Report"}),s.jsx(vt,{value:"appeals",children:"⚖️ Ban Appeals"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(_e,{className:"text-xs font-semibold",children:"Ticket Subject / Reason"}),s.jsx(De,{value:_n,onChange:W=>wn(W.target.value),placeholder:"e.g. Assistance with server permissions",className:"text-xs border-border bg-secondary/30"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(_e,{className:"text-xs font-semibold",children:"Discord User ID (Optional)"}),s.jsx(De,{value:Xn,onChange:W=>Zn(W.target.value),placeholder:"e.g. 123456789012345678 (Leave blank for yourself)",className:"text-xs font-mono border-border bg-secondary/30"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"If specified, the ticket channel will be created for this user."})]})]}),s.jsxs(Js,{className:"gap-2 sm:gap-0",children:[s.jsx(ue,{variant:"outline",size:"sm",onClick:()=>Pt(!1),disabled:It,className:"text-xs",children:"Cancel"}),s.jsxs(ue,{size:"sm",onClick:nn,disabled:It||!_n.trim(),className:"gap-1.5 text-xs bg-primary font-semibold",children:[It?s.jsx(ve,{icon:ur,size:14,className:"animate-spin"}):s.jsx(ve,{icon:is,size:14}),It?"Opening Ticket...":"Open Ticket"]})]})]})})]})}const SP=["admin","moderator","editor","viewer","custom"];function NP(){return{mode:"add",id:"",username:"",globalName:"",role:"viewer",enabled:!0,permissions:ls("viewer"),yamlOwner:!1}}function EP({permissions:t,onChange:n,disabled:a}){const o=d=>n({...t,...d}),c=[{key:"overview",title:"Dashboard Overview",description:"Access to system metrics, bot health status, and main dashboard stats."},{key:"tickets",title:"Support Tickets",description:"View open support tickets, live web chat, send staff replies, and close tickets."},{key:"transcripts",title:"Ticket Transcripts",description:"Access saved ticket HTML transcripts and configure public transcript options."},{key:"logs",title:"Console Terminal Logs",description:"View real-time bot terminal output, system logs, and runtime error traces."}],l=[["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 & Modules Access"}),s.jsx("div",{className:"grid gap-2.5",children:c.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(kt,{checked:t[d]??(d==="tickets"?t.overview:!1),disabled:a,onCheckedChange:g=>o({[d]:g}),className:"shrink-0"})]},d))})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Administration & Settings"}),s.jsxs("div",{className:"grid gap-2.5",children:[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(kt,{checked:t.settings.view,disabled:a,onCheckedChange:d=>o({settings:{...t.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(kt,{checked:t.settings.update,disabled:a,onCheckedChange:d=>o({settings:{...t.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(kt,{checked:t.users.view,disabled:a,onCheckedChange:d=>o({users:{...t.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(kt,{checked:t.users.manage,disabled:a,onCheckedChange:d=>o({users:{...t.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.jsxs("div",{className:"grid gap-2.5",children:[l.map(([d,m,p])=>{var v;const g=((v=t.configs)==null?void 0:v[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(kt,{checked:g.view,disabled:a,onCheckedChange:b=>o({configs:{...t.configs,[d]:{...g,view:b}}})})]}),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(kt,{checked:g.edit,disabled:a,onCheckedChange:b=>o({configs:{...t.configs,[d]:{...g,edit:b,view:b?!0:g.view}}})})]})]})]},d)}),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:"Raw YAML Code Editor"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Access the raw YAML code editor tab to view or edit full raw configuration files."})]}),s.jsx("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:"Access"}),s.jsx(kt,{checked:t.rawYaml??!1,disabled:a,onCheckedChange:d=>o({rawYaml:d})})]})})]})]})]})]})}function kP(t){return t.permissions.users.manage?"Full + user management":t.permissions.settings.update?"Configs + settings updates":Object.values(t.permissions.configs).some(n=>n.edit)?"Can edit configs":"View only"}function TP(){const{user:t,hasPermission:n}=qt(),a=n("users.manage"),[o,c]=f.useState([]),[l,d]=f.useState([]),[m,p]=f.useState(!0),[g,v]=f.useState(""),[b,w]=f.useState(null),[y,C]=f.useState(!1),S=f.useCallback(async()=>{p(!0),v("");try{const[R,L]=await Promise.all([Ne.listDashboardUsers(),Ne.listGroups().catch(()=>({data:{groups:[]}}))]);R.data&&c(R.data.users),L.data&&d(L.data.groups)}catch(R){v(R instanceof Error?R.message:"Failed to load users")}finally{p(!1)}},[]);f.useEffect(()=>{S()},[S]);const E=f.useMemo(()=>[...o].sort((R,L)=>R.yamlOwner!==L.yamlOwner?R.yamlOwner?-1:1:(R.username||R.id).localeCompare(L.username||L.id)),[o]);function k(){w(NP())}function N(R){w({mode:"edit",id:R.id,username:R.username||"",globalName:R.globalName||"",role:R.yamlOwner?"owner":R.role,enabled:R.enabled,permissions:R.role==="custom"?R.permissions:ls(R.role),yamlOwner:R.yamlOwner})}function T(R){b&&w({...b,role:R,permissions:ls(R,b.permissions)})}async function M(){if(!(!b||!a)){C(!0),v("");try{b.mode==="add"?await Ne.addDashboardUser({id:b.id.trim(),role:b.role,username:b.username||void 0,globalName:b.globalName||void 0,enabled:b.enabled,permissions:b.role==="custom"?b.permissions:void 0}):await Ne.updateDashboardUser(b.id,{role:b.yamlOwner?void 0:b.role,enabled:b.enabled,username:b.username||void 0,globalName:b.globalName||void 0,permissions:b.role==="custom"?b.permissions:void 0}),w(null),await S()}catch(R){v(R instanceof Error?R.message:"Could not save user")}finally{C(!1)}}}async function _(R){if(a&&window.confirm("Remove this user from the dashboard?")){v("");try{await Ne.removeDashboardUser(R),await S()}catch(L){v(L instanceof Error?L.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(ue,{onClick:k,children:[s.jsx(ve,{icon:sg,size:16,className:"mr-2"}),"Add user"]}):null]}),g?s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:g})}):null,s.jsx(Ze,{className:"border-border bg-card overflow-hidden",children:s.jsx(Qe,{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(R=>{const L=l.find(I=>I.id===R.groupId||I.id===R.role),te=(L==null?void 0:L.color)||"#10B981",K=(L==null?void 0:L.name)||$y[R.yamlOwner?"owner":R.role]||R.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(bs,{className:"size-7",children:[s.jsx(eo,{src:R.avatar,alt:R.username}),s.jsx(ys,{className:"text-[10px]",children:(R.username||R.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:[P2(R),R.id===(t==null?void 0:t.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:R.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:te}}),s.jsx("span",{className:"font-medium text-xs text-foreground",children:K}),R.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:kP(R)}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:R.enabled?s.jsx(Fn,{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(Fn,{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(ue,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>N(R),children:[s.jsx(ve,{icon:v8,size:13}),"Edit"]}),!R.yamlOwner&&s.jsxs(ue,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-destructive",onClick:()=>_(R.id),children:[s.jsx(ve,{icon:wi,size:13}),"Remove"]})]})})]},R.id)})})]})})})}),s.jsx(Qs,{open:!!b,onOpenChange:R=>!R&&w(null),children:s.jsxs(hs,{className:"max-h-[90vh] max-w-lg overflow-y-auto",children:[s.jsxs(gs,{children:[s.jsx(xs,{children:(b==null?void 0:b.mode)==="add"?"Add dashboard user":"Edit user"}),s.jsx(vs,{children:b!=null&&b.yamlOwner?"This user is an owner in api.yml. Role and removal are managed in the config file.":P8[(b==null?void 0:b.role)??"viewer"]})]}),b?s.jsxs("div",{className:"space-y-4",children:[b.mode==="add"?s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:"discord-id",children:"Discord user ID"}),s.jsx(De,{id:"discord-id",value:b.id,onChange:R=>w({...b,id:R.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(_e,{children:"Display name (optional)"}),s.jsx(De,{value:b.globalName,onChange:R=>w({...b,globalName:R.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Username (optional)"}),s.jsx(De,{value:b.username,onChange:R=>w({...b,username:R.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{children:"Permission Group"}),s.jsxs(Ca,{value:b.role,disabled:b.yamlOwner,onValueChange:R=>{const L=l.find(te=>te.id===R);L?w({...b,role:R,permissions:L.permissions}):T(R)},children:[s.jsx(Br,{children:s.jsx(Sa,{})}),s.jsx($r,{children:b.yamlOwner?s.jsx(vt,{value:"owner",children:"Owner"}):l.length>0?l.map(R=>s.jsx(vt,{value:R.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:R.color||"#10B981"}}),s.jsx("span",{children:R.name})]})},R.id)):SP.map(R=>s.jsx(vt,{value:R,children:$y[R]},R))})]})]}),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(kt,{checked:b.enabled,disabled:b.yamlOwner,onCheckedChange:R=>w({...b,enabled:R})})]}),b.role==="custom"&&!b.yamlOwner?s.jsx(EP,{permissions:b.permissions,onChange:R=>w({...b,permissions:R})}):null]}):null,s.jsxs(Js,{children:[s.jsx(ue,{variant:"outline",onClick:()=>w(null),children:"Cancel"}),s.jsx(ue,{disabled:y||!a||(b==null?void 0:b.mode)==="add"&&!/^\d{17,20}$/.test(b.id.trim()),onClick:()=>void M(),children:y?"Saving…":"Save"})]})]})})]})}const MP=[{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 RP({permissions:t,onChange:n,disabled:a}){const o=d=>n({...t,...d}),c=[{key:"overview",title:"Dashboard Overview",description:"Access to system metrics, bot health status, and main dashboard stats."},{key:"tickets",title:"Support Tickets",description:"View open support tickets, live web chat, send staff replies, and close tickets."},{key:"transcripts",title:"Ticket Transcripts",description:"Access saved ticket HTML transcripts and configure public transcript options."},{key:"logs",title:"Console Terminal Logs",description:"View real-time bot terminal output, system logs, and runtime error traces."}],l=[["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 & Modules Access"}),s.jsx("div",{className:"grid gap-2.5",children:c.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(kt,{checked:t[d]??(d==="tickets"?t.overview:!1),disabled:a,onCheckedChange:g=>o({[d]:g}),className:"shrink-0"})]},d))})]}),s.jsxs("div",{className:"space-y-2.5",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Administration & Settings"}),s.jsxs("div",{className:"grid gap-2.5",children:[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(kt,{checked:t.settings.view,disabled:a,onCheckedChange:d=>o({settings:{...t.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(kt,{checked:t.settings.update,disabled:a,onCheckedChange:d=>o({settings:{...t.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(kt,{checked:t.users.view,disabled:a,onCheckedChange:d=>o({users:{...t.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(kt,{checked:t.users.manage,disabled:a,onCheckedChange:d=>o({users:{...t.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.jsxs("div",{className:"grid gap-2.5",children:[l.map(([d,m,p])=>{var v;const g=((v=t.configs)==null?void 0:v[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(kt,{checked:g.view,disabled:a,onCheckedChange:b=>o({configs:{...t.configs,[d]:{...g,view:b}}})})]}),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(kt,{checked:g.edit,disabled:a,onCheckedChange:b=>o({configs:{...t.configs,[d]:{...g,edit:b,view:b?!0:g.view}}})})]})]})]},d)}),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:"Raw YAML Code Editor"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:"Access the raw YAML code editor tab to view or edit full raw configuration files."})]}),s.jsx("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:"Access"}),s.jsx(kt,{checked:t.rawYaml??!1,disabled:a,onCheckedChange:d=>o({rawYaml:d})})]})})]})]})]})]})}function AP(){const{permissions:t,impersonateGroup:n,impersonatedGroup:a,stopImpersonation:o}=qt(),c=Mn(t,"users.manage"),[l,d]=f.useState([]),[m,p]=f.useState(!0),[g,v]=f.useState(null),[b,w]=f.useState(null),[y,C]=f.useState(!1),[S,E]=f.useState("add"),[k,N]=f.useState(!1),[T,M]=f.useState(""),[_,R]=f.useState(""),[L,te]=f.useState(""),[K,I]=f.useState("#10B981"),[G,Y]=f.useState(""),[ce,fe]=f.useState(ls("viewer")),se=async()=>{var V;p(!0),v(null);try{const O=await Ne.listGroups();d(((V=O.data)==null?void 0:V.groups)||[])}catch(O){v(O instanceof Error?O.message:"Failed to load groups")}finally{p(!1)}};f.useEffect(()=>{se()},[]);const P=()=>{E("add"),M(""),R(""),te(""),I("#10B981"),Y(""),fe(ls("viewer")),C(!0)},Z=V=>{E("edit"),M(V.id),R(V.name),te(V.description||""),I(V.color||"#10B981"),Y(V.discordRoleId||""),fe(V.permissions||ls("viewer")),C(!0)},ae=async()=>{if(!_.trim()){v("Group name is required");return}N(!0),v(null);try{S==="add"?(await Ne.createGroup({name:_.trim(),description:L.trim(),color:K,discordRoleId:G.trim()||null,permissions:ce}),w(`Group "${_}" created successfully.`)):(await Ne.updateGroup(T,{name:_.trim(),description:L.trim(),color:K,discordRoleId:G.trim()||null,permissions:ce}),w(`Group "${_}" updated successfully.`)),C(!1),await se()}catch(V){v(V instanceof Error?V.message:"Failed to save group")}finally{N(!1)}},re=async V=>{if(!V.isSystem&&confirm(`Are you sure you want to delete the group "${V.name}"?`))try{await Ne.deleteGroup(V.id),w(`Group "${V.name}" deleted.`),await se()}catch(O){v(O instanceof Error?O.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."})]}),c&&s.jsxs(ue,{onClick:P,className:"shrink-0 gap-2 bg-primary",children:[s.jsx(ve,{icon:sg,size:18}),"Create Group"]})]}),g&&s.jsx(Ye,{variant:"destructive",children:s.jsx(qe,{children:g})}),b&&s.jsx(Ye,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-500",children:s.jsxs(qe,{className:"flex items-center justify-between",children:[s.jsx("span",{children:b}),s.jsx(ue,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>w(null),children:"Dismiss"})]})}),s.jsx(Ze,{className:"border-border bg-card overflow-hidden",children:s.jsx(Qe,{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"})]}):l.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:l.map(V=>{var O,D,$,H,X,xe,q;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:V.color||"#10B981"}}),s.jsx("span",{className:"text-foreground font-semibold text-xs",children:V.name}),V.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(ve,{icon:qu,size:10}),"System"]})]})}),s.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground max-w-xs truncate",children:V.description||"—"}),s.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:V.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(ve,{icon:qu,size:12,className:"text-primary"}),V.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:[((O=V.permissions)==null?void 0:O.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"}),(((D=V.permissions)==null?void 0:D.tickets)??(($=V.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"}),((H=V.permissions)==null?void 0:H.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"}),((X=V.permissions)==null?void 0:X.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"}),((q=(xe=V.permissions)==null?void 0:xe.users)==null?void 0:q.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(ue,{size:"sm",variant:"ghost",className:`h-7 px-2 text-xs gap-1 ${(a==null?void 0:a.id)===V.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:()=>(a==null?void 0:a.id)===V.id?o():n(V.id),children:[s.jsx(ve,{icon:qu,size:13}),(a==null?void 0:a.id)===V.id?"Active Preview":"View as Group"]}),c&&V.id!=="owner"&&s.jsxs(ue,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-foreground",onClick:()=>Z(V),children:[s.jsx(ve,{icon:D2,size:13}),"Edit"]}),c&&!V.isSystem&&s.jsxs(ue,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs gap-1 text-muted-foreground hover:text-destructive",onClick:()=>re(V),children:[s.jsx(ve,{icon:wi,size:13}),"Delete"]})]})})]},V.id)})})]})})})}),s.jsx(Qs,{open:y,onOpenChange:C,children:s.jsxs(hs,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(gs,{children:[s.jsx(xs,{children:S==="add"?"Create Permission Group":`Edit Group: ${_}`}),s.jsx(vs,{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(_e,{htmlFor:"group-name",children:"Group Name"}),s.jsx(De,{id:"group-name",placeholder:"e.g. Support Staff",value:_,onChange:V=>R(V.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:"group-color",children:"Color Badge"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(tf,{value:K,onChange:I}),s.jsx(De,{value:K,onChange:V=>I(V.target.value),placeholder:"#10B981",className:"w-28 font-mono text-sm uppercase"}),s.jsx("div",{className:"flex flex-wrap gap-1 ml-auto",children:MP.map(V=>s.jsx("button",{type:"button",className:"size-6 rounded-full border border-white/20 transition-transform hover:scale-110",style:{backgroundColor:V.hex},onClick:()=>I(V.hex),title:V.name},V.hex))})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(_e,{htmlFor:"group-desc",children:"Description"}),s.jsx(De,{id:"group-desc",placeholder:"Brief description of what members in this group can access...",value:L,onChange:V=>te(V.target.value)})]}),s.jsx(TS,{id:"discord-role-id",label:"Discord Role ID (Optional Auto-Sync)",description:"If provided, Discord users with this Role ID will automatically inherit this group upon login.",kind:"role",value:G,onChange:V=>Y(String(V??""))}),s.jsxs("div",{className:"pt-2",children:[s.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Group Permission Matrix"}),s.jsx(RP,{permissions:ce,onChange:fe})]})]}),s.jsxs(Js,{className:"gap-2 sm:gap-0",children:[s.jsx(ue,{variant:"outline",onClick:()=>C(!1),disabled:k,children:"Cancel"}),s.jsx(ue,{onClick:ae,disabled:k,className:"bg-primary",children:k?"Saving...":S==="add"?"Create Group":"Save Changes"})]})]})})]})}function _P({children:t}){const{isAuthenticated:n,loading:a}=qt();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:t}):s.jsx(ya,{to:"/login",replace:!0})}function DP(){const{complete:t,loading:n}=fS(),a=Kn();return n?s.jsx("div",{className:"flex min-h-svh items-center justify-center bg-background text-sm text-muted-foreground",children:"Loading…"}):t?a.pathname==="/setup"?s.jsx(ya,{to:"/login",replace:!0}):s.jsxs(Py,{children:[s.jsx(cn,{path:"/login",element:s.jsx(bz,{})}),s.jsxs(cn,{element:s.jsx(_P,{children:s.jsx(TA,{})}),children:[s.jsx(cn,{index:!0,element:s.jsx(Vz,{})}),s.jsx(cn,{path:"system",element:s.jsx(ga,{permission:"overview",children:s.jsx(sP,{})})}),s.jsx(cn,{path:"settings",element:s.jsx(ga,{permission:"settings.view",children:s.jsx(nP,{})})}),s.jsx(cn,{path:"configs",element:s.jsx(gz,{})}),s.jsx(cn,{path:"logs",element:s.jsx(ga,{permission:"logs",children:s.jsx(mP,{})})}),s.jsx(cn,{path:"tickets",element:s.jsx(ga,{permission:"transcripts",children:s.jsx(CP,{})})}),s.jsx(cn,{path:"transcripts",element:s.jsx(ga,{permission:"transcripts",children:s.jsx(jP,{})})}),s.jsx(cn,{path:"users",element:s.jsx(ga,{permission:"users.view",children:s.jsx(TP,{})})}),s.jsx(cn,{path:"groups",element:s.jsx(ga,{permission:"users.view",children:s.jsx(AP,{})})}),s.jsx(cn,{path:"addons",element:s.jsx(ga,{permission:"settings.view",children:s.jsx(Fz,{})})}),s.jsx(cn,{path:"addons/builder",element:s.jsx(ga,{permission:"settings.update",children:s.jsx(Yz,{})})})]}),s.jsx(cn,{path:"*",element:s.jsx(ya,{to:"/",replace:!0})})]}):s.jsxs(Py,{children:[s.jsx(cn,{path:"/setup",element:s.jsx(Lz,{})}),s.jsx(cn,{path:"*",element:s.jsx(ya,{to:"/setup",replace:!0})})]})}function OP({...t}){return s.jsx(KO,{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"}},...t})}Zz();_3.createRoot(document.getElementById("root")).render(s.jsx(f.StrictMode,{children:s.jsx(a8,{children:s.jsx(aC,{children:s.jsx(B8,{children:s.jsx(MA,{children:s.jsxs(U8,{children:[s.jsx(DP,{}),s.jsx(OP,{})]})})})})})}));
|