@goodfish/jarvy 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,534 +0,0 @@
1
- var bT=Object.defineProperty;var cx=e=>{throw TypeError(e)};var xT=(e,i,a)=>i in e?bT(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var nc=(e,i,a)=>xT(e,typeof i!="symbol"?i+"":i,a),ux=(e,i,a)=>i.has(e)||cx("Cannot "+a);var Ln=(e,i,a)=>(ux(e,i,"read from private field"),a?a.call(e):i.get(e)),dx=(e,i,a)=>i.has(e)?cx("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,a),Nm=(e,i,a,l)=>(ux(e,i,"write to private field"),l?l.call(e,a):i.set(e,a),a);function jT(e,i){for(var a=0;a<i.length;a++){const l=i[a];if(typeof l!="string"&&!Array.isArray(l)){for(const s in l)if(s!=="default"&&!(s in e)){const c=Object.getOwnPropertyDescriptor(l,s);c&&Object.defineProperty(e,s,c.get?c:{enumerable:!0,get:()=>l[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function a(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(s){if(s.ep)return;s.ep=!0;const c=a(s);fetch(s.href,c)}})();function cg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tm={exports:{}},ic={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var fx;function wT(){if(fx)return ic;fx=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(l,s,c){var d=null;if(c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),"key"in s){c={};for(var f in s)f!=="key"&&(c[f]=s[f])}else c=s;return s=c.ref,{$$typeof:e,type:l,key:d,ref:s!==void 0?s:null,props:c}}return ic.Fragment=i,ic.jsx=a,ic.jsxs=a,ic}var hx;function ST(){return hx||(hx=1,Tm.exports=wT()),Tm.exports}var u=ST(),Am={exports:{}},Ye={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var mx;function kT(){if(mx)return Ye;mx=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),x=Symbol.iterator;function w($){return $===null||typeof $!="object"?null:($=x&&$[x]||$["@@iterator"],typeof $=="function"?$:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function M($,fe,ye){this.props=$,this.context=fe,this.refs=N,this.updater=ye||S}M.prototype.isReactComponent={},M.prototype.setState=function($,fe){if(typeof $!="object"&&typeof $!="function"&&$!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,$,fe,"setState")},M.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function T(){}T.prototype=M.prototype;function A($,fe,ye){this.props=$,this.context=fe,this.refs=N,this.updater=ye||S}var I=A.prototype=new T;I.constructor=A,C(I,M.prototype),I.isPureReactComponent=!0;var D=Array.isArray;function B(){}var P={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function z($,fe,ye){var xe=ye.ref;return{$$typeof:e,type:$,key:fe,ref:xe!==void 0?xe:null,props:ye}}function Y($,fe){return z($.type,fe,$.props)}function q($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function W($){var fe={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(ye){return fe[ye]})}var Q=/\/+/g;function U($,fe){return typeof $=="object"&&$!==null&&$.key!=null?W(""+$.key):fe.toString(36)}function X($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(B,B):($.status="pending",$.then(function(fe){$.status==="pending"&&($.status="fulfilled",$.value=fe)},function(fe){$.status==="pending"&&($.status="rejected",$.reason=fe)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function O($,fe,ye,xe,re){var be=typeof $;(be==="undefined"||be==="boolean")&&($=null);var oe=!1;if($===null)oe=!0;else switch(be){case"bigint":case"string":case"number":oe=!0;break;case"object":switch($.$$typeof){case e:case i:oe=!0;break;case y:return oe=$._init,O(oe($._payload),fe,ye,xe,re)}}if(oe)return re=re($),oe=xe===""?"."+U($,0):xe,D(re)?(ye="",oe!=null&&(ye=oe.replace(Q,"$&/")+"/"),O(re,fe,ye,"",function(Ee){return Ee})):re!=null&&(q(re)&&(re=Y(re,ye+(re.key==null||$&&$.key===re.key?"":(""+re.key).replace(Q,"$&/")+"/")+oe)),fe.push(re)),1;oe=0;var ce=xe===""?".":xe+":";if(D($))for(var me=0;me<$.length;me++)xe=$[me],be=ce+U(xe,me),oe+=O(xe,fe,ye,be,re);else if(me=w($),typeof me=="function")for($=me.call($),me=0;!(xe=$.next()).done;)xe=xe.value,be=ce+U(xe,me++),oe+=O(xe,fe,ye,be,re);else if(be==="object"){if(typeof $.then=="function")return O(X($),fe,ye,xe,re);throw fe=String($),Error("Objects are not valid as a React child (found: "+(fe==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":fe)+"). If you meant to render a collection of children, use an array instead.")}return oe}function F($,fe,ye){if($==null)return $;var xe=[],re=0;return O($,xe,"","",function(be){return fe.call(ye,be,re++)}),xe}function ne($){if($._status===-1){var fe=$._result,ye=fe();ye.then(function(xe){($._status===0||$._status===-1)&&($._status=1,$._result=xe,ye.status===void 0&&(ye.status="fulfilled",ye.value=xe))},function(xe){($._status===0||$._status===-1)&&($._status=2,$._result=xe,ye.status===void 0&&(ye.status="rejected",ye.reason=xe))}),$._status===-1&&($._status=0,$._result=ye)}if($._status===1)return $._result.default;throw $._result}var _=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var fe=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(fe))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)};function J($){var fe=P.T,ye={};ye.types=fe!==null?fe.types:null,P.T=ye;try{var xe=$(),re=P.S;re!==null&&re(ye,xe),typeof xe=="object"&&xe!==null&&typeof xe.then=="function"&&xe.then(B,_)}catch(be){_(be)}finally{fe!==null&&ye.types!==null&&(fe.types=ye.types),P.T=fe}}function ee($){var fe=P.T;if(fe!==null){var ye=fe.types;ye===null?fe.types=[$]:ye.indexOf($)===-1&&ye.push($)}else J(ee.bind(null,$))}var H={map:F,forEach:function($,fe,ye){F($,function(){fe.apply(this,arguments)},ye)},count:function($){var fe=0;return F($,function(){fe++}),fe},toArray:function($){return F($,function(fe){return fe})||[]},only:function($){if(!q($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return Ye.Activity=g,Ye.Children=H,Ye.Component=M,Ye.Fragment=a,Ye.Profiler=s,Ye.PureComponent=A,Ye.StrictMode=l,Ye.Suspense=m,Ye.ViewTransition=b,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ye.__COMPILER_RUNTIME={__proto__:null,c:function($){return P.H.useMemoCache($)}},Ye.addTransitionType=ee,Ye.cache=function($){return function(){return $.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function($,fe,ye){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var xe=C({},$.props),re=$.key;if(fe!=null)for(be in fe.key!==void 0&&(re=""+fe.key),fe)!V.call(fe,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&fe.ref===void 0||(xe[be]=fe[be]);var be=arguments.length-2;if(be===1)xe.children=ye;else if(1<be){for(var oe=Array(be),ce=0;ce<be;ce++)oe[ce]=arguments[ce+2];xe.children=oe}return z($.type,re,xe)},Ye.createContext=function($){return $={$$typeof:d,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:c,_context:$},$},Ye.createElement=function($,fe,ye){var xe,re={},be=null;if(fe!=null)for(xe in fe.key!==void 0&&(be=""+fe.key),fe)V.call(fe,xe)&&xe!=="key"&&xe!=="__self"&&xe!=="__source"&&(re[xe]=fe[xe]);var oe=arguments.length-2;if(oe===1)re.children=ye;else if(1<oe){for(var ce=Array(oe),me=0;me<oe;me++)ce[me]=arguments[me+2];re.children=ce}if($&&$.defaultProps)for(xe in oe=$.defaultProps,oe)re[xe]===void 0&&(re[xe]=oe[xe]);return z($,be,re)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function($){return{$$typeof:f,render:$}},Ye.isValidElement=q,Ye.lazy=function($){return{$$typeof:y,_payload:{_status:-1,_result:$},_init:ne}},Ye.memo=function($,fe){return{$$typeof:v,type:$,compare:fe===void 0?null:fe}},Ye.startTransition=J,Ye.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ye.use=function($){return P.H.use($)},Ye.useActionState=function($,fe,ye){return P.H.useActionState($,fe,ye)},Ye.useCallback=function($,fe){return P.H.useCallback($,fe)},Ye.useContext=function($){return P.H.useContext($)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function($,fe){return P.H.useDeferredValue($,fe)},Ye.useEffect=function($,fe){return P.H.useEffect($,fe)},Ye.useEffectEvent=function($){return P.H.useEffectEvent($)},Ye.useId=function(){return P.H.useId()},Ye.useImperativeHandle=function($,fe,ye){return P.H.useImperativeHandle($,fe,ye)},Ye.useInsertionEffect=function($,fe){return P.H.useInsertionEffect($,fe)},Ye.useLayoutEffect=function($,fe){return P.H.useLayoutEffect($,fe)},Ye.useMemo=function($,fe){return P.H.useMemo($,fe)},Ye.useOptimistic=function($,fe){return P.H.useOptimistic($,fe)},Ye.useReducer=function($,fe,ye){return P.H.useReducer($,fe,ye)},Ye.useRef=function($){return P.H.useRef($)},Ye.useState=function($){return P.H.useState($)},Ye.useSyncExternalStore=function($,fe,ye){return P.H.useSyncExternalStore($,fe,ye)},Ye.useTransition=function(){return P.H.useTransition()},Ye.version="19.3.0",Ye}var px;function ug(){return px||(px=1,Am.exports=kT()),Am.exports}var k=ug();const CT=cg(k),wc=jT({__proto__:null,default:CT},[k]);var Mm={exports:{}},ac={},Om={exports:{}},Rm={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var gx;function ET(){return gx||(gx=1,(function(e){function i(X,O){var F=X.length;X.push(O);e:for(;0<F;){var ne=F-1>>>1,_=X[ne];if(0<s(_,O))X[ne]=O,X[F]=_,F=ne;else break e}}function a(X){return X.length===0?null:X[0]}function l(X){if(X.length===0)return null;var O=X[0],F=X.pop();if(F!==O){X[0]=F;e:for(var ne=0,_=X.length,J=_>>>1;ne<J;){var ee=2*(ne+1)-1,H=X[ee],$=ee+1,fe=X[$];if(0>s(H,F))$<_&&0>s(fe,H)?(X[ne]=fe,X[$]=F,ne=$):(X[ne]=H,X[ee]=F,ne=ee);else if($<_&&0>s(fe,F))X[ne]=fe,X[$]=F,ne=$;else break e}}return O}function s(X,O){var F=X.sortIndex-O.sortIndex;return F!==0?F:X.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],v=[],y=1,g=null,b=3,x=!1,w=!1,S=!1,C=!1,N=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(X){for(var O=a(v);O!==null;){if(O.callback===null)l(v);else if(O.startTime<=X)l(v),O.sortIndex=O.expirationTime,i(m,O);else break;O=a(v)}}function I(X){if(S=!1,A(X),!w)if(a(m)!==null)w=!0,D||(D=!0,q());else{var O=a(v);O!==null&&U(I,O.startTime-X)}}var D=!1,B=-1,P=5,V=-1;function z(){return C?!0:!(e.unstable_now()-V<P)}function Y(){if(C=!1,D){var X=e.unstable_now();V=X;var O=!0;try{e:{w=!1,S&&(S=!1,M(B),B=-1),x=!0;var F=b;try{t:{for(A(X),g=a(m);g!==null&&!(g.expirationTime>X&&z());){var ne=g.callback;if(typeof ne=="function"){g.callback=null,b=g.priorityLevel;var _=ne(g.expirationTime<=X);if(X=e.unstable_now(),typeof _=="function"){g.callback=_,A(X),O=!0;break t}g===a(m)&&l(m),A(X)}else l(m);g=a(m)}if(g!==null)O=!0;else{var J=a(v);J!==null&&U(I,J.startTime-X),O=!1}}break e}finally{g=null,b=F,x=!1}O=void 0}}finally{O?q():D=!1}}}var q;if(typeof T=="function")q=function(){T(Y)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,Q=W.port2;W.port1.onmessage=Y,q=function(){Q.postMessage(null)}}else q=function(){N(Y,0)};function U(X,O){B=N(function(){X(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(X){X.callback=null},e.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<X?Math.floor(1e3/X):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(X){switch(b){case 1:case 2:case 3:var O=3;break;default:O=b}var F=b;b=O;try{return X()}finally{b=F}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(X,O){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var F=b;b=X;try{return O()}finally{b=F}},e.unstable_scheduleCallback=function(X,O,F){var ne=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?ne+F:ne):F=ne,X){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=F+_,X={id:y++,callback:O,priorityLevel:X,startTime:F,expirationTime:_,sortIndex:-1},F>ne?(X.sortIndex=F,i(v,X),a(m)===null&&X===a(v)&&(S?(M(B),B=-1):S=!0,U(I,F-ne))):(X.sortIndex=_,i(m,X),w||x||(w=!0,D||(D=!0,q()))),X},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(X){var O=b;return function(){var F=b;b=O;try{return X.apply(this,arguments)}finally{b=F}}}})(Rm)),Rm}var vx;function NT(){return vx||(vx=1,Om.exports=ET()),Om.exports}var _m={exports:{}},Tn={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var yx;function TT(){if(yx)return Tn;yx=1;var e=ug();function i(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var l={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},s=Symbol.for("react.portal"),c=Symbol.for("react.recoverable"),d=Symbol.for("react.optimistic_key");function f(y,g,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:x==null?null:x===d?d:""+x,children:y,containerInfo:g,implementation:b}}var m=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Tn.browser=function(y){return{$$typeof:c,_reason:y}},Tn.createPortal=function(y,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(i(299));return f(y,g,null,b)},Tn.flushSync=function(y){var g=m.T,b=l.p;try{if(m.T=null,l.p=2,y)return y()}finally{m.T=g,l.p=b,l.d.f()}},Tn.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,l.d.C(y,g))},Tn.prefetchDNS=function(y){typeof y=="string"&&l.d.D(y)},Tn.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var b=g.as,x=v(b,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?l.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:x,integrity:w,fetchPriority:S}):b==="script"&&l.d.X(y,{crossOrigin:x,integrity:w,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Tn.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=v(g.as,g.crossOrigin);l.d.M(y,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}}else g==null&&l.d.M(y)},Tn.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,x=v(b,g.crossOrigin);l.d.L(y,b,{crossOrigin:x,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})}},Tn.preloadModule=function(y,g){if(typeof y=="string")if(g){var b=v(g.as,g.crossOrigin);l.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}else l.d.m(y)},Tn.requestFormReset=function(y){l.d.r(y)},Tn.unstable_batchedUpdates=function(y,g){return y(g)},Tn.useFormState=function(y,g,b){return m.H.useFormState(y,g,b)},Tn.useFormStatus=function(){return m.H.useHostTransitionStatus()},Tn.version="19.3.0",Tn}var bx;function A2(){if(bx)return _m.exports;bx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),_m.exports=TT(),_m.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var xx;function AT(){if(xx)return ac;xx=1;var e=NT(),i=ug(),a=A2();function l(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){for(var n=t,r=n;r&&!r.alternate;)n=r,(n.flags&4098)!==0&&(t=n.return),r=n.return;for(;n.return;)n=n.return;return n.tag===3?t:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function m(t){if(c(t)!==t)throw Error(l(188))}function v(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(l(188));return n!==t?null:t}for(var r=t,o=n;;){var h=r.return;if(h===null)break;var p=h.alternate;if(p===null){if(o=h.return,o!==null){r=o;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===r)return m(h),t;if(p===o)return m(h),n;p=p.sibling}throw Error(l(188))}if(r.return!==o.return)r=h,o=p;else{for(var E=!1,R=h.child;R;){if(R===r){E=!0,r=h,o=p;break}if(R===o){E=!0,o=h,r=p;break}R=R.sibling}if(!E){for(R=p.child;R;){if(R===r){E=!0,r=p,o=h;break}if(R===o){E=!0,o=p,r=h;break}R=R.sibling}if(!E)throw Error(l(189))}}if(r.alternate!==o)throw Error(l(190))}if(r.tag!==3)throw Error(l(188));return r.stateNode.current===r?t:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}function g(t,n,r,o,h,p){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&r(t,o,h,p)||(t.tag!==22||t.memoizedState===null)&&(n||t.tag!==5&&t.tag!==27)&&g(t.child,n,r,o,h,p))return!0;t=t.sibling}return!1}function b(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function x(t){var n=!1;for(t=t.return;t!==null&&(t.tag===4&&(n=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return n}function w(t){var n=[null,null],r=b(t);return r===null||S(n,t,r.child,{foundSelf:!1}),n}function S(t,n,r,o){for(;r!==null;){if(r===n)o.foundSelf=!0;else if(r.tag===5||r.tag===27||r.tag===6){if(o.foundSelf)return t[1]=r,!0;t[0]=r}else if((r.tag!==22||r.memoizedState===null)&&S(t,n,r.child,o))return!0;r=r.sibling}return!1}function C(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(l(559))}}var N=null,M=null;function T(t,n,r){return t===r?!0:t===n?(N=t,!0):!1}function A(t,n,r){return t===r?(M=t,!1):t===n?(M!==null&&(N=t),!0):!1}function I(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function D(t,n,r){for(var o=0,h=t;h;h=r(h))o++;h=0;for(var p=n;p;p=r(p))h++;for(;0<o-h;)t=r(t),o--;for(;0<h-o;)n=r(n),h--;for(;o--;){if(t===n||n!==null&&t===n.alternate)return t;t=r(t),n=r(n)}return null}var B=Object.assign,P=Symbol.for("react.element"),V=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),Y=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),U=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),ee=Symbol.for("react.legacy_hidden"),H=Symbol.for("react.memo_cache_sentinel"),$=Symbol.for("react.view_transition"),fe=Symbol.for("react.recoverable"),ye=Symbol.iterator;function xe(t){return t===null||typeof t!="object"?null:(t=ye&&t[ye]||t["@@iterator"],typeof t=="function"?t:null)}var re=Symbol.for("react.client.reference");function be(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===re?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Y:return"Fragment";case W:return"Profiler";case q:return"StrictMode";case O:return"Suspense";case F:return"SuspenseList";case J:return"Activity";case $:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case z:return"Portal";case U:return t.displayName||"Context";case Q:return(t._context.displayName||"Context")+".Consumer";case X:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ne:return n=t.displayName||null,n!==null?n:be(t.type)||"Memo";case _:n=t._payload,t=t._init;try{return be(t(n))}catch{}}return null}var oe=Array.isArray,ce=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ee={pending:!1,data:null,method:null,action:null},ze=[],Fe=-1;function ht(t){return{current:t}}function ot(t){0>Fe||(t.current=ze[Fe],ze[Fe]=null,Fe--)}function Je(t,n){Fe++,ze[Fe]=t.current,t.current=n}var At=ht(null),gn=ht(null),vn=ht(null),Hn=ht(null);function di(t,n){switch(Je(vn,n),Je(gn,t),Je(At,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?yb(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=yb(n),t=bb(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ot(At),Je(At,t)}function an(){ot(At),ot(gn),ot(vn)}function Yi(t){var n=t.memoizedState;n!==null&&(qo._currentValue=n.memoizedState,Je(Hn,t)),n=At.current;var r=bb(n,t.type);n!==r&&(Je(gn,t),Je(At,r))}function pe(t){gn.current===t&&(ot(At),ot(gn)),Hn.current===t&&(ot(Hn),qo._currentValue=Ee)}var ke,Be;function Ue(t){if(ke===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);ke=n&&n[1]||"",Be=-1<r.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+ke+t+Be}var We=!1;function Ht(t,n){if(!t||We)return"";We=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(Ce){var te=Ce}Reflect.construct(t,[],ve)}else{try{ve.call()}catch(Ce){te=Ce}ve=!1;try{var se=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ve=!0,new t}finally{ve&&(se!==void 0?Object.defineProperty(t.prototype,"props",se):delete t.prototype.props)}}}else{try{throw Error()}catch(Ce){te=Ce}(ve=t())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(Ce){if(Ce&&te&&typeof Ce.stack=="string")return[Ce.stack,te.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=o.DetermineComponentFrameRoot(),E=p[0],R=p[1];if(E&&R){var G=E.split(`
44
- `),ae=R.split(`
45
- `);for(h=o=0;o<G.length&&!G[o].includes("DetermineComponentFrameRoot");)o++;for(;h<ae.length&&!ae[h].includes("DetermineComponentFrameRoot");)h++;if(o===G.length||h===ae.length)for(o=G.length-1,h=ae.length-1;1<=o&&0<=h&&G[o]!==ae[h];)h--;for(;1<=o&&0<=h;o--,h--)if(G[o]!==ae[h]){if(o!==1||h!==1)do if(o--,h--,0>h||G[o]!==ae[h]){var de=`
46
- `+G[o].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=o&&0<=h);break}}}finally{We=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Ue(r):""}function yn(t,n){switch(t.tag){case 26:case 27:case 5:return Ue(t.type);case 16:return Ue("Lazy");case 13:return t.child!==n&&n!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return Ht(t.type,!1);case 11:return Ht(t.type.render,!1);case 1:return Ht(t.type,!0);case 31:return Ue("Activity");case 30:return Ue("ViewTransition");default:return""}}function Ut(t){try{var n="",r=null;do n+=yn(t,r),r=t,t=t.return;while(t);return n}catch(o){return`
47
- Error generating stack: `+o.message+`
48
- `+o.stack}}var On=Object.prototype.hasOwnProperty,Un=e.unstable_scheduleCallback,Rt=e.unstable_cancelCallback,Rn=e.unstable_shouldYield,Xe=e.unstable_requestPaint,Gt=e.unstable_now,ll=e.unstable_getCurrentPriorityLevel,sa=e.unstable_ImmediatePriority,ca=e.unstable_UserBlockingPriority,bn=e.unstable_NormalPriority,fi=e.unstable_LowPriority,ol=e.unstable_IdlePriority,hi=e.log,ao=e.unstable_setDisableYieldValue,Gi=null,sn=null;function zt(t){if(typeof hi=="function"&&ao(t),sn&&typeof sn.setStrictMode=="function")try{sn.setStrictMode(Gi,t)}catch{}}var Vt=Math.clz32?Math.clz32:Xi,ua=Math.log,da=Math.LN2;function Xi(t){return t>>>=0,t===0?32:31-(ua(t)/da|0)|0}var Qi=256,Oi=262144,Kn=4194304;function Ki(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function mi(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var h=0,p=t.suspendedLanes,E=t.pingedLanes;t=t.warmLanes;var R=o&134217727;return R!==0?(o=R&~p,o!==0?h=Ki(o):(E&=R,E!==0?h=Ki(E):r||(r=R&~t,r!==0&&(h=Ki(r))))):(R=o&~p,R!==0?h=Ki(R):E!==0?h=Ki(E):r||(r=o&~t,r!==0&&(h=Ki(r)))),h===0?0:n!==0&&n!==h&&(n&p)===0&&(p=h&-h,r=n&-n,p>=r||p===32&&(r&4194048)!==0)?n:h}function pi(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function fa(t,n){(n&8)!==0&&(n|=n&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=n;0<r;){var o=31-Vt(r),h=1<<o;n|=t[o],r&=~h}return n}function sl(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 gi(){var t=Kn;return Kn<<=1,(Kn&62914560)===0&&(Kn=4194304),t}function yr(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function Zn(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ha(t,n,r,o,h,p){var E=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var R=t.entanglements,G=t.expirationTimes,ae=t.hiddenUpdates;for(r=E&~r;0<r;){var de=31-Vt(r),ve=1<<de;R[de]=0,G[de]=-1;var te=ae[de];if(te!==null)for(ae[de]=null,de=0;de<te.length;de++){var se=te[de];se!==null&&(se.lane&=-536870913)}r&=~ve}o!==0&&Jn(t,o,0),p!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=p&~(E&~n))}function Jn(t,n,r){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-Vt(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|r&261930}function rn(t,n){var r=t.entangledLanes|=n;for(t=t.entanglements;r;){var o=31-Vt(r),h=1<<o;h&n|t[o]&n&&(t[o]|=n),r&=~h}}function cn(t,n){var r=n&-n;return r=(r&42)!==0?1:ma(r),(r&(t.suspendedLanes|n))!==0?0:r}function ma(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Wn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function ei(){var t=me.p;return t!==0?t:(t=window.event,t===void 0?32:nx(t.type))}function _n(t,n){var r=me.p;try{return me.p=t,n()}finally{me.p=r}}var Lt=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Lt,$t="__reactProps$"+Lt,xn="__reactContainer$"+Lt,cl="__reactEvents$"+Lt,br="__reactListeners$"+Lt,xr="__reactHandles$"+Lt,pa="__reactResources$"+Lt,ga="__reactMarker$"+Lt,Va="__reactLoad$"+Lt;function $a(t){delete t[Mt],delete t[$t],delete t[br],delete t[xr]}function ti(t){var n;if(n=t[Mt])return n;for(var r=t.parentNode;r;){if(n=r[xn]||r[Mt]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(t=Lb(t);t!==null;){if(r=t[Mt])return r;t=Lb(t)}return n}t=r,r=t.parentNode}return null}function va(t){if(t=t[Mt]||t[xn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ue(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(l(33))}function L(t){var n=t[pa];return n||(n=t[pa]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function K(t){t[ga]=!0}function he(t){t[Va]=void 0}var Ne=new Set,Se={};function Te(t,n){Le(t,n),Le(t+"Capture",n)}function Le(t,n){for(Se[t]=n,t=0;t<n.length;t++)Ne.add(n[t])}var Qe=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]*$"),Me={},$e={};function st(t){return On.call($e,t)?!0:On.call(Me,t)?!1:Qe.test(t)?$e[t]=!0:(Me[t]=!0,!1)}var Pe=!1;function ln(){var t=Pe;return Pe=!1,t}function It(t,n,r){if(st(n))if(r===null)t.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,r)}}function vi(t,n,r){if(r===null)t.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,r)}}function Xt(t,n,r,o){if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttributeNS(n,r,o)}}function Qt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ro(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ds(t,n,r){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,p=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return h.call(this)},set:function(E){r=""+E,p.call(this,E)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return r},setValue:function(E){r=""+E},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Ya(t){if(!t._valueTracker){var n=ro(t)?"checked":"value";t._valueTracker=ds(t,n,""+t[n])}}function lo(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var r=n.getValue(),o="";return t&&(o=ro(t)?t.checked?"true":"false":t.value),t=o,t!==r?(n.setValue(t),!0):!1}var Ic=/[\n"\\]/g;function Ot(t){return t.replace(Ic,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Dn(t,n,r,o,h,p,E,R){t.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.type=E:t.removeAttribute("type"),n!=null?E==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Qt(n)):t.value!==""+Qt(n)&&(t.value=""+Qt(n)):E!=="submit"&&E!=="reset"||t.removeAttribute("value"),n!=null?E==="number"&&t.value==n?oo(t,Qt(t.value)):oo(t,Qt(n)):r!=null?oo(t,Qt(r)):o!=null&&t.removeAttribute("value"),h==null&&p!=null&&(t.defaultChecked=!!p),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+Qt(R):t.removeAttribute("name")}function jr(t,n,r,o,h,p,E,R){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),n!=null||r!=null){if(!(p!=="submit"&&p!=="reset"||n!=null)){Ya(t);return}r=r!=null?""+Qt(r):"",n=n!=null?""+Qt(n):r,R||n===t.value||(t.value=n),t.defaultValue=n}o=o??h,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=R?t.checked:!!o,t.defaultChecked=!!o,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(t.name=E),Ya(t)}function oo(t,n){t.defaultValue!==""+n&&(t.defaultValue=""+n)}function ni(t,n,r,o){if(t=t.options,n){n={};for(var h=0;h<r.length;h++)n["$"+r[h]]=!0;for(r=0;r<t.length;r++)h=n.hasOwnProperty("$"+t[r].value),t[r].selected!==h&&(t[r].selected=h),h&&o&&(t[r].defaultSelected=!0)}else{for(r=""+Qt(r),n=null,h=0;h<t.length;h++){if(t[h].value===r){t[h].selected=!0,o&&(t[h].defaultSelected=!0);return}n!==null||t[h].disabled||(n=t[h])}n!==null&&(n.selected=!0)}}function so(t,n,r){if(n!=null&&(n=""+Qt(n),n!==t.value&&(t.value=n),r==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=r!=null?""+Qt(r):""}function yi(t,n,r,o){if(n==null){if(o!=null){if(r!=null)throw Error(l(92));if(oe(o)){if(1<o.length)throw Error(l(93));o=o[0]}r=o}r==null&&(r=""),n=r}r=Qt(n),t.defaultValue=r,o=t.textContent,o===r&&o!==""&&o!==null&&(t.value=o),Ya(t)}function qn(t,n){if(n){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=n;return}}t.textContent=n}var wr=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 fs(t,n,r){var o=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,r):typeof r!="number"||r===0||wr.has(n)?n==="float"?t.cssFloat=r:t[n]=(""+r).trim():t[n]=r+"px"}function bi(t,n,r){if(n!=null&&typeof n!="object")throw Error(l(62));if(t=t.style,r!=null){for(var o in r)!r.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="",Pe=!0);for(var h in n)o=n[h],n.hasOwnProperty(h)&&r[h]!==o&&(fs(t,h,o),Pe=!0)}else for(var p in n)n.hasOwnProperty(p)&&fs(t,p,n[p])}function ul(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var hs=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"],["maskType","mask-type"],["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"]]),ms=/^[\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 jn(t){return ms.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Fn(){}var dl=null;function fl(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ut=null,un=null;function Ri(t){var n=va(t);if(n&&(t=n.stateNode)){var r=t[$t]||null;e:switch(t=n.stateNode,n.type){case"input":if(Dn(t,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Ot(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var o=r[n];if(o!==t&&o.form===t.form){var h=o[$t]||null;if(!h)throw Error(l(90));Dn(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<r.length;n++)o=r[n],o.form===t.form&&lo(o)}break e;case"textarea":so(t,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&ni(t,!!r.multiple,n,!1)}}}var xi=!1;function hl(t,n,r){if(xi)return t(n,r);xi=!0;try{var o=t(n);return o}finally{if(xi=!1,(ut!==null||un!==null)&&(Iu(),ut&&(n=ut,t=un,un=ut=null,Ri(n),t)))for(n=0;n<t.length;n++)Ri(t[n])}}function Ga(t,n){var r=t.stateNode;if(r===null)return null;var o=r[$t]||null;if(o===null)return null;r=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(l(231,n,typeof r));return r}var wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ml=!1;if(wn)try{var ps={};Object.defineProperty(ps,"passive",{get:function(){ml=!0}}),window.addEventListener("test",ps,ps),window.removeEventListener("test",ps,ps)}catch{ml=!1}var Sr=null,df=null,Bc=null;function mv(){if(Bc)return Bc;var t,n=df,r=n.length,o,h="value"in Sr?Sr.value:Sr.textContent,p=h.length;for(t=0;t<r&&n[t]===h[t];t++);var E=r-t;for(o=1;o<=E&&n[r-o]===h[p-o];o++);return Bc=h.slice(t,1<o?1-o:void 0)}function Pc(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Hc(){return!0}function pv(){return!1}function Vn(t){function n(r,o,h,p,E){this._reactName=r,this._targetInst=h,this.type=o,this.nativeEvent=p,this.target=E,this.currentTarget=null;for(var R in t)t.hasOwnProperty(R)&&(r=t[R],this[R]=r?r(p):p[R]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Hc:pv,this.isPropagationStopped=pv,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Hc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Hc)},persist:function(){},isPersistent:Hc}),n}var kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uc=Vn(kr),gs=B({},kr,{view:0,detail:0}),VC=Vn(gs),ff,hf,vs,qc=B({},gs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==vs&&(vs&&t.type==="mousemove"?(ff=t.screenX-vs.screenX,hf=t.screenY-vs.screenY):hf=ff=0,vs=t),ff)},movementY:function(t){return"movementY"in t?t.movementY:hf}}),gv=Vn(qc),$C=B({},qc,{dataTransfer:0}),YC=Vn($C),GC=B({},gs,{relatedTarget:0}),mf=Vn(GC),XC=B({},kr,{animationName:0,elapsedTime:0,pseudoElement:0}),QC=Vn(XC),KC=B({},kr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ZC=Vn(KC),JC=B({},kr,{data:0}),vv=Vn(JC),WC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eE={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"},tE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nE(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=tE[t])?!!n[t]:!1}function pf(){return nE}var iE=B({},gs,{key:function(t){if(t.key){var n=WC[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Pc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?eE[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pf,charCode:function(t){return t.type==="keypress"?Pc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Pc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),aE=Vn(iE),rE=B({},qc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yv=Vn(rE),lE=B({},kr,{submitter:0}),oE=Vn(lE),sE=B({},gs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pf}),cE=Vn(sE),uE=B({},kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),dE=Vn(uE),fE=B({},qc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),hE=Vn(fE),mE=B({},kr,{newState:0,oldState:0,source:0}),pE=Vn(mE),gE=[9,13,27,32],gf=wn&&"CompositionEvent"in window,ys=null;wn&&"documentMode"in document&&(ys=document.documentMode);var vE=wn&&"TextEvent"in window&&!ys,bv=wn&&(!gf||ys&&8<ys&&11>=ys),xv=" ",jv=!1;function wv(t,n){switch(t){case"keyup":return gE.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var co=!1;function yE(t,n){switch(t){case"compositionend":return Sv(n);case"keypress":return n.which!==32?null:(jv=!0,xv);case"textInput":return t=n.data,t===xv&&jv?null:t;default:return null}}function bE(t,n){if(co)return t==="compositionend"||!gf&&wv(t,n)?(t=mv(),Bc=df=Sr=null,co=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return bv&&n.locale!=="ko"?null:n.data;default:return null}}var xE={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 kv(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!xE[t.type]:n==="textarea"}function Cv(t,n,r,o){ut?un?un.push(o):un=[o]:ut=o,n=Fu(n,"onChange"),0<n.length&&(r=new Uc("onChange","change",null,r,o),t.push({event:r,listeners:n}))}var bs=null,xs=null;function jE(t){fb(t,0)}function Fc(t){var n=ue(t);if(lo(n))return t}function Ev(t,n){if(t==="change")return n}var Nv=!1;if(wn){var vf;if(wn){var yf="oninput"in document;if(!yf){var Tv=document.createElement("div");Tv.setAttribute("oninput","return;"),yf=typeof Tv.oninput=="function"}vf=yf}else vf=!1;Nv=vf&&(!document.documentMode||9<document.documentMode)}function Av(){bs&&(bs.detachEvent("onpropertychange",Mv),xs=bs=null)}function Mv(t){if(t.propertyName==="value"&&Fc(xs)){var n=[];Cv(n,xs,t,fl(t)),hl(jE,n)}}function wE(t,n,r){t==="focusin"?(Av(),bs=n,xs=r,bs.attachEvent("onpropertychange",Mv)):t==="focusout"&&Av()}function SE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Fc(xs)}function kE(t,n){if(t==="click")return Fc(n)}function CE(t,n){if(t==="input"||t==="change")return Fc(n)}function EE(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var ji=typeof Object.is=="function"?Object.is:EE;function js(t,n){if(ji(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(o=0;o<r.length;o++){var h=r[o];if(!On.call(n,h)||!ji(t[h],n[h]))return!1}return!0}function bf(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Ov(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Rv(t,n){var r=Ov(t);t=0;for(var o;r;){if(r.nodeType===3){if(o=t+r.textContent.length,t<=n&&o>=n)return{node:r,offset:n-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ov(r)}}function _v(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?_v(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Dv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=bf(t.document);n instanceof t.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)t=n.contentWindow;else break;n=bf(t.document)}return n}function xf(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var NE=wn&&"documentMode"in document&&11>=document.documentMode,uo=null,jf=null,ws=null,wf=!1;function zv(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wf||uo==null||uo!==bf(o)||(o=uo,"selectionStart"in o&&xf(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ws&&js(ws,o)||(ws=o,o=Fu(jf,"onSelect"),0<o.length&&(n=new Uc("onSelect","select",null,n,r),t.push({event:n,listeners:o}),n.target=uo)))}function pl(t,n){var r={};return r[t.toLowerCase()]=n.toLowerCase(),r["Webkit"+t]="webkit"+n,r["Moz"+t]="moz"+n,r}var fo={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionrun:pl("Transition","TransitionRun"),transitionstart:pl("Transition","TransitionStart"),transitioncancel:pl("Transition","TransitionCancel"),transitionend:pl("Transition","TransitionEnd")},Sf={},Lv={};wn&&(Lv=document.createElement("div").style,"AnimationEvent"in window||(delete fo.animationend.animation,delete fo.animationiteration.animation,delete fo.animationstart.animation),"TransitionEvent"in window||delete fo.transitionend.transition);function gl(t){if(Sf[t])return Sf[t];if(!fo[t])return t;var n=fo[t],r;for(r in n)if(n.hasOwnProperty(r)&&r in Lv)return Sf[t]=n[r];return t}var Iv=gl("animationend"),Bv=gl("animationiteration"),Pv=gl("animationstart"),TE=gl("transitionrun"),AE=gl("transitionstart"),ME=gl("transitioncancel"),Hv=gl("transitionend"),Uv=new Map,kf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");kf.push("scrollEnd");function Zi(t,n){Uv.set(t,n),Te(n,[t])}var OE=0;function Xa(t,n){if(t.name!=null&&t.name!=="auto")return t.name;if(n.autoName!==null)return n.autoName;t=ta.identifierPrefix;var r=OE++;return t="_"+t+"t_"+r.toString(32)+"_",n.autoName=t}function qv(t){if(t==null||typeof t=="string")return t;var n=null,r=Ro;if(r!==null)for(var o=0;o<r.length;o++){var h=t[r[o]];if(h!=null){if(h==="none")return"none";n=n==null?h:n+(" "+h)}}return n??t.default}function Qa(t,n){return t=qv(t),n=qv(n),n==null?t==="auto"?null:t:n==="auto"?null:n}var Vc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},_i=[],ho=0,Cf=0;function $c(){for(var t=ho,n=Cf=ho=0;n<t;){var r=_i[n];_i[n++]=null;var o=_i[n];_i[n++]=null;var h=_i[n];_i[n++]=null;var p=_i[n];if(_i[n++]=null,o!==null&&h!==null){var E=o.pending;E===null?h.next=h:(h.next=E.next,E.next=h),o.pending=h}p!==0&&Fv(r,h,p)}}function Yc(t,n,r,o){_i[ho++]=t,_i[ho++]=n,_i[ho++]=r,_i[ho++]=o,Cf|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Ef(t,n,r,o){return Yc(t,n,r,o),Gc(t)}function vl(t,n){return Yc(t,null,null,n),Gc(t)}function Fv(t,n,r){t.lanes|=r;var o=t.alternate;o!==null&&(o.lanes|=r);for(var h=!1,p=t.return;p!==null;)p.childLanes|=r,o=p.alternate,o!==null&&(o.childLanes|=r),p.tag===22&&(t=p.stateNode,t===null||t._visibility&1||(h=!0)),t=p,p=p.return;return t.tag===3?(p=t.stateNode,h&&n!==null&&(h=31-Vt(r),t=p.hiddenUpdates,o=t[h],o===null?t[h]=[n]:o.push(n),n.lane=r|536870912),p):null}function Gc(t){if(50<Vs)throw Vs=0,Lu=null,Error(l(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var mo={};function RE(t,n,r,o){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(t,n,r,o){return new RE(t,n,r,o)}function Nf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ka(t,n){var r=t.alternate;return r===null?(r=ii(t.tag,n,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=n,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&1206910976,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,n=t.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r.refCleanup=t.refCleanup,r}function Vv(t,n){t.flags&=1206910978;var r=t.alternate;return r===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,t.type=r.type,n=r.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Xc(t,n,r,o,h,p){var E=0;if(o=t,typeof o=="function")Nf(o)&&(E=1);else if(typeof o=="string")E=lT(t,r,At.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(o){case J:return t=ii(31,r,n,h),t.elementType=J,t.lanes=p,t;case Y:return yl(r.children,h,p,n);case q:E=8,h|=24;break;case W:return t=ii(12,r,n,h|2),t.elementType=W,t.lanes=p,t;case O:return t=ii(13,r,n,h),t.elementType=O,t.lanes=p,t;case F:return t=ii(19,r,n,h),t.elementType=F,t.lanes=p,t;case ee:case $:return t=h|32,t=ii(30,r,n,t),t.elementType=$,t.lanes=p,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case U:E=10;break e;case Q:E=9;break e;case X:E=11;break e;case ne:E=14;break e;case _:E=16,o=null;break e}E=29,r=Error(l(130,t===null?"null":typeof t,"")),o=null}return n=ii(E,r,n,h),n.elementType=t,n.type=o,n.lanes=p,n}function yl(t,n,r,o){return t=ii(7,t,o,n),t.lanes=r,t}function Tf(t,n,r){return t=ii(6,t,null,n),t.lanes=r,t}function $v(t){var n=ii(18,null,null,0);return n.stateNode=t,n}function Af(t,n,r){return n=ii(4,t.children!==null?t.children:[],t.key,n),n.lanes=r,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Yv=new WeakMap;function Di(t,n){if(typeof t=="object"&&t!==null){var r=Yv.get(t);return r!==void 0?r:(n={value:t,source:n,stack:Ut(n)},Yv.set(t,n),n)}return{value:t,source:n,stack:Ut(n)}}var po=[],go=0,Qc=null,Ss=0,zi=[],Li=0,Cr=null,ya=1,ba="";function Za(t,n){po[go++]=Ss,po[go++]=Qc,Qc=t,Ss=n}function Gv(t,n,r){zi[Li++]=ya,zi[Li++]=ba,zi[Li++]=Cr,Cr=t;var o=ya;t=ba;var h=32-Vt(o)-1;o&=~(1<<h),r+=1;var p=32-Vt(n)+h;if(30<p){var E=h-h%5;p=(o&(1<<E)-1).toString(32),o>>=E,h-=E,ya=1<<32-Vt(n)+h|r<<h|o,ba=p+t}else ya=1<<p|r<<h|o,ba=t}function Kc(t){t.return!==null&&(Za(t,1),Gv(t,1,0))}function Mf(t){for(;t===Qc;)Qc=po[--go],po[go]=null,Ss=po[--go],po[go]=null;for(;t===Cr;)Cr=zi[--Li],zi[Li]=null,ba=zi[--Li],zi[Li]=null,ya=zi[--Li],zi[Li]=null}function Xv(t,n){zi[Li++]=ya,zi[Li++]=ba,zi[Li++]=Cr,ya=n.id,ba=n.overflow,Cr=t}var dn=null,Nt=null,et=!1,Er=null,Ii=!1,Of=Error(l(519));function Nr(t){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ks(Di(n,t)),Of}function Qv(t){var n=t.stateNode,r=t.type,o=t.memoizedProps;switch(n[Mt]=t,n[$t]=o,r){case"dialog":nt("cancel",n),nt("close",n);break;case"iframe":case"object":case"embed":nt("load",n);break;case"video":case"audio":for(r=0;r<Ys.length;r++)nt(Ys[r],n);break;case"source":nt("error",n);break;case"img":case"image":case"link":nt("error",n),nt("load",n);break;case"details":nt("toggle",n);break;case"input":nt("invalid",n),jr(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":nt("invalid",n);break;case"textarea":nt("invalid",n),yi(n,o.value,o.defaultValue,o.children)}r=o.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||o.suppressHydrationWarning===!0||gb(n.textContent,r)?(o.popover!=null&&(nt("beforetoggle",n),nt("toggle",n)),o.onScroll!=null&&nt("scroll",n),o.onScrollEnd!=null&&nt("scrollend",n),o.onClick!=null&&(n.onclick=Fn),n=!0):n=!1,n||Nr(t,!0)}function Zc(t){for(dn=t.return;dn;)switch(dn.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:dn=dn.return}}function vo(t){if(t!==dn)return!1;if(!et)return Zc(t),et=!0,!1;var n=t.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||om(t.type,t.memoizedProps)),r=!r),r&&Nt&&Nr(t),Zc(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Nt=zb(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Nt=zb(t)}else n===27?(n=Nt,Fr(t.type)?(t=gm,gm=null,Nt=t):Nt=n):Nt=dn?Pi(t.stateNode.nextSibling):null;return!0}function bl(){Nt=dn=null,et=!1}function Rf(){var t=Er;return t!==null&&(li===null?li=t:li.push.apply(li,t),Er=null),t}function ks(t){Er===null?Er=[t]:Er.push(t)}var _f=ht(null),xl=null,Ja=null;function Tr(t,n,r){Je(_f,n._currentValue),n._currentValue=r}function Wa(t){t._currentValue=_f.current,ot(_f)}function Jc(t,n,r){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===r)break;t=t.return}}function Df(t,n,r,o){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var p=h.dependencies;if(p!==null){var E=h.child;p=p.firstContext;e:for(;p!==null;){var R=p;p=h;for(var G=0;G<n.length;G++)if(R.context===n[G]){p.lanes|=r,R=p.alternate,R!==null&&(R.lanes|=r),Jc(p.return,r,t),o||(E=null);break e}p=R.next}}else if(h.tag===18){if(E=h.return,E===null)throw Error(l(341));E.lanes|=r,p=E.alternate,p!==null&&(p.lanes|=r),Jc(E,r,t),E=null}else h.tag===13&&h.memoizedState!==null&&h.memoizedState.dehydrated===null?(h.lanes|=r,E=h.alternate,E!==null&&(E.lanes|=r),Jc(h.return,r,t),E=h.child,E=E!==null?E.sibling:null):E=h.child;if(E!==null)E.return=h;else for(E=h;E!==null;){if(E===t){E=null;break}if(h=E.sibling,h!==null){h.return=E.return,E=h;break}E=E.return}h=E}}function jl(t,n,r,o){t=null;for(var h=n,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var E=h.alternate;if(E===null)throw Error(l(387));if(E=E.memoizedProps,E!==null){var R=h.type;ji(h.pendingProps.value,E.value)||(t!==null?t.push(R):t=[R])}}else if(h===Hn.current){if(E=h.alternate,E===null)throw Error(l(387));E.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(qo):t=[qo])}h=h.return}return t!==null&&Df(n,t,r,o),n.flags|=262144,t!==null}function Wc(t){for(t=t.firstContext;t!==null;){if(!ji(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function wl(t){xl=t,Ja=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Sn(t){return Kv(xl,t)}function eu(t,n){return xl===null&&wl(t),Kv(t,n)}function Kv(t,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},Ja===null){if(t===null)throw Error(l(308));Ja=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Ja=Ja.next=n;return r}var _E=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(r,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(r){return r()})}},DE=e.unstable_scheduleCallback,zE=e.unstable_NormalPriority,Kt={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zf(){return{controller:new _E,data:new Map,refCount:0}}function Cs(t){t.refCount--,t.refCount===0&&DE(zE,function(){t.controller.abort()})}function Zv(t,n){if((t.pendingLanes&4194048)!==0){var r=t.transitionTypes;for(r===null&&(r=t.transitionTypes=[]),t=0;t<n.length;t++){var o=n[t];r.indexOf(o)===-1&&r.push(o)}}}var Es=null;function LE(t){var n=t.transitionTypes;return t.transitionTypes=null,n}var Ns=null,Lf=0,Sl=0,yo=null;function IE(t,n){if(Ns===null){var r=Ns=[];Lf=0,Sl=Jh(),yo={status:"pending",value:void 0,then:function(o){r.push(o)}}}return Lf++,n.then(Jv,Jv),n}function Jv(){if(--Lf===0&&(Es=null,Ns!==null)){yo!==null&&(yo.status="fulfilled");var t=Ns;Ns=null,Sl=0,yo=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function BE(t,n){var r=[],o={status:"pending",value:null,reason:null,then:function(h){r.push(h)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var h=0;h<r.length;h++)(0,r[h])(n)},function(h){for(o.status="rejected",o.reason=h,h=0;h<r.length;h++)(0,r[h])(void 0)}),o}var Wv=ce.S;ce.S=function(t,n){if($0=Gt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&IE(t,n),Es!==null)for(var r=Lo;r!==null;)Zv(r,Es),r=r.next;if(r=t.types,r!==null){for(var o=Lo;o!==null;)Zv(o,r),o=o.next;if(Sl!==0){o=Es,o===null&&(o=Es=[]);for(var h=0;h<r.length;h++){var p=r[h];o.indexOf(p)===-1&&o.push(p)}}}Wv!==null&&Wv(t,n)};var kl=ht(null);function If(){var t=kl.current;return t!==null?t:kt.pooledCache}function tu(t,n){n===null?Je(kl,kl.current):Je(kl,n.pool)}function ey(){var t=If();return t===null?null:{parent:Kt._currentValue,pool:t}}var bo=Error(l(460)),Bf=Error(l(474)),nu=Error(l(542)),iu={then:function(){}};function ty(t){return t=t.status,t==="fulfilled"||t==="rejected"}function ny(t,n,r){switch(r=t[r],r===void 0?t.push(n):r!==n&&(n.then(Fn,Fn),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,ay(t),t===void 0&&!("reason"in n)?Error(l(600)):t;default:if(typeof n.status=="string")n.then(Fn,Fn);else{if(t=kt,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=o}},function(o){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,ay(t),t}throw El=n,bo}}function Cl(t){try{var n=t._init;return n(t._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(El=r,bo):r}}var El=null;function iy(){if(El===null)throw Error(l(459));var t=El;return El=null,t}function ay(t){if(t===bo||t===nu)throw Error(l(483))}var xo=null,Ts=0;function au(t){var n=Ts;return Ts+=1,xo===null&&(xo=[]),ny(xo,t,n)}function Ar(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function ru(t,n){throw n.$$typeof===P?Error(l(525)):(t=Object.prototype.toString.call(n),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function ry(t){function n(ie,Z){if(t){var le=ie.deletions;le===null?(ie.deletions=[Z],ie.flags|=16):le.push(Z)}}function r(ie,Z){if(!t)return null;for(;Z!==null;)n(ie,Z),Z=Z.sibling;return null}function o(ie){for(var Z=new Map;ie!==null;)ie.key===null?Z.set(ie.index,ie):Z.set(ie.key,ie),ie=ie.sibling;return Z}function h(ie,Z){return ie=Ka(ie,Z),ie.index=0,ie.sibling=null,ie}function p(ie,Z,le){return ie.index=le,t?(le=ie.alternate,le!==null?(le=le.index,le<Z?(ie.flags|=2,Z):le):(ie.flags|=134217730,Z)):(ie.flags|=1048576,Z)}function E(ie){return t&&ie.alternate===null&&(ie.flags|=134217730),ie}function R(ie,Z,le,ge){return Z===null||Z.tag!==6?(Z=Tf(le,ie.mode,ge),Z.return=ie,Z):(Z=h(Z,le),Z.return=ie,Z)}function G(ie,Z,le,ge){var Oe=le.type;return Oe===Y?(ie=de(ie,Z,le.props.children,ge,le.key),Ar(ie,le),ie):Z!==null&&(Z.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===_&&Cl(Oe)===Z.type)?(Z=h(Z,le.props),Ar(Z,le),Z.return=ie,Z):(Z=Xc(le.type,le.key,le.props,null,ie.mode,ge),Ar(Z,le),Z.return=ie,Z)}function ae(ie,Z,le,ge){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==le.containerInfo||Z.stateNode.implementation!==le.implementation?(Z=Af(le,ie.mode,ge),Z.return=ie,Z):(Z=h(Z,le.children||[]),Z.return=ie,Z)}function de(ie,Z,le,ge,Oe){return Z===null||Z.tag!==7?(Z=yl(le,ie.mode,ge,Oe),Z.return=ie,Z):(Z=h(Z,le),Z.return=ie,Z)}function ve(ie,Z,le){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Tf(""+Z,ie.mode,le),Z.return=ie,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case V:return le=Xc(Z.type,Z.key,Z.props,null,ie.mode,le),Ar(le,Z),le.return=ie,le;case z:return Z=Af(Z,ie.mode,le),Z.return=ie,Z;case _:return Z=Cl(Z),ve(ie,Z,le)}if(oe(Z)||xe(Z))return Z=yl(Z,ie.mode,le,null),Z.return=ie,Z;if(typeof Z.then=="function")return ve(ie,au(Z),le);if(Z.$$typeof===U)return ve(ie,eu(ie,Z),le);ru(ie,Z)}return null}function te(ie,Z,le,ge){var Oe=Z!==null?Z.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Oe!==null?null:R(ie,Z,""+le,ge);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case V:return le.key===Oe?G(ie,Z,le,ge):null;case z:return le.key===Oe?ae(ie,Z,le,ge):null;case _:return le=Cl(le),te(ie,Z,le,ge)}if(oe(le)||xe(le))return Oe!==null?null:de(ie,Z,le,ge,null);if(typeof le.then=="function")return te(ie,Z,au(le),ge);if(le.$$typeof===U)return te(ie,Z,eu(ie,le),ge);ru(ie,le)}return null}function se(ie,Z,le,ge,Oe){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ie=ie.get(le)||null,R(Z,ie,""+ge,Oe);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case V:return ie=ie.get(ge.key===null?le:ge.key)||null,G(Z,ie,ge,Oe);case z:return ie=ie.get(ge.key===null?le:ge.key)||null,ae(Z,ie,ge,Oe);case _:return ge=Cl(ge),se(ie,Z,le,ge,Oe)}if(oe(ge)||xe(ge))return ie=ie.get(le)||null,de(Z,ie,ge,Oe,null);if(typeof ge.then=="function")return se(ie,Z,le,au(ge),Oe);if(ge.$$typeof===U)return se(ie,Z,le,eu(Z,ge),Oe);ru(Z,ge)}return null}function Ce(ie,Z,le,ge){for(var Oe=null,lt=null,Ie=Z,qe=Z=0,Wt=null;Ie!==null&&qe<le.length;qe++){Ie.index>qe?(Wt=Ie,Ie=null):Wt=Ie.sibling;var dt=te(ie,Ie,le[qe],ge);if(dt===null){Ie===null&&(Ie=Wt);break}t&&Ie&&dt.alternate===null&&n(ie,Ie),Z=p(dt,Z,qe),lt===null?Oe=dt:lt.sibling=dt,lt=dt,Ie=Wt}if(qe===le.length)return r(ie,Ie),et&&Za(ie,qe),Oe;if(Ie===null){for(;qe<le.length;qe++)Ie=ve(ie,le[qe],ge),Ie!==null&&(Z=p(Ie,Z,qe),lt===null?Oe=Ie:lt.sibling=Ie,lt=Ie);return et&&Za(ie,qe),Oe}for(Ie=o(Ie);qe<le.length;qe++)Wt=se(Ie,ie,qe,le[qe],ge),Wt!==null&&(t&&(dt=Wt.alternate,dt!==null&&Ie.delete(dt.key===null?qe:dt.key)),Z=p(Wt,Z,qe),lt===null?Oe=Wt:lt.sibling=Wt,lt=Wt);return t&&Ie.forEach(function(Xr){return n(ie,Xr)}),et&&Za(ie,qe),Oe}function _e(ie,Z,le,ge){if(le==null)throw Error(l(151));for(var Oe=null,lt=null,Ie=Z,qe=Z=0,Wt=null,dt=le.next();Ie!==null&&!dt.done;qe++,dt=le.next()){Ie.index>qe?(Wt=Ie,Ie=null):Wt=Ie.sibling;var Xr=te(ie,Ie,dt.value,ge);if(Xr===null){Ie===null&&(Ie=Wt);break}t&&Ie&&Xr.alternate===null&&n(ie,Ie),Z=p(Xr,Z,qe),lt===null?Oe=Xr:lt.sibling=Xr,lt=Xr,Ie=Wt}if(dt.done)return r(ie,Ie),et&&Za(ie,qe),Oe;if(Ie===null){for(;!dt.done;qe++,dt=le.next())dt=ve(ie,dt.value,ge),dt!==null&&(Z=p(dt,Z,qe),lt===null?Oe=dt:lt.sibling=dt,lt=dt);return et&&Za(ie,qe),Oe}for(Ie=o(Ie);!dt.done;qe++,dt=le.next())dt=se(Ie,ie,qe,dt.value,ge),dt!==null&&(t&&(Wt=dt.alternate,Wt!==null&&Ie.delete(Wt.key===null?qe:Wt.key)),Z=p(dt,Z,qe),lt===null?Oe=dt:lt.sibling=dt,lt=dt);return t&&Ie.forEach(function(yT){return n(ie,yT)}),et&&Za(ie,qe),Oe}function Ze(ie,Z,le,ge){if(typeof le=="object"&&le!==null&&le.type===Y&&le.key===null&&le.props.ref===void 0&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case V:e:{for(var Oe=le.key;Z!==null;){if(Z.key===Oe){if(Oe=le.type,Oe===Y){if(Z.tag===7){r(ie,Z.sibling),ge=h(Z,le.props.children),Ar(ge,le),ge.return=ie,ie=ge;break e}}else if(Z.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===_&&Cl(Oe)===Z.type){r(ie,Z.sibling),ge=h(Z,le.props),Ar(ge,le),ge.return=ie,ie=ge;break e}r(ie,Z);break}else n(ie,Z);Z=Z.sibling}le.type===Y?(ge=yl(le.props.children,ie.mode,ge,le.key),Ar(ge,le),ge.return=ie,ie=ge):(ge=Xc(le.type,le.key,le.props,null,ie.mode,ge),Ar(ge,le),ge.return=ie,ie=ge)}return E(ie);case z:e:{for(Oe=le.key;Z!==null;){if(Z.key===Oe)if(Z.tag===4&&Z.stateNode.containerInfo===le.containerInfo&&Z.stateNode.implementation===le.implementation){r(ie,Z.sibling),ge=h(Z,le.children||[]),ge.return=ie,ie=ge;break e}else{r(ie,Z);break}else n(ie,Z);Z=Z.sibling}ge=Af(le,ie.mode,ge),ge.return=ie,ie=ge}return E(ie);case _:return le=Cl(le),Ze(ie,Z,le,ge)}if(oe(le))return Ce(ie,Z,le,ge);if(xe(le)){if(Oe=xe(le),typeof Oe!="function")throw Error(l(150));return le=Oe.call(le),_e(ie,Z,le,ge)}if(typeof le.then=="function")return Ze(ie,Z,au(le),ge);if(le.$$typeof===U)return Ze(ie,Z,eu(ie,le),ge);ru(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,Z!==null&&Z.tag===6?(r(ie,Z.sibling),ge=h(Z,le),ge.return=ie,ie=ge):(r(ie,Z),ge=Tf(le,ie.mode,ge),ge.return=ie,ie=ge),E(ie)):r(ie,Z)}return function(ie,Z,le,ge){try{Ts=0;var Oe=Ze(ie,Z,le,ge);return xo=null,Oe}catch(Ie){if(Ie===bo||Ie===nu)throw Ie;var lt=ii(29,Ie,null,ie.mode);return lt.lanes=ge,lt.return=ie,lt}finally{}}}var Nl=ry(!0),ly=ry(!1),Mr=!1;function Pf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hf(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Or(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Rr(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(pt&2)!==0){var h=o.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),o.pending=n,n=Gc(t),Fv(t,null,r),n}return Yc(t,o,n,r),Gc(t)}function As(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,rn(t,r)}}function Uf(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var h=null,p=null;if(r=r.firstBaseUpdate,r!==null){do{var E={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};p===null?h=p=E:p=p.next=E,r=r.next}while(r!==null);p===null?h=p=n:p=p.next=n}else h=p=n;r={baseState:o.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var qf=!1;function Ms(){if(qf){var t=yo;if(t!==null)throw t}}function Os(t,n,r,o){qf=!1;var h=t.updateQueue;Mr=!1;var p=h.firstBaseUpdate,E=h.lastBaseUpdate,R=h.shared.pending;if(R!==null){h.shared.pending=null;var G=R,ae=G.next;G.next=null,E===null?p=ae:E.next=ae,E=G;var de=t.alternate;de!==null&&(de=de.updateQueue,R=de.lastBaseUpdate,R!==E&&(R===null?de.firstBaseUpdate=ae:R.next=ae,de.lastBaseUpdate=G))}if(p!==null){var ve=h.baseState;E=0,de=ae=G=null,R=p;do{var te=R.lane&-536870913,se=te!==R.lane;if(se?(rt&te)===te:(o&te)===te){te!==0&&te===Sl&&(qf=!0),de!==null&&(de=de.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ce=t,_e=R;te=n;var Ze=r;switch(_e.tag){case 1:if(Ce=_e.payload,typeof Ce=="function"){ve=Ce.call(Ze,ve,te);break e}ve=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=_e.payload,te=typeof Ce=="function"?Ce.call(Ze,ve,te):Ce,te==null)break e;ve=B({},ve,te);break e;case 2:Mr=!0}}te=R.callback,te!==null&&(t.flags|=64,se&&(t.flags|=8192),se=h.callbacks,se===null?h.callbacks=[te]:se.push(te))}else se={lane:te,tag:R.tag,payload:R.payload,callback:R.callback,next:null},de===null?(ae=de=se,G=ve):de=de.next=se,E|=te;if(R=R.next,R===null){if(R=h.shared.pending,R===null)break;se=R,R=se.next,se.next=null,h.lastBaseUpdate=se,h.shared.pending=null}}while(!0);de===null&&(G=ve),h.baseState=G,h.firstBaseUpdate=ae,h.lastBaseUpdate=de,p===null&&(h.shared.lanes=0),Pr|=E,t.lanes=E,t.memoizedState=ve}}function oy(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function sy(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)oy(r[t],n)}var _r=ht(null),lu=ht(0);function cy(t,n){t=ar,Je(lu,t),Je(_r,n),ar=t|n.baseLanes}function Ff(){Je(lu,ar),Je(_r,_r.current)}function Vf(){ar=lu.current,ot(_r),ot(lu)}var kn=ht(null),zn=null;function Dr(t){var n=t.alternate;Je(Cn,Cn.current&1),Je(kn,t),zn===null&&(n===null||_r.current!==null||n.memoizedState!==null)&&(zn=t)}function $f(t){Je(Cn,Cn.current),Je(kn,t),zn===null&&(zn=t)}function uy(t){t.tag===22?(Je(Cn,Cn.current),Je(kn,t),zn===null&&(zn=t)):zr()}function zr(){Je(Cn,Cn.current),Je(kn,kn.current)}function wi(t){ot(kn),zn===t&&(zn=null),ot(Cn)}var Cn=ht(0);function Rs(t,n){Je(kn,kn.current),Je(Cn,n)}function Yf(t){ot(Cn),ot(kn),zn===t&&(zn=null)}function ou(t){for(var n=t;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||mm(r)||pm(r)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!=="independent"){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var er=0,Ke=null,jt=null,Zt=null,su=!1,jo=!1,Tl=!1,cu=0,_s=0,wo=null,PE=0;function qt(){throw Error(l(321))}function Gf(t,n){if(n===null)return!1;for(var r=0;r<n.length&&r<t.length;r++)if(!ji(t[r],n[r]))return!1;return!0}function Xf(t,n,r,o,h,p){return er=p,Ke=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,ce.H=t===null||t.memoizedState===null?Gy:Xy,Tl=!1,p=r(o,h),Tl=!1,jo&&(p=fy(n,r,o,h)),dy(t),p}function dy(t){ce.H=gu;var n=jt!==null&&jt.next!==null;if(er=0,Zt=jt=Ke=null,su=!1,_s=0,wo=null,n)throw Error(l(300));t===null||Jt||(t=t.dependencies,t!==null&&Wc(t)&&(Jt=!0))}function fy(t,n,r,o){Ke=t;var h=0;do{if(jo&&(wo=null),_s=0,jo=!1,25<=h)throw Error(l(301));if(h+=1,Zt=jt=null,t.updateQueue!=null){var p=t.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}ce.H=GE,p=n(r,o)}while(jo);return p}function HE(){var t=ce.H,n=t.useState()[0];return n=typeof n.then=="function"?Ds(n):n,t=t.useState()[0],(jt!==null?jt.memoizedState:null)!==t&&(Ke.flags|=1024),n}function Qf(){var t=cu!==0;return cu=0,t}function Kf(t,n,r){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~r}function Zf(t){if(su){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}su=!1}er=0,Zt=jt=Ke=null,jo=!1,_s=cu=0,wo=null}function $n(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?Ke.memoizedState=Zt=t:Zt=Zt.next=t,Zt}function Yt(){if(jt===null){var t=Ke.alternate;t=t!==null?t.memoizedState:null}else t=jt.next;var n=Zt===null?Ke.memoizedState:Zt.next;if(n!==null)Zt=n,jt=t;else{if(t===null)throw Ke.alternate===null?Error(l(467)):Error(l(310));jt=t,t={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},Zt===null?Ke.memoizedState=Zt=t:Zt=Zt.next=t}return Zt}function uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ds(t){var n=_s;return _s+=1,wo===null&&(wo=[]),t=ny(wo,t,n),n=Ke,(Zt===null?n.memoizedState:Zt.next)===null&&(n=n.alternate,ce.H=n===null||n.memoizedState===null?Gy:Xy),t}function du(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ds(t);if(t.$$typeof===fe)return;if(t.$$typeof===U)return Sn(t)}throw Error(l(438,String(t)))}function Jf(t){var n=null,r=Ke.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var o=Ke.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=uu(),Ke.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(t),o=0;o<t;o++)r[o]=H;return n.index++,r}function tr(t,n){return typeof n=="function"?n(t):n}function fu(t){var n=Yt();return Wf(n,jt,t)}function Wf(t,n,r){var o=t.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=r;var h=t.baseQueue,p=o.pending;if(p!==null){if(h!==null){var E=h.next;h.next=p.next,p.next=E}n.baseQueue=h=p,o.pending=null}if(p=t.baseState,h===null)t.memoizedState=p;else{n=h.next;var R=E=null,G=null,ae=n,de=!1;do{var ve=ae.lane&-536870913;if(ve!==ae.lane?(rt&ve)===ve:(er&ve)===ve){var te=ae.revertLane;if(te===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),ve===Sl&&(de=!0);else if((er&te)===te){ae=ae.next,te===Sl&&(de=!0);continue}else ve={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},G===null?(R=G=ve,E=p):G=G.next=ve,Ke.lanes|=te,Pr|=te;ve=ae.action,Tl&&r(p,ve),p=ae.hasEagerState?ae.eagerState:r(p,ve)}else te={lane:ve,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},G===null?(R=G=te,E=p):G=G.next=te,Ke.lanes|=ve,Pr|=ve;ae=ae.next}while(ae!==null&&ae!==n);if(G===null?E=p:G.next=R,!ji(p,t.memoizedState)&&(Jt=!0,de&&(r=yo,r!==null)))throw r;t.memoizedState=p,t.baseState=E,t.baseQueue=G,o.lastRenderedState=p}return h===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function eh(t){var n=Yt(),r=n.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=t;var o=r.dispatch,h=r.pending,p=n.memoizedState;if(h!==null){r.pending=null;var E=h=h.next;do p=t(p,E.action),E=E.next;while(E!==h);ji(p,n.memoizedState)||(Jt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),r.lastRenderedState=p}return[p,o]}function hy(t,n,r){var o=Ke,h=Yt(),p=et;if(p){if(r===void 0)throw Error(l(407));r=r()}else r=n();var E=!ji((jt||h).memoizedState,r);if(E&&(h.memoizedState=r,Jt=!0),h=h.queue,ih(gy.bind(null,o,h,t),[t]),t=h.getSnapshot!==n||E||Zt!==null&&(Zt.memoizedState.tag&1)!==0,So(t?9:8,{destroy:void 0},py.bind(null,o,h,r,n),null),t){if(o.flags|=2048,kt===null)throw Error(l(349));p||(er&127)!==0||my(o,n,r)}return r}function my(t,n,r){t.flags|=16384,t={getSnapshot:n,value:r},n=Ke.updateQueue,n===null?(n=uu(),Ke.updateQueue=n,n.stores=[t]):(r=n.stores,r===null?n.stores=[t]:r.push(t))}function py(t,n,r,o){n.value=r,n.getSnapshot=o,vy(n)&&yy(t)}function gy(t,n,r){return r(function(){vy(n)&&yy(t)})}function vy(t){var n=t.getSnapshot;t=t.value;try{var r=n();return!ji(t,r)}catch{return!0}}function yy(t){var n=vl(t,2);n!==null&&oi(n,t,2)}function th(t){var n=$n();if(typeof t=="function"){var r=t;if(t=r(),Tl){zt(!0);try{r()}finally{zt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:t},n}function by(t,n,r,o){return t.baseState=r,Wf(t,jt,typeof o=="function"?o:tr)}function UE(t,n,r,o,h){if(pu(t))throw Error(l(485));if(t=n.action,t!==null){var p={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){p.listeners.push(E)}};ce.T!==null?r(!0):p.isTransition=!1,o(p),r=n.pending,r===null?(p.next=n.pending=p,xy(n,p)):(p.next=r.next,n.pending=r.next=p)}}function xy(t,n){var r=n.action,o=n.payload,h=t.state;if(n.isTransition){var p=ce.T,E={};E.types=p!==null?p.types:null,ce.T=E;try{var R=r(h,o),G=ce.S;G!==null&&G(E,R),jy(t,n,R)}catch(ae){nh(t,n,ae)}finally{p!==null&&E.types!==null&&(p.types=E.types),ce.T=p}}else try{p=r(h,o),jy(t,n,p)}catch(ae){nh(t,n,ae)}}function jy(t,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(o){wy(t,n,o)},function(o){return nh(t,n,o)}):wy(t,n,r)}function wy(t,n,r){n.status="fulfilled",n.value=r,Sy(n),t.state=r,n=t.pending,n!==null&&(r=n.next,r===n?t.pending=null:(r=r.next,n.next=r,xy(t,r)))}function nh(t,n,r){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=r,Sy(n),n=n.next;while(n!==o)}t.action=null}function Sy(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function ky(t,n){return n}function Cy(t,n){if(et){var r=kt.formState;if(r!==null){e:{var o=Ke;if(et){if(Nt){t:{for(var h=Nt,p=Ii;h.nodeType!==8;){if(!p){h=null;break t}if(h=Pi(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){Nt=Pi(h.nextSibling),o=h.data==="F!";break e}}Nr(o)}o=!1}o&&(n=r[0])}}return r=$n(),r.memoizedState=r.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ky,lastRenderedState:n},r.queue=o,r=Vy.bind(null,Ke,o),o.dispatch=r,o=th(!1),p=sh.bind(null,Ke,!1,o.queue),o=$n(),h={state:n,dispatch:null,action:t,pending:null},o.queue=h,r=UE.bind(null,Ke,h,p,r),h.dispatch=r,o.memoizedState=t,[n,r,!1]}function Ey(t){var n=Yt();return Ny(n,jt,t)}function Ny(t,n,r){if(n=Wf(t,n,ky)[0],t=fu(tr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Ds(n)}catch(E){throw E===bo?nu:E}else o=n;n=Yt();var h=n.queue,p=h.dispatch;return r!==n.memoizedState&&(Ke.flags|=2048,So(9,{destroy:void 0},qE.bind(null,h,r),null)),[o,p,t]}function qE(t,n){t.action=n}function Ty(t){var n=Yt(),r=jt;if(r!==null)return Ny(n,r,t);Yt(),n=n.memoizedState,r=Yt();var o=r.queue.dispatch;return r.memoizedState=t,[n,o,!1]}function So(t,n,r,o){return t={tag:t,create:r,deps:o,inst:n,next:null},n=Ke.updateQueue,n===null&&(n=uu(),Ke.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=t.next=t:(o=r.next,r.next=t,t.next=o,n.lastEffect=t),t}function Ay(){return Yt().memoizedState}function hu(t,n,r,o){var h=$n();Ke.flags|=t,h.memoizedState=So(1|n,{destroy:void 0},r,o===void 0?null:o)}function mu(t,n,r,o){var h=Yt();o=o===void 0?null:o;var p=h.memoizedState.inst;jt!==null&&o!==null&&Gf(o,jt.memoizedState.deps)?h.memoizedState=So(n,p,r,o):(Ke.flags|=t,h.memoizedState=So(1|n,p,r,o))}function My(t,n){hu(8390656,8,t,n)}function ih(t,n){mu(2048,8,t,n)}function FE(t){Ke.flags|=4;var n=Ke.updateQueue;if(n===null)n=uu(),Ke.updateQueue=n,n.events=[t];else{var r=n.events;r===null?n.events=[t]:r.push(t)}}function Oy(t){var n=Yt().memoizedState;return FE({ref:n,nextImpl:t}),function(){if((pt&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function Ry(t,n){return mu(4,2,t,n)}function _y(t,n){return mu(4,4,t,n)}function Dy(t,n){if(typeof n=="function"){t=t();var r=n(t);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function zy(t,n,r){r=r!=null?r.concat([t]):null,mu(4,4,Dy.bind(null,n,t),r)}function ah(){}function Ly(t,n){var r=Yt();n=n===void 0?null:n;var o=r.memoizedState;return n!==null&&Gf(n,o[1])?o[0]:(r.memoizedState=[t,n],t)}function Iy(t,n){var r=Yt();n=n===void 0?null:n;var o=r.memoizedState;if(n!==null&&Gf(n,o[1]))return o[0];if(o=t(),Tl){zt(!0);try{t()}finally{zt(!1)}}return r.memoizedState=[o,n],o}function rh(t,n,r){return r===void 0||(er&1073741824)!==0&&(rt&261930)===0?t.memoizedState=n:(t.memoizedState=r,t=G0(),Ke.lanes|=t,Pr|=t,r)}function By(t,n,r,o){return ji(r,n)?r:_r.current!==null?(t=rh(t,r,o),ji(t,n)||(Jt=!0),t):(er&106)===0||(er&1073741824)!==0&&(rt&261930)===0?(Jt=!0,t.memoizedState=r):(t=G0(),Ke.lanes|=t,Pr|=t,n)}function Py(t,n,r,o,h){var p=me.p;me.p=p!==0&&8>p?p:8;var E=ce.T,R={};R.types=E!==null?E.types:null,ce.T=R,sh(t,!1,n,r);try{var G=h(),ae=ce.S;if(ae!==null&&ae(R,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var de=BE(G,o);zs(t,n,de,Ei(t))}else zs(t,n,o,Ei(t))}catch(ve){zs(t,n,{then:function(){},status:"rejected",reason:ve},Ei())}finally{me.p=p,E!==null&&R.types!==null&&(E.types=R.types),ce.T=E}}function VE(){}function lh(t,n,r,o){if(t.tag!==5)throw Error(l(476));var h=Hy(t).queue;Py(t,h,n,Ee,r===null?VE:function(){return Uy(t),r(o)})}function Hy(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:Ee,baseState:Ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:Ee},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Uy(t){var n=Hy(t);n.next===null&&(n=t.alternate.memoizedState),zs(t,n.next.queue,{},Ei())}function oh(){return Sn(qo)}function qy(){return Yt().memoizedState}function Fy(){return Yt().memoizedState}function $E(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=Ei();t=Or(r);var o=Rr(n,t,r);o!==null&&(oi(o,n,r),As(o,n,r)),n={cache:zf()},t.payload=n;return}n=n.return}}function YE(t,n,r){var o=Ei();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pu(t)?$y(n,r):(r=Ef(t,n,r,o),r!==null&&(oi(r,t,o),Yy(r,n,o)))}function Vy(t,n,r){var o=Ei();zs(t,n,r,o)}function zs(t,n,r,o){var h={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(pu(t))$y(n,h);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var E=n.lastRenderedState,R=p(E,r);if(h.hasEagerState=!0,h.eagerState=R,ji(R,E))return Yc(t,n,h,0),kt===null&&$c(),!1}catch{}finally{}if(r=Ef(t,n,h,o),r!==null)return oi(r,t,o),Yy(r,n,o),!0}return!1}function sh(t,n,r,o){if(o={lane:2,revertLane:Jh(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},pu(t)){if(n)throw Error(l(479))}else n=Ef(t,r,o,2),n!==null&&oi(n,t,2)}function pu(t){var n=t.alternate;return t===Ke||n!==null&&n===Ke}function $y(t,n){jo=su=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function Yy(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,rn(t,r)}}var gu={readContext:Sn,use:du,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt,useEffectEvent:qt},Gy={readContext:Sn,use:du,useCallback:function(t,n){return $n().memoizedState=[t,n===void 0?null:n],t},useContext:Sn,useEffect:My,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,hu(4194308,4,Dy.bind(null,n,t),r)},useLayoutEffect:function(t,n){return hu(4194308,4,t,n)},useInsertionEffect:function(t,n){hu(4,2,t,n)},useMemo:function(t,n){var r=$n();n=n===void 0?null:n;var o=t();if(Tl){zt(!0);try{t()}finally{zt(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=$n();if(r!==void 0){var h=r(n);if(Tl){zt(!0);try{r(n)}finally{zt(!1)}}}else h=n;return o.memoizedState=o.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},o.queue=t,t=t.dispatch=YE.bind(null,Ke,t),[o.memoizedState,t]},useRef:function(t){var n=$n();return t={current:t},n.memoizedState=t},useState:function(t){t=th(t);var n=t.queue,r=Vy.bind(null,Ke,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:ah,useDeferredValue:function(t,n){var r=$n();return rh(r,t,n)},useTransition:function(){var t=th(!1);return t=Py.bind(null,Ke,t.queue,!0,!1),$n().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=Ke,h=$n();if(et){if(r===void 0)throw Error(l(407));r=r()}else{if(r=n(),kt===null)throw Error(l(349));(rt&127)!==0||my(o,n,r)}h.memoizedState=r;var p={value:r,getSnapshot:n};return h.queue=p,My(gy.bind(null,o,p,t),[t]),o.flags|=2048,So(9,{destroy:void 0},py.bind(null,o,p,r,n),null),r},useId:function(){var t=$n(),n=kt.identifierPrefix;if(et){var r=ba,o=ya;r=(o&~(1<<32-Vt(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=cu++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=PE++,n="_"+n+"r_"+r.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:oh,useFormState:Cy,useActionState:Cy,useOptimistic:function(t){var n=$n();n.memoizedState=n.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=sh.bind(null,Ke,!0,r),r.dispatch=n,[t,n]},useMemoCache:Jf,useCacheRefresh:function(){return $n().memoizedState=$E.bind(null,Ke)},useEffectEvent:function(t){var n=$n(),r={impl:t};return n.memoizedState=r,function(){if((pt&2)!==0)throw Error(l(440));return r.impl.apply(void 0,arguments)}}},Xy={readContext:Sn,use:du,useCallback:Ly,useContext:Sn,useEffect:ih,useImperativeHandle:zy,useInsertionEffect:Ry,useLayoutEffect:_y,useMemo:Iy,useReducer:fu,useRef:Ay,useState:function(){return fu(tr)},useDebugValue:ah,useDeferredValue:function(t,n){var r=Yt();return By(r,jt.memoizedState,t,n)},useTransition:function(){var t=fu(tr)[0],n=Yt().memoizedState;return[typeof t=="boolean"?t:Ds(t),n]},useSyncExternalStore:hy,useId:qy,useHostTransitionStatus:oh,useFormState:Ey,useActionState:Ey,useOptimistic:function(t,n){var r=Yt();return by(r,jt,t,n)},useMemoCache:Jf,useCacheRefresh:Fy,useEffectEvent:Oy},GE={readContext:Sn,use:du,useCallback:Ly,useContext:Sn,useEffect:ih,useImperativeHandle:zy,useInsertionEffect:Ry,useLayoutEffect:_y,useMemo:Iy,useReducer:eh,useRef:Ay,useState:function(){return eh(tr)},useDebugValue:ah,useDeferredValue:function(t,n){var r=Yt();return jt===null?rh(r,t,n):By(r,jt.memoizedState,t,n)},useTransition:function(){var t=eh(tr)[0],n=Yt().memoizedState;return[typeof t=="boolean"?t:Ds(t),n]},useSyncExternalStore:hy,useId:qy,useHostTransitionStatus:oh,useFormState:Ty,useActionState:Ty,useOptimistic:function(t,n){var r=Yt();return jt!==null?by(r,jt,t,n):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:Jf,useCacheRefresh:Fy,useEffectEvent:Oy};function ch(t,n,r,o){n=t.memoizedState,r=r(o,n),r=r==null?n:B({},n,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var uh={enqueueSetState:function(t,n,r){t=t._reactInternals;var o=Ei(),h=Or(o);h.payload=n,r!=null&&(h.callback=r),n=Rr(t,h,o),n!==null&&(oi(n,t,o),As(n,t,o))},enqueueReplaceState:function(t,n,r){t=t._reactInternals;var o=Ei(),h=Or(o);h.tag=1,h.payload=n,r!=null&&(h.callback=r),n=Rr(t,h,o),n!==null&&(oi(n,t,o),As(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var r=Ei(),o=Or(r);o.tag=2,n!=null&&(o.callback=n),n=Rr(t,o,r),n!==null&&(oi(n,t,r),As(n,t,r))}};function Qy(t,n,r,o,h,p,E){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,p,E):n.prototype&&n.prototype.isPureReactComponent?!js(r,o)||!js(h,p):!0}function Ky(t,n,r,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,o),n.state!==t&&uh.enqueueReplaceState(n,n.state,null)}function Al(t,n){var r=n;if("ref"in n){r={};for(var o in n)o!=="ref"&&(r[o]=n[o])}if(t=t.defaultProps){r===n&&(r=B({},r));for(var h in t)r[h]===void 0&&(r[h]=t[h])}return r}function Zy(t){Vc(t)}function Jy(t){console.error(t)}function Wy(t){Vc(t)}function vu(t,n){try{var r=t.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function e0(t,n,r){try{var o=t.onCaughtError;o(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function dh(t,n,r){return r=Or(r),r.tag=3,r.payload={element:null},r.callback=function(){vu(t,n)},r}function t0(t){return t=Or(t),t.tag=3,t}function n0(t,n,r,o){var h=r.type.getDerivedStateFromError;if(typeof h=="function"){var p=o.value;t.payload=function(){return h(p)},t.callback=function(){e0(n,r,o)}}var E=r.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(t.callback=function(){e0(n,r,o),typeof h!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var R=o.stack;this.componentDidCatch(o.value,{componentStack:R!==null?R:""})})}function XE(t,n,r,o,h){if(r.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=r.alternate,n!==null&&jl(n,r,h,!0),r=kn.current,r!==null){switch(r.tag){case 31:case 13:case 19:return zn===null?Bu():r.alternate===null&&Ft===0&&(Ft=3),r.flags&=-257,r.flags|=65536,r.lanes=h,o===iu?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([o]):n.add(o),Qh(t,o,h)),!1;case 22:return r.flags|=65536,o===iu?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([o]):r.add(o)),Qh(t,o,h)),!1}throw Error(l(435,r.tag))}return Qh(t,o,h),Bu(),!1}if(et)return n=kn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,o!==Of&&(t=Error(l(422),{cause:o}),ks(Di(t,r)))):(o!==Of&&(n=Error(l(423),{cause:o}),ks(Di(n,r))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,o=Di(o,r),h=dh(t.stateNode,o,h),Uf(t,h),Ft!==4&&(Ft=2)),!1;var p=Error(l(520),{cause:o});if(p=Di(p,r),Fs===null?Fs=[p]:Fs.push(p),Ft!==4&&(Ft=2),n===null)return!0;o=Di(o,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,t=h&-h,r.lanes|=t,t=dh(r.stateNode,o,t),Uf(r,t),!1;case 1:if(n=r.type,p=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Hr===null||!Hr.has(p))))return r.flags|=65536,h&=-h,r.lanes|=h,h=t0(h),n0(h,t,r,o),Uf(r,h),!1;break;case 22:if(r.memoizedState!==null)return r.flags|=65536,!1}r=r.return}while(r!==null);return!1}var fh=Error(l(461)),Jt=!1;function on(t,n,r,o){n.child=t===null?ly(n,null,r,o):Nl(n,t.child,r,o)}function i0(t,n,r,o,h){r=r.render;var p=n.ref;if("ref"in o){var E={};for(var R in o)R!=="ref"&&(E[R]=o[R])}else E=o;return wl(n),o=Xf(t,n,r,E,p,h),R=Qf(),t!==null&&!Jt?(Kf(t,n,h),nr(t,n,h)):(et&&R&&Kc(n),n.flags|=1,on(t,n,o,h),n.child)}function a0(t,n,r,o,h){if(t===null){var p=r.type;return typeof p=="function"&&!Nf(p)&&p.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=p,r0(t,n,p,o,h)):(t=Xc(r.type,null,o,n,n.mode,h),t.ref=n.ref,t.return=n,n.child=t)}if(p=t.child,!xh(t,h)){var E=p.memoizedProps;if(r=r.compare,r=r!==null?r:js,r(E,o)&&t.ref===n.ref)return nr(t,n,h)}return n.flags|=1,t=Ka(p,o),t.ref=n.ref,t.return=n,n.child=t}function r0(t,n,r,o,h){if(t!==null){var p=t.memoizedProps;if(js(p,o)&&t.ref===n.ref)if(Jt=!1,n.pendingProps=o=p,xh(t,h))(t.flags&131072)!==0&&(Jt=!0);else return n.lanes=t.lanes,nr(t,n,h)}return hh(t,n,r,o,h)}function l0(t,n,r,o){var h=o.children,p=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(p=p!==null?p.baseLanes|r:r,t!==null){for(o=n.child=t.child,h=0;o!==null;)h=h|o.lanes|o.childLanes,o=o.sibling;o=h&~p}else o=0,n.child=null;return o0(t,n,p,r,o)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&tu(n,p!==null?p.cachePool:null),p!==null?cy(n,p):Ff(),uy(n);else return o=n.lanes=536870912,o0(t,n,p!==null?p.baseLanes|r:r,r,o)}else p!==null?(tu(n,p.cachePool),cy(n,p),zr(),n.memoizedState=null):(t!==null&&tu(n,null),Ff(),zr());return on(t,n,h,r),n.child}function Ls(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function o0(t,n,r,o,h){var p=If();return p=p===null?null:{parent:Kt._currentValue,pool:p},n.memoizedState={baseLanes:r,cachePool:p},t!==null&&tu(n,null),Ff(),uy(n),t!==null&&jl(t,n,o,!0),n.childLanes=h,null}function yu(t,n){return n=bu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function s0(t,n,r){return Nl(n,t.child,null,r),t=yu(n,n.pendingProps),t.flags|=2,wi(n),n.memoizedState=null,t}function QE(t,n,r){var o=n.pendingProps,h=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(et){if(o.mode==="hidden")return t=yu(n,o),n.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},Ls(null,t);if($f(n),(t=Nt)?(t=Db(t,Ii),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Cr!==null?{id:ya,overflow:ba}:null,retryLane:536870912,hydrationErrors:null},r=$v(t),r.return=n,n.child=r,dn=n,Nt=null)):t=null,t===null)throw Nr(n);return n.lanes=536870912,null}return yu(n,o)}var p=t.memoizedState;if(p!==null){var E=p.dehydrated;if($f(n),h)if(n.flags&256)n.flags&=-257,n=s0(t,n,r);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(l(558));else if(Jt||jl(t,n,r,!1),h=(r&t.childLanes)!==0,Jt||h){if(_r.current===null){if(o=kt,o!==null&&(E=cn(o,r),E!==0&&E!==p.retryLane))throw p.retryLane=E,vl(t,E),oi(o,t,E),fh;Bu()}n=s0(t,n,r)}else t=p.treeContext,Nt=Pi(E.nextSibling),dn=n,et=!0,Er=null,Ii=!1,t!==null&&Xv(n,t),n=yu(n,o),n.flags|=134221824;return n}return t=Ka(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function ko(t,n){var r=n.ref;if(r===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(l(284));(t===null||t.ref!==r)&&(n.flags|=4194816)}}function hh(t,n,r,o,h){return wl(n),r=Xf(t,n,r,o,void 0,h),o=Qf(),t!==null&&!Jt?(Kf(t,n,h),nr(t,n,h)):(et&&o&&Kc(n),n.flags|=1,on(t,n,r,h),n.child)}function c0(t,n,r,o,h,p){return wl(n),n.updateQueue=null,r=fy(n,o,r,h),dy(t),o=Qf(),t!==null&&!Jt?(Kf(t,n,p),nr(t,n,p)):(et&&o&&Kc(n),n.flags|=1,on(t,n,r,p),n.child)}function u0(t,n,r,o,h){if(wl(n),n.stateNode===null){var p=mo,E=r.contextType;typeof E=="object"&&E!==null&&(p=Sn(E)),p=new r(o,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=uh,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=o,p.state=n.memoizedState,p.refs={},Pf(n),E=r.contextType,p.context=typeof E=="object"&&E!==null?Sn(E):mo,p.state=n.memoizedState,E=r.getDerivedStateFromProps,typeof E=="function"&&(ch(n,r,E,o),p.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(E=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),E!==p.state&&uh.enqueueReplaceState(p,p.state,null),Os(n,o,p,h),Ms(),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){p=n.stateNode;var R=n.memoizedProps,G=Al(r,R);p.props=G;var ae=p.context,de=r.contextType;E=mo,typeof de=="object"&&de!==null&&(E=Sn(de));var ve=r.getDerivedStateFromProps;de=typeof ve=="function"||typeof p.getSnapshotBeforeUpdate=="function",R=n.pendingProps!==R,de||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(R||ae!==E)&&Ky(n,p,o,E),Mr=!1;var te=n.memoizedState;p.state=te,Os(n,o,p,h),Ms(),ae=n.memoizedState,R||te!==ae||Mr?(typeof ve=="function"&&(ch(n,r,ve,o),ae=n.memoizedState),(G=Mr||Qy(n,r,G,o,te,ae,E))?(de||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(n.flags|=4194308)):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=ae),p.props=o,p.state=ae,p.context=E,o=G):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{p=n.stateNode,Hf(t,n),E=n.memoizedProps,de=Al(r,E),p.props=de,ve=n.pendingProps,te=p.context,ae=r.contextType,G=mo,typeof ae=="object"&&ae!==null&&(G=Sn(ae)),R=r.getDerivedStateFromProps,(ae=typeof R=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(E!==ve||te!==G)&&Ky(n,p,o,G),Mr=!1,te=n.memoizedState,p.state=te,Os(n,o,p,h),Ms();var se=n.memoizedState;E!==ve||te!==se||Mr||t!==null&&t.dependencies!==null&&Wc(t.dependencies)?(typeof R=="function"&&(ch(n,r,R,o),se=n.memoizedState),(de=Mr||Qy(n,r,de,o,te,se,G)||t!==null&&t.dependencies!==null&&Wc(t.dependencies))?(ae||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(o,se,G),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(o,se,G)),typeof p.componentDidUpdate=="function"&&(n.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof p.componentDidUpdate!="function"||E===t.memoizedProps&&te===t.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&te===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=se),p.props=o,p.state=se,p.context=G,o=de):(typeof p.componentDidUpdate!="function"||E===t.memoizedProps&&te===t.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&te===t.memoizedState||(n.flags|=1024),o=!1)}return p=o,ko(t,n),o=(n.flags&128)!==0,p||o?(p=n.stateNode,r=o&&typeof r.getDerivedStateFromError!="function"?null:p.render(),n.flags|=1,t!==null&&o?(n.child=Nl(n,t.child,null,h),n.child=Nl(n,null,r,h)):on(t,n,r,h),n.memoizedState=p.state,t=n.child):t=nr(t,n,h),t}function d0(t,n,r,o){return bl(),n.flags|=256,on(t,n,r,o),n.child}var mh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ph(t){return{baseLanes:t,cachePool:ey()}}function gh(t,n,r){return t=t!==null?t.childLanes&~r:0,n&&(t|=Ci),t}function f0(t,n,r){var o=n.pendingProps,h=!1,p=(n.flags&128)!==0,E;if((E=p)||(E=t!==null&&t.memoizedState===null?!1:(Cn.current&2)!==0),E&&(h=!0,n.flags&=-129),E=(n.flags&32)!==0,n.flags&=-33,t===null){if(et){if(h?Dr(n):zr(),(t=Nt)?(t=Db(t,Ii),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Cr!==null?{id:ya,overflow:ba}:null,retryLane:536870912,hydrationErrors:null},r=$v(t),r.return=n,n.child=r,dn=n,Nt=null)):t=null,t===null)throw Nr(n);return pm(t)?n.lanes=32:n.lanes=536870912,null}return p=o.children,o=o.fallback,h?(zr(),h=n.mode,p=bu({mode:"hidden",children:p},h),o=yl(o,h,r,null),p.return=n,o.return=n,p.sibling=o,n.child=p,o=n.child,o.memoizedState=ph(r),o.childLanes=gh(t,E,r),n.memoizedState=mh,Ls(null,o)):(Dr(n),vh(n,p))}var R=t.memoizedState;if(R!==null){var G=R.dehydrated;if(G!==null)return KE(t,n,p,E,o,G,R,r)}return h?(zr(),h=o.fallback,p=n.mode,R=t.child,G=R.sibling,o=Ka(R,{mode:"hidden",children:o.children}),o.subtreeFlags=R.subtreeFlags&1206910976,G!==null?h=Ka(G,h):(h=yl(h,p,r,null),h.flags|=2),h.return=n,o.return=n,o.sibling=h,n.child=o,Ls(null,o),o=n.child,h=t.child.memoizedState,h===null?h=ph(r):(p=h.cachePool,p!==null?(R=Kt._currentValue,p=p.parent!==R?{parent:R,pool:R}:p):p=ey(),h={baseLanes:h.baseLanes|r,cachePool:p}),o.memoizedState=h,o.childLanes=gh(t,E,r),n.memoizedState=mh,Ls(t.child,o)):(Dr(n),r=t.child,t=r.sibling,r=Ka(r,{mode:"visible",children:o.children}),r.return=n,r.sibling=null,t!==null&&(E=n.deletions,E===null?(n.deletions=[t],n.flags|=16):E.push(t)),n.child=r,n.memoizedState=null,r)}function vh(t,n){return n=bu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function bu(t,n){return t=ii(22,t,null,n),t.lanes=0,t}function xu(t,n,r){return Nl(n,t.child,null,r),t=vh(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function KE(t,n,r,o,h,p,E,R){if(r)return n.flags&256?(Dr(n),n.flags&=-257,xu(t,n,R)):n.memoizedState!==null?(zr(),n.child=t.child,n.flags|=128,null):(zr(),p=h.fallback,E=n.mode,h=bu({mode:"visible",children:h.children},E),p=yl(p,E,R,null),p.flags|=2,h.return=n,p.return=n,h.sibling=p,n.child=h,Nl(n,t.child,null,R),h=n.child,h.memoizedState=ph(R),h.childLanes=gh(t,o,R),n.memoizedState=mh,Ls(null,h));if(Dr(n),pm(p)){if(o=p.nextSibling&&p.nextSibling.dataset,o)var G=o.dgst;return o=G,o!==""&&(h=Error(l(419)),h.stack="",h.digest=o,ks({value:h,source:null,stack:null})),xu(t,n,R)}if(Jt||jl(t,n,R,!1),o=(R&t.childLanes)!==0,Jt||o){if(_r.current!==null)return xu(t,n,R);if(o=kt,o!==null&&(h=cn(o,R),h!==0&&h!==E.retryLane))throw E.retryLane=h,vl(t,h),oi(o,t,h),fh;return mm(p)||Bu(),xu(t,n,R)}return mm(p)?(n.flags|=192,n.child=t.child,null):(t=E.treeContext,Nt=Pi(p.nextSibling),dn=n,et=!0,Er=null,Ii=!1,t!==null&&Xv(n,t),n=vh(n,h.children),n.flags|=134221824,n)}function h0(t,n,r){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Jc(t.return,n,r)}function m0(t){for(var n=null;t!==null;){var r=t.alternate;r!==null&&ou(r)===null&&(n=t),t=t.sibling}return n}function ju(t,n,r,o,h,p){var E=t.memoizedState;E===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:r,tailMode:h,treeForkCount:p}:(E.isBackwards=n,E.rendering=null,E.renderingStartTime=0,E.last=o,E.tail=r,E.tailMode=h,E.treeForkCount=p)}function yh(t){var n=t.child;for(t.child=null;n!==null;){var r=n.sibling;n.sibling=t.child,t.child=n,n=r}}function bh(t,n,r){var o=n.pendingProps,h=o.revealOrder,p=o.tail;o=o.children;var E=Cn.current;if(n.flags&128)return Rs(n,E),null;var R=(E&2)!==0;if(R?(E=E&1|2,n.flags|=128):E&=1,Rs(n,E),h==="backwards"&&t!==null?(yh(t),on(t,n,o,r),yh(t)):on(t,n,o,r),o=et?Ss:0,!R&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&h0(t,r,n);else if(t.tag===19)h0(t,r,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"backwards":r=m0(n.child),r===null?(h=n.child,n.child=null):(h=r.sibling,r.sibling=null,yh(n)),ju(n,!0,h,null,p,o);break;case"unstable_legacy-backwards":for(r=null,h=n.child,n.child=null;h!==null;){if(t=h.alternate,t!==null&&ou(t)===null){n.child=h;break}t=h.sibling,h.sibling=r,r=h,h=t}ju(n,!0,r,null,p,o);break;case"together":ju(n,!1,null,null,void 0,o);break;case"independent":n.memoizedState=null;break;default:r=m0(n.child),r===null?(h=n.child,n.child=null):(h=r.sibling,r.sibling=null),ju(n,!1,h,r,p,o)}return n.child}function p0(t,n,r){var o=n.pendingProps;return Tr(n,n.type,o.value),on(t,n,o.children,r),n.child}function nr(t,n,r){if(t!==null&&(n.dependencies=t.dependencies),Pr|=n.lanes,(r&n.childLanes)===0)if(t!==null){if(jl(t,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(l(153));if(n.child!==null){for(t=n.child,r=Ka(t,t.pendingProps),n.child=r,r.return=n;t.sibling!==null;)t=t.sibling,r=r.sibling=Ka(t,t.pendingProps),r.return=n;r.sibling=null}return n.child}function xh(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Wc(t)))}function ZE(t,n,r){switch(n.tag){case 3:di(n,n.stateNode.containerInfo),Tr(n,Kt,t.memoizedState.cache),bl();break;case 27:case 5:Yi(n);break;case 4:di(n,n.stateNode.containerInfo);break;case 10:Tr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,$f(n),null;break;case 13:var o=n.memoizedState;if(o!==null){if(o.dehydrated!==null)return Dr(n),n.flags|=128,null;o=jl(t,n,r,!1);var h=n.child.childLanes;return o||(r&h)!==0?f0(t,n,r):(Dr(n),t=nr(t,n,r),t!==null?t.sibling:null)}Dr(n);break;case 19:if(n.flags&128)return bh(t,n,r);if(h=(t.flags&128)!==0,o=(r&n.childLanes)!==0,o||(jl(t,n,r,!1),o=(r&n.childLanes)!==0),h){if(o)return bh(t,n,r);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Rs(n,Cn.current),o)break;return null;case 22:return n.lanes=0,l0(t,n,r,n.pendingProps);case 24:Tr(n,Kt,t.memoizedState.cache)}return nr(t,n,r)}function g0(t,n,r){if(t!==null)if(t.memoizedProps!==n.pendingProps)Jt=!0;else{if(!xh(t,r)&&(n.flags&128)===0)return Jt=!1,ZE(t,n,r);Jt=(t.flags&131072)!==0}else Jt=!1,et&&(n.flags&1048576)!==0&&Gv(n,Ss,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Cl(n.elementType),n.type=t,typeof t=="function")Nf(t)?(o=Al(t,o),n.tag=1,n=u0(null,n,t,o,r)):(n.tag=0,n=hh(null,n,t,o,r));else{if(t!=null){var h=t.$$typeof;if(h===X){n.tag=11,n=i0(null,n,t,o,r);break e}else if(h===ne){n.tag=14,n=a0(null,n,t,o,r);break e}else if(h===U){n.tag=10,n.type=t,n=p0(null,n,r);break e}}throw n=be(t)||t,Error(l(306,n,""))}}return n;case 0:return hh(t,n,n.type,n.pendingProps,r);case 1:return o=n.type,h=Al(o,n.pendingProps),u0(t,n,o,h,r);case 3:e:{if(di(n,n.stateNode.containerInfo),t===null)throw Error(l(387));o=n.pendingProps;var p=n.memoizedState;h=p.element,Hf(t,n),Os(n,o,null,r);var E=n.memoizedState;if(o=E.cache,Tr(n,Kt,o),o!==p.cache&&Df(n,[Kt],r,!0),Ms(),o=E.element,p.isDehydrated)if(p={element:o,isDehydrated:!1,cache:E.cache},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){n=d0(t,n,o,r);break e}else if(o!==h){h=Di(Error(l(424)),n),ks(h),n=d0(t,n,o,r);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Nt=Pi(t.firstChild),dn=n,et=!0,Er=null,Ii=!0,r=ly(n,null,o,r),n.child=r;r;)r.flags=r.flags&-3|134221824,r=r.sibling}else{if(bl(),o===h){n=nr(t,n,r);break e}on(t,n,o,r)}n=n.child}return n;case 26:return ko(t,n),t===null?(r=Ub(n.type,null,n.pendingProps,null))?n.memoizedState=r:et||(n.stateNode=xb(n.type,n.pendingProps,vn.current,n)):n.memoizedState=Ub(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Yi(n),t===null&&et&&(o=n.stateNode=Ib(n.type,n.pendingProps,vn.current),dn=n,Ii=!0,h=Nt,Fr(n.type)?(gm=h,Nt=Pi(o.firstChild)):Nt=h),on(t,n,n.pendingProps.children,r),ko(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&et&&((h=o=Nt)&&(o=$N(o,n.type,n.pendingProps,Ii),o!==null?(n.stateNode=o,dn=n,Nt=Pi(o.firstChild),Ii=!1,h=!0):h=!1),h||Nr(n)),Yi(n),h=n.type,p=n.pendingProps,E=t!==null?t.memoizedProps:null,o=p.children,om(h,p)?o=null:E!==null&&om(h,E)&&(n.flags|=32),n.memoizedState!==null&&(h=Xf(t,n,HE,null,null,r),qo._currentValue=h),ko(t,n),on(t,n,o,r),n.child;case 6:return t===null&&et&&((t=r=Nt)&&(r=YN(r,n.pendingProps,Ii),r!==null?(n.stateNode=r,dn=n,Nt=null,t=!0):t=!1),t||Nr(n)),null;case 13:return f0(t,n,r);case 4:return di(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=Nl(n,null,o,r):on(t,n,o,r),n.child;case 11:return i0(t,n,n.type,n.pendingProps,r);case 7:return o=n.pendingProps,ko(t,n),on(t,n,o,r),n.child;case 8:return on(t,n,n.pendingProps.children,r),n.child;case 12:return on(t,n,n.pendingProps.children,r),n.child;case 10:return p0(t,n,r);case 9:return h=n.type._context,o=n.pendingProps.children,wl(n),h=Sn(h),o=o(h),n.flags|=1,on(t,n,o,r),n.child;case 14:return a0(t,n,n.type,n.pendingProps,r);case 15:return r0(t,n,n.type,n.pendingProps,r);case 19:return bh(t,n,r);case 31:return QE(t,n,r);case 22:return l0(t,n,r,n.pendingProps);case 24:return wl(n),o=Sn(Kt),t===null?(h=If(),h===null&&(h=kt,p=zf(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=r),h=p),n.memoizedState={parent:o,cache:h},Pf(n),Tr(n,Kt,h)):((t.lanes&r)!==0&&(Hf(t,n),Os(n,null,null,r),Ms()),h=t.memoizedState,p=n.memoizedState,h.parent!==o?(h={parent:o,cache:o},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),Tr(n,Kt,o)):(o=p.cache,Tr(n,Kt,o),o!==h.cache&&Df(n,[Kt],r,!0))),on(t,n,n.pendingProps.children,r),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),o=n.pendingProps,o.name!=null&&o.name!=="auto"?n.flags|=t===null?18882560:18874368:et&&Kc(n),t!==null&&t.memoizedProps.name!==o.name?n.flags|=4194816:ko(t,n),on(t,n,o.children,r),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function ir(t){t.flags|=4}function jh(t,n,r,o,h){var p;if((p=(t.mode&32)!==0)&&(p=r===null?$b(n,o):$b(n,o)&&(o.src!==r.src||o.srcSet!==r.srcSet)),p){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Z0())t.flags|=8192;else throw El=iu,Bf}else t.flags&=-16777217}function v0(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Yb(n))if(Z0())t.flags|=8192;else throw El=iu,Bf}function wu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?gi():536870912,t.lanes|=n,Ao|=n)}function Is(t,n){if(!et)switch(t.tailMode){case"visible":break;case"collapsed":for(var r=t.tail,o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null;break;default:for(n=t.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t.tail=null:r.sibling=null}}function Tt(t){var n=t.alternate!==null&&t.alternate.child===t.child,r=0,o=0;if(n)for(var h=t.child;h!==null;)r|=h.lanes|h.childLanes,o|=h.subtreeFlags&1206910976,o|=h.flags&1206910976,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)r|=h.lanes|h.childLanes,o|=h.subtreeFlags,o|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=o,t.childLanes=r,n}function JE(t,n,r){var o=n.pendingProps;switch(Mf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(n),null;case 1:return Tt(n),null;case 3:return r=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Wa(Kt),an(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(vo(n)?ir(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Rf())),Tt(n),null;case 26:var h=n.type,p=n.memoizedState;return t===null?(ir(n),p!==null?(Tt(n),v0(n,p)):(Tt(n),jh(n,h,null,o,r))):p?p!==t.memoizedState?(ir(n),Tt(n),v0(n,p)):(Tt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&ir(n),Tt(n),jh(n,h,t,o,r)),null;case 27:if(pe(n),r=vn.current,h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ir(n);else{if(!o){if(n.stateNode===null)throw Error(l(166));return Tt(n),n.subtreeFlags&=-33554433,null}t=At.current,vo(n)?Qv(n):(t=Ib(h,o,r),n.stateNode=t,ir(n))}return Tt(n),n.subtreeFlags&=-33554433,null;case 5:if(pe(n),h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ir(n);else{if(!o){if(n.stateNode===null)throw Error(l(166));return Tt(n),n.subtreeFlags&=-33554433,null}if(p=At.current,vo(n))Qv(n);else{var E=Xs(vn.current);switch(p){case 1:p=E.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=E.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=E.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=E.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=E.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof o.is=="string"?E.createElement("select",{is:o.is}):E.createElement("select"),o.multiple?p.multiple=!0:o.size&&(p.size=o.size);break;default:p=typeof o.is=="string"?E.createElement(h,{is:o.is}):E.createElement(h)}}p[Mt]=n,p[$t]=o;e:for(E=n.child;E!==null;){if(E.tag===5||E.tag===6)p.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===n)break e;for(;E.sibling===null;){if(E.return===null||E.return===n)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}n.stateNode=p;e:switch(Nn(p,h,o),h){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ir(n)}}return Tt(n),n.subtreeFlags&=-33554433,jh(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&ir(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=vn.current,vo(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,h=dn,h!==null)switch(h.tag){case 27:case 5:o=h.memoizedProps}t[Mt]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||gb(t.nodeValue,r)),t||Nr(n,!0)}else t=Xs(t).createTextNode(o),t[Mt]=n,n.stateNode=t}return Tt(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=vo(n),r!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Mt]=n}else bl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Tt(n),t=!1}else r=Rf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(wi(n),n):(wi(n),null);if((n.flags&128)!==0)throw Error(l(558))}return Tt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=vo(n),o!==null&&o.dehydrated!==null){if(t===null){if(!h)throw Error(l(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(l(317));h[Mt]=n}else bl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Tt(n),h=!1}else h=Rf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(wi(n),n):(wi(n),null)}return wi(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,h=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(h=o.alternate.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==h&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),wu(n,n.updateQueue),Tt(n),null);case 4:return an(),t===null&&nm(n.stateNode.containerInfo),n.flags|=67108864,Tt(n),null;case 10:return Wa(n.type),Tt(n),null;case 19:if(Yf(n),o=n.memoizedState,o===null)return Tt(n),null;if(h=(n.flags&128)!==0,p=o.rendering,p===null)if(h)Is(o,!1);else{if(Ft!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(p=ou(t),p!==null){for(n.flags|=128,Is(o,!1),t=p.updateQueue,n.updateQueue=t,wu(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)Vv(r,t),r=r.sibling;return Rs(n,Cn.current&1|2),et&&Za(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Gt()>Du&&(n.flags|=128,h=!0,Is(o,!1),n.lanes=4194304)}else{if(!h)if(t=ou(p),t!==null){if(n.flags|=128,h=!0,t=t.updateQueue,n.updateQueue=t,wu(n,t),Is(o,!0),o.tail===null&&o.tailMode!=="collapsed"&&o.tailMode!=="visible"&&!p.alternate&&!et)return Tt(n),null}else 2*Gt()-o.renderingStartTime>Du&&r!==536870912&&(n.flags|=128,h=!0,Is(o,!1),n.lanes=4194304);o.isBackwards?(p.sibling=n.child,n.child=p):(t=o.last,t!==null?t.sibling=p:n.child=p,o.last=p)}if(o.tail!==null){t=o.tail;e:{for(r=t;r!==null;){if(r.alternate!==null){r=!1;break e}r=r.sibling}r=!0}return o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Gt(),t.sibling=null,p=Cn.current,p=h?p&1|2:p&1,o.tailMode==="visible"||o.tailMode==="collapsed"||!r||et?Rs(n,p):(r=p,Je(kn,n),Je(Cn,r),zn===null&&(zn=n)),et&&Za(n,o.treeForkCount),t}return Tt(n),null;case 22:case 23:return wi(n),Vf(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(Tt(n),n.subtreeFlags&6&&(n.flags|=8192)):Tt(n),r=n.updateQueue,r!==null&&wu(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&ot(kl),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Wa(Kt),Tt(n),null;case 25:return null;case 30:return n.flags|=33554432,Tt(n),null}throw Error(l(156,n.tag))}function WE(t,n){switch(Mf(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Wa(Kt),an(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return pe(n),null;case 31:if(n.memoizedState!==null){if(wi(n),n.alternate===null)throw Error(l(340));bl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(wi(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));bl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Yf(n),t=n.flags,t&65536?(n.flags=t&-65537|128,t=n.memoizedState,t!==null&&(t.rendering=null,t.tail=null),n.flags|=4,n):null;case 4:return an(),null;case 10:return Wa(n.type),null;case 22:case 23:return wi(n),Vf(),t!==null&&ot(kl),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Wa(Kt),null;case 25:return null;default:return null}}function y0(t,n){switch(Mf(n),n.tag){case 3:Wa(Kt),an();break;case 26:case 27:case 5:pe(n);break;case 4:an();break;case 31:n.memoizedState!==null&&wi(n);break;case 13:wi(n);break;case 19:Yf(n);break;case 10:Wa(n.type);break;case 22:case 23:wi(n),Vf(),t!==null&&ot(kl);break;case 24:Wa(Kt)}}function Bs(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var h=o.next;r=h;do{if((r.tag&t)===t){o=void 0;var p=r.create,E=r.inst;o=p(),E.destroy=o}r=r.next}while(r!==h)}}catch(R){yt(n,n.return,R)}}function Lr(t,n,r){try{var o=n.updateQueue,h=o!==null?o.lastEffect:null;if(h!==null){var p=h.next;o=p;do{if((o.tag&t)===t){var E=o.inst,R=E.destroy;if(R!==void 0){E.destroy=void 0,h=n;var G=r,ae=R;try{ae()}catch(de){yt(h,G,de)}}}o=o.next}while(o!==p)}}catch(de){yt(n,n.return,de)}}function b0(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{sy(n,r)}catch(o){yt(t,t.return,o)}}}function x0(t,n,r){r.props=Al(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){yt(t,n,o)}}function xa(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:var h=t.stateNode,p=Xa(t.memoizedProps,h);(h.ref===null||h.ref.name!==p)&&(h.ref=Nb(p)),o=h.ref;break;case 7:if(t.stateNode===null){var E=new Ni(t);g(t.child,!1,FN,E,void 0,void 0),t.stateNode=E}o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(R){yt(t,n,R)}}function En(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(h){yt(t,n,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(h){yt(t,n,h)}else r.current=null}function Su(t,n){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&n!==null)for(var r=0;r<n.length;r++)_b(t.stateNode,n[r])}function j0(t){for(var n=t.return;n!==null&&(Sh(n)&&_b(t.stateNode,n.stateNode),!wh(n));)n=n.return}function Ps(t){for(var n=t.return;n!==null&&(Sh(n)&&VN(t.stateNode,n.stateNode),!wh(n));)n=n.return}function wh(t){return t.tag===5||t.tag===3||t.tag===27}function Sh(t){return t&&t.tag===7&&t.stateNode!==null}function kh(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(h){yt(t,t.return,h)}}function Ch(t,n,r){try{var o=t.stateNode;CN(o,t.type,r,n),o[$t]=n}catch(h){yt(t,t.return,h)}}function w0(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fr(t.type)||t.tag===4}function Eh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||w0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Nh(t,n,r,o){var h=t.tag;if(h===5||h===6)h=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(h,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(h),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=Fn)),Su(t,o),Pe=!0;else if(h!==4&&(h===27&&(Su(t,o),o=null,Fr(t.type)&&(r=t.stateNode,n=null)),t=t.child,t!==null))for(Nh(t,n,r,o),t=t.sibling;t!==null;)Nh(t,n,r,o),t=t.sibling}function ku(t,n,r,o){var h=t.tag;if(h===5||h===6)h=t.stateNode,n?r.insertBefore(h,n):r.appendChild(h),Su(t,o),Pe=!0;else if(h!==4&&(h===27&&(Su(t,o),o=null,Fr(t.type)&&(r=t.stateNode)),t=t.child,t!==null))for(ku(t,n,r,o),t=t.sibling;t!==null;)ku(t,n,r,o),t=t.sibling}function S0(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);Nn(n,o,r),n[Mt]=t,n[$t]=r}catch(p){yt(t,t.return,p)}}var Cu=!1,Si=null;function k0(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(Cu=!0)}var ja=null;function C0(){var t=ja;return ja=null,t}var ai=0;function Co(t,n,r,o,h){return ai=0,E0(t.child,n,r,o,h)}function E0(t,n,r,o,h){for(var p=!1;t!==null;){if(t.tag===5){var E=t.stateNode;if(o!==null){var R=um(E);o.push(R),R.view&&(p=!0)}else p||um(E).view&&(p=!0);Cu=!0,Cb(E,ai===0?n:n+"_"+ai,r),ai++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&h||E0(t.child,n,r,o,h)&&(p=!0));t=t.sibling}return p}function wa(t,n){for(;t!==null;)t.tag===5?Eb(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&n||wa(t.child,n)),t=t.sibling}function Eu(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(Eu(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var n=t.memoizedProps;if(n.name==null||n.name==="auto")throw Error(l(544));var r=n.name;n=Qa(n.default,n.share),n!=="none"&&(Co(t,r,n,null,!1)||wa(t.child,!1))}t=t.sibling}}function Th(t,n){if(t.tag===30){var r=t.stateNode,o=t.memoizedProps,h=Xa(o,r),p=Qa(o.default,r.paired?o.share:o.enter);p!=="none"?Co(t,h,p,null,!1)?(Eu(t),r.paired||n||_o(t,o.onEnter)):wa(t.child,!1):Eu(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Th(t,n),t=t.sibling;else Eu(t)}function Ah(t){if(Si!==null&&Si.size!==0){var n=Si;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var r=t.memoizedProps,o=r.name;if(o!=null&&o!=="auto"){var h=n.get(o);if(h!==void 0){var p=Qa(r.default,r.share);if(p!=="none"&&(Co(t,o,p,null,!1)?(p=t.stateNode,h.paired=p,p.paired=h,_o(t,r.onShare)):wa(t.child,!1)),n.delete(o),n.size===0)break}}}Ah(t)}t=t.sibling}}}function Mh(t){if(t.tag===30){var n=t.memoizedProps,r=Xa(n,t.stateNode),o=Si!==null?Si.get(r):void 0,h=Qa(n.default,o!==void 0?n.share:n.exit);h!=="none"&&(Co(t,r,h,null,!1)?o!==void 0?(h=t.stateNode,o.paired=h,h.paired=o,Si.delete(r),_o(t,n.onShare)):_o(t,n.onExit):wa(t.child,!1)),Si!==null&&Ah(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Mh(t),t=t.sibling;else Si!==null&&Ah(t)}function N0(t){for(t=t.child;t!==null;){if(t.tag===30){var n=t.memoizedProps,r=Xa(n,t.stateNode);n=Qa(n.default,n.update),t.flags&=-5,n!=="none"&&Co(t,r,n,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&N0(t);t=t.sibling}}function Oh(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var n=t.stateNode;n.paired!==null&&(n.paired=null,wa(t.child,!1))}Oh(t)}t=t.sibling}}function Nu(t){if(t.tag===30)t.stateNode.paired=null,wa(t.child,!1),Oh(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Nu(t),t=t.sibling;else Oh(t)}function T0(t){for(t=t.child;t!==null;)t.tag===30?wa(t.child,!1):(t.subtreeFlags&33554432)!==0&&T0(t),t=t.sibling}function Rh(t,n,r,o,h,p,E){for(var R=!1;n!==null;){if(n.tag===5){var G=n.stateNode;if(p!==null&&ai<p.length){var ae=p[ai],de=um(G);(ae.view||de.view)&&(R=!0);var ve;if(ve=(t.flags&4)===0)if(de.clip)ve=!0;else{ve=ae.rect;var te=de.rect;ve=ve.y!==te.y||ve.x!==te.x||ve.height!==te.height||ve.width!==te.width}ve&&(t.flags|=4),de.abs?de=!ae.abs:(ae=ae.rect,de=de.rect,de=ae.height!==de.height||ae.width!==de.width),de&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&Cb(G,ai===0?r:r+"_"+ai,h),R&&(t.flags&4)!==0||(ja===null&&(ja=[]),ja.push(G,ai===0?o:o+"_"+ai,n.memoizedProps)),ai++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&E?t.flags|=n.flags&32:Rh(t,n.child,r,o,h,p,E)&&(R=!0));n=n.sibling}return R}function A0(t,n){for(t=t.child;t!==null;){if(t.tag===30){var r=t.memoizedProps,o=t.stateNode,h=Xa(r,o),p=Qa(r.default,r.update),E;E=t.memoizedState,t.memoizedState=null,o=t;var R=t.child;ai=0,h=Rh(o,R,h,h,p,E,!1),(t.flags&4)!==0&&h&&_o(t,r.onUpdate)}else(t.subtreeFlags&33554432)!==0&&A0(t);t=t.sibling}}var fn=!1,gt=!1,Sa=!1,_h=!1,M0=typeof WeakSet=="function"?WeakSet:Set,hn=null,ka=!1,Hs=!1,Tu=!1,Dh=!1;function eN(t,n,r){if(t=t.containerInfo,rm=Fo,t=Dv(t),xf(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var h=o.getSelection&&o.getSelection();if(h&&h.rangeCount!==0){o=h.anchorNode;var p=h.anchorOffset,E=h.focusNode;h=h.focusOffset;try{o.nodeType,E.nodeType}catch{o=null;break e}var R=0,G=-1,ae=-1,de=0,ve=0,te=t,se=null;t:for(;;){for(var Ce;te!==o||p!==0&&te.nodeType!==3||(G=R+p),te!==E||h!==0&&te.nodeType!==3||(ae=R+h),te.nodeType===3&&(R+=te.nodeValue.length),(Ce=te.firstChild)!==null;)se=te,te=Ce;for(;;){if(te===t)break t;if(se===o&&++de===p&&(G=R),se===E&&++ve===h&&(ae=R),(Ce=te.nextSibling)!==null)break;te=se,se=te.parentNode}te=Ce}o=G===-1||ae===-1?null:{start:G,end:ae}}else o=null}o=o||{start:0,end:0}}else o=null;for(lm={focusedElem:t,selectionRange:o},Fo=!1,r=(r&335544064)===r,hn=n,n=r?9270:1024;hn!==null;){if(t=hn,r&&(o=t.deletions,o!==null))for(p=0;p<o.length;p++)r&&Mh(o[p]);if(t.alternate===null&&(t.flags&2)!==0)r&&k0(t),Au(r);else{if(t.tag===22){if(o=t.alternate,t.memoizedState!==null){o!==null&&o.memoizedState===null&&r&&Mh(o),Au(r);continue}else if(o!==null&&o.memoizedState!==null){r&&k0(t),Au(r);continue}}o=t.child,(t.subtreeFlags&n)!==0&&o!==null?(o.return=t,hn=o):(r&&N0(t),Au(r))}}Si=null}function Au(t){for(;hn!==null;){var n=hn,r=t,o=n.alternate,h=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((h&1024)!==0&&o!==null){r=void 0,h=o.memoizedProps,o=o.memoizedState;var p=n.stateNode;try{var E=Al(n.type,h);r=p.getSnapshotBeforeUpdate(E,o),p.__reactInternalSnapshotBeforeUpdate=r}catch(R){yt(n,n.return,R)}}break;case 3:if((h&1024)!==0){if(o=n.stateNode.containerInfo,r=o.nodeType,r===9)hm(o);else if(r===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":hm(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:r&&o!==null&&(r=Xa(o.memoizedProps,o.stateNode),h=n.memoizedProps,h=Qa(h.default,h.update),h!=="none"&&Co(o,r,h,o.memoizedState=[],!0));break;default:if((h&1024)!==0)throw Error(l(163))}if(o=n.sibling,o!==null){o.return=n.return,hn=o;break}hn=n.return}}function O0(t,n,r){var o=r.flags;switch(r.tag){case 0:case 11:case 15:Ca(t,r),o&4&&Bs(5,r);break;case 1:if(Ca(t,r),o&4)if(t=r.stateNode,n===null)try{t.componentDidMount()}catch(E){yt(r,r.return,E)}else{var h=Al(r.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(h,n,t.__reactInternalSnapshotBeforeUpdate)}catch(E){yt(r,r.return,E)}}o&64&&b0(r),o&512&&xa(r,r.return);break;case 3:if(Ca(t,r),o&64&&(t=r.updateQueue,t!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{sy(t,n)}catch(E){yt(r,r.return,E)}}break;case 27:n===null&&o&4&&S0(r);case 26:case 5:Ca(t,r),n===null&&o&4&&kh(r),o&512&&xa(r,r.return);break;case 12:Ca(t,r);break;case 31:Ca(t,r),o&4&&z0(t,r);break;case 13:Ca(t,r),o&4&&L0(t,r),o&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=fN.bind(null,r),GN(t,r))));break;case 22:if(o=r.memoizedState!==null||fn,!o){var p=n!==null&&n.memoizedState!==null||gt;n=fn,h=gt,fn=o,(gt=p)&&!h?(o=2,(r.subtreeFlags&8772)!==0&&(o|=1),ea(t,r,o)):Ca(t,r),fn=n,gt=h}break;case 30:Ca(t,r),o&512&&xa(r,r.return);break;case 7:o&512&&xa(r,r.return);default:Ca(t,r)}}function zh(t,n){for(t=t.child;t!==null;)R0(t,n),t=t.sibling}function R0(t,n){switch(t.tag){case 5:case 26:try{var r=t.stateNode;if(n){var o=r.style;typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"}else{var h=t.stateNode,p=t.memoizedProps.style,E=p!=null&&p.hasOwnProperty("display")?p.display:null;h.style.display=E==null||typeof E=="boolean"?"":(""+E).trim()}}catch(G){yt(t,t.return,G)}Lh(t,n);break;case 6:try{t.stateNode.nodeValue=n?"":t.memoizedProps,Pe=!0}catch(G){yt(t,t.return,G)}break;case 18:try{var R=t.stateNode;n?kb(R,!0):kb(t.stateNode,!1)}catch(G){yt(t,t.return,G)}break;case 22:case 23:t.memoizedState===null&&zh(t,n);break;default:zh(t,n)}}function Lh(t,n){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var r=t,o=n;switch(r.tag){case 4:R0(r,o);break e;case 22:r.memoizedState===null&&Lh(r,o);break e;default:Lh(r,o)}}t=t.sibling}}function _0(t){var n=t.alternate;n!==null&&(t.alternate=null,_0(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&$a(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var _t=null,ri=!1;function Ji(t,n,r){for(r=r.child;r!==null;)D0(t,n,r),r=r.sibling}function D0(t,n,r){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(Gi,r)}catch{}switch(r.tag){case 26:gt||En(r,n),Ji(t,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&!gt&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:gt||En(r,n),Ps(r);var o=_t,h=ri;Fr(r.type)&&(_t=r.stateNode,ri=!1),Ji(t,n,r),Bb(r.stateNode,r.type,r.memoizedProps),_t=o,ri=h;break;case 5:gt||En(r,n),Ps(r);case 6:if(r.tag===6&&Ps(r),o=_t,h=ri,_t=null,Ji(t,n,r),_t=o,ri=h,_t!==null)if(ri)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(r.stateNode),Pe=!0}catch(p){yt(r,n,p)}else try{_t.removeChild(r.stateNode),Pe=!0}catch(p){yt(r,n,p)}break;case 18:_t!==null&&(ri?(t=_t,Sb(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),Vo(t)):Sb(_t,r.stateNode));break;case 4:o=_t,h=ri,_t=r.stateNode.containerInfo,ri=!0,Ji(t,n,r),_t=o,ri=h;break;case 0:case 11:case 14:case 15:Lr(2,r,n),gt||Lr(4,r,n),Ji(t,n,r);break;case 1:gt||(En(r,n),o=r.stateNode,typeof o.componentWillUnmount=="function"&&x0(r,n,o)),Ji(t,n,r);break;case 21:Ji(t,n,r);break;case 22:gt=(o=gt)||r.memoizedState!==null,Ji(t,n,r),gt=o;break;case 30:En(r,n),Ji(t,n,r);break;case 7:gt||En(r,n),Ji(t,n,r);break;default:Ji(t,n,r)}}function z0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Vo(t)}catch(r){yt(n,n.return,r)}}}function L0(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Vo(t)}catch(r){yt(n,n.return,r)}}function tN(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new M0),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new M0),n;default:throw Error(l(435,t.tag))}}function Mu(t,n){var r=tN(t);n.forEach(function(o){if(!r.has(o)){r.add(o);var h=hN.bind(null,t,o);o.then(h,h)}})}function Yn(t,n,r){var o=n.deletions;if(o!==null)for(var h=0;h<o.length;h++){var p=o[h],E=t,R=n,G=R;e:for(;G!==null;){switch(G.tag){case 27:if(Fr(G.type)){_t=G.stateNode,ri=!1;break e}break;case 5:_t=G.stateNode,ri=!1;break e;case 3:case 4:_t=G.stateNode.containerInfo,ri=!0;break e}G=G.return}if(_t===null)throw Error(l(160));D0(E,R,p),_t=null,ri=!1,E=p.alternate,E!==null&&(E.return=null),p.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)I0(n,t,r),n=n.sibling}var Wi=null;function I0(t,n,r){var o=t.alternate,h=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(h&4&&(o=t.updateQueue,o=o!==null?o.events:null,o!==null))for(var p=0;p<o.length;p++){var E=o[p];E.ref.impl=E.nextImpl}Yn(n,t,r),Gn(t),h&4&&(Lr(3,t,t.return),Bs(3,t),Lr(5,t,t.return));break;case 1:Yn(n,t,r),Gn(t),h&512&&(gt||o===null||En(o,o.return)),h&64&&fn&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(r=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=r===null?n:r.concat(n))));break;case 26:if(p=Wi,Yn(n,t,r),Gn(t),h&512&&(gt||o===null||En(o,o.return)),h&4)if(h=o!==null?o.memoizedState:null,r=t.memoizedState,o===null)if(r===null)if(t.stateNode===null)if(fn)t.stateNode=xb(t.type,t.memoizedProps,n.containerInfo,t);else{e:{n=t.type,r=t.memoizedProps,h=p.ownerDocument||p;t:switch(n){case"title":o=h.getElementsByTagName("title")[0],(!o||o[ga]||o[Mt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=h.createElement(n),h.head.insertBefore(o,h.querySelector("head > title"))),Nn(o,n,r),o[Mt]=t,K(o),n=o;break e;case"link":if(p=Vb("link","href",h).get(n+(r.href||""))){for(E=0;E<p.length;E++)if(o=p[E],o.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&o.getAttribute("rel")===(r.rel==null?null:r.rel)&&o.getAttribute("title")===(r.title==null?null:r.title)&&o.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){p.splice(E,1);break t}}o=h.createElement(n),Nn(o,n,r),h.head.appendChild(o);break;case"meta":if(p=Vb("meta","content",h).get(n+(r.content||""))){for(E=0;E<p.length;E++)if(o=p[E],o.getAttribute("content")===(r.content==null?null:""+r.content)&&o.getAttribute("name")===(r.name==null?null:r.name)&&o.getAttribute("property")===(r.property==null?null:r.property)&&o.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&o.getAttribute("charset")===(r.charSet==null?null:r.charSet)){p.splice(E,1);break t}}o=h.createElement(n),Nn(o,n,r),h.head.appendChild(o);break;default:throw Error(l(468,n))}o[Mt]=t,K(o),n=o}t.stateNode=n}else fn||xm(p,t.type,t.stateNode);else t.stateNode=Fb(p,r,t.memoizedProps);else h!==r?(h===null?(n=o.stateNode,n===null||gt||n.parentNode.removeChild(n)):h.count--,r===null?fn||xm(p,t.type,t.stateNode):Fb(p,r,t.memoizedProps)):r===null&&t.stateNode!==null&&Ch(t,t.memoizedProps,o.memoizedProps);break;case 27:Yn(n,t,r),Gn(t),h&512&&(gt||o===null||En(o,o.return)),o!==null&&h&4&&Ch(t,t.memoizedProps,o.memoizedProps);break;case 5:if(p=Sa,Sa=!1,Yn(n,t,r),Sa=p,Gn(t),h&512&&(gt||o===null||En(o,o.return)),t.flags&32){n=t.stateNode;try{qn(n,""),Pe=!0}catch(de){yt(t,t.return,de)}}h&4&&t.stateNode!=null&&(n=t.memoizedProps,Ch(t,n,o!==null?o.memoizedProps:n)),h&1024&&(_h=!0);break;case 6:if(Yn(n,t,r),Gn(t),h&4){if(t.stateNode===null)throw Error(l(162));n=t.memoizedProps,r=t.stateNode;try{r.nodeValue=n,Pe=!0}catch(de){yt(t,t.return,de)}}break;case 3:if(Pe=!1,$u=null,p=Wi,Wi=Qs(n.containerInfo),Yn(n,t,r),Wi=p,Gn(t),h&4&&o!==null&&o.memoizedState.isDehydrated)try{Vo(n.containerInfo)}catch(de){yt(t,t.return,de)}_h&&(_h=!1,B0(t)),Pe=!1;break;case 4:h=Sa,Sa=fn,o=ln(),p=Wi,Wi=Qs(t.stateNode.containerInfo),Yn(n,t,r),Gn(t),Wi=p,Pe&&Hs&&(Tu=!0),Pe=o,Sa=h;break;case 12:Yn(n,t,r),Gn(t);break;case 31:Yn(n,t,r),Gn(t),h&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Mu(t,n)));break;case 13:Yn(n,t,r),Gn(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(_u=Gt()),h&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Mu(t,n)));break;case 22:p=t.memoizedState!==null,E=o!==null&&o.memoizedState!==null;var R=fn,G=gt,ae=Sa;fn=R||p,Sa=ae||p,gt=G||E,Yn(n,t,r),gt=G,Sa=ae,fn=R,Gn(t),h&8192&&(n=t.stateNode,n._visibility=p?n._visibility&-2:n._visibility|1,!p||o===null||E||fn||gt||(n=E||gt,r=fn,o=gt,fn=p||fn,gt=n,Ir(t,2),fn=r,gt=o),!p&&Sa||zh(t,p)),h&4&&(n=t.updateQueue,n!==null&&(r=n.retryQueue,r!==null&&(n.retryQueue=null,Mu(t,r))));break;case 19:Yn(n,t,r),Gn(t),h&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Mu(t,n)));break;case 30:h&512&&(gt||o===null||En(o,o.return)),h=ln(),p=Hs,E=(r&335544064)===r,R=t.memoizedProps,Hs=E&&Qa(R.default,R.update)!=="none",Yn(n,t,r),Gn(t),E&&o!==null&&Pe&&(t.flags|=4),Hs=p,Pe=h;break;case 21:break;case 7:h&512&&(gt||o===null||En(o,o.return)),o&&o.stateNode!==null&&(o.stateNode._fragmentFiber=t);default:Yn(n,t,r),Gn(t)}}function Gn(t){var n=t.flags;if(n&2){try{for(var r,o=t.return;o!==null;){if(w0(o)){r=o;break}o=o.return}o=null;for(var h=t.return;h!==null;){if(Sh(h)){var p=h.stateNode;o===null?o=[p]:o.push(p)}if(wh(h))break;h=h.return}var E=o;if(r==null)throw Error(l(160));switch(r.tag){case 27:var R=r.stateNode,G=Eh(t);ku(t,G,R,E);break;case 5:var ae=r.stateNode;r.flags&32&&(qn(ae,""),r.flags&=-33);var de=Eh(t);ku(t,de,ae,E);break;case 3:case 4:var ve=r.stateNode.containerInfo,te=Eh(t);Nh(t,te,ve,E);break;default:throw Error(l(161))}}catch(se){yt(t,t.return,se)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function B0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;B0(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,Fo=!0,n.reset(),Fo=!1),t=t.sibling}}function Eo(t,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)P0(n,t),n=n.sibling;else A0(n)}function P0(t,n){var r=t.alternate;if(r===null)Th(t,!1);else switch(t.tag){case 3:if(Dh=ka=!1,C0(),Eo(n,t),!ka&&!Tu){if(t=ja,t!==null)for(var o=0;o<t.length;o+=3){r=t[o];var h=t[o+1];Eb(r,t[o+2]),r=r.ownerDocument.documentElement,r!==null&&r.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+h+")"})}t=n.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Dh=!0}ja=null;break;case 5:Eo(n,t);break;case 4:o=ka,ka=!1,Eo(n,t),ka&&(Tu=!0),ka=o;break;case 22:t.memoizedState===null&&(r.memoizedState!==null?Th(t,!1):Eo(n,t));break;case 30:o=ka,h=C0(),ka=!1,Eo(n,t),ka&&(t.flags|=4);var p=t.memoizedProps,E=t.stateNode;n=Xa(p,E),E=Xa(r.memoizedProps,E);var R=Qa(p.default,p.update);R==="none"?n=!1:(p=r.memoizedState,r.memoizedState=null,r=t.child,ai=0,n=Rh(t,r,n,E,R,p,!0),ai!==(p===null?0:p.length)&&(t.flags|=32)),(t.flags&4)!==0&&n?(_o(t,t.memoizedProps.onUpdate),ja=h):h!==null&&(h.push.apply(h,ja),ja=h),ka=(t.flags&32)!==0?!0:o;break;default:Eo(n,t)}}function Ca(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)O0(t,n.alternate,n),n=n.sibling}function Ir(t,n){for(t=t.child;t!==null;){var r=t,o=n;switch(r.tag){case 0:case 11:case 14:case 15:Lr(4,r,r.return),Ir(r,o);break;case 1:En(r,r.return);var h=r.stateNode;typeof h.componentWillUnmount=="function"&&x0(r,r.return,h),Ir(r,o);break;case 27:(o&2)!==0&&Bb(r.stateNode,r.type,r.memoizedProps);case 5:En(r,r.return),r.tag!==5&&r.tag!==27||Ps(r),Ir(r,o);break;case 6:Ps(r);break;case 26:En(r,r.return),h=r.stateNode,r.memoizedState!==null||h===null||gt||h.parentNode.removeChild(h),Ir(r,o);break;case 22:r.memoizedState===null&&Ir(r,o);break;case 30:En(r,r.return),Ir(r,o);break;case 7:En(r,r.return);default:Ir(r,o)}t=t.sibling}}function ea(t,n,r){for(r=(n.subtreeFlags&8772)!==0?r:r&-2,n=n.child;n!==null;){var o=n.alternate,h=t,p=n,E=p.flags,R=(r&1)!==0;switch(p.tag){case 0:case 11:case 15:ea(h,p,r),Bs(4,p);break;case 1:if(ea(h,p,r),o=p,h=o.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(de){yt(o,o.return,de)}if(o=p,h=o.updateQueue,h!==null){var G=o.stateNode;try{var ae=h.shared.hiddenCallbacks;if(ae!==null)for(h.shared.hiddenCallbacks=null,h=0;h<ae.length;h++)oy(ae[h],G)}catch(de){yt(o,o.return,de)}}R&&E&64&&b0(p),xa(p,p.return);break;case 27:(r&2)!==0&&S0(p);case 5:p.tag!==5&&p.tag!==27||j0(p),ea(h,p,r),R&&o===null&&E&4&&kh(p),xa(p,p.return);break;case 6:j0(p);break;case 26:G=p.stateNode,p.memoizedState!==null||G===null||fn||xm(Qs(G.ownerDocument),p.type,G),ea(h,p,r),R&&o===null&&E&4&&kh(p),xa(p,p.return);break;case 12:ea(h,p,r);break;case 31:ea(h,p,r),R&&E&4&&z0(h,p);break;case 13:ea(h,p,r),R&&E&4&&L0(h,p);break;case 22:p.memoizedState===null&&ea(h,p,r),xa(p,p.return);break;case 30:ea(h,p,r),xa(p,p.return);break;case 7:xa(p,p.return);default:ea(h,p,r)}n=n.sibling}}function Ih(t,n){var r=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==r&&(t!=null&&t.refCount++,r!=null&&Cs(r))}function Bh(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Cs(t))}function Bi(t,n,r,o){var h=(r&335544064)===r;if(n.subtreeFlags&(h?10262:10256))for(n=n.child;n!==null;)H0(t,n,r,o),n=n.sibling;else h&&T0(n)}function H0(t,n,r,o){var h=(r&335544064)===r;h&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&Nu(n);var p=n.flags;switch(n.tag){case 0:case 11:case 15:Bi(t,n,r,o),p&2048&&Bs(9,n);break;case 1:Bi(t,n,r,o);break;case 3:Bi(t,n,r,o),h&&Dh&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),p&2048&&(p=null,n.alternate!==null&&(p=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==p&&(n.refCount++,p!=null&&Cs(p)));break;case 12:if(p&2048){Bi(t,n,r,o),p=n.stateNode;try{var E=n.memoizedProps,R=E.id,G=E.onPostCommit;typeof G=="function"&&G(R,n.alternate===null?"mount":"update",p.passiveEffectDuration,-0)}catch(ae){yt(n,n.return,ae)}}else Bi(t,n,r,o);break;case 31:Bi(t,n,r,o);break;case 13:Bi(t,n,r,o);break;case 23:break;case 22:E=n.stateNode,R=n.alternate,n.memoizedState!==null?(h&&R!==null&&R.memoizedState===null&&Nu(R),E._visibility&2?Bi(t,n,r,o):Us(t,n)):(h&&R!==null&&R.memoizedState!==null&&Nu(n),E._visibility&2?Bi(t,n,r,o):(E._visibility|=2,No(t,n,r,o,(n.subtreeFlags&10256)!==0||!1))),p&2048&&Ih(R,n);break;case 24:Bi(t,n,r,o),p&2048&&Bh(n.alternate,n);break;case 30:h&&(p=n.alternate,p!==null&&(wa(p.child,!0),wa(n.child,!0))),Bi(t,n,r,o);break;default:Bi(t,n,r,o)}}function No(t,n,r,o,h){for(h=h&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=t,E=n,R=r,G=o,ae=E.flags;switch(E.tag){case 0:case 11:case 15:No(p,E,R,G,h),Bs(8,E);break;case 23:break;case 22:var de=E.stateNode;E.memoizedState!==null?de._visibility&2?No(p,E,R,G,h):Us(p,E):(de._visibility|=2,No(p,E,R,G,h)),h&&ae&2048&&Ih(E.alternate,E);break;case 24:No(p,E,R,G,h),h&&ae&2048&&Bh(E.alternate,E);break;default:No(p,E,R,G,h)}n=n.sibling}}function Us(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=t,o=n,h=o.flags;switch(o.tag){case 22:Us(r,o),h&2048&&Ih(o.alternate,o);break;case 24:Us(r,o),h&2048&&Bh(o.alternate,o);break;default:Us(r,o)}n=n.sibling}}var Ml=8192;function Ol(t,n,r){if(t.subtreeFlags&Ml)for(t=t.child;t!==null;)U0(t,n,r),t=t.sibling}function U0(t,n,r){switch(t.tag){case 26:Ol(t,n,r),t.flags&Ml&&(t.memoizedState!==null?oT(r,Wi,t.memoizedState,t.memoizedProps):(t=t.stateNode,(n&335544128)===n&&Xb(r,t)));break;case 5:Ol(t,n,r),t.flags&Ml&&(t=t.stateNode,(n&335544128)===n&&Xb(r,t));break;case 3:case 4:var o=Wi;Wi=Qs(t.stateNode.containerInfo),Ol(t,n,r),Wi=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Ml,Ml=16777216,Ol(t,n,r),Ml=o):Ol(t,n,r));break;case 30:if((t.flags&Ml)!==0&&(o=t.memoizedProps.name,o!=null&&o!=="auto")){var h=t.stateNode;h.paired=null,Si===null&&(Si=new Map),Si.set(o,h)}Ol(t,n,r);break;default:Ol(t,n,r)}}function q0(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function qs(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];hn=o,V0(o,t)}q0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)F0(t),t=t.sibling}function F0(t){switch(t.tag){case 0:case 11:case 15:qs(t),t.flags&2048&&Lr(9,t,t.return);break;case 3:qs(t);break;case 12:qs(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Ou(t)):qs(t);break;default:qs(t)}}function Ou(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];hn=o,V0(o,t)}q0(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Lr(8,n,n.return),Ou(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,Ou(n));break;default:Ou(n)}t=t.sibling}}function V0(t,n){for(;hn!==null;){var r=hn;switch(r.tag){case 0:case 11:case 15:Lr(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var o=r.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Cs(r.memoizedState.cache)}if(o=r.child,o!==null)o.return=r,hn=o;else e:for(r=t;hn!==null;){o=hn;var h=o.sibling,p=o.return;if(_0(o),o===r){hn=null;break e}if(h!==null){h.return=p,hn=h;break e}hn=p}}}var nN={getCacheForType:function(t){var n=Sn(Kt),r=n.data.get(t);return r===void 0&&(r=t(),n.data.set(t,r)),r},cacheSignal:function(){return Sn(Kt).controller.signal}},iN=typeof WeakMap=="function"?WeakMap:Map,pt=0,kt=null,tt=null,rt=0,vt=0,ki=null,Br=!1,To=!1,Ph=!1,ar=0,Ft=0,Pr=0,Rl=0,Ru=0,Ci=0,Ao=0,Fs=null,li=null,Hh=!1,_u=0,$0=0,Du=1/0,zu=null,Hr=null,Bt=0,ta=null,_l=null,Ea=0,Uh=0,qh=null,Y0=null,Mo=null,Oo=null,Ro=null,Vs=0,Lu=null;function Ei(){return(pt&2)!==0&&rt!==0?rt&-rt:ce.T!==null?Jh():ei()}function G0(){if(Ci===0)if((rt&536870912)===0||et){var t=Oi;Oi<<=1,(Oi&3932160)===0&&(Oi=262144),Ci=t}else Ci=536870912;return t=kn.current,t!==null&&(t.flags|=32),Ci}function _o(t,n){if(n!=null){var r=t.stateNode,o=r.ref;o===null&&(o=r.ref=Nb(Xa(t.memoizedProps,r))),Oo===null&&(Oo=[]),Oo.push(n.bind(null,o))}}function oi(t,n,r){(t===kt&&(vt===2||vt===9)||t.cancelPendingCommit!==null)&&(Do(t,0),Ur(t,rt,Ci,!1)),Zn(t,r),((pt&2)===0||t!==kt)&&(t===kt&&((pt&2)===0&&(Rl|=r),Ft===4&&Ur(t,rt,Ci,!1)),Na(t))}function X0(t,n,r){if((pt&6)!==0)throw Error(l(327));var o=!r&&(n&127)===0&&(n&t.expiredLanes)===0||pi(t,n),h=o?lN(t,n):Vh(t,n,!0),p=o;do{if(h===0){To&&!o&&Ur(t,n,0,!1);break}else{if(r=t.current.alternate,p&&!aN(r)){h=Vh(t,n,!1),p=!1;continue}if(h===2){if(p=n,t.errorRecoveryDisabledLanes&p)var E=0;else E=t.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){n=E;e:{var R=t;h=Fs;var G=R.current.memoizedState.isDehydrated;if(G&&(Do(R,E).flags|=256),E=Vh(R,E,!1),E!==2&&E!==6){if(Ph&&!G){R.errorRecoveryDisabledLanes|=p,Rl|=p,h=4;break e}p=li,li=h,p!==null&&(li===null?li=p:li.push.apply(li,p))}h=E}if(p=!1,h!==2)continue}}if(h===1){Do(t,0),Ur(t,n,0,!0);break}e:{switch(o=t,p=h,p){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:Ur(o,n,Ci,!Br);break e;case 2:li=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(h=_u+300-Gt(),10<h)){if(Ur(o,n,Ci,!Br),mi(o,0,!0)!==0)break e;Ea=n,o.timeoutHandle=cm(Q0.bind(null,o,r,li,zu,Hh,n,Ci,Rl,Ao,Br,p,"Throttled",-0,0),h);break e}Q0(o,r,li,zu,Hh,n,Ci,Rl,Ao,Br,p,null,-0,0)}}break}while(!0);Na(t)}function Q0(t,n,r,o,h,p,E,R,G,ae,de,ve,te,se){t.timeoutHandle=-1;var Ce=n.subtreeFlags,_e=(p&335544064)===p;if(ve=null,(_e||Ce&8192||(Ce&16785408)===16785408)&&(ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fn},Si=null,U0(n,p,ve),_e&&(Ce=ve,_e=t.containerInfo,_e=(_e.nodeType===9?_e:_e.ownerDocument).__reactViewTransition,_e!=null&&(Ce.count++,Ce.waitingForViewTransition=!0,Ce=Js.bind(Ce),_e.finished.then(Ce,Ce))),Ce=(p&62914560)===p?_u-Gt():(p&4194048)===p?$0-Gt():0,Ce=sT(ve,Ce),Ce!==null)){Ea=p,t.cancelPendingCommit=Ce(ib.bind(null,t,n,p,r,o,h,E,R,G,ae,de,ve,null,te,se)),Ur(t,p,E,!ae);return}ib(t,n,p,r,o,h,E,R,G,ae,de,ve)}function aN(t){for(var n=t;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var o=0;o<r.length;o++){var h=r[o],p=h.getSnapshot;h=h.value;try{if(!ji(p(),h))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ur(t,n,r,o){n=fa(t,n),n&=~Ru,n&=~Rl,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var h=n;0<h;){var p=31-Vt(h),E=1<<p;o[p]=-1,h&=~E}r!==0&&Jn(t,r,n)}function Iu(){return(pt&6)===0?($s(0),!1):!0}function Fh(){if(tt!==null){if(vt===0)var t=tt.return;else t=tt,Ja=xl=null,Zf(t),xo=null,Ts=0,t=tt;for(;t!==null;)y0(t.alternate,t),t=t.return;tt=null}}function Do(t,n){var r=t.timeoutHandle;return r!==-1&&(t.timeoutHandle=-1,TN(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),Ea=0,Fh(),kt=t,tt=r=Ka(t.current,null),rt=n,vt=0,ki=null,Br=!1,To=pi(t,n),Ph=!1,Ao=Ci=Ru=Rl=Pr=Ft=0,li=Fs=null,Hh=!1,ar=fa(t,n),$c(),r}function K0(t,n){Ke=null,ce.H=gu,n===bo||n===nu?(n=iy(),vt=3):n===Bf?(n=iy(),vt=4):vt=n===fh?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ki=n,tt===null&&(Ft=1,vu(t,Di(n,t.current)))}function Z0(){var t=kn.current;return t===null?!0:(rt&4194048)===rt?zn===null:(rt&62914560)===rt||(rt&536870912)!==0?t===zn:!1}function J0(){var t=ce.H;return ce.H=gu,t===null?gu:t}function W0(){var t=ce.A;return ce.A=nN,t}function Bu(){Ft=4,Br||(rt&4194048)!==rt&&kn.current!==null||(To=!0),(Pr&134217727)===0&&(Rl&134217727)===0||kt===null||Ur(kt,rt,Ci,!1)}function Vh(t,n,r){var o=pt;pt|=2;var h=J0(),p=W0();(kt!==t||rt!==n)&&(zu=null,Do(t,n)),n=!1;var E=Ft;e:do try{if(vt!==0&&tt!==null){var R=tt,G=ki;switch(vt){case 8:Fh(),E=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(n=!0);var ae=vt;if(vt=0,ki=null,zo(t,R,G,ae),r&&To){E=0;break e}break;default:ae=vt,vt=0,ki=null,zo(t,R,G,ae)}}rN(),E=Ft;break}catch(de){K0(t,de)}while(!0);return n&&t.shellSuspendCounter++,Ja=xl=null,pt=o,ce.H=h,ce.A=p,tt===null&&(kt=null,rt=0,$c()),E}function rN(){for(;tt!==null;)eb(tt)}function lN(t,n){var r=pt;pt|=2;var o=J0(),h=W0();kt!==t||rt!==n?(zu=null,Du=Gt()+500,Do(t,n)):To=pi(t,n);e:do try{if(vt!==0&&tt!==null){n=tt;var p=ki;t:switch(vt){case 1:vt=0,ki=null,zo(t,n,p,1);break;case 2:case 9:if(ty(p)){vt=0,ki=null,tb(n);break}n=function(){vt!==2&&vt!==9||kt!==t||(vt=7),Na(t)},p.then(n,n);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:ty(p)?(vt=0,ki=null,tb(n)):(vt=0,ki=null,zo(t,n,p,7));break;case 5:var E=null;switch(tt.tag){case 26:E=tt.memoizedState;case 5:case 27:var R=tt;if(E?Yb(E):R.stateNode.complete){vt=0,ki=null;var G=R.sibling;if(G!==null)tt=G;else{var ae=R.return;ae!==null?(tt=ae,Pu(ae)):tt=null}break t}}vt=0,ki=null,zo(t,n,p,5);break;case 6:vt=0,ki=null,zo(t,n,p,6);break;case 8:Fh(),Ft=6;break e;default:throw Error(l(462))}}oN();break}catch(de){K0(t,de)}while(!0);return Ja=xl=null,ce.H=o,ce.A=h,pt=r,tt!==null?0:(kt=null,rt=0,$c(),Ft)}function oN(){for(;tt!==null&&!Rn();)eb(tt)}function eb(t){var n=g0(t.alternate,t,ar);t.memoizedProps=t.pendingProps,n===null?Pu(t):tt=n}function tb(t){var n=t,r=n.alternate;switch(n.tag){case 15:case 0:n=c0(r,n,n.pendingProps,n.type,void 0,rt);break;case 11:n=c0(r,n,n.pendingProps,n.type.render,n.ref,rt);break;case 5:Zf(n);var o=n;o===dn&&(et?(Zc(o),o.tag===5&&o.stateNode!=null&&(Nt=o.stateNode)):(Zc(o),et=!0));default:y0(r,n),n=tt=Vv(n,ar),n=g0(r,n,ar)}t.memoizedProps=t.pendingProps,n===null?Pu(t):tt=n}function zo(t,n,r,o){Ja=xl=null,Zf(n),xo=null,Ts=0;var h=n.return;try{if(XE(t,h,n,r,rt)){Ft=1,vu(t,Di(r,t.current)),tt=null;return}}catch(p){if(h!==null)throw tt=h,p;Ft=1,vu(t,Di(r,t.current)),tt=null;return}n.flags&32768?(et||o===1?t=!0:To||(rt&536870912)!==0?t=!1:(Br=t=!0,(o===2||o===9||o===3||o===6)&&(o=kn.current,o!==null&&o.tag===13&&(o.flags|=16384))),nb(n,t)):Pu(n)}function Pu(t){var n=t;do{if((n.flags&32768)!==0){nb(n,Br);return}t=n.return;var r=JE(n.alternate,n,ar);if(r!==null){tt=r;return}if(n=n.sibling,n!==null){tt=n;return}tt=n=t}while(n!==null);Ft===0&&(Ft=5)}function nb(t,n){do{var r=WE(t.alternate,t);if(r!==null){r.flags&=32767,tt=r;return}if(r=t.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(t=t.sibling,t!==null)){tt=t;return}tt=t=r}while(t!==null);Ft=6,tt=null}function ib(t,n,r,o,h,p,E,R,G,ae,de,ve){t.cancelPendingCommit=null;do Hu();while(Bt!==0);if((pt&6)!==0)throw Error(l(327));if(n!==null){if(n===t.current)throw Error(l(177));t===kt&&(tt=kt=null,rt=0),_l=n,ta=t,Ea=r,qh=h,Y0=o,sN(t,n,r,E,R,G,ve)}}function sN(t,n,r,o,h,p,E){var R=n.lanes|n.childLanes;if(Uh=R,R|=Cf,ha(t,r,R,o,h,p),Oo=null,(r&335544064)===r?(Ro=LE(t),o=10262):(Ro=null,o=10256),(n.subtreeFlags&o)!==0||(n.flags&o)!==0?(t.callbackNode=null,t.callbackPriority=0,mN(bn,function(){return Xh(),null})):(t.callbackNode=null,t.callbackPriority=0),Cu=!1,o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=ce.T,ce.T=null,h=me.p,me.p=2,p=pt,pt|=4;try{eN(t,n,r)}finally{pt=p,me.p=h,ce.T=o}}Bt=1,Cu?Mo=DN(E,t.containerInfo,Ro,$h,Yh,uN,Gh,Xh,cN):($h(),Yh(),Gh())}function cN(t){if(Bt!==0){var n=ta.onRecoverableError;n(t,{componentStack:null})}}function uN(){Bt===3&&(Bt=0,P0(_l,ta),Bt=4)}function $h(){if(Bt===1){Bt=0;var t=ta,n=_l,r=Ea,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=ce.T,ce.T=null;var h=me.p;me.p=2;var p=pt;pt|=4;try{Hs=Tu=!1,I0(n,t,r),r=lm;var E=Dv(t.containerInfo),R=r.focusedElem,G=r.selectionRange;if(E!==R&&R&&R.ownerDocument&&_v(R.ownerDocument.documentElement,R)){if(G!==null&&xf(R)){var ae=G.start,de=G.end;if(de===void 0&&(de=ae),"selectionStart"in R)R.selectionStart=ae,R.selectionEnd=Math.min(de,R.value.length);else{var ve=R.ownerDocument||document,te=ve&&ve.defaultView||window;if(te.getSelection){var se=te.getSelection(),Ce=R.textContent.length,_e=Math.min(G.start,Ce),Ze=G.end===void 0?_e:Math.min(G.end,Ce);!se.extend&&_e>Ze&&(E=Ze,Ze=_e,_e=E);var ie=Rv(R,_e),Z=Rv(R,Ze);if(ie&&Z&&(se.rangeCount!==1||se.anchorNode!==ie.node||se.anchorOffset!==ie.offset||se.focusNode!==Z.node||se.focusOffset!==Z.offset)){var le=ve.createRange();le.setStart(ie.node,ie.offset),se.removeAllRanges(),_e>Ze?(se.addRange(le),se.extend(Z.node,Z.offset)):(le.setEnd(Z.node,Z.offset),se.addRange(le))}}}}for(ve=[],se=R;se=se.parentNode;)se.nodeType===1&&ve.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ve.length;R++){var ge=ve[R];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Fo=!!rm,lm=rm=null}finally{pt=p,me.p=h,ce.T=o}}t.current=n,Bt=2}}function Yh(){if(Bt===2){Bt=0;var t=ta,n=_l,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=ce.T,ce.T=null;var o=me.p;me.p=2;var h=pt;pt|=4;try{O0(t,n.alternate,n)}finally{pt=h,me.p=o,ce.T=r}}Bt=3}}function Gh(){if(Bt===4||Bt===3){Bt=0;var t=Mo;Mo=null,Xe();var n=ta,r=_l,o=Ea,h=Y0,p=(o&335544064)===o?10262:10256;if((r.subtreeFlags&p)!==0||(r.flags&p)!==0?Bt=5:(Bt=0,_l=ta=null,ab(n,n.pendingLanes)),p=n.pendingLanes,p===0&&(Hr=null),Wn(o),r=r.stateNode,sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(Gi,r,void 0,(r.current.flags&128)===128)}catch{}if(h!==null){r=ce.T,p=me.p,me.p=2,ce.T=null;try{for(var E=n.onRecoverableError,R=0;R<h.length;R++){var G=h[R];E(G.value,{componentStack:G.stack})}}finally{ce.T=r,me.p=p}}if(h=Oo,E=Ro,Ro=null,h!==null&&(Oo=null,E===null&&(E=[]),t!==null))for(G=0;G<h.length;G++)r=(0,h[G])(E),r!==void 0&&t.finished.finally(r);(Ea&3)!==0&&Hu(),Na(n),p=n.pendingLanes,(o&261930)!==0&&(p&42)!==0?n===Lu?Vs++:(Vs=0,Lu=n):(Vs=0,Lu=null),$s(0)}}function ab(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Cs(n)))}function Hu(){return Mo!==null&&(Mo.skipTransition(),Mo=null),$h(),Yh(),Gh(),Xh()}function Xh(){if(Bt!==5)return!1;var t=ta,n=Uh;Uh=0;var r=Wn(Ea),o=ce.T,h=me.p;try{me.p=32>r?32:r,ce.T=null,r=qh,qh=null;var p=ta,E=Ea;if(Bt=0,_l=ta=null,Ea=0,(pt&6)!==0)throw Error(l(331));var R=pt;if(pt|=4,F0(p.current),H0(p,p.current,E,r),pt=R,$s(0,!1),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(Gi,p)}catch{}return!0}finally{me.p=h,ce.T=o,ab(t,n)}}function rb(t,n,r){n=Di(r,n),n=dh(t.stateNode,n,2),t=Rr(t,n,2),t!==null&&(Zn(t,2),Na(t))}function yt(t,n,r){if(t.tag===3)rb(t,t,r);else for(;n!==null;){if(n.tag===3){rb(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Hr===null||!Hr.has(o))){t=Di(r,t),r=t0(2),o=Rr(n,r,2),o!==null&&(n0(r,o,n,t),Zn(o,2),Na(o));break}}n=n.return}}function Qh(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new iN;var h=new Set;o.set(n,h)}else h=o.get(n),h===void 0&&(h=new Set,o.set(n,h));h.has(r)||(Ph=!0,h.add(r),t=dN.bind(null,t,n,r),n.then(t,t))}function dN(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,kt===t&&(rt&r)===r&&((Ft===4||Ft===3&&(rt&62914560)===rt&&300>Gt()-_u)&&(pt&2)===0?Do(t,0):Ru|=r,Ao===rt&&(Ao=0)),Na(t)}function lb(t,n){n===0&&(n=gi()),t=vl(t,n),t!==null&&(Zn(t,n),Na(t))}function fN(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),lb(t,r)}function hN(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,h=t.memoizedState;h!==null&&(r=h.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),lb(t,r)}function mN(t,n){return Un(t,n)}var Lo=null,Io=null,Kh=!1,Uu=!1,Zh=!1,qr=0;function Na(t){t!==Io&&t.next===null&&(Io===null?Lo=Io=t:Io=Io.next=t),Uu=!0,Kh||(Kh=!0,gN())}function $s(t,n){if(!Zh&&Uu){Zh=!0;do for(var r=!1,o=Lo;o!==null;){if(t!==0){var h=o.pendingLanes;if(h===0)var p=0;else{var E=o.suspendedLanes,R=o.pingedLanes;p=(1<<31-Vt(42|t)+1)-1,p&=h&~(E&~R),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(r=!0,ub(o,p))}else p=rt,p=mi(o,o===kt?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||pi(o,p)||(r=!0,ub(o,p));o=o.next}while(r);Zh=!1}}function pN(){ob()}function ob(){Uu=Kh=!1;var t=0;qr!==0&&NN()&&(t=qr);for(var n=Gt(),r=null,o=Lo;o!==null;){var h=o.next,p=sb(o,n);p===0?(o.next=null,r===null?Lo=h:r.next=h,h===null&&(Io=r)):(r=o,(t!==0||(p&3)!==0)&&(Uu=!0)),o=h}Bt!==0&&Bt!==5||$s(t),qr!==0&&(qr=0)}function sb(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,h=t.expirationTimes,p=t.pendingLanes&-62914561;0<p;){var E=31-Vt(p),R=1<<E,G=h[E];G===-1?((R&r)===0||(R&o)!==0)&&(h[E]=sl(R,n)):G<=n&&(t.expiredLanes|=R),p&=~R}if(n=kt,r=rt,r=mi(t,t===n?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,r===0||t===n&&(vt===2||vt===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Rt(o),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||pi(t,r)){if(n=r&-r,n===t.callbackPriority)return n;switch(o!==null&&Rt(o),Wn(r)){case 2:case 8:r=ca;break;case 32:r=bn;break;case 268435456:r=ol;break;default:r=bn}return o=cb.bind(null,t),r=Un(r,o),t.callbackPriority=n,t.callbackNode=r,n}return o!==null&&o!==null&&Rt(o),t.callbackPriority=2,t.callbackNode=null,2}function cb(t,n){if(Bt!==0&&Bt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(Hu()&&t.callbackNode!==r)return null;var o=rt;return o=mi(t,t===kt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(X0(t,o,n),sb(t,Gt()),t.callbackNode!=null&&t.callbackNode===r?cb.bind(null,t):null)}function ub(t,n){if(Hu())return null;X0(t,n,!0)}function gN(){AN(function(){(pt&6)!==0?Un(sa,pN):ob()})}function Jh(){if(qr===0){var t=Sl;t===0&&(t=Qi,Qi<<=1,(Qi&261888)===0&&(Qi=256)),qr=t}return qr}function db(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:jn(t)}function vN(t,n,r,o,h){if(n==="submit"&&r&&r.stateNode===h){var p=db((h[$t]||null).action),E=o.submitter;E&&(n=(n=E[$t]||null)?db(n.formAction):E.getAttribute("formAction"),n!==null&&(p=n,E=null));var R=new Uc("action","action",null,o,h);t.push({event:R,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(qr!==0){var G=new FormData(h,E);lh(r,{pending:!0,data:G,method:h.method,action:p},null,G)}}else typeof p=="function"&&(R.preventDefault(),G=new FormData(h,E),lh(r,{pending:!0,data:G,method:h.method,action:p},p,G))},currentTarget:h}]})}}for(var Wh=0;Wh<kf.length;Wh++){var em=kf[Wh],yN=em.toLowerCase(),bN=em[0].toUpperCase()+em.slice(1);Zi(yN,"on"+bN)}Zi(Iv,"onAnimationEnd"),Zi(Bv,"onAnimationIteration"),Zi(Pv,"onAnimationStart"),Zi("dblclick","onDoubleClick"),Zi("focusin","onFocus"),Zi("focusout","onBlur"),Zi(TE,"onTransitionRun"),Zi(AE,"onTransitionStart"),Zi(ME,"onTransitionCancel"),Zi(Hv,"onTransitionEnd"),Le("onMouseEnter",["mouseout","mouseover"]),Le("onMouseLeave",["mouseout","mouseover"]),Le("onPointerEnter",["pointerout","pointerover"]),Le("onPointerLeave",["pointerout","pointerover"]),Te("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Te("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Te("onBeforeInput",["compositionend","keypress","textInput","paste"]),Te("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Te("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Te("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ys="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(" "),xN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ys));function fb(t,n){n=(n&4)!==0;for(var r=0;r<t.length;r++){var o=t[r],h=o.event;o=o.listeners;e:{var p=void 0;if(n)for(var E=o.length-1;0<=E;E--){var R=o[E],G=R.instance,ae=R.currentTarget;if(R=R.listener,G!==p&&h.isPropagationStopped())break e;p=R,h.currentTarget=ae;try{p(h)}catch(de){Vc(de)}h.currentTarget=null,p=G}else for(E=0;E<o.length;E++){if(R=o[E],G=R.instance,ae=R.currentTarget,R=R.listener,G!==p&&h.isPropagationStopped())break e;p=R,h.currentTarget=ae;try{p(h)}catch(de){Vc(de)}h.currentTarget=null,p=G}}}}function nt(t,n){var r=n[cl];r===void 0&&(r=n[cl]=new Set);var o=t+"__bubble";r.has(o)||(hb(n,t,2,!1),r.add(o))}function tm(t,n,r){var o=0;n&&(o|=4),hb(r,t,o,n)}var qu="_reactListening"+Math.random().toString(36).slice(2);function nm(t){if(!t[qu]){t[qu]=!0,Ne.forEach(function(r){r!=="selectionchange"&&(xN.has(r)||tm(r,!1,t),tm(r,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[qu]||(n[qu]=!0,tm("selectionchange",!1,n))}}function hb(t,n,r,o){switch(nx(n)){case 2:var h=fT;break;case 8:h=hT;break;default:h=wm}r=h.bind(null,n,r,t),h=void 0,!ml||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),o?h!==void 0?t.addEventListener(n,r,{capture:!0,passive:h}):t.addEventListener(n,r,!0):h!==void 0?t.addEventListener(n,r,{passive:h}):t.addEventListener(n,r,!1)}function im(t,n,r,o,h){var p=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var E=o.tag;if(E===3||E===4){var R=o.stateNode.containerInfo;if(R===h)break;if(E===4)for(E=o.return;E!==null;){var G=E.tag;if((G===3||G===4)&&E.stateNode.containerInfo===h)return;E=E.return}for(;R!==null;){if(E=ti(R),E===null)return;if(G=E.tag,G===5||G===6||G===26||G===27){o=p=E;continue e}R=R.parentNode}}o=o.return}hl(function(){var ae=p,de=fl(r),ve=[];e:{var te=Uv.get(t);if(te!==void 0){var se=Uc,Ce=t;switch(t){case"keypress":if(Pc(r)===0)break e;case"keydown":case"keyup":se=aE;break;case"focusin":Ce="focus",se=mf;break;case"focusout":Ce="blur",se=mf;break;case"beforeblur":case"afterblur":se=mf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=gv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=YC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=cE;break;case Iv:case Bv:case Pv:se=QC;break;case Hv:se=dE;break;case"scroll":case"scrollend":se=VC;break;case"wheel":se=hE;break;case"copy":case"cut":case"paste":se=ZC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=yv;break;case"submit":se=oE;break;case"toggle":case"beforetoggle":se=pE}var _e=(n&4)!==0,Ze=!_e&&(t==="scroll"||t==="scrollend"),ie=_e?te!==null?te+"Capture":null:te;_e=[];for(var Z=ae,le;Z!==null;){var ge=Z;if(le=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||le===null||ie===null||(ge=Ga(Z,ie),ge!=null&&_e.push(Gs(Z,ge,le))),Ze)break;Z=Z.return}0<_e.length&&(te=new se(te,Ce,null,r,de),ve.push({event:te,listeners:_e}))}}if((n&7)===0){e:{if(se=t==="mouseover"||t==="pointerover",te=t==="mouseout"||t==="pointerout",se&&r!==dl&&(Ce=r.relatedTarget||r.fromElement)&&(ti(Ce)||Ce[xn]))break e;(te||se)&&(Ce=de.window===de?de:(se=de.ownerDocument)?se.defaultView||se.parentWindow:window,te?(se=r.relatedTarget||r.toElement,te=ae,se=se?ti(se):null,se!==null&&(Ze=c(se),_e=se.tag,se!==Ze||_e!==5&&_e!==27&&_e!==6)&&(se=null)):(te=null,se=ae),te!==se&&(_e=gv,ge="onMouseLeave",ie="onMouseEnter",Z="mouse",(t==="pointerout"||t==="pointerover")&&(_e=yv,ge="onPointerLeave",ie="onPointerEnter",Z="pointer"),Ze=te==null?Ce:ue(te),le=se==null?Ce:ue(se),Ce=new _e(ge,Z+"leave",te,r,de),Ce.target=Ze,Ce.relatedTarget=le,ge=null,ti(de)===ae&&(_e=new _e(ie,Z+"enter",se,r,de),_e.target=le,_e.relatedTarget=Ze,ge=_e),Ze=ge,_e=te&&se?D(te,se,jN):null,te!==null&&mb(ve,Ce,te,_e,!1),se!==null&&Ze!==null&&mb(ve,Ze,se,_e,!0)))}e:{if(te=ae?ue(ae):window,se=te.nodeName&&te.nodeName.toLowerCase(),se==="select"||se==="input"&&te.type==="file")var Oe=Ev;else if(kv(te))if(Nv)Oe=CE;else{Oe=SE;var lt=wE}else se=te.nodeName,!se||se.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ae&&ul(ae.elementType)&&(Oe=Ev):Oe=kE;if(Oe&&(Oe=Oe(t,ae))){Cv(ve,Oe,r,de);break e}lt&&lt(t,te,ae)}switch(lt=ae?ue(ae):window,t){case"focusin":(kv(lt)||lt.contentEditable==="true")&&(uo=lt,jf=ae,ws=null);break;case"focusout":ws=jf=uo=null;break;case"mousedown":wf=!0;break;case"contextmenu":case"mouseup":case"dragend":wf=!1,zv(ve,r,de);break;case"selectionchange":if(NE)break;case"keydown":case"keyup":zv(ve,r,de)}var Ie;if(gf)e:{switch(t){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else co?wv(t,r)&&(qe="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(qe="onCompositionStart");qe&&(bv&&r.locale!=="ko"&&(co||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&co&&(Ie=mv()):(Sr=de,df="value"in Sr?Sr.value:Sr.textContent,co=!0)),lt=Fu(ae,qe),0<lt.length&&(qe=new vv(qe,t,null,r,de),ve.push({event:qe,listeners:lt}),Ie?qe.data=Ie:(Ie=Sv(r),Ie!==null&&(qe.data=Ie)))),(Ie=vE?yE(t,r):bE(t,r))&&(qe=Fu(ae,"onBeforeInput"),0<qe.length&&(lt=new vv("onBeforeInput","beforeinput",null,r,de),ve.push({event:lt,listeners:qe}),lt.data=Ie)),vN(ve,t,ae,r,de)}fb(ve,n)})}function Gs(t,n,r){return{instance:t,listener:n,currentTarget:r}}function Fu(t,n){for(var r=n+"Capture",o=[];t!==null;){var h=t,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=Ga(t,r),h!=null&&o.unshift(Gs(t,h,p)),h=Ga(t,n),h!=null&&o.push(Gs(t,h,p))),t.tag===3)return o;t=t.return}return[]}function jN(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function mb(t,n,r,o,h){for(var p=n._reactName,E=[];r!==null&&r!==o;){var R=r,G=R.alternate,ae=R.stateNode;if(R=R.tag,G!==null&&G===o)break;R!==5&&R!==26&&R!==27||ae===null||(G=ae,h?(ae=Ga(r,p),ae!=null&&E.unshift(Gs(r,ae,G))):h||(ae=Ga(r,p),ae!=null&&E.push(Gs(r,ae,G)))),r=r.return}E.length!==0&&t.push({event:n,listeners:E})}var wN=/\r\n?/g,SN=/\u0000|\uFFFD/g;function pb(t){return(typeof t=="string"?t:""+t).replace(wN,`
49
- `).replace(SN,"")}function gb(t,n){return n=pb(n),pb(t)===n}function bt(t,n,r,o,h,p){switch(r){case"children":if(typeof o=="string")n==="body"||n==="textarea"&&o===""||qn(t,o);else if(typeof o=="number"||typeof o=="bigint")n!=="body"&&qn(t,""+o);else return;break;case"className":vi(t,"class",o);break;case"tabIndex":vi(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":vi(t,r,o);break;case"style":bi(t,o,p);return;case"data":if(n!=="object"){vi(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||r!=="href")){t.removeAttribute(r);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(r);break}o=jn(o),t.setAttribute(r,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(r,"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 p=="function"&&(r==="formAction"?(n!=="input"&&bt(t,n,"name",h.name,h,null),bt(t,n,"formEncType",h.formEncType,h,null),bt(t,n,"formMethod",h.formMethod,h,null),bt(t,n,"formTarget",h.formTarget,h,null)):(bt(t,n,"encType",h.encType,h,null),bt(t,n,"method",h.method,h,null),bt(t,n,"target",h.target,h,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(r);break}o=jn(o),t.setAttribute(r,o);break;case"onClick":o!=null&&(t.onclick=Fn);return;case"onScroll":o!=null&&nt("scroll",t);return;case"onScrollEnd":o!=null&&nt("scrollend",t);return;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(r=o.__html,r!=null){if(h.children!=null)throw Error(l(60));(p!=null?p.__html:void 0)!==r&&(t.innerHTML=r)}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}r=jn(o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(r,o):t.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(r,""):t.removeAttribute(r);break;case"capture":case"download":o===!0?t.setAttribute(r,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(r,o):t.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(r,o):t.removeAttribute(r);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(r):t.setAttribute(r,o);break;case"popover":nt("beforetoggle",t),nt("toggle",t),It(t,"popover",o);break;case"xlinkActuate":Xt(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Xt(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Xt(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Xt(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Xt(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Xt(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Xt(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Xt(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Xt(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":It(t,"is",o);break;case"innerText":case"textContent":return;default:if(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")r=hs.get(r)||r,It(t,r,o);else return}Pe=!0}function am(t,n,r,o,h,p){switch(r){case"style":bi(t,o,p);return;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(r=o.__html,r!=null){if(h.children!=null)throw Error(l(60));(p!=null?p.__html:void 0)!==r&&(t.innerHTML=r)}}break;case"children":if(typeof o=="string")qn(t,o);else if(typeof o=="number"||typeof o=="bigint")qn(t,""+o);else return;break;case"onScroll":o!=null&&nt("scroll",t);return;case"onScrollEnd":o!=null&&nt("scrollend",t);return;case"onClick":o!=null&&(t.onclick=Fn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Se.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(h=r.endsWith("Capture"),p=r.slice(2,h?r.length-7:void 0),n=t[$t]||null,n=n!=null?n[r]:null,typeof n=="function"&&t.removeEventListener(p,n,h),typeof o=="function")){typeof n!="function"&&n!==null&&(r in t?t[r]=null:t.hasAttribute(r)&&t.removeAttribute(r)),t.addEventListener(p,o,h);break e}Pe=!0,r in t?t[r]=o:o===!0?t.setAttribute(r,""):It(t,r,o)}return}Pe=!0}function Nn(t,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",t),nt("load",t);var o=!1,h=!1,p;for(p in r)if(r.hasOwnProperty(p)){var E=r[p];if(E!=null)switch(p){case"src":o=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:bt(t,n,p,E,r,null)}}h&&bt(t,n,"srcSet",r.srcSet,r,null),o&&bt(t,n,"src",r.src,r,null);return;case"input":nt("invalid",t);var R=p=E=h=null,G=null,ae=null;for(o in r)if(r.hasOwnProperty(o)){var de=r[o];if(de!=null)switch(o){case"name":h=de;break;case"type":E=de;break;case"checked":G=de;break;case"defaultChecked":ae=de;break;case"value":p=de;break;case"defaultValue":R=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(l(137,n));break;default:bt(t,n,o,de,r,null)}}jr(t,p,R,G,ae,E,h,!1);return;case"select":nt("invalid",t),o=E=p=null;for(h in r)if(r.hasOwnProperty(h)&&(R=r[h],R!=null))switch(h){case"value":p=R;break;case"defaultValue":E=R;break;case"multiple":o=R;default:bt(t,n,h,R,r,null)}n=p,r=E,t.multiple=!!o,n!=null?ni(t,!!o,n,!1):r!=null&&ni(t,!!o,r,!0);return;case"textarea":nt("invalid",t),p=h=o=null;for(E in r)if(r.hasOwnProperty(E)&&(R=r[E],R!=null))switch(E){case"value":o=R;break;case"defaultValue":h=R;break;case"children":p=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(l(91));break;default:bt(t,n,E,R,r,null)}yi(t,o,h,p);return;case"option":for(G in r)if(r.hasOwnProperty(G)&&(o=r[G],o!=null))switch(G){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:bt(t,n,G,o,r,null)}return;case"dialog":nt("beforetoggle",t),nt("toggle",t),nt("cancel",t),nt("close",t);break;case"iframe":case"object":nt("load",t);break;case"video":case"audio":for(o=0;o<Ys.length;o++)nt(Ys[o],t);break;case"image":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"embed":case"source":case"link":nt("error",t),nt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in r)if(r.hasOwnProperty(ae)&&(o=r[ae],o!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:bt(t,n,ae,o,r,null)}return;default:if(ul(n)){for(de in r)r.hasOwnProperty(de)&&(o=r[de],o!==void 0&&am(t,n,de,o,r,void 0));return}}for(R in r)r.hasOwnProperty(R)&&(o=r[R],o!=null&&bt(t,n,R,o,r,null))}var kN={};function CN(t,n,r,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,E=null,R=null,G=null,ae=null,de=null;for(se in r){var ve=r[se];if(r.hasOwnProperty(se)&&ve!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":G=ve;default:o.hasOwnProperty(se)||bt(t,n,se,null,o,ve)}}for(var te in o){var se=o[te];if(ve=r[te],o.hasOwnProperty(te)&&(se!=null||ve!=null))switch(te){case"type":se!==ve&&(Pe=!0),p=se;break;case"name":se!==ve&&(Pe=!0),h=se;break;case"checked":se!==ve&&(Pe=!0),ae=se;break;case"defaultChecked":se!==ve&&(Pe=!0),de=se;break;case"value":se!==ve&&(Pe=!0),E=se;break;case"defaultValue":se!==ve&&(Pe=!0),R=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(l(137,n));break;default:se!==ve&&bt(t,n,te,se,o,ve)}}Dn(t,E,R,G,ae,de,p,h);return;case"select":se=E=R=te=null;for(p in r)if(G=r[p],r.hasOwnProperty(p)&&G!=null)switch(p){case"value":break;case"multiple":se=G;default:o.hasOwnProperty(p)||bt(t,n,p,null,o,G)}for(h in o)if(p=o[h],G=r[h],o.hasOwnProperty(h)&&(p!=null||G!=null))switch(h){case"value":p!==G&&(Pe=!0),te=p;break;case"defaultValue":p!==G&&(Pe=!0),R=p;break;case"multiple":p!==G&&(Pe=!0),E=p;default:p!==G&&bt(t,n,h,p,o,G)}n=R,r=E,o=se,te!=null?ni(t,!!r,te,!1):!!o!=!!r&&(n!=null?ni(t,!!r,n,!0):ni(t,!!r,r?[]:"",!1));return;case"textarea":se=te=null;for(R in r)if(h=r[R],r.hasOwnProperty(R)&&h!=null&&!o.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:bt(t,n,R,null,o,h)}for(E in o)if(h=o[E],p=r[E],o.hasOwnProperty(E)&&(h!=null||p!=null))switch(E){case"value":h!==p&&(Pe=!0),te=h;break;case"defaultValue":h!==p&&(Pe=!0),se=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(l(91));break;default:h!==p&&bt(t,n,E,h,o,p)}so(t,te,se);return;case"option":for(var Ce in r)if(te=r[Ce],r.hasOwnProperty(Ce)&&te!=null&&!o.hasOwnProperty(Ce))switch(Ce){case"selected":t.selected=!1;break;default:bt(t,n,Ce,null,o,te)}for(G in o)if(te=o[G],se=r[G],o.hasOwnProperty(G)&&te!==se&&(te!=null||se!=null))switch(G){case"selected":te!==se&&(Pe=!0),t.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:bt(t,n,G,te,o,se)}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 _e in r)te=r[_e],r.hasOwnProperty(_e)&&te!=null&&!o.hasOwnProperty(_e)&&bt(t,n,_e,null,o,te);for(ae in o)if(te=o[ae],se=r[ae],o.hasOwnProperty(ae)&&te!==se&&(te!=null||se!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(l(137,n));break;default:bt(t,n,ae,te,o,se)}return;default:if(ul(n)){for(var Ze in r)te=r[Ze],r.hasOwnProperty(Ze)&&te!==void 0&&!o.hasOwnProperty(Ze)&&am(t,n,Ze,void 0,o,te);for(de in o)te=o[de],se=r[de],!o.hasOwnProperty(de)||te===se||te===void 0&&se===void 0||am(t,n,de,te,o,se);return}}for(var ie in r)te=r[ie],r.hasOwnProperty(ie)&&te!=null&&!o.hasOwnProperty(ie)&&bt(t,n,ie,null,o,te);for(ve in o)te=o[ve],se=r[ve],!o.hasOwnProperty(ve)||te===se||te==null&&se==null||bt(t,n,ve,te,o,se)}function vb(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function EN(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,r=performance.getEntriesByType("resource"),o=0;o<r.length;o++){var h=r[o],p=h.transferSize,E=h.initiatorType,R=h.duration;if(p&&R&&vb(E)){for(E=0,R=h.responseEnd,o+=1;o<r.length;o++){var G=r[o],ae=G.startTime;if(ae>R)break;var de=G.transferSize,ve=G.initiatorType;de&&vb(ve)&&(G=G.responseEnd,E+=de*(G<R?1:(R-ae)/(G-ae)))}if(--o,n+=8*(p+E)/(h.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var rm=null,lm=null;function Xs(t){return t.nodeType===9?t:t.ownerDocument}function yb(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function bb(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function xb(t,n,r,o){return r=Xs(r).createElement(t),r[Mt]=o,r[$t]=n,Nn(r,t,n),K(r),r}function om(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var sm=null;function NN(){var t=window.event;return t&&t.type==="popstate"?t===sm?!1:(sm=t,!0):(sm=null,!1)}var cm=typeof setTimeout=="function"?setTimeout:void 0,TN=typeof clearTimeout=="function"?clearTimeout:void 0,jb=typeof Promise=="function"?Promise:void 0,wb=typeof requestAnimationFrame=="function"?requestAnimationFrame:cm,AN=typeof queueMicrotask=="function"?queueMicrotask:typeof jb<"u"?function(t){return jb.resolve(null).then(t).catch(MN)}:cm;function MN(t){setTimeout(function(){throw t})}function Fr(t){return t==="head"}function Sb(t,n){var r=n,o=0;do{var h=r.nextSibling;if(t.removeChild(r),h&&h.nodeType===8)if(r=h.data,r==="/$"||r==="/&"){if(o===0){t.removeChild(h),Vo(n);return}o--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")o++;else if(r==="html")vm(t.ownerDocument.documentElement);else if(r==="head"){r=t.ownerDocument.head,vm(r);for(var p=r.firstChild;p;){var E=p.nextSibling,R=p.nodeName;p[ga]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&p.rel.toLowerCase()==="stylesheet"||r.removeChild(p),p=E}}else r==="body"&&vm(t.ownerDocument.body);r=h}while(r);Vo(n)}function kb(t,n){var r=t;t=0;do{var o=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(t===0)break;t--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||t++;r=o}while(r)}function Cb(t,n,r){if(n=CSS.escape(n)!==n?"r-"+btoa(n).replace(/=/g,""):n,t.style.viewTransitionName=n,r!=null&&(t.style.viewTransitionClass=r),r=getComputedStyle(t),r.display==="inline"){if(n=t.getClientRects(),n.length===1)var o=1;else for(var h=o=0;h<n.length;h++){var p=n[h];0<p.width&&0<p.height&&o++}o===1&&(t=t.style,t.display=n.length===1?"inline-block":"block",t.marginTop="-"+r.paddingTop,t.marginBottom="-"+r.paddingBottom)}}function Eb(t,n){t=t.style,n=n.style;var r=n!=null?n.hasOwnProperty("viewTransitionName")?n.viewTransitionName:n.hasOwnProperty("view-transition-name")?n["view-transition-name"]:null:null;t.viewTransitionName=r==null||typeof r=="boolean"?"":(""+r).trim(),r=n!=null?n.hasOwnProperty("viewTransitionClass")?n.viewTransitionClass:n.hasOwnProperty("view-transition-class")?n["view-transition-class"]:null:null,t.viewTransitionClass=r==null||typeof r=="boolean"?"":(""+r).trim(),t.display==="inline-block"&&(n==null?t.display=t.margin="":(r=n.display,t.display=r==null||typeof r=="boolean"?"":r,r=n.margin,r!=null?t.margin=r:(r=n.hasOwnProperty("marginTop")?n.marginTop:n["margin-top"],t.marginTop=r==null||typeof r=="boolean"?"":r,n=n.hasOwnProperty("marginBottom")?n.marginBottom:n["margin-bottom"],t.marginBottom=n==null||typeof n=="boolean"?"":n)))}function ON(t,n,r){return r=r.ownerDocument.defaultView,{rect:t,abs:n.position==="absolute"||n.position==="fixed",clip:n.clipPath!=="none"||n.overflow!=="visible"||n.filter!=="none"||n.mask!=="none"||n.mask!=="none"||n.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=r.innerHeight&&t.left<=r.innerWidth}}function um(t){var n=t.getBoundingClientRect(),r=getComputedStyle(t);return ON(n,r,t)}function RN(t){return t.documentElement.clientHeight}function _N(t){this.addEventListener("load",t),this.addEventListener("error",t)}function DN(t,n,r,o,h,p,E,R,G){var ae=n.nodeType===9?n:n.ownerDocument;try{var de=ae.startViewTransition({update:function(){var te=ae.defaultView,se=te.navigation&&te.navigation.transition,Ce=ae.fonts.status;o();var _e=[];if(Ce==="loaded"&&(RN(ae),ae.fonts.status==="loading"&&_e.push(ae.fonts.ready)),Ce=_e.length,t!==null)for(var Ze=t.suspenseyImages,ie=0,Z=0;Z<Ze.length;Z++){var le=Ze[Z];if(!le.complete){var ge=le.getBoundingClientRect();if(0<ge.bottom&&0<ge.right&&ge.top<te.innerHeight&&ge.left<te.innerWidth){if(ie+=Gb(le),ie>Yu){_e.length=Ce;break}le=new Promise(_N.bind(le)),_e.push(le)}}}if(0<_e.length)return te=Promise.race([Promise.all(_e),new Promise(function(Oe){return setTimeout(Oe,500)})]).then(h,h),(se?Promise.allSettled([se.finished,te]):te).then(p,p);if(h(),se)return se.finished.then(p,p);p()},types:r});ae.__reactViewTransition=de;var ve=[];return de.ready.then(function(){for(var te=ae.documentElement.getAnimations({subtree:!0}),se=0;se<te.length;se++){var Ce=te[se],_e=Ce.effect,Ze=_e.pseudoElement;if(Ze!=null&&Ze.startsWith("::view-transition")){ve.push(Ce),Ce=_e.getKeyframes();for(var ie=Ze=void 0,Z=!0,le=0;le<Ce.length;le++){var ge=Ce[le],Oe=ge.width;if(Ze===void 0)Ze=Oe;else if(Ze!==Oe){Z=!1;break}if(Oe=ge.height,ie===void 0)ie=Oe;else if(ie!==Oe){Z=!1;break}delete ge.width,delete ge.height,ge.transform==="none"&&delete ge.transform}Z&&Ze!==void 0&&ie!==void 0&&(_e.setKeyframes(Ce),Z=getComputedStyle(_e.target,_e.pseudoElement),Z.width!==Ze||Z.height!==ie)&&(Z=Ce[0],Z.width=Ze,Z.height=ie,Z=Ce[Ce.length-1],Z.width=Ze,Z.height=ie,_e.setKeyframes(Ce))}}E()},function(te){ae.__reactViewTransition===de&&(ae.__reactViewTransition=null);try{if(typeof te=="object"&&te!==null)switch(te.name){case"InvalidStateError":(te.message==="View transition was skipped because document visibility state is hidden."||te.message==="Skipping view transition because document visibility state has become hidden."||te.message==="Skipping view transition because viewport size changed."||te.message==="Transition was aborted because of invalid state")&&(te=null)}te!==null&&G(te)}finally{o(),h(),E()}}),de.finished.finally(function(){for(var te=0;te<ve.length;te++)ve[te].cancel();ae.__reactViewTransition===de&&(ae.__reactViewTransition=null),R()}),de}catch{return o(),h(),E(),null}}function Dl(t,n){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+n+")"}Dl.prototype.animate=function(t,n){return n=typeof n=="number"?{duration:n}:B({},n),n.pseudoElement=this._selector,this._scope.animate(t,n)},Dl.prototype.getAnimations=function(){for(var t=this._scope,n=this._selector,r=t.getAnimations({subtree:!0}),o=[],h=0;h<r.length;h++){var p=r[h].effect;p!==null&&p.target===t&&p.pseudoElement===n&&o.push(r[h])}return o},Dl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Nb(t){return{name:t,group:new Dl("group",t),imagePair:new Dl("image-pair",t),old:new Dl("old",t),new:new Dl("new",t)}}function Ni(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}Ni.prototype.addEventListener=function(t,n,r){var o=null,h=null;if(!(r!=null&&typeof r!="boolean"&&(o=r.signal||null,o!==null&&o.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var p=this._eventListeners;if(Ab(p,t,n,r)===-1){var E=this,R=n;r!=null&&typeof r!="boolean"&&r.once===!0&&(R=function(G){E.removeEventListener(t,n,r),typeof n=="function"?n.call(this,G):n.handleEvent(G)}),o!==null&&(h=E.removeEventListener.bind(E,t,n,r),o.addEventListener("abort",h,{once:!0}),h=o.removeEventListener.bind(o,"abort",h)),o=Bo(r),p.push({type:t,listener:n,optionsOrUseCapture:r,attachedListener:R,cleanup:h}),g(this._fragmentFiber.child,!1,zN,t,R,o)}this._eventListeners=p}};function zN(t,n,r,o){return C(t).addEventListener(n,r,o),!1}Ni.prototype.removeEventListener=function(t,n,r){var o=this._eventListeners;if(o!==null&&(n=Ab(o,t,n,r),n!==-1)){var h=o[n];r=h.attachedListener;var p=h.cleanup;h=Bo(h.optionsOrUseCapture),g(this._fragmentFiber.child,!1,LN,t,r,h),o.splice(n,1),p!==null&&p()}};function LN(t,n,r,o){return C(t).removeEventListener(n,r,o),!1}function Bo(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function Tb(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function Ab(t,n,r,o){if(t.length===0)return-1;o=Tb(o);for(var h=0;h<t.length;h++){var p=t[h];if(p.type===n&&p.listener===r&&Tb(p.optionsOrUseCapture)===o)return h}return-1}Ni.prototype.dispatchEvent=function(t){var n=b(this._fragmentFiber);if(n===null)return!0;n=C(n);var r=this._eventListeners;if(r!==null&&0<r.length||!t.bubbles){var o=n.nodeType===9?n.createComment(""):document.createTextNode("");if(r)for(var h=0;h<r.length;h++){var p=r[h];o.addEventListener(p.type,p.attachedListener,Bo(p.optionsOrUseCapture))}if(n.appendChild(o),t=o.dispatchEvent(t),r)for(h=0;h<r.length;h++)p=r[h],o.removeEventListener(p.type,p.attachedListener,Bo(p.optionsOrUseCapture));return n.removeChild(o),t}return n.dispatchEvent(t)},Ni.prototype.focus=function(t){g(this._fragmentFiber.child,!0,Mb,t,void 0,void 0)};function Mb(t,n){return t.tag===6?!1:(t=C(t),XN(t,n))}Ni.prototype.focusLast=function(t){var n=[];g(this._fragmentFiber.child,!0,dm,n,void 0,void 0);for(var r=n.length-1;0<=r&&!Mb(n[r],t);r--);};function dm(t,n){return n.push(t),!1}Ni.prototype.blur=function(){var t=b(this._fragmentFiber);t!==null&&(t=C(t),t=Xs(t).activeElement,t!==null&&g(this._fragmentFiber.child,!1,IN,t,void 0,void 0))};function IN(t,n){return t.tag===6?!1:(t=C(t),t===n||t.contains(n)?(n.blur(),!0):!1)}Ni.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),g(this._fragmentFiber.child,!1,BN,t,void 0,void 0)};function BN(t,n){return t.tag===6||(t=C(t),n.observe(t)),!1}Ni.prototype.unobserveUsing=function(t){var n=this._observers;if(n!==null&&n.has(t)){n.delete(t),g(this._fragmentFiber.child,!1,PN,t,void 0,void 0);for(var r=n=0;r<na.length;r++){var o=na[r];o.fragmentInstance===this&&o.observer===t?t.unobserve(o.instance):na[n++]=o}na.length=n}};function PN(t,n){return t.tag===6||(t=C(t),n.unobserve(t)),!1}var na=[],fm=!1;function HN(t,n,r){na.push({fragmentInstance:t,observer:n,instance:r}),fm||(fm=!0,QN(function(){fm=!1;var o=na;na=[];for(var h=0;h<o.length;h++){var p=o[h];p.observer.unobserve(p.instance)}}))}Ni.prototype.getClientRects=function(){var t=[];return g(this._fragmentFiber.child,!1,UN,t,void 0,void 0),t};function UN(t,n){if(t.tag===6){t=t.stateNode;var r=t.ownerDocument.createRange();r.selectNodeContents(t),n.push.apply(n,r.getClientRects())}else t=C(t),n.push.apply(n,t.getClientRects());return!1}Ni.prototype.getRootNode=function(t){var n=b(this._fragmentFiber);return n===null?this:C(n).getRootNode(t)},Ni.prototype.compareDocumentPosition=function(t){var n=b(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var r=[];g(this._fragmentFiber.child,!1,dm,r,void 0,void 0);var o=C(n);if(r.length===0){if(r=o,x(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(r=n)}n=this._fragmentFiber;var h=o=r.compareDocumentPosition(t);return r===t?h=Node.DOCUMENT_POSITION_CONTAINS:o&Node.DOCUMENT_POSITION_CONTAINED_BY&&(r=w(n)[1],r===null?h=Node.DOCUMENT_POSITION_PRECEDING:(t=C(r).compareDocumentPosition(t),h=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),h|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=C(r[0]),h=C(r[r.length-1]);var p=x(this._fragmentFiber)?n.parentElement:o;if(p==null)return Node.DOCUMENT_POSITION_DISCONNECTED;o=p.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,p=p.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_CONTAINED_BY;var E=n.compareDocumentPosition(t),R=h.compareDocumentPosition(t),G=E&Node.DOCUMENT_POSITION_CONTAINED_BY||R&Node.DOCUMENT_POSITION_CONTAINED_BY;return R=o&&p&&E&Node.DOCUMENT_POSITION_FOLLOWING&&R&Node.DOCUMENT_POSITION_PRECEDING,n=o&&n===t||p&&h===t||G||R?Node.DOCUMENT_POSITION_CONTAINED_BY:!o&&n===t||!p&&h===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:E,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||qN(n,this._fragmentFiber,r[0],r[r.length-1],t)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function qN(t,n,r,o,h){var p=ti(h);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(r=!!p)e:{for(;p!==null;){if(p.tag===7&&(p===n||p.alternate===n)){r=!0;break e}p=p.return}r=!1}return r}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(p===null)return p=h.ownerDocument,h===p||h===p.documentElement||h===p.body;e:{for(p=n,n=b(n);p!==null;){if(!(p.tag!==5&&p.tag!==3&&p.tag!==27||p!==n&&p.alternate!==n)){p=!0;break e}p=p.return}p=!1}return p}return t&Node.DOCUMENT_POSITION_PRECEDING?((n=!!p)&&!(n=p===r)&&(n=D(r,p,I),n===null?n=!1:(g(n,!0,T,p,r),p=N,N=null,n=p!==null)),n):t&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!p)&&!(n=p===o)&&(n=D(o,p,I),n===null?n=!1:(g(n,!0,A,p,o),p=N,M=N=null,n=p!==null)),n):!1}function Ob(t,n){var r=t.ownerDocument.createRange();r.selectNodeContents(t),t=r.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,n?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}Ni.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(l(566));var n=[];g(this._fragmentFiber.child,!1,dm,n,void 0,void 0);var r=t!==!1;if(n.length===0){var o=w(this._fragmentFiber);if(o=r?o[1]||o[0]||b(this._fragmentFiber):o[0]||o[1],o===null)return;if(o.tag===6){t=C(o),Ob(t,r);return}if(o=C(o),o.nodeType!==9){if(o.nodeType===11){r="host"in o?o.host:null,r!==null&&r.scrollIntoView(t);return}o.scrollIntoView(t)}}for(o=r?n.length-1:0;o!==(r?-1:n.length);){var h=n[o];h.tag===6?(h=C(h),Ob(h,r)):C(h).scrollIntoView(t),o+=r?-1:1}};function FN(t,n){return t=C(t),Rb(t,n),!1}function Rb(t,n){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(n)}function _b(t,n){var r=n._eventListeners;if(r!==null)for(var o=0;o<r.length;o++){var h=r[o];t.addEventListener(h.type,h.attachedListener,Bo(h.optionsOrUseCapture))}t.nodeType!==3&&(r=n._observers,r!==null&&r.forEach(function(p){for(var E=0,R=0;R<na.length;R++){var G=na[R];(G.fragmentInstance!==n||G.observer!==p||G.instance!==t)&&(na[E++]=G)}na.length=E,p.observe(t)}),Rb(t,n))}function VN(t,n){var r=n._eventListeners;if(r!==null)for(var o=0;o<r.length;o++){var h=r[o];t.removeEventListener(h.type,h.attachedListener,Bo(h.optionsOrUseCapture))}t.nodeType!==3&&(r=n._observers,r!==null&&r.forEach(function(p){typeof p.rootMargin=="string"?HN(n,p,t):p.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(n))}function hm(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":hm(r),$a(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function $N(t,n,r,o){for(;t.nodeType===1;){var h=r;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[ga])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(p=t.getAttribute("rel"),p==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(p!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(p=t.getAttribute("src"),(p!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===p)return t}else return t;if(t=Pi(t.nextSibling),t===null)break}return null}function YN(t,n,r){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Pi(t.nextSibling),t===null))return null;return t}function Db(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Pi(t.nextSibling),t===null))return null;return t}function mm(t){return t.data==="$?"||t.data==="$~"}function pm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function GN(t,n){var r=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||r.readyState!=="loading")n();else{var o=function(){n(),r.removeEventListener("DOMContentLoaded",o)};r.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function Pi(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var gm=null;function zb(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"||r==="/&"){if(n===0)return Pi(t.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}t=t.nextSibling}return null}function Lb(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return t;n--}else r!=="/$"&&r!=="/&"||n++}t=t.previousSibling}return null}function XN(t,n){function r(){o=!0}if(t.ownerDocument.activeElement===t)return!0;var o=!1;try{t.ownerDocument.addEventListener("focus",r,!0),(t.focus||HTMLElement.prototype.focus).call(t,n)}finally{t.ownerDocument.removeEventListener("focus",r,!0)}return o}function QN(t){wb(function(){wb(function(n){return t(n)})})}function Ib(t,n,r){switch(n=Xs(r),t){case"html":if(t=n.documentElement,!t)throw Error(l(452));return t;case"head":if(t=n.head,!t)throw Error(l(453));return t;case"body":if(t=n.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Bb(t,n,r){for(var o in r){var h=r[o];r.hasOwnProperty(o)&&h!=null&&bt(t,n,o,null,kN,h)}r.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Fn&&(t.onclick=null),$a(t)}function vm(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);$a(t)}var Hi=new Map,Pb=new Set;function Qs(t){if(typeof t.getRootNode=="function"){var n=t.getRootNode();if(n.nodeType===9||n.nodeType===11)return n}return t.nodeType===9?t:t.ownerDocument}var rr=me.d;me.d={f:KN,r:ZN,D:JN,C:WN,L:eT,m:tT,X:iT,S:nT,M:aT};function KN(){var t=rr.f(),n=Iu();return t||n}function ZN(t){var n=va(t);n!==null&&n.tag===5&&n.type==="form"?Uy(n):rr.r(t)}var Po=typeof document>"u"?null:document;function Hb(t,n,r){var o=Po;if(o&&typeof n=="string"&&n){var h=Ot(n);h='link[rel="'+t+'"][href="'+h+'"]',typeof r=="string"&&(h+='[crossorigin="'+r+'"]'),Pb.has(h)||(Pb.add(h),t={rel:t,crossOrigin:r,href:n},o.querySelector(h)===null&&(n=o.createElement("link"),Nn(n,"link",t),K(n),o.head.appendChild(n)))}}function JN(t){rr.D(t),Hb("dns-prefetch",t,null)}function WN(t,n){rr.C(t,n),Hb("preconnect",t,n)}function eT(t,n,r){rr.L(t,n,r);var o=Po;if(o&&t&&n){var h='link[rel="preload"][as="'+Ot(n)+'"]';n==="image"&&r&&r.imageSrcSet?(h+='[imagesrcset="'+Ot(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(h+='[imagesizes="'+Ot(r.imageSizes)+'"]')):h+='[href="'+Ot(t)+'"]';var p=h;switch(n){case"style":p=Ho(t);break;case"script":p=Uo(t)}if(!(Hi.has(p)||(t=B({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),Hi.set(p,t),o.querySelector(h)!==null||n==="style"&&o.querySelector(Ks(p))||n==="script"&&o.querySelector(Zs(p))))){var E=o.createElement("link");Nn(E,"link",t),n==="style"&&(E[Va]=!0,E.onload=E.onerror=function(){he(E)}),K(E),o.head.appendChild(E)}}}function tT(t,n){rr.m(t,n);var r=Po;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+Ot(o)+'"][href="'+Ot(t)+'"]',p=h;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Uo(t)}if(!Hi.has(p)&&(t=B({rel:"modulepreload",href:t},n),Hi.set(p,t),r.querySelector(h)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Zs(p)))return}o=r.createElement("link"),Nn(o,"link",t),K(o),r.head.appendChild(o)}}}function nT(t,n,r){rr.S(t,n,r);var o=Po;if(o&&t){var h=L(o).hoistableStyles,p=Ho(t);n=n||"default";var E=h.get(p);if(!E){var R={loading:0,preload:null};if(E=o.querySelector(Ks(p)))R.loading=5;else{t=B({rel:"stylesheet",href:t,"data-precedence":n},r),(r=Hi.get(p))&&ym(t,r);var G=E=o.createElement("link");K(G),Nn(G,"link",t),G._p=new Promise(function(ae,de){G.onload=ae,G.onerror=de}),G.addEventListener("load",function(){R.loading|=1}),G.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Vu(E,n,o)}E={type:"stylesheet",instance:E,count:1,state:R},h.set(p,E)}}}function iT(t,n){rr.X(t,n);var r=Po;if(r&&t){var o=L(r).hoistableScripts,h=Uo(t),p=o.get(h);p||(p=r.querySelector(Zs(h)),p||(t=B({src:t,async:!0},n),(n=Hi.get(h))&&bm(t,n),p=r.createElement("script"),K(p),Nn(p,"link",t),r.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(h,p))}}function aT(t,n){rr.M(t,n);var r=Po;if(r&&t){var o=L(r).hoistableScripts,h=Uo(t),p=o.get(h);p||(p=r.querySelector(Zs(h)),p||(t=B({src:t,async:!0,type:"module"},n),(n=Hi.get(h))&&bm(t,n),p=r.createElement("script"),K(p),Nn(p,"link",t),r.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(h,p))}}function Ub(t,n,r,o){var h=(h=vn.current)?Qs(h):null;if(!h)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(r=Ho(r.href),n=L(h).hoistableStyles,o=n.get(r),o||(o={type:"style",instance:null,count:0,state:null},n.set(r,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Ho(r.href);var p=L(h).hoistableStyles,E=p.get(t);if(E||(h=h.ownerDocument||h,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,E),(p=h.querySelector(Ks(t)))?p._p||(E.instance=p,E.state.loading=5):(p=Hi.get(t),p||(p={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Hi.set(t,p)),rT(h,t,p,E.state))),n&&o===null)throw Error(l(528,""));return E}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(r=Uo(r),n=L(h).hoistableScripts,o=n.get(r),o||(o={type:"script",instance:null,count:0,state:null},n.set(r,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Ho(t){return'href="'+Ot(t)+'"'}function Ks(t){return'link[rel="stylesheet"]['+t+"]"}function qb(t){return B({},t,{"data-precedence":t.precedence,precedence:null})}function rT(t,n,r,o){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[Va]!==!0){o.loading=1;return}}else n=t.createElement("link"),n[Va]=!0,n.onload=n.onerror=he.bind(null,n),Nn(n,"link",r),K(n),t.head.appendChild(n);o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2})}function Uo(t){return'[src="'+Ot(t)+'"]'}function Zs(t){return"script[async]"+t}function Fb(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Ot(r.href)+'"]');if(o)return n.instance=o,K(o),o;var h=B({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),K(o),Nn(o,"style",h),Vu(o,r.precedence,t),n.instance=o;case"stylesheet":h=Ho(r.href);var p=t.querySelector(Ks(h));if(p)return n.state.loading|=4,n.instance=p,K(p),p;o=qb(r),(h=Hi.get(h))&&ym(o,h),p=(t.ownerDocument||t).createElement("link"),K(p);var E=p;return E._p=new Promise(function(R,G){E.onload=R,E.onerror=G}),Nn(p,"link",o),n.state.loading|=4,Vu(p,r.precedence,t),n.instance=p;case"script":return p=Uo(r.src),(h=t.querySelector(Zs(p)))?(n.instance=h,K(h),h):(o=r,(h=Hi.get(p))&&(o=B({},r),bm(o,h)),t=t.ownerDocument||t,h=t.createElement("script"),K(h),Nn(h,"link",o),t.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Vu(o,r.precedence,t));return n.instance}function Vu(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=o.length?o[o.length-1]:null,p=h,E=0;E<o.length;E++){var R=o[E];if(R.dataset.precedence===n)p=R;else if(p!==h)break}p?p.parentNode.insertBefore(t,p.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(t,n.firstChild))}function ym(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function bm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var $u=null;function Vb(t,n,r){if($u===null){var o=new Map,h=$u=new Map;h.set(r,o)}else h=$u,o=h.get(r),o||(o=new Map,h.set(r,o));if(o.has(t))return o;for(o.set(t,null),r=r.getElementsByTagName(t),h=0;h<r.length;h++){var p=r[h];if(!(p[ga]||p[Mt]||t==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var E=p.getAttribute(n)||"";E=t+E;var R=o.get(E);R?R.push(p):o.set(E,[p])}}return o}function xm(t,n,r){t=t.ownerDocument||t,t.head.insertBefore(r,n==="title"?t.querySelector("head > title"):null)}function lT(t,n,r){if(r===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function $b(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Yb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Gb(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Xb(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=Gb(n),t.suspenseyImages.push(n)),t=cT.bind(t),n.decode().then(t,t))}function oT(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var h=Ho(o.href),p=n.querySelector(Ks(h));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Js.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=p,K(p);return}p=n.ownerDocument||n,o=qb(o),(h=Hi.get(h))&&ym(o,h),p=p.createElement("link"),K(p);var E=p;E._p=new Promise(function(R,G){E.onload=R,E.onerror=G}),Nn(p,"link",o),r.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=Js.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var Yu=0;function sT(t,n){return t.stylesheets&&t.count===0&&Xu(t,t.stylesheets),0<t.count||0<t.imgCount?function(r){var o=setTimeout(function(){if(t.stylesheets&&Xu(t,t.stylesheets),t.unsuspend){var p=t.unsuspend;t.unsuspend=null,p()}},6e4+n);0<t.imgBytes&&Yu===0&&(Yu=62500*EN());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Xu(t,t.stylesheets),t.unsuspend)){var p=t.unsuspend;t.unsuspend=null,p()}},(t.imgBytes>Yu?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(h)}}:null}function Qb(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)Xu(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function Js(){this.count--,Qb(this)}function cT(){this.imgCount--,Qb(this)}var Gu=null;function Xu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Gu=new Map,n.forEach(uT,t),Gu=null,Js.call(t))}function uT(t,n){if(!(n.state.loading&4)){var r=Gu.get(t);if(r)var o=r.get(null);else{r=new Map,Gu.set(t,r);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var E=h[p];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(r.set(E.dataset.precedence,E),o=E)}o&&r.set(null,o)}h=n.instance,E=h.getAttribute("data-precedence"),p=r.get(E)||o,p===o&&r.set(null,h),r.set(E,h),this.count++,o=Js.bind(this),h.addEventListener("load",o),h.addEventListener("error",o),p?p.parentNode.insertBefore(h,p.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),n.state.loading|=4}}var qo={$$typeof:U,Provider:null,Consumer:null,_currentValue:Ee,_currentValue2:Ee,_threadCount:0};function dT(t,n,r,o,h,p,E,R,G){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yr(0),this.hiddenUpdates=yr(null),this.identifierPrefix=o,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.transitionTypes=null,this.incompleteTransitions=new Map}function Kb(t,n,r,o,h,p,E,R,G,ae,de,ve){return t=new dT(t,n,r,E,G,ae,de,ve,R),n=1,p===!0&&(n|=24),p=ii(3,null,null,n),t.current=p,p.stateNode=t,n=zf(),n.refCount++,t.pooledCache=n,n.refCount++,p.memoizedState={element:o,isDehydrated:r,cache:n},Pf(p),t}function Zb(t){return t?(t=mo,t):mo}function Jb(t,n,r,o,h,p){h=Zb(h),o.context===null?o.context=h:o.pendingContext=h,o=Or(n),o.payload={element:r},p=p===void 0?null:p,p!==null&&(o.callback=p),r=Rr(t,o,n),r!==null&&(oi(r,t,n),As(r,t,n))}function Wb(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<n?r:n}}function jm(t,n){Wb(t,n),(t=t.alternate)&&Wb(t,n)}function ex(t){if(t.tag===13||t.tag===31){var n=vl(t,67108864);n!==null&&oi(n,t,67108864),jm(t,67108864)}}function tx(t){if(t.tag===13||t.tag===31){var n=Ei();n=ma(n);var r=vl(t,n);r!==null&&oi(r,t,n),jm(t,n)}}var Fo=!0;function fT(t,n,r,o){var h=ce.T;ce.T=null;var p=me.p;try{me.p=2,wm(t,n,r,o)}finally{me.p=p,ce.T=h}}function hT(t,n,r,o){var h=ce.T;ce.T=null;var p=me.p;try{me.p=8,wm(t,n,r,o)}finally{me.p=p,ce.T=h}}function wm(t,n,r,o){if(Fo){var h=Sm(o);if(h===null)im(t,n,o,Qu,r),ix(t,o);else if(pT(h,t,n,r,o))o.stopPropagation();else if(ix(t,o),n&4&&-1<mT.indexOf(t)){for(;h!==null;){var p=va(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var E=Ki(p.pendingLanes);if(E!==0){var R=p;for(R.pendingLanes|=2,R.entangledLanes|=2;E;){var G=1<<31-Vt(E);R.entanglements[1]|=G,E&=~G}Na(p),(pt&6)===0&&(Du=Gt()+500,$s(0))}}break;case 31:case 13:R=vl(p,2),R!==null&&oi(R,p,2),Iu(),jm(p,2)}if(p=Sm(o),p===null&&im(t,n,o,Qu,r),p===h)break;h=p}h!==null&&o.stopPropagation()}else im(t,n,o,null,r)}}function Sm(t){return t=fl(t),km(t)}var Qu=null;function km(t){if(Qu=null,t=ti(t),t!==null){var n=c(t);if(n===null)t=null;else{var r=n.tag;if(r===13){if(t=d(n),t!==null)return t;t=null}else if(r===31){if(t=f(n),t!==null)return t;t=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Qu=t,null}function nx(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ll()){case sa:return 2;case ca:return 8;case bn:case fi:return 32;case ol:return 268435456;default:return 32}default:return 32}}var Cm=!1,Vr=null,$r=null,Yr=null,Ws=new Map,ec=new Map,Gr=[],mT="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 ix(t,n){switch(t){case"focusin":case"focusout":Vr=null;break;case"dragenter":case"dragleave":$r=null;break;case"mouseover":case"mouseout":Yr=null;break;case"pointerover":case"pointerout":Ws.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ec.delete(n.pointerId)}}function tc(t,n,r,o,h,p){return t===null||t.nativeEvent!==p?(t={blockedOn:n,domEventName:r,eventSystemFlags:o,nativeEvent:p,targetContainers:[h]},n!==null&&(n=va(n),n!==null&&ex(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),t)}function pT(t,n,r,o,h){switch(n){case"focusin":return Vr=tc(Vr,t,n,r,o,h),!0;case"dragenter":return $r=tc($r,t,n,r,o,h),!0;case"mouseover":return Yr=tc(Yr,t,n,r,o,h),!0;case"pointerover":var p=h.pointerId;return Ws.set(p,tc(Ws.get(p)||null,t,n,r,o,h)),!0;case"gotpointercapture":return p=h.pointerId,ec.set(p,tc(ec.get(p)||null,t,n,r,o,h)),!0}return!1}function ax(t){var n=ti(t.target);if(n!==null){var r=c(n);if(r!==null){if(n=r.tag,n===13){if(n=d(r),n!==null){t.blockedOn=n,_n(t.priority,function(){tx(r)});return}}else if(n===31){if(n=f(r),n!==null){t.blockedOn=n,_n(t.priority,function(){tx(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ku(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var r=Sm(t.nativeEvent);if(r===null){r=t.nativeEvent;var o=new r.constructor(r.type,r);dl=o,r.target.dispatchEvent(o),dl=null}else return n=va(r),n!==null&&ex(n),t.blockedOn=r,!1;n.shift()}return!0}function rx(t,n,r){Ku(t)&&r.delete(n)}function gT(){Cm=!1,Vr!==null&&Ku(Vr)&&(Vr=null),$r!==null&&Ku($r)&&($r=null),Yr!==null&&Ku(Yr)&&(Yr=null),Ws.forEach(rx),ec.forEach(rx)}function Zu(t,n){t.blockedOn===n&&(t.blockedOn=null,Cm||(Cm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,gT)))}var Ju=null;function lx(t){Ju!==t&&(Ju=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ju===t&&(Ju=null);for(var n=0;n<t.length;n+=3){var r=t[n],o=t[n+1],h=t[n+2];if(typeof o!="function"){if(km(o||r)===null)continue;break}var p=va(r);p!==null&&(t.splice(n,3),n-=3,lh(p,{pending:!0,data:h,method:r.method,action:o},o,h))}}))}function Vo(t){function n(G){return Zu(G,t)}Vr!==null&&Zu(Vr,t),$r!==null&&Zu($r,t),Yr!==null&&Zu(Yr,t),Ws.forEach(n),ec.forEach(n);for(var r=0;r<Gr.length;r++){var o=Gr[r];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Gr.length&&(r=Gr[0],r.blockedOn===null);)ax(r),r.blockedOn===null&&Gr.shift();if(r=(t.ownerDocument||t).$$reactFormReplay,r!=null)for(o=0;o<r.length;o+=3){var h=r[o],p=r[o+1],E=h[$t]||null;if(typeof p=="function")E||lx(r);else if(E){var R=null;if(p&&p.hasAttribute("formAction")){if(h=p,E=p[$t]||null)R=E.formAction;else if(km(h)!==null)continue}else R=E.action;typeof R=="function"?r[o+1]=R:(r.splice(o,3),o-=3),lx(r)}}}function ox(){function t(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(E){return h=E})},focusReset:"manual",scroll:"manual"})}function n(){h!==null&&(h(),h=null),o||setTimeout(r,20)}function r(){if(!o&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),h!==null&&(h(),h=null)}}}function Em(t){this._internalRoot=t}Wu.prototype.render=Em.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(l(409));var r=n.current,o=Ei();Jb(r,o,t,n,null,null)},Wu.prototype.unmount=Em.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Jb(t.current,2,null,t,null,null),Iu(),n[xn]=null}};function Wu(t){this._internalRoot=t}Wu.prototype.unstable_scheduleHydration=function(t){if(t){var n=ei();t={blockedOn:null,target:t,priority:n};for(var r=0;r<Gr.length&&n!==0&&n<Gr[r].priority;r++);Gr.splice(r,0,t),r===0&&ax(t)}};var sx=i.version;if(sx!=="19.3.0")throw Error(l(527,sx,"19.3.0"));me.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=v(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var vT={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:ce,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ed=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ed.isDisabled&&ed.supportsFiber)try{Gi=ed.inject(vT),sn=ed}catch{}}return ac.createRoot=function(t,n){if(!s(t))throw Error(l(299));var r=!1,o="",h=Zy,p=Jy,E=Wy;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(E=n.onRecoverableError)),n=Kb(t,1,!1,null,null,r,o,null,h,p,E,ox),t[xn]=n.current,nm(t),new Em(n)},ac.hydrateRoot=function(t,n,r){if(!s(t))throw Error(l(299));var o=!1,h="",p=Zy,E=Jy,R=Wy,G=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(E=r.onCaughtError),r.onRecoverableError!==void 0&&(R=r.onRecoverableError),r.formState!==void 0&&(G=r.formState)),n=Kb(t,1,!0,n,r??null,o,h,G,p,E,R,ox),n.context=Zb(null),r=n.current,o=Ei(),o=ma(o),h=Or(o),h.callback=null,Rr(r,h,o),r=o,n.current.lanes=r,Zn(n,r),Na(n),t[xn]=n.current,nm(t),new Wu(n)},ac.version="19.3.0",ac}var jx;function MT(){if(jx)return Mm.exports;jx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Mm.exports=AT(),Mm.exports}var OT=MT();const RT={"locale.name":"English","locale.short":"EN","common.close":"Close","common.continue":"Continue","common.failed":"Something went wrong. Please try again.","common.listSeparator":", ","login.subtitle":"Sign in to continue","login.form":"Sign in","login.username":"Username","login.password":"Password","login.showPassword":"Show password","login.hidePassword":"Hide password","login.submit":"Sign in","login.submitting":"Signing in…","login.wrong":"Wrong username or password.","login.tooMany":"Too many attempts. Please try again later.","login.offline":"Can't sign in right now. Check your connection and try again.","login.themeLight":"Switch to the light theme","login.themeDark":"Switch to the dark theme","general.language":"Language","general.theme":"Theme","general.light":"Light","general.dark":"Dark","about.tagline":"A group chat where you and your AI Bots work side by side, running entirely on your own machine.","about.version":"Version {version}","about.source":"Source","about.package":"npm package","about.license":"License","about.notices":"Third-party notices","status.signedIn":"Signed in","status.signedOut":"Signed out","status.configured":"Ready","status.notConfigured":"Not set up","account.menu":"Account menu","account.menuFor":"Account menu, {name}","account.toggleTheme":"Switch theme","account.signOut":"Sign out","entry.menu":"Chat actions","entry.pin":"Pin","entry.unpin":"Unpin","entry.mute":"Mute","entry.unmute":"Unmute","entry.botInfo":"Bot info","entry.channelInfo":"Channel info","entry.deleteBot":"Delete Bot","entry.deleteChannel":"Delete channel","hint.reaction":"{actor} reacted {emoji} to your message","hint.reactionInThread":"{actor} reacted {emoji} to your message in “{title}”","hint.threadSummary":"{actor} updated the summary of “{title}”","hint.summary":"{actor} updated the thread summary","hint.notice":"{actor} updated the notice","app.connecting":"Connecting to Jarvy…","app.channelDeleted":"Channel deleted","app.botDeleted":"{name} deleted","app.notInChannel":{one:"{names} isn't in this channel, so wasn't notified",other:"{names} aren't in this channel, so weren't notified"},"app.memberAdded":"{name} joined #{channel}","app.sourceGone":"The original message is gone","ui.closeNamed":"Close {name}","ui.copied":"Copied","ui.copyFailed":"Couldn't copy","ui.copyCode":"Copy code","ui.image":"[Image: {alt}]","ui.imageHidden":"external image hidden","app.deleteChannelTitle":"Delete channel #{name}","app.deleteChannelBody":"Its messages, threads and attachments will all be deleted.","app.resizePane":"Drag to resize the side panel","common.cancel":"Cancel","common.save":"Save","common.create":"Create","common.delete":"Delete","common.retry":"Retry","common.back":"Back","common.add":"Add","common.saveFailed":"Couldn't save","common.openNav":"Open the chat list","common.you":"You","common.member":"Member","common.noMatch":"No matching members","common.searchMembers":"Search members","common.attachment":"(attachment)","actions.reply":"Reply to this message","actions.react":"Add a reaction","actions.pickEmoji":"Pick an emoji","actions.more":"More","dialogs.candidates":"Members you can add","dialogs.allInside":"Everyone is already in this channel","dialogs.addCount":"Add ({count})","dialogs.addFailed":"Couldn't add","dialogs.optional":"Optional","dialogs.deleteSection":"Delete the group “{name}”? Its channels move under Channels.","dialogs.deleteFailed":"Couldn't delete","dialogs.editSection":"Edit channel group","dialogs.sectionName":"Group name","dialogs.newSection":"New group","api.offline":"Can't reach the server. Check your connection and try again.","api.historyFailed":"Couldn't load the messages. Please try again.","error.autoconfigModel":"Enter the model ID.","error.autoconfigSource":"The setup source isn't valid.","error.botMissing":"This Bot doesn't exist.","error.agentUndeletable":"The agent Bot can't be deleted. You can rename or stop it.","error.chatAccessChanged":"Chat access has changed.","error.connectionMissing":"This model connection doesn't exist.","error.credentialChanged":"The credential changed. Please try again.","error.credentialScope":"The credential belongs to another connection.","error.credentialsMissing":"Set up this connection's credential first.","error.dataLocked":"The data directory is in use, or its run lock can't be taken.","error.discoveryFormat":"The response isn't a model list for this protocol.","error.discoveryHttp":"Couldn't fetch the models: HTTP {status}.","error.discoveryKey":"Enter the API key.","error.discoveryProtocol":"This protocol can't list models yet.","error.discoveryUrl":"The API URL isn't valid.","error.discoveryUrlMissing":"Enter the API URL.","error.historyMissing":"This History record doesn't exist.","error.invalidCredential":"The credential format isn't valid.","error.invalidRun":"The run state has changed.","error.loginInput":"Enter the sign-in details.","error.loginOption":"Pick a sign-in method.","error.loginStep":"The sign-in step has changed. Please start again.","error.loginFailed":"Sign-in failed. Refresh and try again.","error.messageMissing":"This message doesn't exist.","error.modelIncomplete":"Fill in the model's context window and max output.","error.modelMissing":"This model doesn't exist.","error.modelRequestFailed":"Model request failed: {detail}","error.modelRequired":"Pick a model for the Bot first.","error.modelSwitchUncertain":"The model switch didn't finish. Pick the model again.","error.nameTaken":"Another member already has this name.","error.providerNameTaken":"A provider with this name already exists.","error.questionClosed":"This question is already settled.","error.questionExpired":"This question has expired.","error.runtimeFailed":"The run failed. Check the model setup or the run records.","error.sessionCorrupt":"The session file can't be read.","error.sessionMismatch":"The session file doesn't match this Bot.","error.sessionMissing":"The session file is missing; check the run records before recovering.","error.sessionPath":"The session file path isn't valid.","error.stopping":"Shutting down.","error.thinkingFormat":"This thinking format isn't supported.","error.toolsMissing":"Couldn't load the run's tools.","error.unsafeReplay":"A submitted run can't be replayed automatically.","error.discoveryUnreachable":"Couldn't reach {host}. Check the API URL.","color.gray":"Gray","color.blue":"Blue","color.green":"Green","color.amber":"Amber","color.rose":"Pink","color.violet":"Purple","avatar.working":"Working","avatar.openInfo":"Open {name}'s Bot info"},_T={"settings.title":"Settings","settings.sections":"Settings sections","settings.general":"General","settings.models":"Models","settings.about":"About","group.custom":"Custom API","group.subscription":"Subscription","group.apiKey":"API key","models.intro":"Connect model services; each Bot picks its model from these.","models.add":"Add a provider","models.empty":"No model connection yet","models.emptyHint":"Add a provider, then a Bot can pick one of its models.","models.count":{one:"{count} model",other:"{count} models"},"models.none":"No models yet","picker.intro":"Pick the kind of service; next you enter its credentials and models.","picker.back":"Back to the model page","picker.search":"Search providers","picker.searchPlaceholder":"Search providers…","picker.customHint":"Any OpenAI / Anthropic / Gemini compatible endpoint","picker.oauthHint":"Sign in with your account","picker.keyHint":{one:"API key · {count} model",other:"API key · {count} models"},"picker.loading":"Reading providers…","picker.retry":"Try again","picker.noMatch":"No provider matches","picker.noMatchHint":"Try another word.","editor.back":"Back to the provider list","editor.delete":"Delete this provider","editor.connection":"Connection","editor.providerName":"Provider name","editor.name":"Connection name","editor.protocol":"API protocol","editor.url":"API URL","editor.defaultUrl":"The provider's own address","editor.key":"API key","editor.keyPlaceholder":"Enter the API key","editor.keySaved":"Saved — leave empty to keep it","editor.settings":"Connection settings","editor.models":"Model list","editor.selected":"{selected} of {total} selected","editor.fetch":"Get the model list","editor.fetching":"Getting…","editor.fetched":{one:"Got {count} model",other:"Got {count} models"},"editor.noneReturned":"This endpoint returned no models","editor.fetchFailed":"Could not get the list","editor.loadingCatalog":"Reading the model catalog…","editor.autoSelected":"Autoconfigure selected","editor.addManually":"Add manually","editor.filter":"Filter models","editor.filterPlaceholder":"Filter models…","editor.selectVisible":"Select everything shown","editor.empty":"No models yet","editor.emptyCustom":"Get the model list, or add a model by hand.","editor.emptyBuiltin":"You can add a model by hand.","editor.autoSummary":"{parts}; saved with the form","editor.autoMatched":{one:"{count} configured",other:"{count} configured"},"editor.autoChoose":{one:"{count} needs a source",other:"{count} need a source"},"editor.autoNone":{one:"{count} not in the catalog",other:"{count} not in the catalog"},"editor.autoFailed":{one:"{count} failed",other:"{count} failed"},"editor.confirmDelete":'Delete "{name}" and its models?',"editor.deleteFailed":"Could not delete","editor.saveFailed":"Could not save","editor.saved":"Saved","editor.saving":"Saving…","editor.save":"Save","editor.footer":"Ticked models appear in the Bots' model menu once saved.","card.defaultProtocol":"The provider's own protocol","card.modelId":"Model ID","card.modelName":"Model name","card.optional":"Optional","card.newModel":"New model","card.enterId":"Enter the model ID","card.use":"Use {name}","card.remove":"Remove {name}","card.image":"Image","card.reasoning":"Thinking","card.capabilities":"Capabilities","card.reasoningThinking":"Thinking / reasoning","card.imageInput":"Image input","card.specs":"Model specs","card.hidePrices":"Hide prices","card.editPrices":"Edit prices","card.context":"Context window · tokens","card.maxOutput":"Maximum output · tokens","card.costTitle":"Price per million tokens","card.costInput":"Input","card.costOutput":"Output","card.costCacheRead":"Cache read","card.costCacheWrite":"Cache write","card.notProvided":"Not given","card.advanced":"Advanced","card.apiOverride":"API override","card.headers":"Headers","card.headerSaved":"Saved — leave empty to keep it","card.addHeader":"Add a header","card.removeHeader":"Remove this header","card.compat":"Compat flags","card.jsonObject":"Enter a JSON object","auto.run":"Autoconfigure","auto.pending":"Configuring…","auto.failed":"Autoconfigure failed","auto.tagChoose":"Pick a source","auto.tagNone":"Not in the catalog","auto.official":"Official","auto.matched":"Filled in from {source}{note}{suffix}","auto.reseller":" (a reseller's catalog, not the vendor's)","auto.applied":"; it takes effect once saved.","auto.apiMismatch":"The catalog has this model on the {api} protocol, not the one chosen here, so the thinking format and compat flags were left alone.","auto.changeSource":"Change the source","auto.multiple":"Several official sources share this model name; pick one:","auto.similar":"The catalog has no {modelId}; similar models:","auto.notFound":"The catalog has no such model. Fill it in by hand.","thinking.title":"Thinking","thinking.format":"Thinking format","thinking.protocolDefault":"The protocol's default","thinking.onlyCompletions":"Only used by the OpenAI Chat Completions protocol","thinking.levels":"Thinking levels","thinking.level.off":"Off","thinking.level.minimal":"Minimal","thinking.level.low":"Low","thinking.level.medium":"Medium","thinking.level.high":"High","thinking.level.xhigh":"Extra high","thinking.level.max":"Maximum","thinking.levelName":"{level} level","thinking.levelValue":"Value sent for the {level} level","thinking.supportedDefault":"Supported (default)","thinking.unsupported":"Not supported","thinking.supportedCustom":"Supported, send this value","thinking.supported":"Levels in use: {levels}","auth.title":"Account authorization","auth.running":"Authorizing","auth.openPage":"Open the authorization page","auth.code":"Code: {code}","auth.browser":"Sign in with the browser (OAuth)","auth.deviceCode":"Sign in with a device code","auth.redirectFull":"The full redirect URL","auth.redirectOrCode":"Code or redirect URL","auth.manualNote":"If the browser does not come back on its own, paste the redirect URL here.","auth.waiting":"Waiting for authorization…","auth.cancel":"Cancel authorization","auth.configureCredential":"Set up the credential","auth.signInAgain":"Sign in again","auth.signIn":"Sign in","auth.removeCredential":"Remove the credential","auth.signOut":"Sign out","auth.statusFailed":"Could not read the authorization state","auth.refresh":"Refresh the state","picker.loadFailed":"Couldn't load the providers"},DT={"sidebar.label":"Chats","sidebar.create":"Create","sidebar.createMenu":"Create menu","sidebar.newChannel":"New channel","sidebar.newSection":"New channel group","sidebar.newBot":"New Bot","sidebar.alerts":"{count} unread for you","sidebar.unread":"{count} unread","sidebar.said":"{name}: {text}","sidebar.atMe":"[Mentioned you]","sidebar.more":"More actions for {name}","sidebar.asking":"(waiting for your answer)","sidebar.working":"(working)","sidebar.pinned":"Pinned","sidebar.muted":"Muted","sidebar.hasUnread":"Unread","sidebar.editSection":"Edit group: {name}","sidebar.search":"Search chats and messages","sidebar.results":"Search results","sidebar.chats":"Chats","sidebar.nav":"Channels and DMs","sidebar.followed":"Followed threads","sidebar.channels":"Channels","sidebar.dms":"DMs","sidebar.noDms":"No DMs yet","search.title":"Search","search.paneLabel":"Search in this chat","search.inThread":"This thread","search.inDm":"This DM","search.close":"Close search","search.placeholder":"Search messages","search.channelPlaceholder":"Search this channel and its threads","search.prompt":"Type what you're looking for","search.searching":"Searching…","search.noMessages":"No messages found","search.count":{one:"{count} message, newest first",other:"{count} messages, newest first"},"search.countLatest":"Latest {count}, newest first","search.showAll":"Show all {count}","search.threads":"Threads","search.channels":"Channels (topics and notices)","search.messages":"Messages","search.channel":"Channel","member.unknown":"Unknown member","member.deleted":"{name} (deleted)","members.view":"View {name}","members.remove":"Remove {name}","members.count":{one:"{count} member",other:"{count} members"},"members.people":"People","members.removeTitle":"Remove {name} from #{channel}","members.removeBody":"They won't get this channel's messages anymore.","members.removeConfirm":"Remove","chat.area":"Conversation","chat.botDms":"{name}'s DMs with Bots","chat.botStatus":"Bot status","chat.transcript":"Messages","chat.loading":"Loading the chat…","chat.empty":"No messages yet","chat.start":"Start a conversation with {name}","chat.loadingOlder":"Loading earlier messages…","chat.toLatest":"Jump to the latest","chat.unseen":{one:"{count} new message",other:"{count} new messages"},"chat.toChannel":"Message #{name}","chat.toBot":"Message {name}…","chat.pickModel":"Pick a model first, then send a message","chat.pick":"Pick a chat","channel.infoFor":"Channel info: {name}","channel.membersCount":{one:"{count} member",other:"{count} members"},"channel.members":"Members","channel.search":"Search channel messages (Ctrl+F)","channel.threads":"Threads","notice.title":"Notice","notice.edit":"Edit the notice","notice.content":"Notice text","notice.none":"No notice yet","notice.version":"v{version}","chat.newBelow":"New messages","channel.echo":"Replied in “{title}”","channel.replies":{one:"{count} reply",other:"{count} replies"},"channel.threadDone":"Done","channel.lastReply":"Last reply {time}","channel.replyInThread":"Reply in thread","info.edit":"Edit {name}","info.memberList":"Member list","info.back":"Back to channel info","info.addMembers":"Add members","info.name":"Name","info.newChannel":"New channel","info.topic":"Topic","info.noTopic":"No topic yet","info.section":"Group","info.menu":"Channel","info.noSection":"None","mention.menu":"Mention a member","mention.outside":"Not in this channel","mention.outsideList":"Members not in this channel","mention.searchOutside":"Search members not in this channel","mention.invites":"Picking one adds them to this channel","quote.inline":"“{text}”","quote.by":"{name}:","quote.remove":"Remove quote: {text}","quote.tooMany":"A message can quote up to {count} passages","quote.selection":"Selected text","quote.copy":"Copy","quote.quote":"Quote in reply","composer.busy":"Still uploading. Add more once it's done.","composer.tooMany":"A message can have up to {count} attachments.","composer.size":"Each attachment must be 10 MB or smaller, and not empty.","composer.pasted":"pasted-image","composer.removeFile":"Remove attachment: {name}","composer.uploading":"Uploading: {name}","composer.replying":"Replying to","composer.cancelReply":"Cancel reply","composer.drop":"Drop to attach","composer.attach":"Attach files","composer.input":"Message","composer.send":"Send","files.preview":"Preview {name}","files.download":"Download {name}","files.gone":"This attachment doesn't exist or was deleted","files.readFailed":"Couldn't read it ({status})","files.readError":"Couldn't read it","files.kindImage":"Image","files.kindSvg":"SVG","files.kindHtml":"HTML","files.kindMarkdown":"Markdown","files.kindText":"Text","files.kindFile":"File","files.downloadFile":"Download","files.showPreview":"Preview","files.showSource":"Source","files.showText":"Plain text","files.openTab":"Open in a new tab (sandboxed)","files.narrow":"Shrink the preview","files.widen":"Widen the preview","files.closePreview":"Close the preview","files.running":"Running the scripts in a sandbox: they can reach the network but can't read Jarvy's data.","files.scripts":{one:"This HTML has {count} script{hosts}. You're seeing it without the script; run it and it can reach the network but can't read Jarvy's data.",other:"This HTML has {count} scripts{hosts}. You're seeing it without them; run it and they can reach the network but can't read Jarvy's data."},"files.scriptHosts":" (loading {hosts})","files.andMore":" and more","files.stop":"Stop","files.run":"Run it","files.downloadToView":"Download this file to view it","files.tooLarge":"It's over 1 MB, too big to preview here.","files.unsupported":"This file type can't be previewed here.","files.reading":"Reading the file…","files.runningTitle":"{name} (running)","files.previous":"Previous attachment","files.choose":"Pick a file to preview","files.next":"Next attachment","question.failed":"Couldn't send the answer","question.dismissed":"Dismissed","question.chose":"Chose: {answer}","question.dismissLabel":"Close the question without answering","question.dismiss":"Don't answer","question.multiple":"Pick one or more","question.note":"Add a note (optional)","question.own":"Or write your own…","question.ownLabel":"Your own answer","question.confirmCount":"OK ({count})","question.confirm":"OK","question.send":"Send","directs.back":"Back to the list","directs.between":"{name} and {other}","directs.readOnly":"Read only","files.kindVideo":"Video","files.kindAudio":"Audio","files.cantPlay":"This browser can't play it","files.cantPlayHint":"Download it and open it in a player."},zT={"threadSort.title":"Sort","threadSort.current":"Sort: {order}","threadSort.updated":"Last updated","threadSort.created":"Created","threadSort.status":"Status","threads.list":"Thread list","threads.closeList":"Close the thread list","threads.byStatus":"Filter by status","threads.openCount":"Open {count}","threads.doneCount":"Done {count}","threads.all":"All","threads.loading":"Loading…","threads.none":"No threads yet","threads.following":"Following","threads.filter":"Filter","threads.unreadCount":"Unread {count}","threads.unread":"Unread","threads.noneUnread":"No unread threads","threads.noneOpen":"No open threads","threads.noneDone":"No finished threads","threads.notFollowing":"Not following","threads.pick":"Pick a thread","threads.open":"Open","thread.rename":"Rename","thread.title":"Thread title","thread.toggleStatus":"Switch status","thread.summary":"Summary","thread.editSummary":"Edit the summary","thread.conclude":"Mark done and post the summary to #{channel}","thread.addSummary":"Add a summary","thread.sourceElsewhere":"The original message isn't in this thread","thread.label":"Thread","thread.backToList":"Back to the thread list","thread.inChannel":"View in channel","thread.search":"Search thread messages (Ctrl+F)","thread.followingHint":"New replies count as unread","thread.notFollowingHint":"New replies don't count as unread","thread.follow":"Follow","thread.expand":"Expand","thread.collapse":"Back to the side panel","thread.close":"Close the thread panel","thread.conclusion":"Conclusion:","thread.concluded":"Marked done; the summary was posted to #{channel}","thread.noReplies":"No replies yet","thread.toLatest":"Jump to the latest reply","thread.reply":"Reply in thread"},LT={"usage.title":"Usage","usage.back":"Back to Bot info","usage.range":"Time range","usage.today":"Today","usage.days":"{count} days","usage.refresh":"Refresh","usage.refreshLabel":"Refresh usage","usage.retry":"Retry","usage.loading":"Reading usage…","usage.loadFailed":"Could not load usage","usage.empty":"No model calls in this period","usage.model":"Model","usage.calls":"Calls","usage.input":"Input","usage.output":"Output","usage.cacheRead":"Cache read","usage.cacheWrite":"Cache write","usage.cost":"Cost","usage.total":"Total","usage.unpriced":"No price set","usage.note":"Input, output and cache are counted in tokens.","usage.notePartial":"Input, output and cache are counted in tokens; the total cost leaves out models with no price set.","activity.error":"Error","activity.running":"Running","activity.reasoning":"Thinking","activity.texting":"Writing","activity.toolCalling":"Using tools","activity.asking":"Waiting for your answer","activity.noModel":"No model","activity.idle":"Idle","activity.stopped":"Not running","bot.saved":"Saved","bot.changeFailed":"Couldn't change it","bot.noDescription":"No description yet","bot.color":"Avatar color","bot.contextHint":"Pi's estimate of the context","bot.context":"Context","bot.unknown":"Unknown","bot.tokens":"{used} / {window} tokens","bot.profile":"Profile","bot.description":"Description","bot.descriptionPlaceholder":"What can this Bot do for you?","bot.personaPlaceholder":"The Bot's personality, duties and habits","bot.personaHint":"Part of the system prompt; takes effect from the next run.","bot.unsaved":"Unsaved changes","bot.saving":"Saving…","bot.runtime":"Runtime","agent.title":"Agent Bot","agent.intro":"{name} is your agent Bot: it helps you run Jarvy itself. Ask it in a DM or a channel to:","agent.create":"Create Bots and change their name, description and persona","agent.model":"Give Bots a model and a thinking level","agent.run":"Start or stop Bots, and see their usage","agent.delete":"Delete Bots, channels and channel groups, or remove members from a channel, always after you confirm on a card","agent.note":"The agent Bot can't be deleted, but you can rename or stop it. Model connections and keys stay with you, in Settings.","bot.status":"Status","bot.statusHint":"Stopping keeps the session; starting doesn't call the model by itself","bot.aborting":"Cancelling…","bot.abort":"Cancel this run","bot.starting":"Starting…","bot.stopping":"Stopping…","bot.start":"Start","bot.stop":"Stop","bot.workspace":"Workspace","bot.copyWorkspace":"Copy the workspace path","bot.activity":"Activity","bot.activityHint":"Chat messages and the History timeline","bot.usageHint":"Tokens and cost per model","bot.subscriptions":"Subscriptions","bot.noSubscriptions":"No subscriptions","bot.threadIn":"Thread · #{channel}","botModel.auto":"Pi's default","botModel.off":"Off","botModel.minimal":"Minimal","botModel.low":"Low","botModel.medium":"Medium","botModel.high":"High","botModel.xhigh":"Extra high","botModel.max":"Maximum","botModel.loadFailed":"Couldn't load the models","botModel.switchFailed":"Couldn't switch","botModel.pick":"Pick the Bot's model","botModel.broken":"Model setup is broken","botModel.choose":"Pick a model","botModel.filter":"Filter the Bot's models","botModel.filterPlaceholder":"Filter models…","botModel.list":"Bot models","botModel.noMatch":"No matching models","botModel.none":"No models added yet","botModel.manage":"Manage models","botModel.thinking":"Thinking","botModel.pickThinking":"Pick the thinking level","botModel.loading":"Loading models…","botModel.switching":"Switching…","botModel.pickFor":"Pick a model for {name}","deleteBot.title":"Delete {name}","deleteBot.after":"Once deleted:","deleteBot.chats":{one:"Its {count} DM, channel memberships and subscriptions are deleted.",other:"Its {count} DMs, channel memberships and subscriptions are deleted."},"deleteBot.messages":"Its messages in channels and threads stay, shown as from “{name}”; the name can be used again.","deleteBot.history":"Its session history and unfinished tasks are cleared.","deleteBot.files":"Also delete the workspace folder","deleteBot.filesHint":"The workspace may hold files it made. It's kept unless you tick this.","deleteBot.deleting":"Deleting…","deleteBot.working":"Working…","history.reasoning":"Thinking","history.text":"Text","history.empty":"(empty)","history.image":"Image in History","history.toolCall":"Tool call","history.toolResult":"Tool result","history.error":"Error","history.related":"View related record #{id}","history.result":"Result","history.call":"Call","history.details":"Structured result","history.view":"Record view","history.content":"Content","history.json":"Raw JSON","history.contentLabel":"Record content","history.tools":"Tool definitions","history.toolsRemoved":"Removed tools","history.stopReason":"Stop reason","activity.detailFailed":"Couldn't load the record","activity.detailLoading":"Loading the record…","activity.openChat":"Open the chat","activity.sentBy":"Sent by call #{id}","activity.roleSystem":"System","activity.roleUser":"Input","activity.roleAssistant":"Assistant","activity.timeline":"Bot activity timeline","activity.chatMessage":"Chat message {id}","activity.viewMessage":"View message {sequence} · {chat}","activity.attachmentOnly":"Attachments only","activity.attachments":{one:"{count} attachment",other:"{count} attachments"},"activity.viewSentBy":"View call #{id}, which sent it","activity.historyRecord":"History record #{id}","activity.viewHistory":"View History #{id} · {role}","activity.emptyMessage":"(empty message)","activity.loadFailed":"Couldn't load the activity","activity.backToTimeline":"Back to the timeline","activity.chatRecord":"Chat message","activity.newestFirst":"Newest first","activity.refresh":"Refresh the activity","activity.reading":"Loading…","activity.columnChat":"Chat","activity.columnTime":"Time","activity.loading":"Loading the activity…","activity.empty":"No activity yet","activity.emptyHint":"Chat messages and History show up here","activity.newer":"Newer","activity.page":"Page {page}","activity.older":"Older","activity.historyDetail":"History record details","activity.chatDetail":"Chat message details","activity.toolCall":"Called {name}","activity.toolResult":"{name} · result","activity.toolFailed":"{name} · failed","activity.images":{one:"{count} image",other:"{count} images"},"bot.newName":"New Bot","bot.newNameN":"New Bot {n}"},IT={"npc.toolbar":"NPC prototype","npc.replay":"Replay the turn","npc.mood":"Base mood","npc.mood.normal":"Normal","npc.mood.happy":"Happy","npc.mood.sad":"Sad","npc.mood.angry":"Angry","npc.mood.dizzy":"Dizzy","npc.poses":"Animations","npc.pose.sleep":"Sleeping","npc.pose.idle":"Idle","npc.pose.think":"Thinking","npc.pose.mutter":"Talking to itself","npc.pose.say":"Talking to you","npc.pose.ask":"Waiting for you","npc.pose.read":"Reading a file","npc.pose.work":"Editing, running","npc.pose.compact":"Compacting","npc.pose.busy":"Retrying","npc.pose.failed":"Failed","npc.pose.done":"Done","npc.pose.groom":"Grooming","npc.expand":"Show every step","npc.collapse":"Collapse","npc.panel":"This turn","npc.state.running":"Running","npc.state.ok":"Done","npc.state.failed":"Failed","npc.duration":"{value}s","npc.done":"Done · {duration}","npc.mutter":"({text})","npc.to":"→ {chat}","npc.step.think":"Thinking","npc.step.mutter":"Talked to itself","npc.step.read.running":"Reading {target}","npc.step.read.ok":"Read {target}","npc.step.write.running":"Editing {target}","npc.step.write.ok":"Edited {target}","npc.step.run.running":"Running {target}","npc.step.run.ok":"Ran {target}","npc.step.run.failed":"{target} failed","npc.step.compact.running":"Tidying up the context","npc.step.compact.ok":"Tidied up the context","npc.step.ask.running":"Waiting for your answer","npc.step.ask.ok":"You chose “{answer}”","npc.step.say.running":"Replying to you","npc.step.say.ok":"Replied to you","npc.step.post.running":"Posting to {chat}","npc.step.post.ok":"Posted to {chat}","npc.demo.think1":"fish says the thread pane jumps when it opens. The scroll may run at the wrong moment. Let me first see how ThreadPane scrolls.","npc.demo.think2":"It scrolls before the replies have their height. Scrolling after layout should fix it. The reply count belongs in the dependencies too.","npc.demo.mutter1":"Edited. Let me run the build first.","npc.demo.mutter2":"Hmm… the types don't pass; the ref can be null.","npc.demo.channel":"dev","npc.demo.post":"The thread pane no longer jumps when it opens, and the build passes. Waiting for fish to confirm.","npc.demo.question":"Fixed. Should I also update the screenshots in the docs?","npc.demo.yes":"Yes, update them","npc.demo.no":"Not now","npc.demo.replyYes":"Done: the thread pane now opens at the newest reply without jumping, and the screenshots in the docs are new. The build passes.","npc.demo.replyNo":"Done: the thread pane now opens at the newest reply without jumping. The build passes; I left the screenshots as they are.","npc.live.omitted":"… {count} characters left out …","npc.live.tokens":"Context: {before} → {after} tokens","npc.live.compact.running":"Tidying up the context","npc.live.compact.ok":"Tidied up the context","npc.live.compact.failed":"Couldn't tidy up the context","npc.live.retry.running":"Retrying ({attempt}/{max})","npc.live.retry.ok":"Retried","npc.live.retry.failed":"Retrying failed","npc.live.read.running":"Reading {target}","npc.live.read.ok":"Read {target}","npc.live.read.failed":"Couldn't read {target}","npc.live.edit.running":"Editing {target}","npc.live.edit.ok":"Edited {target}","npc.live.edit.failed":"Couldn't edit {target}","npc.live.write.running":"Writing {target}","npc.live.write.ok":"Wrote {target}","npc.live.write.failed":"Couldn't write {target}","npc.live.run.running":"Running {target}","npc.live.run.ok":"Ran {target}","npc.live.run.failed":"{target} failed","npc.live.script.running":"Running a script","npc.live.script.ok":"Ran a script","npc.live.script.failed":"The script failed","npc.live.tool.running":"Using {tool}","npc.live.tool.ok":"Used {tool}","npc.live.tool.failed":"{tool} failed","npc.live.sendFailed":"The message didn't go out","npc.live.askFailed":"The question didn't go out","npc.live.askClosed":"The question was closed","npc.live.answerBelow":"Answer on the card below","npc.live.answerIn":"Answer in {chat}","npc.live.browse.running":"Looking through {chat}","npc.live.browse.ok":"Looked through {chat}","npc.live.browseAll.running":"Looking through the chats","npc.live.browseAll.ok":"Looked through the chats","npc.done.interrupted":"Interrupted · {duration}","npc.done.failed":"The turn failed · {duration}"},BT={...RT,..._T,...DT,...zT,...LT,...IT},PT={"locale.name":"中文","locale.short":"中","common.close":"关闭","common.continue":"继续","common.failed":"操作失败,请重试。","common.listSeparator":",","login.subtitle":"登录以继续","login.form":"登录","login.username":"用户名","login.password":"密码","login.showPassword":"显示密码","login.hidePassword":"隐藏密码","login.submit":"登录","login.submitting":"正在登录…","login.wrong":"账号或密码不正确。","login.tooMany":"尝试次数较多,请稍后再试。","login.offline":"暂时无法登录,请检查连接后重试。","login.themeLight":"切换为浅色主题","login.themeDark":"切换为深色主题","general.language":"语言","general.theme":"主题","general.light":"浅色","general.dark":"深色","about.tagline":"你和 AI Bot 一起工作的群聊,完整运行在你自己的电脑上。","about.version":"版本 {version}","about.source":"源代码","about.package":"npm 包","about.license":"许可证","about.notices":"第三方声明","status.signedIn":"已登录","status.signedOut":"未登录","status.configured":"已配置","status.notConfigured":"未配置","account.menu":"账户菜单","account.menuFor":"账户菜单,{name}","account.toggleTheme":"切换主题","account.signOut":"退出登录","entry.menu":"会话操作","entry.pin":"置顶","entry.unpin":"取消置顶","entry.mute":"免打扰","entry.unmute":"取消免打扰","entry.botInfo":"Bot 信息","entry.channelInfo":"频道信息","entry.deleteBot":"删除 Bot","entry.deleteChannel":"删除频道","hint.reaction":"{actor} 对你的消息表达了 {emoji}","hint.reactionInThread":"{actor} 对你在线程「{title}」中的消息表达了 {emoji}","hint.threadSummary":"{actor} 更新了线程「{title}」的摘要","hint.summary":"{actor} 更新了线程摘要","hint.notice":"{actor} 更新了公告","app.connecting":"正在连接 Jarvy…","app.channelDeleted":"频道已删除","app.botDeleted":"{name} 已删除","app.notInChannel":{one:"{names} 不在频道中,未收到通知",other:"{names} 不在频道中,未收到通知"},"app.memberAdded":"{name} 已加入 #{channel}","app.sourceGone":"原消息已不在","ui.closeNamed":"关闭{name}","ui.copied":"已复制","ui.copyFailed":"复制失败","ui.copyCode":"复制代码","ui.image":"[图片:{alt}]","ui.imageHidden":"外部图片已隐藏","app.deleteChannelTitle":"删除频道 #{name}","app.deleteChannelBody":"频道里的消息、线程和附件都会删除。","app.resizePane":"拖动调整侧栏宽度","common.cancel":"取消","common.save":"保存","common.create":"创建","common.delete":"删除","common.retry":"重试","common.back":"返回","common.add":"添加","common.saveFailed":"保存失败","common.openNav":"打开会话列表","common.you":"你","common.member":"成员","common.noMatch":"无匹配成员","common.searchMembers":"搜索成员","common.attachment":"(附件)","actions.reply":"回复这条消息","actions.react":"标记表情","actions.pickEmoji":"选择表情","actions.more":"更多","dialogs.candidates":"可添加的成员","dialogs.allInside":"所有成员都已在频道中","dialogs.addCount":"添加({count})","dialogs.addFailed":"添加失败","dialogs.optional":"可选","dialogs.deleteSection":"删除分组「{name}」?其中的频道会移到「频道」下。","dialogs.deleteFailed":"删除失败","dialogs.editSection":"编辑频道分组","dialogs.sectionName":"分组名称","dialogs.newSection":"新分组","api.offline":"无法连接服务器,请检查连接后重试。","api.historyFailed":"聊天记录读取失败,请重试。","error.autoconfigModel":"请填写模型 ID。","error.autoconfigSource":"配置来源无效。","error.botMissing":"Bot 不存在。","error.agentUndeletable":"主 Bot 不能删除,但可以改名或停止。","error.chatAccessChanged":"聊天访问权限已变化。","error.connectionMissing":"模型连接不存在。","error.credentialChanged":"凭证已更改,请重试。","error.credentialScope":"凭证连接不匹配。","error.credentialsMissing":"请先配置此模型连接的凭证。","error.dataLocked":"数据目录正在使用,或无法取得运行锁。","error.discoveryFormat":"返回内容不是此协议的模型列表。","error.discoveryHttp":"获取模型失败:HTTP {status}。","error.discoveryKey":"请填写 API Key。","error.discoveryProtocol":"此协议暂不支持获取模型列表。","error.discoveryUrl":"API URL 无效。","error.discoveryUrlMissing":"请填写 API URL。","error.historyMissing":"History 记录不存在。","error.invalidCredential":"凭证格式无效。","error.invalidRun":"运行状态已变化。","error.loginInput":"请输入授权信息。","error.loginOption":"请选择登录方式。","error.loginStep":"授权步骤已更新,请重新操作。","error.loginFailed":"登录操作失败,请刷新后重试。","error.messageMissing":"聊天记录不存在。","error.modelIncomplete":"请补全模型的上下文窗口和最大输出。","error.modelMissing":"模型不存在。","error.modelRequestFailed":"模型请求失败:{detail}","error.modelRequired":"请先为 Bot 选择模型。","error.modelSwitchUncertain":"模型切换未完成,请重新选择模型。","error.nameTaken":"名称已被其他成员使用。","error.providerNameTaken":"已有同名的 Provider。","error.questionClosed":"问题已结束。","error.questionExpired":"问题已失效。","error.runtimeFailed":"运行失败,请检查模型配置或运行记录。","error.sessionCorrupt":"会话文件无法读取。","error.sessionMismatch":"会话文件身份不匹配。","error.sessionMissing":"会话文件缺失,需检查运行记录后恢复。","error.sessionPath":"会话文件路径无效。","error.stopping":"服务正在停止。","error.thinkingFormat":"不支持此思考格式。","error.toolsMissing":"运行工具加载失败。","error.unsafeReplay":"不能自动重放已提交的运行。","error.discoveryUnreachable":"无法连接 {host},请检查 API URL。","color.gray":"灰","color.blue":"蓝","color.green":"绿","color.amber":"琥珀","color.rose":"粉","color.violet":"紫","avatar.working":"工作中","avatar.openInfo":"查看 {name} 的 Bot 信息"},HT={"settings.title":"设置","settings.sections":"设置分类","settings.general":"通用","settings.models":"模型","settings.about":"关于","group.custom":"自定义 API","group.subscription":"订阅服务","group.apiKey":"API Key","models.intro":"连接模型服务,Bot 从这里选择模型。","models.add":"添加 Provider","models.empty":"还没有模型连接","models.emptyHint":"添加一个 Provider 后,就能为 Bot 选择模型。","models.count":{one:"{count} 个模型",other:"{count} 个模型"},"models.none":"尚未添加模型","picker.intro":"选择服务类型,下一步填写凭证与模型。","picker.back":"返回模型页面","picker.search":"搜索 Provider","picker.searchPlaceholder":"搜索 Provider…","picker.customHint":"任意 OpenAI / Anthropic / Gemini 兼容端点","picker.oauthHint":"账号登录","picker.keyHint":{one:"API Key · {count} 个模型",other:"API Key · {count} 个模型"},"picker.loading":"正在读取 Provider…","picker.retry":"重试","picker.noMatch":"没有匹配的 Provider","picker.noMatchHint":"换个关键词试试。","editor.back":"返回 Provider 列表","editor.delete":"删除 Provider","editor.connection":"连接","editor.providerName":"Provider name","editor.name":"连接名称","editor.protocol":"API 协议","editor.url":"API URL","editor.defaultUrl":"使用 Provider 默认地址","editor.key":"API Key","editor.keyPlaceholder":"输入 API Key","editor.keySaved":"已保存;留空保持不变","editor.settings":"连接设置","editor.models":"模型列表","editor.selected":"已选 {selected} / {total}","editor.fetch":"获取模型列表","editor.fetching":"获取中…","editor.fetched":{one:"获取到 {count} 个模型",other:"获取到 {count} 个模型"},"editor.noneReturned":"此端点没有返回模型","editor.fetchFailed":"获取失败","editor.loadingCatalog":"正在读取模型目录…","editor.autoSelected":"自动配置已选","editor.addManually":"手动添加","editor.filter":"筛选模型","editor.filterPlaceholder":"筛选模型…","editor.selectVisible":"全选当前结果","editor.empty":"还没有模型","editor.emptyCustom":"获取模型列表,或手动添加模型。","editor.emptyBuiltin":"可以手动添加模型。","editor.autoSummary":"{parts};保存后生效","editor.autoMatched":{one:"已配置 {count} 个",other:"已配置 {count} 个"},"editor.autoChoose":{one:"{count} 个需选择来源",other:"{count} 个需选择来源"},"editor.autoNone":{one:"{count} 个目录未收录",other:"{count} 个目录未收录"},"editor.autoFailed":{one:"{count} 个失败",other:"{count} 个失败"},"editor.confirmDelete":"删除「{name}」及其模型?","editor.deleteFailed":"删除失败","editor.saveFailed":"保存未完成","editor.saved":"已保存","editor.saving":"保存中…","editor.save":"保存","editor.footer":"勾选的模型会在保存后出现在 Bot 的模型列表中。","card.defaultProtocol":"使用 Provider 默认协议","card.modelId":"模型 ID","card.modelName":"模型名称","card.optional":"可选","card.newModel":"新模型","card.enterId":"填写模型 ID","card.use":"使用 {name}","card.remove":"移除 {name}","card.image":"图片","card.reasoning":"推理","card.capabilities":"能力","card.reasoningThinking":"推理 / 思考","card.imageInput":"图片输入","card.specs":"模型规格","card.hidePrices":"收起价格","card.editPrices":"编辑价格","card.context":"上下文窗口 · tokens","card.maxOutput":"最大输出 · tokens","card.costTitle":"每百万 tokens 价格","card.costInput":"输入","card.costOutput":"输出","card.costCacheRead":"缓存读取","card.costCacheWrite":"缓存写入","card.notProvided":"未提供","card.advanced":"高级设置","card.apiOverride":"API override","card.headers":"Headers","card.headerSaved":"已保存;留空保持","card.addHeader":"添加 Header","card.removeHeader":"移除 Header","card.compat":"兼容参数 · compat","card.jsonObject":"请输入 JSON 对象","auto.run":"自动配置","auto.pending":"配置中…","auto.failed":"自动配置失败","auto.tagChoose":"需选择配置来源","auto.tagNone":"目录未收录","auto.official":"原厂","auto.matched":"已按 {source}{note} 填入配置{suffix}","auto.reseller":"(来自转售目录,非原厂)","auto.applied":";保存后生效。","auto.apiMismatch":"目录中此模型使用 {api} 协议,与当前协议不同,思考格式和兼容参数未填入。","auto.changeSource":"更换来源","auto.multiple":"同名模型有多个原厂来源,请选择:","auto.similar":"目录中没有 {modelId},以下是相似模型:","auto.notFound":"目录中没有找到此模型,请手动填写。","thinking.title":"思考","thinking.format":"思考格式","thinking.protocolDefault":"协议默认","thinking.onlyCompletions":"仅 OpenAI Chat Completions 协议使用","thinking.levels":"思考档位","thinking.level.off":"关闭","thinking.level.minimal":"极低","thinking.level.low":"低","thinking.level.medium":"中","thinking.level.high":"高","thinking.level.xhigh":"超高","thinking.level.max":"最高","thinking.levelName":"{level}档位","thinking.levelValue":"{level}档位发送值","thinking.supportedDefault":"支持(默认值)","thinking.unsupported":"不支持","thinking.supportedCustom":"支持,发送指定值","thinking.supported":"可选档位:{levels}","auth.title":"账户授权","auth.running":"授权中","auth.openPage":"打开授权页面","auth.code":"验证码:{code}","auth.browser":"浏览器登录(OAuth)","auth.deviceCode":"设备码登录","auth.redirectFull":"完整回调地址","auth.redirectOrCode":"授权码或回调地址","auth.manualNote":"完成授权后若未自动返回,请粘贴回调地址。","auth.waiting":"等待授权完成…","auth.cancel":"取消授权","auth.configureCredential":"配置凭证","auth.signInAgain":"重新登录","auth.signIn":"登录账户","auth.removeCredential":"移除凭证","auth.signOut":"退出登录","auth.statusFailed":"读取授权状态失败","auth.refresh":"刷新状态","picker.loadFailed":"Provider 列表读取失败"},UT={"sidebar.label":"会话列表","sidebar.create":"打开新建菜单","sidebar.createMenu":"新建菜单","sidebar.newChannel":"新建频道","sidebar.newSection":"新建频道分组","sidebar.newBot":"新建 Bot","sidebar.alerts":"{count} 条发给你的未读","sidebar.unread":"{count} 条未读","sidebar.said":"{name}:{text}","sidebar.atMe":"[有人@我]","sidebar.more":"{name} 的更多操作","sidebar.asking":"(等你回答)","sidebar.working":"(工作中)","sidebar.pinned":"已置顶","sidebar.muted":"免打扰","sidebar.hasUnread":"有未读","sidebar.editSection":"编辑分组:{name}","sidebar.search":"搜索会话和消息","sidebar.results":"搜索结果","sidebar.chats":"会话","sidebar.nav":"频道与私信","sidebar.followed":"我关注的线程","sidebar.channels":"频道","sidebar.dms":"私信","sidebar.noDms":"暂无私信","search.title":"搜索","search.paneLabel":"聊天内搜索","search.inThread":"本线程","search.inDm":"本私聊","search.close":"关闭搜索","search.placeholder":"搜索消息","search.channelPlaceholder":"搜索频道和它的线程里的消息","search.prompt":"输入要找的文字","search.searching":"正在搜索…","search.noMessages":"没有找到消息","search.count":{one:"{count} 条,最新在前",other:"{count} 条,最新在前"},"search.countLatest":"最近 {count} 条,最新在前","search.showAll":"查看全部 {count} 条","search.threads":"线程","search.channels":"频道(主题与公告)","search.messages":"消息","search.channel":"频道","member.unknown":"未知成员","member.deleted":"{name}(已删除)","members.view":"查看 {name}","members.remove":"移出 {name}","members.count":{one:"{count} 位成员",other:"{count} 位成员"},"members.people":"人","members.removeTitle":"把 {name} 移出 #{channel}","members.removeBody":"移出后不再收到这个频道的消息。","members.removeConfirm":"移出","chat.area":"对话区域","chat.botDms":"{name} 的 Bot 私聊","chat.botStatus":"Bot 状态","chat.transcript":"聊天记录","chat.loading":"正在读取会话…","chat.empty":"暂无消息","chat.start":"与 {name} 开始对话","chat.loadingOlder":"正在加载更早的消息…","chat.toLatest":"回到最新消息","chat.unseen":{one:"{count} 条新消息",other:"{count} 条新消息"},"chat.toChannel":"发消息到 #{name}","chat.toBot":"发消息给 {name}…","chat.pickModel":"先选择模型,再发送消息","chat.pick":"选择一个会话","channel.infoFor":"频道信息:{name}","channel.membersCount":{one:"成员 {count}",other:"成员 {count}"},"channel.members":"成员","channel.search":"搜索频道消息(Ctrl+F)","channel.threads":"线程","notice.title":"公告","notice.edit":"编辑公告","notice.content":"公告内容","notice.none":"暂无公告","notice.version":"第 {version} 版","chat.newBelow":"以下为新消息","channel.echo":"回复了线程「{title}」","channel.replies":{one:"{count} 条回复",other:"{count} 条回复"},"channel.threadDone":"已完成","channel.lastReply":"最后回复 {time}","channel.replyInThread":"在线程中回复","info.edit":"编辑{name}","info.memberList":"成员列表","info.back":"返回频道信息","info.addMembers":"添加成员","info.name":"名称","info.newChannel":"新频道","info.topic":"主题","info.noTopic":"暂无主题","info.section":"分组","info.menu":"频道","info.noSection":"无","mention.menu":"提及成员","mention.outside":"不在本频道中","mention.outsideList":"不在本频道中的成员","mention.searchOutside":"搜索不在本频道中的成员","mention.invites":"选中后会拉进本频道","quote.inline":"「{text}」","quote.by":"{name}:","quote.remove":"移除引用:{text}","quote.tooMany":"一条消息最多引用 {count} 段","quote.selection":"选中的文字","quote.copy":"复制","quote.quote":"在回复中引用","composer.busy":"附件上传中,请稍后再添加。","composer.tooMany":"每条消息最多添加 {count} 个附件。","composer.size":"每个附件必须在 1 字节到 10 MB 之间。","composer.pasted":"粘贴图片","composer.removeFile":"移除附件:{name}","composer.uploading":"正在上传:{name}","composer.replying":"回复","composer.cancelReply":"取消回复","composer.drop":"松开以添加附件","composer.attach":"上传附件","composer.input":"输入消息","composer.send":"发送消息","files.preview":"预览 {name}","files.download":"下载 {name}","files.gone":"附件不存在或已被删除","files.readFailed":"读取失败({status})","files.readError":"读取失败","files.kindImage":"图片","files.kindSvg":"SVG","files.kindHtml":"HTML","files.kindMarkdown":"Markdown","files.kindText":"文本","files.kindFile":"文件","files.downloadFile":"下载文件","files.showPreview":"预览","files.showSource":"源码","files.showText":"原文","files.openTab":"在新标签打开(沙箱运行)","files.narrow":"收起预览","files.widen":"扩大预览","files.closePreview":"关闭附件预览","files.running":"正在沙箱中运行脚本:它可以访问网络,但读不到 Jarvy 的数据。","files.scripts":{one:"这个 HTML 含有脚本({count} 处{hosts})。当前显示的是去掉脚本后的静态效果;运行后它可以访问网络,但读不到 Jarvy 的数据。",other:"这个 HTML 含有脚本({count} 处{hosts})。当前显示的是去掉脚本后的静态效果;运行后它可以访问网络,但读不到 Jarvy 的数据。"},"files.scriptHosts":",引用 {hosts}","files.andMore":" 等","files.stop":"停止运行","files.run":"运行预览","files.downloadToView":"此文件请下载后查看","files.tooLarge":"文件超过 1 MB,不在页面内预览。","files.unsupported":"这种文件类型不支持在页面内预览。","files.reading":"正在读取文件…","files.runningTitle":"{name}(运行中)","files.previous":"上一个附件","files.choose":"选择预览文件","files.next":"下一个附件","question.failed":"提交失败","question.dismissed":"已忽略","question.chose":"已选:{answer}","question.dismissLabel":"关闭问题,不回答","question.dismiss":"不回答","question.multiple":"可多选","question.note":"补充说明(可选)","question.own":"或者自己填写…","question.ownLabel":"自己填写回答","question.confirmCount":"确定({count})","question.confirm":"确定","question.send":"发送","directs.back":"返回列表","directs.between":"{name} 与 {other}","directs.readOnly":"只读","files.kindVideo":"视频","files.kindAudio":"音频","files.cantPlay":"这个浏览器播放不了","files.cantPlayHint":"下载后用播放器打开。"},qT={"threadSort.title":"排序","threadSort.current":"排序:{order}","threadSort.updated":"最近更新","threadSort.created":"创建时间","threadSort.status":"状态","threads.list":"线程列表","threads.closeList":"关闭线程列表","threads.byStatus":"按状态筛选","threads.openCount":"进行中 {count}","threads.doneCount":"已完成 {count}","threads.all":"全部","threads.loading":"正在读取…","threads.none":"暂无线程","threads.following":"已关注","threads.filter":"筛选","threads.unreadCount":"未读 {count}","threads.unread":"未读","threads.noneUnread":"暂无未读线程","threads.noneOpen":"暂无进行中的线程","threads.noneDone":"暂无已完成的线程","threads.notFollowing":"未关注","threads.pick":"选择一个线程","threads.open":"进行中","thread.rename":"修改标题","thread.title":"线程标题","thread.toggleStatus":"切换状态","thread.summary":"摘要","thread.editSummary":"编辑摘要","thread.conclude":"完成并把摘要发到 #{channel}","thread.addSummary":"添加摘要","thread.sourceElsewhere":"原消息不在这个线程里","thread.label":"线程","thread.backToList":"返回线程列表","thread.inChannel":"在频道中查看","thread.search":"搜索线程消息(Ctrl+F)","thread.followingHint":"新回复计入未读","thread.notFollowingHint":"新回复不计入未读","thread.follow":"关注","thread.expand":"展开","thread.collapse":"收起到侧栏","thread.close":"关闭线程","thread.conclusion":"结论:","thread.concluded":"已完成,摘要已发到 #{channel}","thread.noReplies":"暂无回复","thread.toLatest":"回到最新回复","thread.reply":"回复线程"},FT={"usage.title":"用量","usage.back":"返回 Bot 信息","usage.range":"时间范围","usage.today":"今天","usage.days":"{count} 天","usage.refresh":"刷新","usage.refreshLabel":"刷新用量","usage.retry":"重试","usage.loading":"读取用量…","usage.loadFailed":"用量加载失败","usage.empty":"这段时间没有模型调用","usage.model":"模型","usage.calls":"调用","usage.input":"输入","usage.output":"输出","usage.cacheRead":"缓存读","usage.cacheWrite":"缓存写","usage.cost":"费用","usage.total":"合计","usage.unpriced":"未配置价格","usage.note":"输入、输出和缓存的单位是 token。","usage.notePartial":"输入、输出和缓存的单位是 token;合计费用不含未配置价格的模型。","activity.error":"运行出错","activity.running":"运行中","activity.reasoning":"思考中","activity.texting":"处理中","activity.toolCalling":"执行工具","activity.asking":"等你回答","activity.noModel":"未设置模型","activity.idle":"空闲","activity.stopped":"未运行","bot.saved":"已保存","bot.changeFailed":"修改失败","bot.noDescription":"还没有描述","bot.color":"形象颜色","bot.contextHint":"Pi 上下文估算","bot.context":"上下文","bot.unknown":"未知","bot.tokens":"{used} / {window} tokens","bot.profile":"个人设定","bot.description":"描述","bot.descriptionPlaceholder":"这个 Bot 能帮你做什么?","bot.personaPlaceholder":"Bot 的性格、职责与行为偏好","bot.personaHint":"作为系统提示词的一部分,下一次执行时生效。","bot.unsaved":"有未保存的修改","bot.saving":"保存中…","bot.runtime":"运行","agent.title":"主 Bot","agent.intro":"{name} 是你的主 Bot,替你打理 Jarvy 本身。在私信或频道里跟它说一声,它就能:","agent.create":"新建 Bot,修改它们的名字、描述和 Persona","agent.model":"给 Bot 选模型和思考强度","agent.run":"启动、停止 Bot,查看用量","agent.delete":"删除 Bot、频道、频道分组,或把成员移出频道,每次都先弹卡片请你确认","agent.note":"主 Bot 不能删除,但可以改名或停止。模型连接和密钥仍由你在设置里添加。","bot.status":"状态","bot.statusHint":"停止后保留原会话,启动不会主动请求模型","bot.aborting":"取消中…","bot.abort":"取消本轮","bot.starting":"启动中…","bot.stopping":"停止中…","bot.start":"启动","bot.stop":"停止","bot.workspace":"工作区","bot.copyWorkspace":"复制工作区路径","bot.activity":"活动历史","bot.activityHint":"聊天发言与 History 时间线","bot.usageHint":"按模型统计 token 和费用","bot.subscriptions":"订阅","bot.noSubscriptions":"暂无订阅","bot.threadIn":"线程 · #{channel}","botModel.auto":"跟随 Pi 默认","botModel.off":"关闭思考","botModel.minimal":"最少思考","botModel.low":"少量思考","botModel.medium":"适中思考","botModel.high":"更多思考","botModel.xhigh":"高强度思考","botModel.max":"最高强度思考","botModel.loadFailed":"模型列表读取失败","botModel.switchFailed":"切换失败","botModel.pick":"选择 Bot 模型","botModel.broken":"模型配置已失效","botModel.choose":"选择模型","botModel.filter":"筛选 Bot 模型","botModel.filterPlaceholder":"筛选模型…","botModel.list":"Bot 模型","botModel.noMatch":"没有匹配的模型","botModel.none":"暂无已添加的模型","botModel.manage":"管理模型","botModel.thinking":"思考强度","botModel.pickThinking":"选择思考强度","botModel.loading":"加载模型…","botModel.switching":"正在切换…","botModel.pickFor":"为 {name} 选择模型","deleteBot.title":"删除 {name}","deleteBot.after":"删除后:","deleteBot.chats":{one:"它的 {count} 个私聊、频道成员身份和订阅都会被删掉。",other:"它的 {count} 个私聊、频道成员身份和订阅都会被删掉。"},"deleteBot.messages":"它在频道和线程里发过的消息会保留,发送者显示为「{name}」,名字可以重新使用。","deleteBot.history":"它的会话历史和未完成的任务都会被清除。","deleteBot.files":"同时删除工作区文件夹","deleteBot.filesHint":"工作区里可能有它做的文件(Bot 目录下的 workspace)。默认保留。","deleteBot.deleting":"删除中…","deleteBot.working":"处理中…","history.reasoning":"思考","history.text":"正文","history.empty":"(空)","history.image":"History 中的图片","history.toolCall":"工具调用","history.toolResult":"工具结果","history.error":"出错","history.related":"查看关联记录 #{id}","history.result":"结果","history.call":"调用","history.details":"结构化结果","history.view":"记录显示方式","history.content":"内容","history.json":"原始 JSON","history.contentLabel":"记录内容","history.tools":"工具定义","history.toolsRemoved":"移除的工具","history.stopReason":"结束原因","activity.detailFailed":"记录读取失败","activity.detailLoading":"读取记录…","activity.openChat":"打开聊天","activity.sentBy":"发送调用 #{id}","activity.roleSystem":"系统","activity.roleUser":"输入","activity.roleAssistant":"助手","activity.timeline":"Bot 活动时间线","activity.chatMessage":"聊天发言 {id}","activity.viewMessage":"查看聊天消息 {sequence} · {chat}","activity.attachmentOnly":"附件消息","activity.attachments":{one:"{count} 个附件",other:"{count} 个附件"},"activity.viewSentBy":"查看发送调用 #{id}","activity.historyRecord":"History 记录 #{id}","activity.viewHistory":"查看 History #{id} · {role}","activity.emptyMessage":"(空消息)","activity.loadFailed":"活动记录加载失败","activity.backToTimeline":"返回时间线","activity.chatRecord":"聊天记录","activity.newestFirst":"最新记录在前","activity.refresh":"刷新活动历史","activity.reading":"读取中…","activity.columnChat":"聊天","activity.columnTime":"时间","activity.loading":"加载活动记录…","activity.empty":"还没有活动记录","activity.emptyHint":"聊天发言与 History 会显示在这里","activity.newer":"较新","activity.page":"第 {page} 页","activity.older":"较早","activity.historyDetail":"History 记录详情","activity.chatDetail":"聊天记录详情","activity.toolCall":"调用 {name}","activity.toolResult":"{name} · 执行结果","activity.toolFailed":"{name} · 执行出错","activity.images":{one:"{count} 张图片",other:"{count} 张图片"},"bot.newName":"新 Bot","bot.newNameN":"新 Bot {n}"},VT={"npc.toolbar":"NPC 原型","npc.replay":"重播","npc.mood":"基础心情","npc.mood.normal":"普通","npc.mood.happy":"开心","npc.mood.sad":"难过","npc.mood.angry":"生气","npc.mood.dizzy":"晕","npc.poses":"动作","npc.pose.sleep":"睡觉","npc.pose.idle":"空闲","npc.pose.think":"思考","npc.pose.mutter":"自言自语","npc.pose.say":"对你说话","npc.pose.ask":"等你回答","npc.pose.read":"读文件","npc.pose.work":"改文件、跑命令","npc.pose.compact":"压缩上下文","npc.pose.busy":"重试","npc.pose.failed":"报错","npc.pose.done":"做完了","npc.pose.groom":"舔爪子","npc.expand":"展开过程","npc.collapse":"收起","npc.panel":"这一轮","npc.state.running":"进行中","npc.state.ok":"成功","npc.state.failed":"失败","npc.duration":"{value} 秒","npc.done":"做完了 · {duration}","npc.mutter":"({text})","npc.to":"→ {chat}","npc.step.think":"思考","npc.step.mutter":"自言自语","npc.step.read.running":"在读 {target}","npc.step.read.ok":"读了 {target}","npc.step.write.running":"在改 {target}","npc.step.write.ok":"改好了 {target}","npc.step.run.running":"在跑 {target}","npc.step.run.ok":"跑完了 {target}","npc.step.run.failed":"{target} 失败了","npc.step.compact.running":"在整理上下文","npc.step.compact.ok":"整理好了上下文","npc.step.ask.running":"在等你回答","npc.step.ask.ok":"你选了「{answer}」","npc.step.say.running":"在回复你","npc.step.say.ok":"回复了你","npc.step.post.running":"在发到 {chat}","npc.step.post.ok":"发到了 {chat}","npc.demo.think1":"fish 说线程面板打开时会跳一下。可能是滚动的时机不对。先看看 ThreadPane 是怎么滚动的。","npc.demo.think2":"它在回复还没量好高度时就滚了。改成布局之后再滚应该就好。回复数也要算进依赖里。","npc.demo.mutter1":"改好了,先跑一遍构建看看。","npc.demo.mutter2":"嗯……类型没过,ref 可能是空的。","npc.demo.channel":"研发","npc.demo.post":"线程面板打开时跳一下的问题修好了,构建通过,等 fish 确认。","npc.demo.question":"修好了。要不要顺便更新文档里的截图?","npc.demo.yes":"要,一起更新","npc.demo.no":"先不用","npc.demo.replyYes":"好了:线程面板现在打开就停在最新回复,不会再跳;文档里的截图也换成了新的。构建通过。","npc.demo.replyNo":"好了:线程面板现在打开就停在最新回复,不会再跳。构建通过,截图先没动。","npc.live.omitted":"……省略 {count} 字……","npc.live.tokens":"上下文:{before} → {after} tokens","npc.live.compact.running":"在整理上下文","npc.live.compact.ok":"整理好了上下文","npc.live.compact.failed":"整理上下文失败了","npc.live.retry.running":"在重试(第 {attempt}/{max} 次)","npc.live.retry.ok":"重试成功","npc.live.retry.failed":"重试失败了","npc.live.read.running":"在读 {target}","npc.live.read.ok":"读了 {target}","npc.live.read.failed":"没读到 {target}","npc.live.edit.running":"在改 {target}","npc.live.edit.ok":"改好了 {target}","npc.live.edit.failed":"没改成 {target}","npc.live.write.running":"在写 {target}","npc.live.write.ok":"写好了 {target}","npc.live.write.failed":"没写成 {target}","npc.live.run.running":"在跑 {target}","npc.live.run.ok":"跑完了 {target}","npc.live.run.failed":"{target} 失败了","npc.live.script.running":"在跑一段脚本","npc.live.script.ok":"跑完了一段脚本","npc.live.script.failed":"脚本出错了","npc.live.tool.running":"在用 {tool}","npc.live.tool.ok":"用了 {tool}","npc.live.tool.failed":"{tool} 出错了","npc.live.sendFailed":"消息没发出去","npc.live.askFailed":"问题没发出去","npc.live.askClosed":"问题关掉了","npc.live.answerBelow":"在下面的卡片里回答","npc.live.answerIn":"去 {chat} 里回答","npc.live.browse.running":"在翻看 {chat}","npc.live.browse.ok":"翻看了 {chat}","npc.live.browseAll.running":"在翻看聊天","npc.live.browseAll.ok":"翻看了聊天","npc.done.interrupted":"被打断了 · {duration}","npc.done.failed":"这一轮失败了 · {duration}"},$T={...PT,...HT,...UT,...qT,...FT,...VT},M2=["en","zh"],O2={en:BT,zh:$T},Sc={en:"en",zh:"zh-CN"},R2="jarvy-locale";function YT(){var a;const e=localStorage.getItem(R2);if(e==="en"||e==="zh")return e;const i=((a=navigator.languages)!=null&&a.length?navigator.languages:[navigator.language]).map(l=>l.toLowerCase()).find(l=>/^(en|zh)\b/.test(l));return i!=null&&i.startsWith("zh")?"zh":"en"}let Da=YT();document.documentElement.lang=Sc[Da];const wp=new Set,qd=()=>Da;function _2(e){if(e!==Da){Da=e,localStorage.setItem(R2,e),document.documentElement.lang=Sc[e];for(const i of wp)i()}}function D2(){return k.useSyncExternalStore(e=>(wp.add(e),()=>{wp.delete(e)}),qd)}const Sp=(e,i)=>O2[e][i==="name"?"locale.name":"locale.short"];function z2(e,i){const a=O2[Da][e];return typeof a=="string"?a:new Intl.PluralRules(Sc[Da]).select(Number(i))==="one"?a.one:a.other}function j(e,i){const a=z2(e,i==null?void 0:i.count);return i?a.replace(/\{(\w+)\}/g,(l,s)=>s in i?String(i[s]):l):a}const Ha=(e,i)=>new Date(e).toLocaleString(Sc[Da],i),cc=e=>Ha(e,{hour:Da==="zh"?"2-digit":"numeric",minute:"2-digit"}),GT=e=>{const i=new Date(e).getFullYear()===new Date().getFullYear();return Ha(e,{year:i?void 0:"numeric",month:Da==="zh"?"numeric":"short",day:"numeric"})},za=(e,i)=>new Intl.NumberFormat(Sc[Da],i).format(e);function L2(e,i){return z2(e,i.count).split(/\{(\w+)\}/).map((a,l)=>u.jsx(k.Fragment,{children:l%2?i[a]??`{${a}}`:a},l))}class es extends Error{constructor(i,a,l,s){super(a),this.status=i,this.code=l,this.params=s}}async function Re(e,i={}){let a;try{a=await fetch(`/api${e}`,{...i,credentials:"same-origin",headers:{...i.body&&!(i.body instanceof Blob)?{"Content-Type":"application/json"}:{},...i.headers}})}catch{throw new Error(j("api.offline"))}const l=await a.json().catch(()=>({}));if(!a.ok)throw I2(a.status,l);return l}const I2=(e,i)=>{const a=typeof i=="object"&&i!==null?i:{};return new es(e,a.error===void 0?`HTTP ${e}`:String(a.error),typeof a.code=="string"?a.code:void 0,a.params)};function XT(e,i,a){return new Promise((l,s)=>{const c=new XMLHttpRequest;c.open("POST",`/api/chats/${e}/attachments`),c.setRequestHeader("Content-Type",i.type||"application/octet-stream"),c.setRequestHeader("X-File-Name",encodeURIComponent(i.name)),c.upload.onprogress=d=>{d.lengthComputable&&(a==null||a(d.loaded/d.total))},c.onerror=()=>s(new Error(j("api.offline"))),c.onload=()=>{let d={};try{d=JSON.parse(c.responseText)}catch{}c.status>=200&&c.status<300?l(d):s(I2(c.status,d))},c.send(i)})}async function QT(e,i=0){const a=[];let l=i;for(;;){const s=await Re(`/chats/${e}/messages?after=${l}&limit=1000`);if(a.push(...s.messages),!s.hasMore)return{messages:a};if(s.nextSequence<=l)throw new Error(j("api.historyFailed"));l=s.nextSequence}}const wt=e=>JSON.stringify(e),je={me:()=>Re("/me"),search:(e,i)=>Re(`/search?q=${encodeURIComponent(e)}${i?`&in=${i}`:""}&limit=60`),login:(e,i)=>Re("/login",{method:"POST",body:wt({username:e,password:i})}),logout:()=>Re("/logout",{method:"POST"}),bots:()=>Re("/bots"),createBot:e=>Re("/bots",{method:"POST",body:wt({name:e})}),saveBot:(e,i)=>Re(`/bots/${e}`,{method:"PUT",body:wt(i)}),modelOptions:()=>Re("/model-options"),selectBotModel:(e,i,a,l,s)=>Re(`/bots/${e}/model`,{method:"PUT",body:wt({connectionId:i,modelId:a,thinkingLevel:l,language:s})}),answerQuestion:(e,i,a)=>Re(`/chats/${e}/questions/${i}`,{method:"POST",body:wt(a)}),setBotColor:(e,i)=>Re(`/bots/${e}/color`,{method:"PUT",body:wt({color:i})}),chats:()=>Re("/chats"),createChat:e=>Re("/chats",{method:"POST",body:wt({botId:e})}),deleteChat:e=>Re(`/chats/${e}`,{method:"DELETE"}),members:()=>Re("/members"),sections:()=>Re("/sections"),createSection:e=>Re("/sections",{method:"POST",body:wt(e)}),updateSection:(e,i)=>Re(`/sections/${e}`,{method:"PATCH",body:wt(i)}),deleteSection:e=>Re(`/sections/${e}`,{method:"DELETE"}),createChannel:e=>Re("/channels",{method:"POST",body:wt(e)}),updateChannel:(e,i)=>Re(`/chats/${e}`,{method:"PATCH",body:wt(i)}),addMember:(e,i)=>Re(`/chats/${e}/members`,{method:"POST",body:wt({memberId:i})}),removeMember:(e,i)=>Re(`/chats/${e}/members/${i}`,{method:"DELETE"}),setNote:(e,i)=>Re(`/chats/${e}/note`,{method:"PUT",body:wt({text:i})}),markRead:(e,i)=>Re(`/chats/${e}/read`,{method:"POST",body:wt({sequence:i})}),messages:QT,latestMessages:(e,i)=>Re(`/chats/${e}/messages?tail=${i}`),olderMessages:(e,i,a)=>Re(`/chats/${e}/messages?before=${i}&limit=${a}`),send:(e,i,a,l,s=!1,c,d=[])=>Re(`/chats/${e}/messages`,{method:"POST",body:wt({content:i,attachmentIds:a,clientMessageId:l,...s?{alsoToChannel:s}:{},...c?{replyTo:c}:{},...d.length?{quotes:d}:{}})}),react:(e,i,a)=>Re(`/messages/${e}/reaction`,{method:"PUT",body:wt({emoji:i,on:a})}),pin:(e,i)=>Re(`/chats/${e}/pin`,{method:"PUT",body:wt({pinned:i})}),mute:(e,i)=>Re(`/chats/${e}/mute`,{method:"PUT",body:wt({muted:i})}),deleteBot:(e,i)=>Re(`/bots/${e}${i?"?files=delete":""}`,{method:"DELETE"}),chat:e=>Re(`/chats/${e}`),message:e=>Re(`/messages/${e}`),openThread:e=>Re(`/messages/${e}/thread`,{method:"POST"}),channelThreads:e=>Re(`/chats/${e}/threads`),followedThreads:()=>Re("/threads"),updateThread:(e,i)=>Re(`/chats/${e}`,{method:"PATCH",body:wt(i)}),follow:(e,i)=>Re(`/chats/${e}/follow`,{method:"PUT",body:wt({following:i})}),botDirects:e=>Re(`/members/${e}/dms`),botSubscriptions:e=>Re(`/members/${e}/subscriptions`),controlBot:(e,i)=>Re(`/bots/${e}/${i}`,{method:"POST"}),botStatus:e=>Re(`/bots/${e}/status`),uploadAttachment:XT,removeAttachment:e=>Re(`/attachments/${e}`,{method:"DELETE"}),authStatus:e=>Re(`/model-connections/${e}/auth`),authStart:e=>Re(`/model-connections/${e}/auth`,{method:"POST"}),authCancel:e=>Re(`/model-connections/${e}/auth`,{method:"DELETE"}),authInput:(e,i,a)=>Re(`/model-connections/${e}/auth/input`,{method:"POST",body:wt({promptId:i,value:a})}),authLogout:e=>Re(`/model-connections/${e}/auth/logout`,{method:"POST"}),modelCatalog:e=>Re(`/model-connections/${e}/catalog`),providerModels:e=>Re(`/model-providers/${encodeURIComponent(e)}/models`),modelProviders:()=>Re("/model-providers"),autoconfigModel:e=>Re("/model-autoconfig",{method:"POST",body:wt(e)}),discoverModels:e=>Re("/model-discovery",{method:"POST",body:wt(e)}),modelConnections:()=>Re("/model-connections"),createModelConnection:e=>Re("/model-connections",{method:"POST",body:wt(e)}),updateModelConnection:(e,i)=>Re(`/model-connections/${e}`,{method:"PUT",body:wt(i)}),deleteModelConnection:e=>Re(`/model-connections/${e}`,{method:"DELETE"}),saveModelCredential:(e,i,a=!1)=>Re(`/model-connections/${e}/credential`,{method:"PUT",body:wt({apiKey:i,remove:a})}),saveConnectionModel:(e,i,a)=>Re(`/model-connections/${e}/models`,{method:a?"PUT":"POST",body:wt({model:i,originalId:a})}),deleteConnectionModel:(e,i)=>Re(`/model-connections/${e}/models`,{method:"DELETE",body:wt({modelId:i})})};/**
50
- * @license lucide-react v1.47.0 - ISC
51
- *
52
- * This source code is licensed under the ISC license.
53
- * See the LICENSE file in the root directory of this source tree.
54
- */const KT=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
55
- * @license lucide-react v1.47.0 - ISC
56
- *
57
- * This source code is licensed under the ISC license.
58
- * See the LICENSE file in the root directory of this source tree.
59
- */function ZT(e,i,a=[]){if(i==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:KT(e),size:24,node:i,...a.length>0?{aliases:a}:{}}}/**
60
- * @license lucide-react v1.47.0 - ISC
61
- *
62
- * This source code is licensed under the ISC license.
63
- * See the LICENSE file in the root directory of this source tree.
64
- */const JT=e=>{let i="",a=!1;for(const l of e){if(l==="-"||l==="_"||l<=" "){a=i.length>0;continue}i.length===0?i+=l.toLowerCase():i+=a?l.toUpperCase():l,a=!1}return i};/**
65
- * @license lucide-react v1.47.0 - ISC
66
- *
67
- * This source code is licensed under the ISC license.
68
- * See the LICENSE file in the root directory of this source tree.
69
- */const WT=e=>{const i=JT(e);return i.charAt(0).toUpperCase()+i.slice(1)};/**
70
- * @license lucide-react v1.47.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */const kp=(...e)=>e.filter((i,a,l)=>!!i&&i.trim()!==""&&l.indexOf(i)===a).join(" ").trim();/**
75
- * @license lucide-react v1.47.0 - ISC
76
- *
77
- * This source code is licensed under the ISC license.
78
- * See the LICENSE file in the root directory of this source tree.
79
- */const zl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
80
- * @license lucide-react v1.47.0 - ISC
81
- *
82
- * This source code is licensed under the ISC license.
83
- * See the LICENSE file in the root directory of this source tree.
84
- */function Dm(e){return e!=null}function eA(e,i={}){var b,x;const a=i.attributeNames??{},l=w=>a[w]??w,s=e.size??e.width??zl.width,c=e.size??e.height??zl.height,d=((b=e.aliases)==null?void 0:b.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`))??[],f=[...e.name?[`lucide-${e.name}`]:[],...d],m=((x=i.className)==null?void 0:x.split(" ").filter(Boolean))??[],v=i.includeDefaultClasses===!1?kp(...m):kp("lucide",...f,...m),y=i.absoluteStrokeWidth?Number(i.strokeWidth??zl["stroke-width"])*Number(e.size??e.width??zl.width)/Number(i.size??i.width??zl.width):i.strokeWidth??zl["stroke-width"];return["svg",{...Object.entries(zl).reduce((w,[S,C])=>(w[l(S)]=C,w),{}),..."color"in i&&i.color&&{[l("stroke")]:i.color},..."size"in i&&Dm(i.size)&&{[l("width")]:i.size,[l("height")]:i.size},..."width"in i&&Dm(i.width)&&{[l("width")]:i.width},..."height"in i&&Dm(i.height)&&{[l("height")]:i.height},[l("stroke-width")]:y,...v&&{[l("class")]:v},[l("viewBox")]:`0 0 ${s} ${c}`,...i.hasA11yProp===!1?{[l("aria-hidden")]:"true"}:{},..."attributes"in i&&i.attributes},e.node.map(w=>{const[S,C,N]=w,M=i.nonScalingStroke?{[l("vector-effect")]:"non-scaling-stroke",...C}:C;return N?[S,M,N]:[S,M]})]}/**
85
- * @license lucide-react v1.47.0 - ISC
86
- *
87
- * This source code is licensed under the ISC license.
88
- * See the LICENSE file in the root directory of this source tree.
89
- */function tA(e,i={}){return eA(e,{...i,attributeNames:{...i.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
90
- * @license lucide-react v1.47.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */const nA=e=>{for(const i in e)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},iA=k.createContext({}),aA=()=>k.useContext(iA),rA=k.forwardRef(({color:e,size:i,width:a,height:l,strokeWidth:s,absoluteStrokeWidth:c,nonScalingStroke:d,className:f="",children:m,iconNode:v=[],icon:y={node:v,aliases:[],size:24},...g},b)=>{const{size:x=24,strokeWidth:w=2,absoluteStrokeWidth:S=!1,nonScalingStroke:C=!1,color:N="currentColor",className:M=""}=aA()??{},T=!!m||nA(g),[A,I,D=[]]=tA(y,{color:e??N,width:a??i??x,height:l??i??x,strokeWidth:s??w,absoluteStrokeWidth:c??S,nonScalingStroke:d??C,className:kp(M,f),hasA11yProp:T,attributes:g});return k.createElement(A,{ref:b,...I},[...D.map(([B,P])=>k.createElement(B,P)),...Array.isArray(m)?m:[m]])});/**
95
- * @license lucide-react v1.47.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */function Ae(e,i=[],a=[]){const l=typeof e=="string"?ZT(e,i,a):e,s=k.forwardRef(({className:c,...d},f)=>k.createElement(rA,{ref:f,icon:l,className:c,...d}));return l.name&&(s.displayName=WT(l.name)),s}/**
100
- * @license lucide-react v1.47.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const B2={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};B2.node;const lA=Ae(B2);/**
105
- * @license lucide-react v1.47.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */const P2={name:"archive",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]};P2.node;const oA=Ae(P2);/**
110
- * @license lucide-react v1.47.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const H2={name:"arrow-down-up",size:24,node:[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]};H2.node;const sA=Ae(H2);/**
115
- * @license lucide-react v1.47.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const U2={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};U2.node;const Fd=Ae(U2);/**
120
- * @license lucide-react v1.47.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const q2={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};q2.node;const Cp=Ae(q2);/**
125
- * @license lucide-react v1.47.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const F2={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};F2.node;const cA=Ae(F2);/**
130
- * @license lucide-react v1.47.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const V2={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};V2.node;const uA=Ae(V2);/**
135
- * @license lucide-react v1.47.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const $2={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};$2.node;const dA=Ae($2);/**
140
- * @license lucide-react v1.47.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const Y2={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};Y2.node;const fA=Ae(Y2);/**
145
- * @license lucide-react v1.47.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const G2={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};G2.node;const hA=Ae(G2);/**
150
- * @license lucide-react v1.47.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const X2={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};X2.node;const ur=Ae(X2);/**
155
- * @license lucide-react v1.47.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const Q2={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Q2.node;const ts=Ae(Q2);/**
160
- * @license lucide-react v1.47.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const K2={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};K2.node;const Z2=Ae(K2);/**
165
- * @license lucide-react v1.47.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const J2={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};J2.node;const Kr=Ae(J2);/**
170
- * @license lucide-react v1.47.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const W2={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};W2.node;const mA=Ae(W2);/**
175
- * @license lucide-react v1.47.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const ej={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};ej.node;const tj=Ae(ej);/**
180
- * @license lucide-react v1.47.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const nj={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};nj.node;const pA=Ae(nj);/**
185
- * @license lucide-react v1.47.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const ij={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};ij.node;const aj=Ae(ij);/**
190
- * @license lucide-react v1.47.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const rj={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};rj.node;const wx=Ae(rj);/**
195
- * @license lucide-react v1.47.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const lj={name:"expand",size:24,node:[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]]};lj.node;const gA=Ae(lj);/**
200
- * @license lucide-react v1.47.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const oj={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};oj.node;const vA=Ae(oj);/**
205
- * @license lucide-react v1.47.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const sj={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};sj.node;const yA=Ae(sj);/**
210
- * @license lucide-react v1.47.0 - ISC
211
- *
212
- * This source code is licensed under the ISC license.
213
- * See the LICENSE file in the root directory of this source tree.
214
- */const cj={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};cj.node;const bA=Ae(cj);/**
215
- * @license lucide-react v1.47.0 - ISC
216
- *
217
- * This source code is licensed under the ISC license.
218
- * See the LICENSE file in the root directory of this source tree.
219
- */const uj={name:"face-slightly-smiling-plus",size:24,node:[["path",{d:"M13.267 2.08a10 10 0 108.653 8.653",key:"1wbpyh"}],["path",{d:"M15 10V9",key:"4dkmfx"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M16.472 15a6 6 0 01-8.943 0",key:"7qomzy"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M9 10V9",key:"1lazqi"}]],aliases:["smile-plus"]};uj.node;const xA=Ae(uj);/**
220
- * @license lucide-react v1.47.0 - ISC
221
- *
222
- * This source code is licensed under the ISC license.
223
- * See the LICENSE file in the root directory of this source tree.
224
- */const dj={name:"file-headphone",size:24,node:[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],aliases:["file-audio","file-audio-2"]};dj.node;const jA=Ae(dj);/**
225
- * @license lucide-react v1.47.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const fj={name:"file-play",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],aliases:["file-video"]};fj.node;const wA=Ae(fj);/**
230
- * @license lucide-react v1.47.0 - ISC
231
- *
232
- * This source code is licensed under the ISC license.
233
- * See the LICENSE file in the root directory of this source tree.
234
- */const hj={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};hj.node;const SA=Ae(hj);/**
235
- * @license lucide-react v1.47.0 - ISC
236
- *
237
- * This source code is licensed under the ISC license.
238
- * See the LICENSE file in the root directory of this source tree.
239
- */const mj={name:"file",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]};mj.node;const kA=Ae(mj);/**
240
- * @license lucide-react v1.47.0 - ISC
241
- *
242
- * This source code is licensed under the ISC license.
243
- * See the LICENSE file in the root directory of this source tree.
244
- */const pj={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};pj.node;const CA=Ae(pj);/**
245
- * @license lucide-react v1.47.0 - ISC
246
- *
247
- * This source code is licensed under the ISC license.
248
- * See the LICENSE file in the root directory of this source tree.
249
- */const gj={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};gj.node;const EA=Ae(gj);/**
250
- * @license lucide-react v1.47.0 - ISC
251
- *
252
- * This source code is licensed under the ISC license.
253
- * See the LICENSE file in the root directory of this source tree.
254
- */const vj={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};vj.node;const NA=Ae(vj);/**
255
- * @license lucide-react v1.47.0 - ISC
256
- *
257
- * This source code is licensed under the ISC license.
258
- * See the LICENSE file in the root directory of this source tree.
259
- */const yj={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};yj.node;const dg=Ae(yj);/**
260
- * @license lucide-react v1.47.0 - ISC
261
- *
262
- * This source code is licensed under the ISC license.
263
- * See the LICENSE file in the root directory of this source tree.
264
- */const bj={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};bj.node;const TA=Ae(bj);/**
265
- * @license lucide-react v1.47.0 - ISC
266
- *
267
- * This source code is licensed under the ISC license.
268
- * See the LICENSE file in the root directory of this source tree.
269
- */const xj={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};xj.node;const jj=Ae(xj);/**
270
- * @license lucide-react v1.47.0 - ISC
271
- *
272
- * This source code is licensed under the ISC license.
273
- * See the LICENSE file in the root directory of this source tree.
274
- */const wj={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};wj.node;const AA=Ae(wj);/**
275
- * @license lucide-react v1.47.0 - ISC
276
- *
277
- * This source code is licensed under the ISC license.
278
- * See the LICENSE file in the root directory of this source tree.
279
- */const Sj={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};Sj.node;const MA=Ae(Sj);/**
280
- * @license lucide-react v1.47.0 - ISC
281
- *
282
- * This source code is licensed under the ISC license.
283
- * See the LICENSE file in the root directory of this source tree.
284
- */const kj={name:"message-circle-question-mark",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["message-circle-question"]};kj.node;const OA=Ae(kj);/**
285
- * @license lucide-react v1.47.0 - ISC
286
- *
287
- * This source code is licensed under the ISC license.
288
- * See the LICENSE file in the root directory of this source tree.
289
- */const Cj={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};Cj.node;const RA=Ae(Cj);/**
290
- * @license lucide-react v1.47.0 - ISC
291
- *
292
- * This source code is licensed under the ISC license.
293
- * See the LICENSE file in the root directory of this source tree.
294
- */const Ej={name:"message-square-text",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]};Ej.node;const _A=Ae(Ej);/**
295
- * @license lucide-react v1.47.0 - ISC
296
- *
297
- * This source code is licensed under the ISC license.
298
- * See the LICENSE file in the root directory of this source tree.
299
- */const Nj={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};Nj.node;const DA=Ae(Nj);/**
300
- * @license lucide-react v1.47.0 - ISC
301
- *
302
- * This source code is licensed under the ISC license.
303
- * See the LICENSE file in the root directory of this source tree.
304
- */const Tj={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};Tj.node;const Aj=Ae(Tj);/**
305
- * @license lucide-react v1.47.0 - ISC
306
- *
307
- * This source code is licensed under the ISC license.
308
- * See the LICENSE file in the root directory of this source tree.
309
- */const Mj={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};Mj.node;const zA=Ae(Mj);/**
310
- * @license lucide-react v1.47.0 - ISC
311
- *
312
- * This source code is licensed under the ISC license.
313
- * See the LICENSE file in the root directory of this source tree.
314
- */const Oj={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};Oj.node;const LA=Ae(Oj);/**
315
- * @license lucide-react v1.47.0 - ISC
316
- *
317
- * This source code is licensed under the ISC license.
318
- * See the LICENSE file in the root directory of this source tree.
319
- */const Rj={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};Rj.node;const IA=Ae(Rj);/**
320
- * @license lucide-react v1.47.0 - ISC
321
- *
322
- * This source code is licensed under the ISC license.
323
- * See the LICENSE file in the root directory of this source tree.
324
- */const _j={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};_j.node;const BA=Ae(_j);/**
325
- * @license lucide-react v1.47.0 - ISC
326
- *
327
- * This source code is licensed under the ISC license.
328
- * See the LICENSE file in the root directory of this source tree.
329
- */const Dj={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};Dj.node;const fg=Ae(Dj);/**
330
- * @license lucide-react v1.47.0 - ISC
331
- *
332
- * This source code is licensed under the ISC license.
333
- * See the LICENSE file in the root directory of this source tree.
334
- */const zj={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};zj.node;const PA=Ae(zj);/**
335
- * @license lucide-react v1.47.0 - ISC
336
- *
337
- * This source code is licensed under the ISC license.
338
- * See the LICENSE file in the root directory of this source tree.
339
- */const Lj={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};Lj.node;const HA=Ae(Lj);/**
340
- * @license lucide-react v1.47.0 - ISC
341
- *
342
- * This source code is licensed under the ISC license.
343
- * See the LICENSE file in the root directory of this source tree.
344
- */const Ij={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};Ij.node;const Ep=Ae(Ij);/**
345
- * @license lucide-react v1.47.0 - ISC
346
- *
347
- * This source code is licensed under the ISC license.
348
- * See the LICENSE file in the root directory of this source tree.
349
- */const Bj={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Bj.node;const Vd=Ae(Bj);/**
350
- * @license lucide-react v1.47.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */const Pj={name:"quote",size:24,node:[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]};Pj.node;const UA=Ae(Pj);/**
355
- * @license lucide-react v1.47.0 - ISC
356
- *
357
- * This source code is licensed under the ISC license.
358
- * See the LICENSE file in the root directory of this source tree.
359
- */const Hj={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};Hj.node;const hg=Ae(Hj);/**
360
- * @license lucide-react v1.47.0 - ISC
361
- *
362
- * This source code is licensed under the ISC license.
363
- * See the LICENSE file in the root directory of this source tree.
364
- */const Uj={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};Uj.node;const qA=Ae(Uj);/**
365
- * @license lucide-react v1.47.0 - ISC
366
- *
367
- * This source code is licensed under the ISC license.
368
- * See the LICENSE file in the root directory of this source tree.
369
- */const qj={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};qj.node;const FA=Ae(qj);/**
370
- * @license lucide-react v1.47.0 - ISC
371
- *
372
- * This source code is licensed under the ISC license.
373
- * See the LICENSE file in the root directory of this source tree.
374
- */const Fj={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};Fj.node;const VA=Ae(Fj);/**
375
- * @license lucide-react v1.47.0 - ISC
376
- *
377
- * This source code is licensed under the ISC license.
378
- * See the LICENSE file in the root directory of this source tree.
379
- */const Vj={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};Vj.node;const kc=Ae(Vj);/**
380
- * @license lucide-react v1.47.0 - ISC
381
- *
382
- * This source code is licensed under the ISC license.
383
- * See the LICENSE file in the root directory of this source tree.
384
- */const $j={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};$j.node;const $A=Ae($j);/**
385
- * @license lucide-react v1.47.0 - ISC
386
- *
387
- * This source code is licensed under the ISC license.
388
- * See the LICENSE file in the root directory of this source tree.
389
- */const Yj={name:"shapes",size:24,node:[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]};Yj.node;const YA=Ae(Yj);/**
390
- * @license lucide-react v1.47.0 - ISC
391
- *
392
- * This source code is licensed under the ISC license.
393
- * See the LICENSE file in the root directory of this source tree.
394
- */const Gj={name:"shrink",size:24,node:[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]};Gj.node;const GA=Ae(Gj);/**
395
- * @license lucide-react v1.47.0 - ISC
396
- *
397
- * This source code is licensed under the ISC license.
398
- * See the LICENSE file in the root directory of this source tree.
399
- */const Xj={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};Xj.node;const XA=Ae(Xj);/**
400
- * @license lucide-react v1.47.0 - ISC
401
- *
402
- * This source code is licensed under the ISC license.
403
- * See the LICENSE file in the root directory of this source tree.
404
- */const Qj={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};Qj.node;const Kj=Ae(Qj);/**
405
- * @license lucide-react v1.47.0 - ISC
406
- *
407
- * This source code is licensed under the ISC license.
408
- * See the LICENSE file in the root directory of this source tree.
409
- */const Zj={name:"speech",size:24,node:[["path",{d:"M8.8 20v-4.1l1.9.2a2.3 2.3 0 0 0 2.164-2.1V8.3A5.37 5.37 0 0 0 2 8.25c0 2.8.656 3.054 1 4.55a5.77 5.77 0 0 1 .029 2.758L2 20",key:"11atix"}],["path",{d:"M19.8 17.8a7.5 7.5 0 0 0 .003-10.603",key:"yol142"}],["path",{d:"M17 15a3.5 3.5 0 0 0-.025-4.975",key:"ssbmkc"}]]};Zj.node;const QA=Ae(Zj);/**
410
- * @license lucide-react v1.47.0 - ISC
411
- *
412
- * This source code is licensed under the ISC license.
413
- * See the LICENSE file in the root directory of this source tree.
414
- */const Jj={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};Jj.node;const KA=Ae(Jj);/**
415
- * @license lucide-react v1.47.0 - ISC
416
- *
417
- * This source code is licensed under the ISC license.
418
- * See the LICENSE file in the root directory of this source tree.
419
- */const Wj={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};Wj.node;const ZA=Ae(Wj);/**
420
- * @license lucide-react v1.47.0 - ISC
421
- *
422
- * This source code is licensed under the ISC license.
423
- * See the LICENSE file in the root directory of this source tree.
424
- */const ew={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};ew.node;const Nd=Ae(ew);/**
425
- * @license lucide-react v1.47.0 - ISC
426
- *
427
- * This source code is licensed under the ISC license.
428
- * See the LICENSE file in the root directory of this source tree.
429
- */const tw={name:"user-plus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};tw.node;const JA=Ae(tw);/**
430
- * @license lucide-react v1.47.0 - ISC
431
- *
432
- * This source code is licensed under the ISC license.
433
- * See the LICENSE file in the root directory of this source tree.
434
- */const nw={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};nw.node;const WA=Ae(nw);/**
435
- * @license lucide-react v1.47.0 - ISC
436
- *
437
- * This source code is licensed under the ISC license.
438
- * See the LICENSE file in the root directory of this source tree.
439
- */const iw={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};iw.node;const e4=Ae(iw);/**
440
- * @license lucide-react v1.47.0 - ISC
441
- *
442
- * This source code is licensed under the ISC license.
443
- * See the LICENSE file in the root directory of this source tree.
444
- */const aw={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};aw.node;const Cc=Ae(aw),rw={list:(e,i)=>Re(`/bots/${e}/activity${i===void 0?"":`?before=${encodeURIComponent(i)}`}`),message:(e,i)=>Re(`/bots/${e}/activity/messages/${i}`)};function lw(e){var i,a,l="";if(typeof e=="string"||typeof e=="number")l+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(i=0;i<s;i++)e[i]&&(a=lw(e[i]))&&(l&&(l+=" "),l+=a)}else for(a in e)e[a]&&(l&&(l+=" "),l+=a);return l}function t4(){for(var e,i,a=0,l="",s=arguments.length;a<s;a++)(e=arguments[a])&&(i=lw(e))&&(l&&(l+=" "),l+=i);return l}const Sx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,kx=t4,mg=(e,i)=>a=>{var l;if((i==null?void 0:i.variants)==null)return kx(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:s,defaultVariants:c}=i,d=Object.keys(s).map(v=>{const y=a==null?void 0:a[v],g=c==null?void 0:c[v];if(y===null)return null;const b=Sx(y)||Sx(g);return s[v][b]}),f=a&&Object.entries(a).reduce((v,y)=>{let[g,b]=y;return b===void 0||(v[g]=b),v},{}),m=i==null||(l=i.compoundVariants)===null||l===void 0?void 0:l.reduce((v,y)=>{let{class:g,className:b,...x}=y;return Object.entries(x).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...v,g,b]:v},[]);return kx(e,d,m,a==null?void 0:a.class,a==null?void 0:a.className)},ow=48,Ua=(e,i=0)=>{const a=new Int32Array(e.length);for(let l=0;l<e.length;l++)a[l]=e.charCodeAt(l)-ow-i;return a},$d=e=>{const i=new Int32Array(e.length+1);for(let a=0;a<e.length;a++)i[a+1]=i[a]+e[a];return i},Jr=e=>{const i=new Int32Array(e.length);let a=0;for(let l=0;l<e.length;l++){const s=e.charCodeAt(l)-ow;a+=s>>>1^-(s&1),i[l]=a}return i},n4=384,i4=[],Hl=$d(Ua("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),a4=$d(Ua(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),r4="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",l4=(()=>{const e=Hl.length-1,i=new Int32Array(e);for(let s=e-1;s>=0;s--){let c=1,d=s+1;for(let f=Hl[s];f<Hl[s+1];f++)c+=i[d],d+=i[d];i[s]=c}const a=new Int32Array(Hl[e]);let l=0;for(let s=0;s<e;s++){let c=s+1;for(let d=Hl[s];d<Hl[s+1];d++)a[l++]=c,c+=i[c]}return a})(),o4=Ua("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),s4=$d(Ua("123333359346463635126536711576")),c4=Ua("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),u4=Ua("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),d4=Jr("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),f4=(()=>{const e=new Int32Array(319).fill(-1),i=Jr("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),a=Jr("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let l=0;l<i.length;l++)e[i[l]]=a[l];return e})(),h4="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(e=>{const i=e.split(" "),a=i.shift();for(let l=0;l<i.length;l++)i[l]=a+i[l];return i}),Cx=Jr("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),m4=Jr("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),p4=Jr("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±"),sw=new Int32Array(995),cw=new Int32Array(995),uw=new Int32Array(995);let Np="";const Tp=new Int32Array(1038);{const e=new Map;let i=0,a=0;for(let l=0;l<Cx.length;l++)for(const s of h4[p4[l]]){let c=e.get(s);c===void 0&&(c=i++,e.set(s,c),Tp[c*2]=Np.length,Tp[c*2+1]=s.length,Np+=s),sw[a]=Cx[l],cw[a]=m4[l],uw[a]=c,a++}}const g4=Jr("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),v4=$d(Ua("1::24444432:442:44:44>222222:44:4421322511111311111114")),y4=Jr("2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222"),b4=Ua("ij"),x4=Ua("—"),j4=Ua("1"),w4="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var S4={GROUP_COUNT:n4,customValidatorNames:i4,edgeStart:Hl,labelStart:a4,labelText:r4,edgeTarget:l4,nodeGroup:o4,nodeVlist:f4,vlistPat:s4,vlistOps:c4,vlistRef:u4,vlistGroup:d4,litAnchor:sw,litGroup:cw,litPool:uw,poolOffsets:Tp,poolText:Np,adjGid:g4,adjStart:v4,adjTgt:y4,patGid:b4,patTgt:x4,postfixLookupGroups:j4,orderSensitiveModifiers:w4};const k4="line"in new Error,Ta=-1,Ll=-1,zm=(e,i,a)=>{let l=2166136261;for(let s=i;s<a;s++)l=Math.imul(l^e.charCodeAt(s),16777619);return l},bd=(e,i,a)=>{const l=a-i;let s=Math.imul(l,2654435761)^e.charCodeAt(i);if(l>3){const c=l>>2,d=l>>1;s=Math.imul(s^e.charCodeAt(i+1)<<8^e.charCodeAt(i+2)<<16^e.charCodeAt(i+c),2246822507),s=Math.imul(s^e.charCodeAt(i+d)<<8^e.charCodeAt(i+d+c)<<16^e.charCodeAt(a-3),3266489909),s^=e.charCodeAt(a-2)<<8^e.charCodeAt(a-1)<<16;for(let f=i+3,m=a-4;f<i+8&&f<m;f++,m--)s=Math.imul(s^e.charCodeAt(f)^e.charCodeAt(m)<<8,16777619)}return s^s>>>15|0},C4=(e,i,a={})=>{const{GROUP_COUNT:l,edgeStart:s,labelStart:c,labelText:d,edgeTarget:f,nodeGroup:m,nodeVlist:v,vlistPat:y,vlistOps:g,vlistRef:b,vlistGroup:x,litAnchor:w,litGroup:S,litPool:C,poolOffsets:N,poolText:M,adjGid:T,adjStart:A,adjTgt:I,patGid:D,patTgt:B,postfixLookupGroups:P,customValidatorNames:V,orderSensitiveModifiers:z}=e,Y=new Int32Array(l).fill(-1);for(let ue=0;ue<T.length;ue++)Y[T[ue]]=ue;let q=0;for(let ue=0;ue+1<A.length;ue++){const L=A[ue+1]-A[ue];L>q&&(q=L)}let W=32;for(;W<2*(1+q+D.length);)W<<=1;const Q=new Int32Array(b.length+1);for(let ue=0;ue<b.length;ue++)Q[ue+1]=Q[ue]+y[b[ue]+1]-y[b[ue]];const U=new Uint8Array(l);for(let ue=0;ue<P.length;ue++)U[P[ue]]=1;const X=s.length-1,O=new Uint8Array(X);let F=0,ne=!0;for(let ue=0;ue<w.length;ue++){O[w[ue]]=1;const L=N[C[ue]*2+1];L>F&&(F=L);const K=M.charCodeAt(N[C[ue]*2]);(K===91||K===40)&&(ne=!1)}let _=1;for(;_<w.length*2;)_<<=1;const J=new Int32Array(_).fill(-1);for(let ue=0;ue<w.length;ue++){const L=N[C[ue]*2];let K=(zm(M,L,L+N[C[ue]*2+1])^Math.imul(w[ue],2654435761)|0)&_-1;for(;J[K]!==-1;)K=K+1&_-1;J[K]=ue}const ee=(ue,L,K,he)=>{let Ne=(zm(L,K,he)^Math.imul(ue,2654435761)|0)&_-1;const Se=he-K;for(;;){const Te=J[Ne];if(Te===-1)return-1;if(w[Te]===ue&&N[C[Te]*2+1]===Se){const Le=N[C[Te]*2];let Qe=!0;for(let Me=0;Me<Se;Me++)if(M.charCodeAt(Le+Me)!==L.charCodeAt(K+Me)){Qe=!1;break}if(Qe)return S[Te]}Ne=Ne+1&_-1}},H=a.cacheSize??8192,$=a.prefix??e.prefix??"",fe=$===""?"":$+":",ye=fe.length,xe=(V??[]).map(ue=>{throw new Error("cn: missing validator "+ue)}),re=/\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$/,be=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ce=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let me=0,Ee=-1,ze=-1,Fe=-1,ht=-1;const ot=ue=>ue>=97&&ue<=122||ue>=65&&ue<=90||ue>=48&&ue<=57||ue===95,Je=ue=>/\s/.test(String.fromCharCode(ue)),At=(ue,L,K)=>{if(me=0,Ee=-1,K-L<3)return;const he=ue.charCodeAt(L),Ne=ue.charCodeAt(K-1);if(he===91&&Ne===93)me=1;else if(he===40&&Ne===41)me=2;else return;Fe=L+1,ht=K-1;let Se=L+1;if(ot(ue.charCodeAt(Se))){for(Se++;Se<K-1;){const Te=ue.charCodeAt(Se);if(!ot(Te)&&Te!==45)break;Se++}Se<K-2&&ue.charCodeAt(Se)===58&&(Ee=L+1,ze=Se,Fe=Se+1)}},gn=(ue,L,K,he)=>{if(K-L!==he.length)return!1;for(let Ne=0;Ne<he.length;Ne++)if(ue.charCodeAt(L+Ne)!==he.charCodeAt(Ne))return!1;return!0},vn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Hn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,di=ue=>!!ue&&!Number.isNaN(Number(ue)),an=(ue,L,K)=>{if(K-L<11||!gn(ue,L,L+10,"@container"))return!1;if(ue.charCodeAt(L+10)===47)return K-L>=12;const he=ue.charCodeAt(L+11);return he===115&&K-L>=17&&gn(ue,L+10,L+16,"-size/")||he===110&&K-L>=19&&gn(ue,L+10,L+18,"-normal/")},Yi=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],pe="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(ue=>ue.split(" ")),ke=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Be=(ue,L,K,he)=>{if(ue>=10){if(ue>=25)return xe[ue-25](L.slice(K,he));const Ne=ue-10;if(me!==Yi[Ne])return!1;if(Ee>=0){for(const Se of pe[Ne])if(gn(L,Ee,ze,Se))return!0;return!1}switch(ke[Ne]){case 0:return!1;case 1:return!0;case 2:{const Se=L.slice(Fe,ht);return re.test(Se)&&!be.test(Se)}case 3:return di(L.slice(Fe,ht));case 4:return ce.test(L.slice(Fe,ht));default:return oe.test(L.slice(Fe,ht))}}switch(ue){case 0:return!0;case 1:return me===0;case 2:return me===1;case 3:return me===2;case 4:return vn.test(L.slice(K,he));case 5:return di(L.slice(K,he));case 6:{const Ne=L.slice(K,he);return!!Ne&&Number.isInteger(Number(Ne))}case 7:return he>K&&L.charCodeAt(he-1)===37&&di(L.slice(K,he-1));case 8:return Hn.test(L.slice(K,he));default:return an(L,K,he)}},Ue=new Set(typeof z=="string"?z.split(" "):z),We=(ue,L,K,he,Ne,Se)=>{const Te=zm(L,K,he)^(Ne?2654435769:0)|0;let Le=ue.get(Te);if(Le!==void 0)e:for(let $e=0;$e<Le.length;$e++){const st=Le[$e];if(!(st.imp!==Ne||st.k.length!==he-K)){for(let Pe=0;Pe<st.k.length;Pe++)if(st.k.charCodeAt(Pe)!==L.charCodeAt(K+Pe))continue e;return st.id}}else ue.set(Te,Le=[]);const Qe=L.slice(K,he),Me=Se(Qe);return Le.push({k:Qe,imp:Ne,id:Me}),Me};let Ht=new Map,yn=new Map,Ut=2;const On=4096,Un=(ue,L)=>{const K=[];let he=0,Ne=0,Se=0;for(let Me=0;Me<ue.length;Me++){const $e=ue.charCodeAt(Me);he===0&&Ne===0&&$e===58?(K.push(ue.slice(Se,Me)),Se=Me+1):$e===91?he++:$e===93?he--:$e===40?Ne++:$e===41&&Ne--}K.push(ue.slice(Se));let Te=K[0];if(K.length>1){const Me=[];let $e=[];for(const st of K)st.charCodeAt(0)===91||Ue.has(st)?($e.length&&(Me.push(...$e.sort()),$e=[]),Me.push(st)):$e.push(st);$e.length&&Me.push(...$e.sort()),Te=Me.join(":")}const Le=L?Te+" !":Te;let Qe=yn.get(Le);return Qe===void 0&&yn.set(Le,Qe=Ut++),Qe};let Rt=new Map,Rn=l;const Xe=l+4096,Gt=()=>Rn++,ll=2097152,sa=8192,ca=new Int32Array(sa),bn=new Array(sa).fill(null),fi=new Int32Array(sa),ol=new Int32Array(sa),hi=new Uint8Array(sa);let ao=0;const Gi=(ue,L,K,he,Ne,Se,Te,Le)=>{let Qe=ue;if(bn[ue]!==null)if(bn[ue|1]===null)Qe=ue|1;else if((ao++&3)===0)Qe=ue|ao>>2&1;else return;bn[Qe]=L.slice(K,he),ca[Qe]=Ne,fi[Qe]=Se,ol[Qe]=Te,hi[Qe]=Le},sn=()=>bn.fill(null);let zt=256,Vt=[new Int32Array(zt),new Int32Array(zt),new Int32Array(zt),new Int32Array(zt)],[ua,da,Xi,Qi]=Vt,Oi=new Uint8Array(zt),Kn=new Uint8Array(zt);const Ki=()=>{zt*=2,Vt=Vt.map(L=>{const K=new Int32Array(zt);return K.set(L),K}),[ua,da,Xi,Qi]=Vt;const ue=new Uint8Array(zt);ue.set(Oi),Oi=ue,Kn=new Uint8Array(zt)};let mi=64,pi=new Int32Array(mi),fa=new Int32Array(mi);const sl=new Int32Array(l);let gi=2048,yr=21,Zn=new Float64Array(gi),ha=new Int32Array(gi),Jn=0;const rn=(ue,L)=>{if(ue===0&&L<l)return sl[L]===Jn?1:(sl[L]=Jn,0);const K=ue*2097152+L+1;let he=Math.imul(K,2654435761)>>>yr;for(;ha[he]===Jn;){if(Zn[he]===K)return 1;he=he+1&gi-1}return Zn[he]=K,ha[he]=Jn,0},cn=(ue,L,K,he,Ne)=>{if(K-L>=2&&ue.charCodeAt(L)===91&&ue.charCodeAt(K-1)===93){let Se=-1;for(let Te=L+1;Te<K-1;Te++)if(ue.charCodeAt(Te)===58){Se=Te;break}return Se===-1||Se===L+1?Ta:We(Rt,ue,L+1,Se,0,Gt)}if(he>=0&&m[he]>=0)return m[he];for(let Se=Ne-1;Se>=0;Se--){const Te=fa[Se];if(Te>K)continue;const Le=pi[Se],Qe=K-Te;if(O[Le]===1&&Qe>0&&Qe<=F){const It=ue.charCodeAt(Te);if(ne===!1||It!==91&&It!==40){const vi=ee(Le,ue,Te,K);if(vi>=0)return vi}}const Me=v[Le];if(Me<0)continue;const $e=b[Me],st=y[$e],Pe=y[$e+1];if(st===Pe)continue;At(ue,Te,K);const ln=Q[Me]-st;for(let It=st;It<Pe;It++)if(Be(g[It],ue,Te,K))return x[ln+It]}return Ta},ma=ue=>{const L=ue.length;let K=0,he=0,Ne=!1;(Ut>On||Ht.size>On)&&(Ht=new Map,yn=new Map,Ut=2,sn()),Rn>Xe&&(Rt=new Map,Rn=l,sn());let Se=0;for(;Se<L;){let Me=ue.charCodeAt(Se);if(Me===32||Me>=9&&Me<=13||Me>=160&&Je(Me)){Me!==32&&(Ne=!0),Se++;continue}const $e=Se;let st=0;for(;Se<L;){if(Me=ue.charCodeAt(Se),Me<=32){if(Me===32)break;if(Me>=9&&Me<=13){Ne=!0;break}}else if(Me>=160&&Je(Me)){Ne=!0;break}st=Math.imul(st^Me,16777619),Se++}const Pe=Se,ln=Pe-$e;K===zt&&Ki();const It=K++;ua[It]=$e,da[It]=Pe,he+=ln,st^=Math.imul(ln,2654435761);const vi=st^st>>>15|0,Xt=vi&8190;{let ut=-1;if(ca[Xt]===vi&&bn[Xt]!==null&&bn[Xt].length===ln?ut=Xt:ca[Xt|1]===vi&&bn[Xt|1]!==null&&bn[Xt|1].length===ln&&(ut=Xt|1),ut>=0){const un=bn[ut];let Ri=!0;for(let xi=0;xi<ln;xi++)if(un.charCodeAt(xi)!==ue.charCodeAt($e+xi)){Ri=!1;break}if(Ri){Xi[It]=fi[ut],Qi[It]=ol[ut],Oi[It]=hi[ut];continue}}}let Qt=$e;if(ye!==0){if(Pe-$e<=ye||!ue.startsWith(fe,$e)){Xi[It]=Ta,Gi(Xt,ue,$e,Pe,vi,Ta,0,0);continue}Qt=$e+ye}let ro=0,ds=0,Ya=-1,lo=-1;for(let ut=Qt;ut<Pe;ut++){const un=ue.charCodeAt(ut);if(ro===0&&ds===0){if(un===58){Ya=ut;continue}if(un===47){lo=ut;continue}}un===91?ro++:un===93?ro--:un===40?ds++:un===41&&ds--}const Ic=Ya>=Qt?Ya+1:Qt;let Ot=Ic,Dn=Pe,jr=!1,oo=0;Dn>Ot&&ue.charCodeAt(Dn-1)===33?(jr=!0,Dn--):Dn>Ot&&ue.charCodeAt(Ot)===33&&(jr=!0,Ot++,oo=1);let ni=-1;lo>Ic&&(ni=lo+oo,ni>=Dn&&(ni=-1));let so=Ot;Dn-Ot>1&&ue.charCodeAt(Ot)===45&&(so=Ot+1);let yi=0,qn=0,wr=0,fs=-1,bi=0;(v[0]>=0||O[0]===1)&&(pi[0]=0,fa[0]=so,bi=1);let ul=Ll,hs=0;for(let ut=so;ut<Dn;ut++)if(ut===ni&&(ul=qn<wr?Ll:yi,hs=bi),yi!==Ll){const un=ue.charCodeAt(ut);let Ri=-1;if(qn<wr)d.charCodeAt(qn)===un?(qn++,qn===wr&&(Ri=yi=fs)):yi=Ll;else{const xi=s[yi],hl=s[yi+1];let Ga=Ll;for(let wn=xi;wn<hl;wn++){const ml=c[wn];if(d.charCodeAt(ml)===un){c[wn+1]-ml===1?Ri=Ga=f[wn]:(qn=ml+1,wr=c[wn+1],fs=f[wn],Ga=yi);break}}yi=Ga}if(Ri>=0&&(v[Ri]>=0||O[Ri]===1)&&ut+1<Dn&&ue.charCodeAt(ut+1)===45){if(bi===mi){mi*=2;const xi=new Int32Array(mi);xi.set(pi),pi=xi;const hl=new Int32Array(mi);hl.set(fa),fa=hl}pi[bi]=Ri,fa[bi]=ut+2,bi++}}ni===Dn&&(ul=qn<wr?Ll:yi,hs=bi);const ms=qn<wr?Ll:yi;let jn,Fn=!1;if(ni>=0)if(Fn=!0,jn=cn(ue,Ot,ni,ul,hs),jn!==Ta&&jn<l&&U[jn]){const ut=cn(ue,Ot,Dn,ms,bi);ut!==Ta&&ut!==jn&&(jn=ut,Fn=!1)}else jn===Ta&&(jn=cn(ue,Ot,Dn,ms,bi),Fn=!1);else jn=cn(ue,Ot,Dn,ms,bi);let dl=0,fl=0;jn===Ta?Xi[It]=Ta:(fl=Fn?1:0,dl=Qt>=Ya?jr?1:0:We(Ht,ue,Qt,Ya,jr?1:0,ut=>Un(ut,jr)),Xi[It]=jn,Oi[It]=fl,Qi[It]=dl),Gi(Xt,ue,$e,Pe,vi,jn,dl,fl)}if(K===0)return"";if(K===1)return ua[0]===0&&da[0]===L?ue:ue.slice(ua[0],da[0]);if(K*W>gi){for(;K*W>gi;)gi<<=1,yr--;Zn=new Float64Array(gi),ha=new Int32Array(gi)}if(Ut>=ll||Rn>=ll)throw new Error("cn: too many distinct classes in one merge");Jn=Jn+1|0,Jn===0&&(sl.fill(0),ha.fill(0),Jn=1);let Te=!1;for(let Me=K-1;Me>=0;Me--){const $e=Xi[Me];if($e===Ta){Kn[Me]=1;continue}const st=Qi[Me];if(rn(st,$e)===1){Kn[Me]=0,Te=!0;continue}if(Kn[Me]=1,$e<l){const Pe=Y[$e];if(Pe>=0)for(let ln=A[Pe];ln<A[Pe+1];ln++)rn(st,I[ln]);if(Oi[Me]&1)for(let ln=0;ln<D.length;ln++)D[ln]===$e&&rn(st,B[ln])}}if(!Te&&!Ne&&L===he+K-1)return ue;let Le="",Qe=0;for(;Qe<K;){if(!Kn[Qe]){Qe++;continue}const Me=ua[Qe];let $e=da[Qe],st=Qe+1;for(;st<K&&Kn[st]&&ua[st]===$e+1&&ue.charCodeAt($e)===32;)$e=da[st],st++;Le.length>0&&(Le+=" "),Le+=ue.slice(Me,$e),Qe=st}return Le},Wn=16384,ei=new Int32Array(Wn*2);let _n=0,Lt=1,Mt=Object.create(null),$t=Object.create(null),xn=new Map,cl=new Map,br=0,xr=0;const pa=()=>{_n^=Wn,Lt=Lt+1|0,xr=0},ga=ue=>{let L=Mt[ue];if(L!==void 0)return L;const K=bd(ue,0,ue.length),he=(K&16383)+_n,Ne=ei[he]===(K^Lt)||ei[he^Wn]===(K^Lt-1);return Ne&&(L=$t[ue],L!==void 0)?(Mt[ue]=L,L):(L=ma(ue),Ne?(Mt[ue]=L,++br>H&&(br=0,$t=Mt,Mt=Object.create(null),pa())):(ei[he]=K^Lt,++xr>Wn&&pa()),L)},Va=ue=>{let L=xn.get(ue);if(L!==void 0)return L;const K=bd(ue,0,ue.length),he=(K&16383)+_n,Ne=ei[he]===(K^Lt)||ei[he^Wn]===(K^Lt-1);return Ne&&(L=cl.get(ue),L!==void 0)?(xn.set(ue,L),L):(L=ma(ue),Ne?(xn.set(ue,L),++br>H&&(br=0,cl=xn,xn=new Map,pa())):(ei[he]=K^Lt,++xr>Wn&&pa()),L)},$a=ue=>{const L=bd(ue,0,ue.length),K=(L&16383)+_n;return ei[K]===(L^Lt)||ei[K^Wn]===(L^Lt-1)?!0:(ei[K]=L^Lt,++xr>Wn&&pa(),!1)},ti=H===0?ma:k4?ue=>{const L=xn.get(ue);return L!==void 0?L:Va(ue)}:ga;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?ti(arguments[0]):ti(N4.apply(null,arguments))},mergeString:ti,seenBefore:H===0?()=>!1:$a,mergeUncached:ma}},Td=(e,i)=>{if(!e)return"";if(typeof e=="string")return e;let a="";if(typeof e.length=="number"&&(!i||Array.isArray(e))){const l=e;for(let s=0;s<l.length;s++){const c=l[s];if(!c)continue;const d=typeof c=="string"?c:Td(c,i);d&&(a&&(a+=" "),a+=d)}return a}if(i){if(typeof e=="number")return""+e;if(typeof e=="object")for(const l in e)e[l]&&(a&&(a+=" "),a+=l)}return a},E4=(e,i)=>{let a="";for(let l=0;l<e.length;l++){const s=e[l];if(!s)continue;const c=typeof s=="string"?s:Td(s,i);c&&(a&&(a+=" "),a+=c)}return a},N4=function(){return E4(arguments,!1)},T4=256,Ex=16,A4=1024,Lm=4096,M4=(e,i)=>{const a=i===void 0?()=>!0:i.seenBefore,l=i===void 0?e:i.mergeUncached;let s=new Map,c=new Map,d=0,f=null,m=null,v=[],y=[],g=0;const b=(N,M,T)=>{m===null&&(m=new Array(Lm).fill(""),v=new Array(Lm).fill(""),y=new Array(Lm).fill(""));const A=bd(N,0,N.length)&4094;if(m[A]===N&&v[A]===M)return y[A];if(m[A|1]===N&&v[A|1]===M)return y[A|1];const I=e(T?M+" "+N:N),D=m[A]===""?A:A|(m[A|1]===""?1:g++&1);return m[D]=N,v[D]=M,y[D]=I,I},x=(N,M,T,A)=>{let I=0;if(M){if(M!==N.a0)return!1;I=1}if(T){if(T!==(I===0?N.a0:N.a1))return!1;I++}if(A){if(A!==(I===0?N.a0:I===1?N.a1:N.a2))return!1;I++}return I===N.t},w=(N,M)=>{const T=N.a;let A=0;for(let I=0;I<M.length;I++){const D=M[I];if(D){if(D!==T[A])return!1;A++}}return A===N.t},S=(N,M)=>{const T=N.length,A=f===null?null:f.n;if(!M){if(A!==null&&w(A,N))return f=A,A.r;if(f!==null&&f!==A&&w(f,N))return f.r}let I="",D=-1,B=0,P=!1;for(let Y=0;Y<T;Y++){let q=N[Y];if(q){if(typeof q!="string"){if(q=N[Y]=Td(q,!0),!q)continue;P=!0}D<0&&(I=q,D=Y),B++}}if(B===0)return"";if(B===1)return e(I);if(P){if(A!==null&&w(A,N))return f=A,A.r;if(f!==null&&f!==A&&w(f,N))return f.r}let V=s.get(I);V===void 0&&(V=c.get(I),V!==void 0&&s.set(I,V));let z=null;if(V!==void 0){if(V.skip>0){V.skip--,f=null;let q=I;for(let W=D+1;W<T;W++){const Q=N[W];Q&&(q+=" "+Q)}return b(q,"",!1)}const Y=V.e;e:for(let q=0;q<Y.length;q++){const W=Y[q];if(W.t!==B)continue;const Q=W.a;let U=1;for(let X=D+1;X<T;X++){const O=N[X];if(O&&O!==Q[U++])continue e}z=W;break}z!==null&&(V.miss=0)}if(z===null){let Y=I;const q=[I];for(let Q=D+1;Q<T;Q++){const U=N[Q];U&&(Y+=" "+U,q.push(U))}if(!a(Y))return l(Y);z={r:e(Y),t:q.length,a0:q[0],a1:q[1],a2:q[2]??"",a:q,n:null},V===void 0?s.set(I,V={e:[],miss:0,skip:0,at:0}):++V.miss>Ex&&(V.miss=Ex,V.skip=A4,V.e.length=0,V.at=0);const W=V.e;W.length<T4?W.push(z):(W[V.at]=z,V.at=V.at+1&255),++d>1e3&&(d=0,c=s,s=new Map)}return f!==null&&f!==z&&(f.n=z),f=z,z.r},C=N=>Array.isArray(N)?S(N.slice(),!1):e(Td(N,!0));return function(N,M,T){const A=arguments.length;if((A|1)===3){const B=f;if(B!==null){const P=B.n;if(P!==null&&x(P,N,M,T))return f=P,P.r;if(B!==P&&x(B,N,M,T))return B.r}if(A===2&&typeof M=="string"&&M!==""){const P=s.get(N);if(P!==void 0&&P.skip>0)return P.skip--,f=null,b(M,N,!0)}return S([N,M,T],!0)}if(A===1)return typeof N=="string"?e(N):C(N);const I=f;if(I!==null){const B=I.n;if(B!==null){const P=B.a;let V=0,z=!0;for(let Y=0;Y<A;Y++){const q=arguments[Y];if(q){if(q!==P[V]){z=!1;break}V++}}if(z&&V===B.t)return f=B,B.r}if(I!==B){const P=I.a;let V=0,z=!0;for(let Y=0;Y<A;Y++){const q=arguments[Y];if(q){if(q!==P[V]){z=!1;break}V++}}if(z&&V===I.t)return I.r}}const D=[];for(let B=0;B<A;B++)D.push(arguments[B]);return S(D,!0)}},Nx=C4(S4),nn=M4(Nx.mergeString,Nx);var to=A2(),O4=Object.defineProperty,pg=(e,i)=>O4(e,"name",{value:i,configurable:!0});function Ap(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}pg(Ap,"setRef");function dw(...e){return i=>{let a=!1;const l=e.map(s=>{const c=Ap(s,i);return!a&&typeof c=="function"&&(a=!0),c});if(a)return()=>{for(let s=0;s<l.length;s++){const c=l[s];typeof c=="function"?c():Ap(e[s],null)}}}}pg(dw,"composeRefs");function xt(...e){return k.useCallback(dw(...e),e)}pg(xt,"useComposedRefs");var R4=Object.defineProperty,la=(e,i)=>R4(e,"name",{value:i,configurable:!0});function La(e){const i=k.forwardRef((a,l)=>{let{children:s,...c}=a,d=null,f=!1;const m=[];Mp(s)&&typeof td=="function"&&(s=td(s._payload)),k.Children.forEach(s,b=>{var x;if(pw(b)){f=!0;const w=b;let S="child"in w.props?w.props.child:w.props.children;Mp(S)&&typeof td=="function"&&(S=td(S._payload)),d=z4(w,S),m.push((x=d==null?void 0:d.props)==null?void 0:x.children)}else m.push(b)}),d?d=k.cloneElement(d,void 0,m):!f&&k.Children.count(s)===1&&k.isValidElement(s)&&(d=s);const v=d?mw(d):void 0,y=xt(l,v);if(!d){if(s||s===0)throw new Error(f?B4(e):I4(e));return s}const g=hw(c,d.props??{});return d.type!==k.Fragment&&(g.ref=l?y:v),k.cloneElement(d,g)});return i.displayName=`${e}.Slot`,i}la(La,"createSlot");var _4=La("Slot"),fw=Symbol.for("radix.slottable");function D4(e){const i=la(a=>"child"in a?a.children(a.child):a.children,"Slottable");return i.displayName=`${e}.Slottable`,i.__radixId=fw,i}la(D4,"createSlottable");var z4=la((e,i)=>{if("child"in e.props){const a=e.props.child;return k.isValidElement(a)?k.cloneElement(a,void 0,e.props.children(a.props.children)):null}return k.isValidElement(i)?i:null},"getSlottableElementFromSlottable");function hw(e,i){const a={...i};for(const l in i){const s=e[l],c=i[l];/^on[A-Z]/.test(l)?s&&c?a[l]=(...f)=>{const m=c(...f);return s(...f),m}:s&&(a[l]=s):l==="style"?a[l]={...s,...c}:l==="className"&&(a[l]=[s,c].filter(Boolean).join(" "))}return{...e,...a}}la(hw,"mergeProps");function mw(e){var l,s;let i=(l=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:l.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?e.ref:(i=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}la(mw,"getElementRef");function pw(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fw}la(pw,"isSlottable");var L4=Symbol.for("react.lazy");function Mp(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===L4&&"_payload"in e&&gw(e._payload)}la(Mp,"isLazyComponent");function gw(e){return typeof e=="object"&&e!==null&&"then"in e}la(gw,"isPromiseLike");var I4=la(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),B4=la(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),td=wc[" use ".trim().toString()],P4=Object.defineProperty,H4=(e,i)=>P4(e,"name",{value:i,configurable:!0}),U4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dt=U4.reduce((e,i)=>{const a=La(`Primitive.${i}`),l=k.forwardRef((s,c)=>{const{asChild:d,...f}=s,m=d?a:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:c})});return l.displayName=`Primitive.${i}`,{...e,[i]:l}},{});function vw(e,i){e&&to.flushSync(()=>e.dispatchEvent(i))}H4(vw,"dispatchDiscreteCustomEvent");var q4=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"}),F4=Object.defineProperty,qi=(e,i)=>F4(e,"name",{value:i,configurable:!0});function V4(e,i){const a=k.createContext(i);a.displayName=e+"Context";const l=qi(c=>{const{children:d,...f}=c,m=k.useMemo(()=>f,Object.values(f));return u.jsx(a.Provider,{value:m,children:d})},"Provider");l.displayName=e+"Provider";function s(c,d={}){const{optional:f=!1}=d,m=k.useContext(a);if(m)return m;if(i!==void 0)return i;if(!f)throw new Error(`\`${c}\` must be used within \`${e}\``)}return qi(s,"useContext"),[l,s]}qi(V4,"createContext");function tl(e,i=[]){let a=[];function l(c,d){const f=k.createContext(d);f.displayName=c+"Context";const m=a.length;a=[...a,d];const v=qi(g=>{var N;const{scope:b,children:x,...w}=g,S=((N=b==null?void 0:b[e])==null?void 0:N[m])||f,C=k.useMemo(()=>w,Object.values(w));return u.jsx(S.Provider,{value:C,children:x})},"Provider");v.displayName=c+"Provider";function y(g,b,x={}){var N;const{optional:w=!1}=x,S=((N=b==null?void 0:b[e])==null?void 0:N[m])||f,C=k.useContext(S);if(C)return C;if(d!==void 0)return d;if(!w)throw new Error(`\`${g}\` must be used within \`${c}\``)}return qi(y,"useContext"),[v,y]}qi(l,"createContext");const s=qi(()=>{const c=a.map(d=>k.createContext(d));return qi(function(f){const m=(f==null?void 0:f[e])||c;return k.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])},"useScope")},"createScope");return s.scopeName=e,[l,yw(s,...i)]}qi(tl,"createContextScope");function yw(...e){const i=e[0];if(e.length===1)return i;const a=qi(()=>{const l=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return qi(function(c){const d=l.reduce((f,{useScope:m,scopeName:v})=>{const g=m(c)[`__scope${v}`];return{...f,...g}},{});return k.useMemo(()=>({[`__scope${i.scopeName}`]:d}),[d])},"useComposedScopes")},"createScope");return a.scopeName=i.scopeName,a}qi(yw,"composeContextScopes");var $4=Object.defineProperty,pn=(e,i)=>$4(e,"name",{value:i,configurable:!0});function bw(e){const i=e+"CollectionProvider",[a,l]=tl(i),[s,c]=a(i,{collectionRef:{current:null},itemMap:new Map}),d=pn(S=>{const{scope:C,children:N}=S,M=k.useRef(null),T=k.useRef(new Map).current;return u.jsx(s,{scope:C,itemMap:T,collectionRef:M,children:N})},"CollectionProvider");d.displayName=i;const f=e+"CollectionSlot",m=La(f),v=k.forwardRef((S,C)=>{const{scope:N,children:M}=S,T=c(f,N),A=xt(C,T.collectionRef);return u.jsx(m,{ref:A,children:M})});v.displayName=f;const y=e+"CollectionItemSlot",g="data-radix-collection-item",b=La(y),x=k.forwardRef((S,C)=>{const{scope:N,children:M,...T}=S,A=k.useRef(null),I=xt(C,A),D=c(y,N);return k.useEffect(()=>(D.itemMap.set(A,{ref:A,...T}),()=>void D.itemMap.delete(A))),u.jsx(b,{[g]:"",ref:I,children:M})});x.displayName=y;function w(S){const C=c(e+"CollectionConsumer",S);return k.useCallback(()=>{const M=C.collectionRef.current;if(!M)return[];const T=Array.from(M.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((D,B)=>T.indexOf(D.ref.current)-T.indexOf(B.ref.current))},[C.collectionRef,C.itemMap])}return pn(w,"useCollection"),[{Provider:d,Slot:v,ItemSlot:x},w,l]}pn(bw,"createCollection");var Tx=new WeakMap,en,Ai,Im=(Ai=class extends Map{constructor(a){super(a);dx(this,en);Nm(this,en,[...super.keys()]),Tx.set(this,!0)}set(a,l){return Tx.get(this)&&(this.has(a)?Ln(this,en)[Ln(this,en).indexOf(a)]=a:Ln(this,en).push(a)),super.set(a,l),this}insert(a,l,s){const c=this.has(l),d=Ln(this,en).length,f=gg(a);let m=f>=0?f:d+f;const v=m<0||m>=d?-1:m;if(v===this.size||c&&v===this.size-1||v===-1)return this.set(l,s),this;const y=this.size+(c?0:1);f<0&&m++;const g=[...Ln(this,en)];let b,x=!1;for(let w=m;w<y;w++)if(m===w){let S=g[w];g[w]===l&&(S=g[w+1]),c&&this.delete(l),b=this.get(S),this.set(l,s)}else{!x&&g[w-1]===l&&(x=!0);const S=g[x?w:w-1],C=b;b=this.get(S),this.delete(S),this.set(S,C)}return this}with(a,l,s){const c=new Ai(this);return c.insert(a,l,s),c}before(a){const l=Ln(this,en).indexOf(a)-1;if(!(l<0))return this.entryAt(l)}setBefore(a,l,s){const c=Ln(this,en).indexOf(a);return c===-1?this:this.insert(c,l,s)}after(a){let l=Ln(this,en).indexOf(a);if(l=l===-1||l===this.size-1?-1:l+1,l!==-1)return this.entryAt(l)}setAfter(a,l,s){const c=Ln(this,en).indexOf(a);return c===-1?this:this.insert(c+1,l,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Nm(this,en,[]),super.clear()}delete(a){const l=super.delete(a);return l&&Ln(this,en).splice(Ln(this,en).indexOf(a),1),l}deleteAt(a){const l=this.keyAt(a);return l!==void 0?this.delete(l):!1}at(a){const l=xd(Ln(this,en),a);if(l!==void 0)return this.get(l)}entryAt(a){const l=xd(Ln(this,en),a);if(l!==void 0)return[l,this.get(l)]}indexOf(a){return Ln(this,en).indexOf(a)}keyAt(a){return xd(Ln(this,en),a)}from(a,l){const s=this.indexOf(a);if(s===-1)return;let c=s+l;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.at(c)}keyFrom(a,l){const s=this.indexOf(a);if(s===-1)return;let c=s+l;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.keyAt(c)}find(a,l){let s=0;for(const c of this){if(Reflect.apply(a,l,[c,s,this]))return c;s++}}findIndex(a,l){let s=0;for(const c of this){if(Reflect.apply(a,l,[c,s,this]))return s;s++}return-1}filter(a,l){const s=[];let c=0;for(const d of this)Reflect.apply(a,l,[d,c,this])&&s.push(d),c++;return new Ai(s)}map(a,l){const s=[];let c=0;for(const d of this)s.push([d[0],Reflect.apply(a,l,[d,c,this])]),c++;return new Ai(s)}reduce(...a){const[l,s]=a;let c=0,d=s??this.at(0);for(const f of this)c===0&&a.length===1?d=f:d=Reflect.apply(l,this,[d,f,c,this]),c++;return d}reduceRight(...a){const[l,s]=a;let c=s??this.at(-1);for(let d=this.size-1;d>=0;d--){const f=this.at(d);d===this.size-1&&a.length===1?c=f:c=Reflect.apply(l,this,[c,f,d,this])}return c}toSorted(a){const l=[...this.entries()].sort(a);return new Ai(l)}toReversed(){const a=new Ai;for(let l=this.size-1;l>=0;l--){const s=this.keyAt(l),c=this.get(s);a.set(s,c)}return a}toSpliced(...a){const l=[...this.entries()];return l.splice(...a),new Ai(l)}slice(a,l){const s=new Ai;let c=this.size-1;if(a===void 0)return s;a<0&&(a=a+this.size),l!==void 0&&l>0&&(c=l-1);for(let d=a;d<=c;d++){const f=this.keyAt(d),m=this.get(f);s.set(f,m)}return s}every(a,l){let s=0;for(const c of this){if(!Reflect.apply(a,l,[c,s,this]))return!1;s++}return!0}some(a,l){let s=0;for(const c of this){if(Reflect.apply(a,l,[c,s,this]))return!0;s++}return!1}},en=new WeakMap,pn(Ai,"OrderedDict"),Ai);function xd(e,i){if("at"in Array.prototype)return Array.prototype.at.call(e,i);const a=xw(e,i);return a===-1?void 0:e[a]}pn(xd,"at");function xw(e,i){const a=e.length,l=gg(i),s=l>=0?l:a+l;return s<0||s>=a?-1:s}pn(xw,"toSafeIndex");function gg(e){return e!==e||e===0?0:Math.trunc(e)}pn(gg,"toSafeInteger");function Y4(e){const i=e+"CollectionProvider",[a,l]=tl(i),[s,c]=a(i,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Im,setItemMap:pn(()=>{},"setItemMap")}),d=pn(({state:T,...A})=>T?u.jsx(m,{...A,state:T}):u.jsx(f,{...A}),"CollectionProvider");d.displayName=i;const f=pn(T=>{const A=C();return u.jsx(m,{...T,state:A})},"CollectionInit");f.displayName=i+"Init";const m=pn(T=>{const{scope:A,children:I,state:D}=T,B=k.useRef(null),[P,V]=k.useState(null),z=xt(B,V),[Y,q]=D;return k.useEffect(()=>{if(!P)return;const W=Sw(()=>{});return W.observe(P,{childList:!0,subtree:!0}),()=>{W.disconnect()}},[P]),u.jsx(s,{scope:A,itemMap:Y,setItemMap:q,collectionRef:z,collectionRefObject:B,collectionElement:P,children:I})},"CollectionProviderImpl");m.displayName=i+"Impl";const v=e+"CollectionSlot",y=La(v),g=k.forwardRef((T,A)=>{const{scope:I,children:D}=T,B=c(v,I),P=xt(A,B.collectionRef);return u.jsx(y,{ref:P,children:D})});g.displayName=v;const b=e+"CollectionItemSlot",x="data-radix-collection-item",w=La(b),S=k.forwardRef((T,A)=>{const{scope:I,children:D,...B}=T,P=k.useRef(null),[V,z]=k.useState(null),Y=xt(A,P,z),q=c(b,I),{setItemMap:W}=q,Q=k.useRef(B);jw(Q.current,B)||(Q.current=B);const U=Q.current;return k.useEffect(()=>{const X=U;return W(O=>V?O.has(V)?O.set(V,{...X,element:V}).toSorted(Op):(O.set(V,{...X,element:V}),O.toSorted(Op)):O),()=>{W(O=>!V||!O.has(V)?O:(O.delete(V),new Im(O)))}},[V,U,W]),u.jsx(w,{[x]:"",ref:Y,children:D})});S.displayName=b;function C(){return k.useState(new Im)}pn(C,"useInitCollection");function N(T){const{itemMap:A}=c(e+"CollectionConsumer",T);return A}return pn(N,"useCollection"),[{Provider:d,Slot:g,ItemSlot:S},{createCollectionScope:l,useCollection:N,useInitCollection:C}]}pn(Y4,"createCollection");function jw(e,i){if(e===i)return!0;if(typeof e!="object"||typeof i!="object"||e==null||i==null)return!1;const a=Object.keys(e),l=Object.keys(i);if(a.length!==l.length)return!1;for(const s of a)if(!Object.prototype.hasOwnProperty.call(i,s)||e[s]!==i[s])return!1;return!0}pn(jw,"shallowEqual");function ww(e,i){return!!(i.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}pn(ww,"isElementPreceding");function Op(e,i){return!e[1].element||!i[1].element?0:ww(e[1].element,i[1].element)?-1:1}pn(Op,"sortByDocumentPosition");function Sw(e){return new MutationObserver(a=>{for(const l of a)if(l.type==="childList"){e();return}})}pn(Sw,"getChildListObserver");var G4=Object.defineProperty,rs=(e,i)=>G4(e,"name",{value:i,configurable:!0}),kw=!!(typeof window<"u"&&window.document&&window.document.createElement);function mt(e,i,{checkForDefaultPrevented:a=!0}={}){return rs(function(s){if(e==null||e(s),a===!1||!s||!s.defaultPrevented)return i==null?void 0:i(s)},"handleEvent")}rs(mt,"composeEventHandlers");function X4(e){var i;if(!kw)throw new Error("Cannot access window outside of the DOM");return((i=e==null?void 0:e.ownerDocument)==null?void 0:i.defaultView)??window}rs(X4,"getOwnerWindow");function Rp(e){if(!kw)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}rs(Rp,"getOwnerDocument");function Cw(e,i=!1){const{activeElement:a}=Rp(e);if(!(a!=null&&a.nodeName))return null;if(Ew(a)&&a.contentDocument)return Cw(a.contentDocument.body,i);if(i){const l=a.getAttribute("aria-activedescendant");if(l){const s=Rp(a).getElementById(l);if(s)return s}}return a}rs(Cw,"getActiveElement");function Ew(e){return e.tagName==="IFRAME"}rs(Ew,"isFrame");var Mn=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},Q4=Object.defineProperty,K4=(e,i)=>Q4(e,"name",{value:i,configurable:!0}),Ax=wc[" useEffectEvent ".trim().toString()],Mx=wc[" useInsertionEffect ".trim().toString()];function Nw(e){if(typeof Ax=="function")return Ax(e);const i=k.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Mx=="function"?Mx(()=>{i.current=e}):Mn(()=>{i.current=e}),k.useMemo(()=>((...a)=>{var l;return(l=i.current)==null?void 0:l.call(i,...a)}),[])}K4(Nw,"useEffectEvent");var Z4=Object.defineProperty,Ec=(e,i)=>Z4(e,"name",{value:i,configurable:!0}),J4=wc[" useInsertionEffect ".trim().toString()]||Mn;function mc({prop:e,defaultProp:i,onChange:a=Ec(()=>{},"onChange"),caller:l}){const[s,c,d]=Tw({defaultProp:i,onChange:a}),f=e!==void 0,m=f?e:s,v=k.useCallback(y=>{var g;if(f){const b=Aw(y)?y(e):y;b!==e&&((g=d.current)==null||g.call(d,b))}else c(y)},[f,e,c,d]);return[m,v]}Ec(mc,"useControllableState");function Tw({defaultProp:e,onChange:i}){const[a,l]=k.useState(e),s=k.useRef(a),c=k.useRef(i);return J4(()=>{c.current=i},[i]),k.useEffect(()=>{var d;s.current!==a&&((d=c.current)==null||d.call(c,a),s.current=a)},[a,s]),[a,l,c]}Ec(Tw,"useUncontrolledState");function Aw(e){return typeof e=="function"}Ec(Aw,"isFunction");var Ox=Symbol("RADIX:SYNC_STATE");function W4(e,i,a,l){const{prop:s,defaultProp:c,onChange:d,caller:f}=i,m=s!==void 0,v=Nw(d),y=[{...a,state:c}];l&&y.push(l);const[g,b]=k.useReducer((C,N)=>{if(N.type===Ox)return{...C,state:N.state};const M=e(C,N);return m&&!Object.is(M.state,C.state)&&v(M.state),M},...y),x=g.state,w=k.useRef(x);k.useEffect(()=>{w.current!==x&&(w.current=x,m||v(x))},[x,w,m]);const S=k.useMemo(()=>s!==void 0?{...g,state:s}:g,[g,s]);return k.useEffect(()=>{m&&!Object.is(s,g.state)&&b({type:Ox,state:s})},[s,g.state,m]),[S,b]}Ec(W4,"useControllableStateReducer");var eM=Object.defineProperty,dr=(e,i)=>eM(e,"name",{value:i,configurable:!0});function Mw(e,i){return k.useReducer((a,l)=>i[a][l]??a,e)}dr(Mw,"useStateMachine");var qa=dr(e=>{const{present:i,children:a}=e,l=Ow(i),s=typeof a=="function"?a({present:l.isPresent}):k.Children.only(a),c=Rw(l.ref,_w(s));return typeof a=="function"||l.isPresent?k.cloneElement(s,{ref:c}):null},"Presence");function Ow(e){const[i,a]=k.useState(),l=k.useRef(null),s=k.useRef(e),c=k.useRef("none"),d=k.useRef(void 0),f=e?"mounted":"unmounted",[m,v]=Mw(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{m==="mounted"?(c.current=d.current??Ko(l.current),d.current=void 0):c.current="none"},[m]),Mn(()=>{const y=l.current,g=s.current;if(g!==e){const x=c.current,w=Ko(y);e?(d.current=w,v("MOUNT")):w==="none"||(y==null?void 0:y.display)==="none"?v("UNMOUNT"):v(g&&x!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,v]),Mn(()=>{if(i){let y;const g=i.ownerDocument.defaultView??window,b=dr(w=>{const C=Ko(l.current).includes(CSS.escape(w.animationName));if(w.target===i&&C&&(v("ANIMATION_END"),!s.current)){const N=i.style.animationFillMode;i.style.animationFillMode="forwards",y=g.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=N)})}},"handleAnimationEnd"),x=dr(w=>{w.target===i&&(c.current=Ko(l.current))},"handleAnimationStart");return i.addEventListener("animationstart",x),i.addEventListener("animationcancel",b),i.addEventListener("animationend",b),()=>{g.clearTimeout(y),i.removeEventListener("animationstart",x),i.removeEventListener("animationcancel",b),i.removeEventListener("animationend",b)}}else v("ANIMATION_END")},[i,v]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:k.useCallback(y=>{if(y){const g=getComputedStyle(y);l.current=g,d.current=Ko(g)}else l.current=null;a(y)},[])}}dr(Ow,"usePresence");function _p(e,i){if(typeof e=="function")return e(i);e!=null&&(e.current=i)}dr(_p,"setRef");function Rw(...e){const i=k.useRef(e);return i.current=e,k.useCallback(a=>{const l=i.current;let s=!1;const c=l.map(d=>{const f=_p(d,a);return!s&&typeof f=="function"&&(s=!0),f});if(s)return()=>{for(let d=0;d<c.length;d++){const f=c[d];typeof f=="function"?f():_p(l[d],null)}}},[])}dr(Rw,"useStableComposedRefs");function Ko(e){return(e==null?void 0:e.animationName)||"none"}dr(Ko,"getAnimationName");function _w(e){var l,s;let i=(l=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:l.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?e.ref:(i=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}dr(_w,"getElementRef");var tM=Object.defineProperty,nM=(e,i)=>tM(e,"name",{value:i,configurable:!0}),iM=wc[" useId ".trim().toString()]||(()=>{}),aM=0;function Vl(e){const[i,a]=k.useState(iM());return Mn(()=>{e||a(l=>l??String(aM++))},[e]),e||(i?`radix-${i}`:"")}nM(Vl,"useId");var rM=Object.defineProperty,lM=(e,i)=>rM(e,"name",{value:i,configurable:!0}),oM=k.createContext(void 0);function vg(e){const i=k.useContext(oM);return e||i||"ltr"}lM(vg,"useDirection");var sM=Object.defineProperty,cM=(e,i)=>sM(e,"name",{value:i,configurable:!0});function An(e){const i=k.useRef(e);return k.useEffect(()=>{i.current=e}),k.useMemo(()=>((...a)=>{var l;return(l=i.current)==null?void 0:l.call(i,...a)}),[])}cM(An,"useCallbackRef");var uM=Object.defineProperty,mn=(e,i)=>uM(e,"name",{value:i,configurable:!0}),Dp="dismissableLayer.update",dM="dismissableLayer.pointerDownOutside",fM="dismissableLayer.focusOutside",Rx,Dw=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),yg=k.forwardRef(mn(function(i,a){const{disableOutsidePointerEvents:l=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,onDismiss:v,...y}=i,g=k.useContext(Dw),[b,x]=k.useState(null),w=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=k.useState({}),C=xt(a,x),N=Array.from(g.layers),[M]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),T=M?N.indexOf(M):-1,A=b?N.indexOf(b):-1,I=g.layersWithOutsidePointerEventsDisabled.size>0,D=A>=T,B=k.useRef(!1),P=Lw(q=>{d==null||d(q),m==null||m(q),q.defaultPrevented||v==null||v()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:k.useCallback(q=>{if(!(q instanceof Node))return!1;const W=[...g.branches].some(Q=>Q.contains(q));return D&&!W},[g.branches,D])}),V=Iw(q=>{if(s&&B.current)return;const W=q.target;[...g.branches].some(U=>U.contains(W))||(f==null||f(q),m==null||m(q),q.defaultPrevented||v==null||v())},w),z=b?A===N.length-1:!1,Y=An(q=>{q.key==="Escape"&&(c==null||c(q),!q.defaultPrevented&&v&&(q.preventDefault(),v()))});return k.useEffect(()=>{if(z)return w.addEventListener("keydown",Y,{capture:!0}),()=>w.removeEventListener("keydown",Y,{capture:!0})},[w,z,Y]),k.useEffect(()=>{if(b)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Rx=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(b)),g.layers.add(b),zp(),()=>{l&&(g.layersWithOutsidePointerEventsDisabled.delete(b),g.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=Rx))}},[b,w,l,g]),k.useEffect(()=>()=>{b&&(g.layers.delete(b),g.layersWithOutsidePointerEventsDisabled.delete(b),zp())},[b,g]),k.useEffect(()=>{const q=mn(()=>S({}),"handleUpdate");return document.addEventListener(Dp,q),()=>document.removeEventListener(Dp,q)},[]),u.jsx(Dt.div,{...y,ref:C,style:{pointerEvents:I?D?"auto":"none":void 0,...i.style},onFocusCapture:mt(i.onFocusCapture,V.onFocusCapture),onBlurCapture:mt(i.onBlurCapture,V.onBlurCapture),onPointerDownCapture:mt(i.onPointerDownCapture,P.onPointerDownCapture)})},"DismissableLayer"));function zw(){const e=k.useContext(Dw),[i,a]=k.useState(null);return k.useEffect(()=>{if(i)return e.dismissableSurfaces.add(i),()=>{e.dismissableSurfaces.delete(i)}},[i,e.dismissableSurfaces]),a}mn(zw,"useDismissableLayerSurface");var hM=mn(()=>!0,"IS_TRUE");function Lw(e,i){const{ownerDocument:a=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:l=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:c,shouldHandlePointerDownOutside:d=hM}=i,f=An(e),m=k.useRef(!1),v=k.useRef(!1),y=k.useRef(new Map),g=k.useRef(()=>{});return k.useEffect(()=>{function b(){v.current=!1,s.current=!1,y.current.clear()}mn(b,"resetOutsideInteraction");function x(){return Array.from(y.current.values()).some(Boolean)}mn(x,"isOutsideInteractionIntercepted");function w(T){if(!v.current)return;const A=T.target;A instanceof Node&&[...c].some(D=>D.contains(A))||y.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{v.current&&g.current()},0)}mn(w,"handleInteractionCapture");function S(T){v.current&&y.current.set(T.type,!1)}mn(S,"handleInteractionBubble");const C=mn(T=>{if(T.target&&!m.current){let A=function(){a.removeEventListener("click",g.current);const D=x();b(),D||bg(dM,f,I,{discrete:!0})};if(mn(A,"handleAndDispatchPointerDownOutsideEvent"),!d(T.target)){a.removeEventListener("click",g.current),b(),m.current=!1;return}const I={originalEvent:T};v.current=!0,s.current=l&&T.button===0,y.current.clear(),!l||T.button!==0?A():(a.removeEventListener("click",g.current),g.current=A,a.addEventListener("click",g.current,{once:!0}))}else a.removeEventListener("click",g.current),b();m.current=!1},"handlePointerDown"),N=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of N)a.addEventListener(T,w,!0),a.addEventListener(T,S);const M=window.setTimeout(()=>{a.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(M),a.removeEventListener("pointerdown",C),a.removeEventListener("click",g.current);for(const T of N)a.removeEventListener(T,w,!0),a.removeEventListener(T,S)}},[a,f,l,s,c,d]),{onPointerDownCapture:mn(()=>m.current=!0,"onPointerDownCapture")}}mn(Lw,"usePointerDownOutside");function Iw(e,i=globalThis==null?void 0:globalThis.document){const a=An(e),l=k.useRef(!1);return k.useEffect(()=>{const s=mn(c=>{c.target&&!l.current&&bg(fM,a,{originalEvent:c},{discrete:!1})},"handleFocus");return i.addEventListener("focusin",s),()=>i.removeEventListener("focusin",s)},[i,a]),{onFocusCapture:mn(()=>l.current=!0,"onFocusCapture"),onBlurCapture:mn(()=>l.current=!1,"onBlurCapture")}}mn(Iw,"useFocusOutside");function zp(){const e=new CustomEvent(Dp);document.dispatchEvent(e)}mn(zp,"dispatchUpdate");function bg(e,i,a,{discrete:l}){const s=a.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});i&&s.addEventListener(e,i,{once:!0}),l?vw(s,c):s.dispatchEvent(c)}mn(bg,"handleAndDispatchCustomEvent");var mM=Object.defineProperty,Qn=(e,i)=>mM(e,"name",{value:i,configurable:!0}),Bm="focusScope.autoFocusOnMount",Pm="focusScope.autoFocusOnUnmount",_x={bubbles:!1,cancelable:!0},xg=k.forwardRef(Qn(function(i,a){const{loop:l=!1,trapped:s=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...f}=i,[m,v]=k.useState(null),y=An(c),g=An(d),b=k.useRef(null),x=xt(a,v),w=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(s){let C=function(A){if(w.paused||!m)return;const I=A.target;m.contains(I)?b.current=I:or(b.current,{select:!0})},N=function(A){if(w.paused||!m)return;const I=A.relatedTarget;I!==null&&(m.contains(I)||or(b.current,{select:!0}))},M=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&or(m)};Qn(C,"handleFocusIn"),Qn(N,"handleFocusOut"),Qn(M,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",N);const T=new MutationObserver(M);return m&&T.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",N),T.disconnect()}}},[s,m,w.paused]),k.useEffect(()=>{if(m){Dx.add(w);const C=document.activeElement;if(!m.contains(C)){const M=new CustomEvent(Bm,_x);m.addEventListener(Bm,y),m.dispatchEvent(M),M.defaultPrevented||(Bw(Fw(jg(m)),{select:!0}),document.activeElement===C&&or(m))}return()=>{m.removeEventListener(Bm,y),setTimeout(()=>{const M=new CustomEvent(Pm,_x);m.addEventListener(Pm,g),m.dispatchEvent(M),M.defaultPrevented||or(C??document.body,{select:!0}),m.removeEventListener(Pm,g),Dx.remove(w)},0)}}},[m,y,g,w]);const S=k.useCallback(C=>{if(!l&&!s||w.paused)return;const N=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,M=document.activeElement;if(N&&M){const T=C.currentTarget,[A,I]=Pw(T);A&&I?!C.shiftKey&&M===I?(C.preventDefault(),l&&or(A,{select:!0})):C.shiftKey&&M===A&&(C.preventDefault(),l&&or(I,{select:!0})):M===T&&C.preventDefault()}},[l,s,w.paused]);return u.jsx(Dt.div,{tabIndex:-1,...f,ref:x,onKeyDown:S})},"FocusScope"));function Bw(e,{select:i=!1}={}){const a=document.activeElement;for(const l of e)if(or(l,{select:i}),document.activeElement!==a)return}Qn(Bw,"focusFirst");function Pw(e){const i=jg(e),a=Lp(i,e),l=Lp(i.reverse(),e);return[a,l]}Qn(Pw,"getTabbableEdges");function jg(e){const i=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Qn(l=>{const s=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||s?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;a.nextNode();)i.push(a.currentNode);return i}Qn(jg,"getTabbableCandidates");function Lp(e,i){const a=typeof i.checkVisibility=="function"&&i.checkVisibility({checkVisibilityCSS:!0});for(const l of e)if(!(a?!l.checkVisibility({checkVisibilityCSS:!0}):Hw(l,{upTo:i})))return l}Qn(Lp,"findVisible");function Hw(e,{upTo:i}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(i!==void 0&&e===i)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Qn(Hw,"isHidden");function Uw(e){return e instanceof HTMLInputElement&&"select"in e}Qn(Uw,"isSelectableInput");function or(e,{select:i=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&Uw(e)&&i&&e.select()}}Qn(or,"focus");var Dx=qw();function qw(){let e=[];return{add(i){const a=e[0];i!==a&&(a==null||a.pause()),e=Ip(e,i),e.unshift(i)},remove(i){var a;e=Ip(e,i),(a=e[0])==null||a.resume()}}}Qn(qw,"createFocusScopesStack");function Ip(e,i){const a=[...e],l=a.indexOf(i);return l!==-1&&a.splice(l,1),a}Qn(Ip,"arrayRemove");function Fw(e){return e.filter(i=>i.tagName!=="A")}Qn(Fw,"removeLinks");var pM=Object.defineProperty,gM=(e,i)=>pM(e,"name",{value:i,configurable:!0}),wg=k.forwardRef(gM(function(i,a){var m;const{container:l,...s}=i,[c,d]=k.useState(!1);Mn(()=>d(!0),[]);const f=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return f?to.createPortal(u.jsx(Dt.div,{...s,ref:a}),f):null},"Portal")),vM=Object.defineProperty,Sg=(e,i)=>vM(e,"name",{value:i,configurable:!0}),nd=0,Aa=null;function yM(e){return Nc(),e.children}Sg(yM,"FocusGuards");function Nc(){k.useEffect(()=>{Aa||(Aa={start:Bp(),end:Bp()});const{start:e,end:i}=Aa;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==i&&document.body.insertAdjacentElement("beforeend",i),nd++,()=>{nd===1&&(Aa==null||Aa.start.remove(),Aa==null||Aa.end.remove(),Aa=null),nd=Math.max(0,nd-1)}},[])}Sg(Nc,"useFocusGuards");function Bp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Sg(Bp,"createFocusGuard");var Oa=function(){return Oa=Object.assign||function(i){for(var a,l=1,s=arguments.length;l<s;l++){a=arguments[l];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(i[c]=a[c])}return i},Oa.apply(this,arguments)};function Vw(e,i){var a={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&i.indexOf(l)<0&&(a[l]=e[l]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,l=Object.getOwnPropertySymbols(e);s<l.length;s++)i.indexOf(l[s])<0&&Object.prototype.propertyIsEnumerable.call(e,l[s])&&(a[l[s]]=e[l[s]]);return a}function bM(e,i,a){if(a||arguments.length===2)for(var l=0,s=i.length,c;l<s;l++)(c||!(l in i))&&(c||(c=Array.prototype.slice.call(i,0,l)),c[l]=i[l]);return e.concat(c||Array.prototype.slice.call(i))}var jd="right-scroll-bar-position",wd="width-before-scroll-bar",xM="with-scroll-bars-hidden",jM="--removed-body-scroll-bar-size";function Hm(e,i){return typeof e=="function"?e(i):e&&(e.current=i),e}function wM(e,i){var a=k.useState(function(){return{value:e,callback:i,facade:{get current(){return a.value},set current(l){var s=a.value;s!==l&&(a.value=l,a.callback(l,s))}}}})[0];return a.callback=i,a.facade}var SM=typeof window<"u"?k.useLayoutEffect:k.useEffect,zx=new WeakMap;function kM(e,i){var a=wM(null,function(l){return e.forEach(function(s){return Hm(s,l)})});return SM(function(){var l=zx.get(a);if(l){var s=new Set(l),c=new Set(e),d=a.current;s.forEach(function(f){c.has(f)||Hm(f,null)}),c.forEach(function(f){s.has(f)||Hm(f,d)})}zx.set(a,e)},[e]),a}function CM(e){return e}function EM(e,i){i===void 0&&(i=CM);var a=[],l=!1,s={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(c){var d=i(c,l);return a.push(d),function(){a=a.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(l=!0;a.length;){var d=a;a=[],d.forEach(c)}a={push:function(f){return c(f)},filter:function(){return a}}},assignMedium:function(c){l=!0;var d=[];if(a.length){var f=a;a=[],f.forEach(c),d=a}var m=function(){var y=d;d=[],y.forEach(c)},v=function(){return Promise.resolve().then(m)};v(),a={push:function(y){d.push(y),v()},filter:function(y){return d=d.filter(y),a}}}};return s}function NM(e){e===void 0&&(e={});var i=EM(null);return i.options=Oa({async:!0,ssr:!1},e),i}var $w=function(e){var i=e.sideCar,a=Vw(e,["sideCar"]);if(!i)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=i.read();if(!l)throw new Error("Sidecar medium not found");return k.createElement(l,Oa({},a))};$w.isSideCarExport=!0;function TM(e,i){return e.useMedium(i),$w}var Yw=NM(),Um=function(){},Yd=k.forwardRef(function(e,i){var a=k.useRef(null),l=k.useState({onScrollCapture:Um,onWheelCapture:Um,onTouchMoveCapture:Um}),s=l[0],c=l[1],d=e.forwardProps,f=e.children,m=e.className,v=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,x=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,N=e.as,M=N===void 0?"div":N,T=e.gapMode,A=Vw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=b,D=kM([a,i]),B=Oa(Oa({},A),s);return k.createElement(k.Fragment,null,y&&k.createElement(I,{sideCar:Yw,removeScrollBar:v,shards:g,noRelative:x,noIsolation:w,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:a,gapMode:T}),d?k.cloneElement(k.Children.only(f),Oa(Oa({},B),{ref:D})):k.createElement(M,Oa({},B,{className:m,ref:D}),f))});Yd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yd.classNames={fullWidth:wd,zeroRight:jd};var AM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var i=AM();return i&&e.setAttribute("nonce",i),e}function OM(e,i){e.styleSheet?e.styleSheet.cssText=i:e.appendChild(document.createTextNode(i))}function RM(e){var i=document.head||document.getElementsByTagName("head")[0];i.appendChild(e)}var _M=function(){var e=0,i=null;return{add:function(a){e==0&&(i=MM())&&(OM(i,a),RM(i)),e++},remove:function(){e--,!e&&i&&(i.parentNode&&i.parentNode.removeChild(i),i=null)}}},DM=function(){var e=_M();return function(i,a){k.useEffect(function(){return e.add(i),function(){e.remove()}},[i&&a])}},Gw=function(){var e=DM(),i=function(a){var l=a.styles,s=a.dynamic;return e(l,s),null};return i},zM={left:0,top:0,right:0,gap:0},qm=function(e){return parseInt(e||"",10)||0},LM=function(e){var i=window.getComputedStyle(document.body),a=i[e==="padding"?"paddingLeft":"marginLeft"],l=i[e==="padding"?"paddingTop":"marginTop"],s=i[e==="padding"?"paddingRight":"marginRight"];return[qm(a),qm(l),qm(s)]},IM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zM;var i=LM(e),a=document.documentElement.clientWidth,l=window.innerWidth;return{left:i[0],top:i[1],right:i[2],gap:Math.max(0,l-a+i[2]-i[0])}},BM=Gw(),Jo="data-scroll-locked",PM=function(e,i,a,l){var s=e.left,c=e.top,d=e.right,f=e.gap;return a===void 0&&(a="margin"),`
445
- .`.concat(xM,` {
446
- overflow: hidden `).concat(l,`;
447
- padding-right: `).concat(f,"px ").concat(l,`;
448
- }
449
- body[`).concat(Jo,`] {
450
- overflow: hidden `).concat(l,`;
451
- overscroll-behavior: contain;
452
- `).concat([i&&"position: relative ".concat(l,";"),a==="margin"&&`
453
- padding-left: `.concat(s,`px;
454
- padding-top: `).concat(c,`px;
455
- padding-right: `).concat(d,`px;
456
- margin-left:0;
457
- margin-top:0;
458
- margin-right: `).concat(f,"px ").concat(l,`;
459
- `),a==="padding"&&"padding-right: ".concat(f,"px ").concat(l,";")].filter(Boolean).join(""),`
460
- }
461
-
462
- .`).concat(jd,` {
463
- right: `).concat(f,"px ").concat(l,`;
464
- }
465
-
466
- .`).concat(wd,` {
467
- margin-right: `).concat(f,"px ").concat(l,`;
468
- }
469
-
470
- .`).concat(jd," .").concat(jd,` {
471
- right: 0 `).concat(l,`;
472
- }
473
-
474
- .`).concat(wd," .").concat(wd,` {
475
- margin-right: 0 `).concat(l,`;
476
- }
477
-
478
- body[`).concat(Jo,`] {
479
- `).concat(jM,": ").concat(f,`px;
480
- }
481
- `)},Lx=function(){var e=parseInt(document.body.getAttribute(Jo)||"0",10);return isFinite(e)?e:0},HM=function(){k.useEffect(function(){return document.body.setAttribute(Jo,(Lx()+1).toString()),function(){var e=Lx()-1;e<=0?document.body.removeAttribute(Jo):document.body.setAttribute(Jo,e.toString())}},[])},UM=function(e){var i=e.noRelative,a=e.noImportant,l=e.gapMode,s=l===void 0?"margin":l;HM();var c=k.useMemo(function(){return IM(s)},[s]);return k.createElement(BM,{styles:PM(c,!i,s,a?"":"!important")})},Pp=!1;if(typeof window<"u")try{var id=Object.defineProperty({},"passive",{get:function(){return Pp=!0,!0}});window.addEventListener("test",id,id),window.removeEventListener("test",id,id)}catch{Pp=!1}var $o=Pp?{passive:!1}:!1,qM=function(e){return e.tagName==="TEXTAREA"},Xw=function(e,i){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[i]!=="hidden"&&!(a.overflowY===a.overflowX&&!qM(e)&&a[i]==="visible")},FM=function(e){return Xw(e,"overflowY")},VM=function(e){return Xw(e,"overflowX")},Ix=function(e,i){var a=i.ownerDocument,l=i;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var s=Qw(e,l);if(s){var c=Kw(e,l),d=c[1],f=c[2];if(d>f)return!0}l=l.parentNode}while(l&&l!==a.body);return!1},$M=function(e){var i=e.scrollTop,a=e.scrollHeight,l=e.clientHeight;return[i,a,l]},YM=function(e){var i=e.scrollLeft,a=e.scrollWidth,l=e.clientWidth;return[i,a,l]},Qw=function(e,i){return e==="v"?FM(i):VM(i)},Kw=function(e,i){return e==="v"?$M(i):YM(i)},GM=function(e,i){return e==="h"&&i==="rtl"?-1:1},XM=function(e,i,a,l,s){var c=GM(e,window.getComputedStyle(i).direction),d=c*l,f=a.target,m=i.contains(f),v=!1,y=d>0,g=0,b=0;do{if(!f)break;var x=Kw(e,f),w=x[0],S=x[1],C=x[2],N=S-C-c*w;(w||N)&&Qw(e,f)&&(g+=N,b+=w);var M=f.parentNode;f=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!m&&f!==document.body||m&&(i.contains(f)||i===f));return(y&&Math.abs(g)<1||!y&&Math.abs(b)<1)&&(v=!0),v},ad=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Bx=function(e){return[e.deltaX,e.deltaY]},Px=function(e){return e&&"current"in e?e.current:e},QM=function(e,i){return e[0]===i[0]&&e[1]===i[1]},KM=function(e){return`
482
- .block-interactivity-`.concat(e,` {pointer-events: none;}
483
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
484
- `)},ZM=0,Yo=[];function JM(e){var i=k.useRef([]),a=k.useRef([0,0]),l=k.useRef(),s=k.useState(ZM++)[0],c=k.useState(Gw)[0],d=k.useRef(e);k.useEffect(function(){d.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=bM([e.lockRef.current],(e.shards||[]).map(Px),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var f=k.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var N=ad(S),M=a.current,T="deltaX"in S?S.deltaX:M[0]-N[0],A="deltaY"in S?S.deltaY:M[1]-N[1],I,D=S.target,B=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in S&&B==="h"&&D.type==="range")return!1;var P=window.getSelection(),V=P&&P.anchorNode,z=V?V===D||V.contains(D):!1;if(z)return!1;var Y=Ix(B,D);if(!Y)return!0;if(Y?I=B:(I=B==="v"?"h":"v",Y=Ix(B,D)),!Y)return!1;if(!l.current&&"changedTouches"in S&&(T||A)&&(l.current=I),!I)return!0;var q=l.current||I;return XM(q,C,S,q==="h"?T:A)},[]),m=k.useCallback(function(S){var C=S;if(!(!Yo.length||Yo[Yo.length-1]!==c)){var N="deltaY"in C?Bx(C):ad(C),M=i.current.filter(function(I){return I.name===C.type&&(I.target===C.target||C.target===I.shadowParent)&&QM(I.delta,N)})[0];if(M&&M.should){C.cancelable&&C.preventDefault();return}if(!M){var T=(d.current.shards||[]).map(Px).filter(Boolean).filter(function(I){return I.contains(C.target)}),A=T.length>0?f(C,T[0]):!d.current.noIsolation;A&&C.cancelable&&C.preventDefault()}}},[]),v=k.useCallback(function(S,C,N,M){var T={name:S,delta:C,target:N,should:M,shadowParent:WM(N)};i.current.push(T),setTimeout(function(){i.current=i.current.filter(function(A){return A!==T})},1)},[]),y=k.useCallback(function(S){a.current=ad(S),l.current=void 0},[]),g=k.useCallback(function(S){v(S.type,Bx(S),S.target,f(S,e.lockRef.current))},[]),b=k.useCallback(function(S){v(S.type,ad(S),S.target,f(S,e.lockRef.current))},[]);k.useEffect(function(){return Yo.push(c),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,$o),document.addEventListener("touchmove",m,$o),document.addEventListener("touchstart",y,$o),function(){Yo=Yo.filter(function(S){return S!==c}),document.removeEventListener("wheel",m,$o),document.removeEventListener("touchmove",m,$o),document.removeEventListener("touchstart",y,$o)}},[]);var x=e.removeScrollBar,w=e.inert;return k.createElement(k.Fragment,null,w?k.createElement(c,{styles:KM(s)}):null,x?k.createElement(UM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function WM(e){for(var i=null;e!==null;)e instanceof ShadowRoot&&(i=e.host,e=e.host),e=e.parentNode;return i}const eO=TM(Yw,JM);var Gd=k.forwardRef(function(e,i){return k.createElement(Yd,Oa({},e,{ref:i,sideCar:eO}))});Gd.classNames=Yd.classNames;var tO=function(e){if(typeof document>"u")return null;var i=Array.isArray(e)?e[0]:e;return i.ownerDocument.body},Go=new WeakMap,rd=new WeakMap,ld={},Fm=0,Zw=function(e){return e&&(e.host||Zw(e.parentNode))},nO=function(e,i){return i.map(function(a){if(e.contains(a))return a;var l=Zw(a);return l&&e.contains(l)?l:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},iO=function(e,i,a,l){var s=nO(i,Array.isArray(e)?e:[e]);ld[a]||(ld[a]=new WeakMap);var c=ld[a],d=[],f=new Set,m=new Set(s),v=function(g){!g||f.has(g)||(f.add(g),v(g.parentNode))};s.forEach(v);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))y(b);else try{var x=b.getAttribute(l),w=x!==null&&x!=="false",S=(Go.get(b)||0)+1,C=(c.get(b)||0)+1;Go.set(b,S),c.set(b,C),d.push(b),S===1&&w&&rd.set(b,!0),C===1&&b.setAttribute(a,"true"),w||b.setAttribute(l,"true")}catch(N){console.error("aria-hidden: cannot operate on ",b,N)}})};return y(i),f.clear(),Fm++,function(){d.forEach(function(g){var b=Go.get(g)-1,x=c.get(g)-1;Go.set(g,b),c.set(g,x),b||(rd.has(g)||g.removeAttribute(l),rd.delete(g)),x||g.removeAttribute(a)}),Fm--,Fm||(Go=new WeakMap,Go=new WeakMap,rd=new WeakMap,ld={})}},kg=function(e,i,a){a===void 0&&(a="data-aria-hidden");var l=Array.from(Array.isArray(e)?e:[e]),s=tO(e);return s?(l.push.apply(l,Array.from(s.querySelectorAll("[aria-live], script"))),iO(l,s,a,"aria-hidden")):function(){return null}},aO=Object.defineProperty,oa=(e,i)=>aO(e,"name",{value:i,configurable:!0}),Cg="Dialog",[Jw,CB]=tl(Cg),[rO,hr]=Jw(Cg),lO=oa(e=>{const{__scopeDialog:i,children:a,open:l,defaultOpen:s,onOpenChange:c,modal:d=!0}=e,f=k.useRef(null),m=k.useRef(null),[v,y]=mc({prop:l,defaultProp:s??!1,onChange:c,caller:Cg}),[g,b]=k.useState(0),[x,w]=k.useState(0);return u.jsx(rO,{scope:i,triggerRef:f,contentRef:m,contentId:Vl(),titleId:Vl(),descriptionId:Vl(),titlePresent:g>0,descriptionPresent:x>0,setTitleCount:b,setDescriptionCount:w,open:v,onOpenChange:y,onOpenToggle:k.useCallback(()=>y(S=>!S),[y]),modal:d,children:a})},"Dialog"),Ww="DialogPortal",[oO,eS]=Jw(Ww,{forceMount:void 0}),sO=oa(e=>{const{__scopeDialog:i,forceMount:a,children:l,container:s}=e,c=hr(Ww,i);return u.jsx(oO,{scope:i,forceMount:a,children:k.Children.map(l,d=>u.jsx(qa,{present:a||c.open,children:u.jsx(wg,{asChild:!0,container:s,children:d})}))})},"DialogPortal"),Hp="DialogOverlay",cO=k.forwardRef(oa(function(i,a){const l=eS(Hp,i.__scopeDialog),{forceMount:s=l.forceMount,...c}=i,d=hr(Hp,i.__scopeDialog);return d.modal?u.jsx(qa,{present:s||d.open,children:u.jsx(dO,{...c,ref:a})}):null},"DialogOverlay")),uO=La("DialogOverlay.RemoveScroll"),dO=k.forwardRef(oa(function(i,a){const{__scopeDialog:l,...s}=i,c=hr(Hp,l),d=zw(),f=xt(a,d);return u.jsx(Gd,{as:uO,allowPinchZoom:!0,shards:[c.contentRef],children:u.jsx(Dt.div,{"data-state":Eg(c.open),...s,ref:f,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),pc="DialogContent",fO=k.forwardRef(oa(function(i,a){const l=eS(pc,i.__scopeDialog),{forceMount:s=l.forceMount,...c}=i,d=hr(pc,i.__scopeDialog);return u.jsx(qa,{present:s||d.open,children:d.modal?u.jsx(hO,{...c,ref:a}):u.jsx(mO,{...c,ref:a})})},"DialogContent")),hO=k.forwardRef(oa(function(i,a){const l=hr(pc,i.__scopeDialog),s=k.useRef(null),c=xt(a,l.contentRef,s);return k.useEffect(()=>{const d=s.current;if(d)return kg(d)},[]),u.jsx(tS,{...i,ref:c,trapFocus:l.open,disableOutsidePointerEvents:l.open,onCloseAutoFocus:mt(i.onCloseAutoFocus,d=>{var f;d.preventDefault(),(f=l.triggerRef.current)==null||f.focus()}),onPointerDownOutside:mt(i.onPointerDownOutside,d=>{const f=d.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0;(f.button===2||m)&&d.preventDefault()}),onFocusOutside:mt(i.onFocusOutside,d=>d.preventDefault())})},"DialogContentModal")),mO=k.forwardRef(oa(function(i,a){const l=hr(pc,i.__scopeDialog),s=k.useRef(!1),c=k.useRef(!1);return u.jsx(tS,{...i,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,m;(f=i.onCloseAutoFocus)==null||f.call(i,d),d.defaultPrevented||(s.current||(m=l.triggerRef.current)==null||m.focus(),d.preventDefault()),s.current=!1,c.current=!1},onInteractOutside:d=>{var v,y;(v=i.onInteractOutside)==null||v.call(i,d),d.defaultPrevented||(s.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((y=l.triggerRef.current)==null?void 0:y.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})},"DialogContentNonModal")),tS=k.forwardRef(oa(function(i,a){const{__scopeDialog:l,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:d,...f}=i,m=hr(pc,l);return Nc(),u.jsx(u.Fragment,{children:u.jsx(xg,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:c,onUnmountAutoFocus:d,children:u.jsx(yg,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionPresent?m.descriptionId:void 0,"aria-labelledby":m.titlePresent?m.titleId:void 0,"data-state":Eg(m.open),...f,ref:a,deferPointerDownOutside:!0,onDismiss:()=>m.onOpenChange(!1)})})})},"DialogContentImpl")),pO="DialogTitle",gO=k.forwardRef(oa(function(i,a){const{__scopeDialog:l,...s}=i,c=hr(pO,l),{setTitleCount:d}=c;return Mn(()=>(d(f=>f+1),()=>d(f=>f-1)),[d]),u.jsx(Dt.h2,{id:c.titleId,...s,ref:a})},"DialogTitle")),vO="DialogClose",yO=k.forwardRef(oa(function(i,a){const{__scopeDialog:l,...s}=i,c=hr(vO,l);return u.jsx(Dt.button,{type:"button",...s,ref:a,onClick:mt(i.onClick,()=>c.onOpenChange(!1))})},"DialogClose"));function Eg(e){return e?"open":"closed"}oa(Eg,"getState");var bO=Object.defineProperty,xO=(e,i)=>bO(e,"name",{value:i,configurable:!0});function nS(e){const[i,a]=k.useState(void 0);return Mn(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const l=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const c=s[0];let d,f;if("borderBoxSize"in c){const m=c.borderBoxSize,v=Array.isArray(m)?m[0]:m;d=v.inlineSize,f=v.blockSize}else d=e.offsetWidth,f=e.offsetHeight;a({width:d,height:f})});return l.observe(e,{box:"border-box"}),()=>l.unobserve(e)}else a(void 0)},[e]),i}xO(nS,"useSize");const jO=["top","right","bottom","left"],Wr=Math.min,sr=Math.max,Ad=Math.round,od=Math.floor,cr=e=>({x:e,y:e}),wO={left:"right",right:"left",bottom:"top",top:"bottom"};function iS(e,i,a){return sr(e,Wr(i,a))}function fr(e,i){return typeof e=="function"?e(i):e}function el(e){return e.split("-")[0]}function ls(e){return e.split("-")[1]}function Ng(e){return e==="x"?"y":"x"}function Tg(e){return e==="y"?"height":"width"}function _a(e){const i=e[0];return i==="t"||i==="b"?"y":"x"}function Ag(e){return Ng(_a(e))}function SO(e,i,a){a===void 0&&(a=!1);const l=ls(e),s=Ag(e),c=Tg(s);let d=s==="x"?l===(a?"end":"start")?"right":"left":l==="start"?"bottom":"top";return i.reference[c]>i.floating[c]&&(d=Md(d)),[d,Md(d)]}function kO(e){const i=Md(e);return[Up(e),i,Up(i)]}function Up(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Hx=["left","right"],Ux=["right","left"],CO=["top","bottom"],EO=["bottom","top"];function NO(e,i,a){switch(e){case"top":case"bottom":return a?i?Ux:Hx:i?Hx:Ux;case"left":case"right":return i?CO:EO;default:return[]}}function TO(e,i,a,l){const s=ls(e);let c=NO(el(e),a==="start",l);return s&&(c=c.map(d=>d+"-"+s),i&&(c=c.concat(c.map(Up)))),c}function Md(e){const i=el(e);return wO[i]+e.slice(i.length)}function AO(e){var i,a,l,s;return{top:(i=e.top)!=null?i:0,right:(a=e.right)!=null?a:0,bottom:(l=e.bottom)!=null?l:0,left:(s=e.left)!=null?s:0}}function aS(e){return typeof e!="number"?AO(e):{top:e,right:e,bottom:e,left:e}}function Od(e){const{x:i,y:a,width:l,height:s}=e;return{width:l,height:s,top:a,left:i,right:i+l,bottom:a+s,x:i,y:a}}function qx(e,i,a){let{reference:l,floating:s}=e;const c=_a(i),d=Ag(i),f=Tg(d),m=el(i),v=c==="y",y=l.x+l.width/2-s.width/2,g=l.y+l.height/2-s.height/2,b=l[f]/2-s[f]/2;let x;switch(m){case"top":x={x:y,y:l.y-s.height};break;case"bottom":x={x:y,y:l.y+l.height};break;case"right":x={x:l.x+l.width,y:g};break;case"left":x={x:l.x-s.width,y:g};break;default:x={x:l.x,y:l.y}}const w=ls(i);return w&&(x[d]+=b*(w==="end"?1:-1)*(a&&v?-1:1)),x}async function MO(e,i){var a;i===void 0&&(i={});const{x:l,y:s,platform:c,rects:d,elements:f,strategy:m}=e,{boundary:v="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:b=!1,padding:x=0}=fr(i,e),w=aS(x),C=f[b?g==="floating"?"reference":"floating":g],N=Od(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(C)))==null||a?C:C.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:v,rootBoundary:y,strategy:m})),M=g==="floating"?{x:l,y:s,width:d.floating.width,height:d.floating.height}:d.reference,T=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),A=await(c.isElement==null?void 0:c.isElement(T))&&await(c.getScale==null?void 0:c.getScale(T))||{x:1,y:1},I=Od(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:M,offsetParent:T,strategy:m}):M);return{top:(N.top-I.top+w.top)/A.y,bottom:(I.bottom-N.bottom+w.bottom)/A.y,left:(N.left-I.left+w.left)/A.x,right:(I.right-N.right+w.right)/A.x}}const OO=50,RO=async(e,i,a)=>{const{placement:l="bottom",strategy:s="absolute",middleware:c=[],platform:d}=a,f=d.detectOverflow?d:{...d,detectOverflow:MO},m=await(d.isRTL==null?void 0:d.isRTL(i));let v=await d.getElementRects({reference:e,floating:i,strategy:s}),{x:y,y:g}=qx(v,l,m),b=l,x=0;const w={};for(let S=0;S<c.length;S++){const C=c[S];if(!C)continue;const{name:N,fn:M}=C,{x:T,y:A,data:I,reset:D}=await M({x:y,y:g,initialPlacement:l,placement:b,strategy:s,middlewareData:w,rects:v,platform:f,elements:{reference:e,floating:i}});y=T??y,g=A??g,w[N]={...w[N],...I},D&&x<OO&&(x++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(v=D.rects===!0?await d.getElementRects({reference:e,floating:i,strategy:s}):D.rects),{x:y,y:g}=qx(v,b,m)),S=-1)}return{x:y,y:g,placement:b,strategy:s,middlewareData:w}},_O=e=>({name:"arrow",options:e,async fn(i){const{x:a,y:l,placement:s,rects:c,platform:d,elements:f,middlewareData:m}=i,{element:v,padding:y=0}=fr(e,i)||{};if(v==null)return{};const g=aS(y),b={x:a,y:l},x=Ag(s),w=Tg(x),S=await d.getDimensions(v),C=x==="y",N=C?"top":"left",M=C?"bottom":"right",T=C?"clientHeight":"clientWidth",A=c.reference[w]+c.reference[x]-b[x]-c.floating[w],I=b[x]-c.reference[x],D=await(d.getOffsetParent==null?void 0:d.getOffsetParent(v));let B=D?D[T]:0;(!B||!await(d.isElement==null?void 0:d.isElement(D)))&&(B=f.floating[T]||c.floating[w]);const P=A/2-I/2,V=B/2-S[w]/2-1,z=Wr(g[N],V),Y=Wr(g[M],V),q=B-S[w]-Y,W=B/2-S[w]/2+P,Q=iS(z,W,q),U=!m.arrow&&ls(s)!=null&&W!==Q&&c.reference[w]/2-(W<z?z:Y)-S[w]/2<0,X=U?W<z?W-z:W-q:0;return{[x]:b[x]+X,data:{[x]:Q,centerOffset:W-Q-X,...U&&{alignmentOffset:X}},reset:U}}}),DO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(i){var a,l;const{placement:s,middlewareData:c,rects:d,initialPlacement:f,platform:m,elements:v}=i,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...C}=fr(e,i);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const N=el(s),M=_a(f),T=el(f)===f,A=await(m.isRTL==null?void 0:m.isRTL(v.floating)),I=b||(T||!S?[Md(f)]:kO(f)),D=w!=="none";!b&&D&&I.push(...TO(f,S,w,A));const B=[f,...I],P=await m.detectOverflow(i,C),V=[];let z=((l=c.flip)==null?void 0:l.overflows)||[];if(y&&V.push(P[N]),g){const Q=SO(s,d,A);V.push(P[Q[0]],P[Q[1]])}if(z=[...z,{placement:s,overflows:V}],!V.every(Q=>Q<=0)){var Y,q;const Q=(((Y=c.flip)==null?void 0:Y.index)||0)+1,U=B[Q];if(U&&(!(g==="alignment"?M!==_a(U):!1)||z.every(F=>_a(F.placement)===M?F.overflows[0]>0:!0)))return{data:{index:Q,overflows:z},reset:{placement:U}};let X=(q=z.filter(O=>O.overflows[0]<=0).sort((O,F)=>O.overflows[1]-F.overflows[1])[0])==null?void 0:q.placement;if(!X)switch(x){case"bestFit":{var W;const O=(W=z.filter(F=>{if(D){const ne=_a(F.placement);return ne===M||ne==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(ne=>ne>0).reduce((ne,_)=>ne+_,0)]).sort((F,ne)=>F[1]-ne[1])[0])==null?void 0:W[0];O&&(X=O);break}case"initialPlacement":X=f;break}if(s!==X)return{reset:{placement:X}}}return{}}}};function Fx(e,i){return{top:e.top-i.height,right:e.right-i.width,bottom:e.bottom-i.height,left:e.left-i.width}}function Vx(e){return jO.some(i=>e[i]>=0)}const zO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(i){const{rects:a,platform:l}=i,{strategy:s="referenceHidden",...c}=fr(e,i);switch(s){case"referenceHidden":{const d=await l.detectOverflow(i,{...c,elementContext:"reference"}),f=Fx(d,a.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Vx(f)}}}case"escaped":{const d=await l.detectOverflow(i,{...c,altBoundary:!0}),f=Fx(d,a.floating);return{data:{escapedOffsets:f,escaped:Vx(f)}}}default:return{}}}}},rS=new Set(["left","top"]);async function LO(e,i){const{placement:a,platform:l,elements:s}=e,c=await(l.isRTL==null?void 0:l.isRTL(s.floating)),d=el(a),f=ls(a),m=_a(a)==="y",v=rS.has(d)?-1:1,y=c&&m?-1:1,g=fr(i,e);let{mainAxis:b,crossAxis:x,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return f&&typeof w=="number"&&(x=f==="end"?w*-1:w),m?{x:x*y,y:b*v}:{x:b*v,y:x*y}}const IO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(i){var a,l;const{x:s,y:c,placement:d,middlewareData:f}=i,m=await LO(i,e);return d===((a=f.offset)==null?void 0:a.placement)&&(l=f.arrow)!=null&&l.alignmentOffset?{}:{x:s+m.x,y:c+m.y,data:{...m,placement:d}}}}},BO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(i){const{x:a,y:l,placement:s,platform:c}=i,{mainAxis:d=!0,crossAxis:f=!1,limiter:m={fn:M=>{let{x:T,y:A}=M;return{x:T,y:A}}},...v}=fr(e,i),y={x:a,y:l},g=await c.detectOverflow(i,v),b=_a(s),x=Ng(b);let w=y[x],S=y[b];const C=(M,T)=>iS(T+g[M==="y"?"top":"left"],T,T-g[M==="y"?"bottom":"right"]);d&&(w=C(x,w)),f&&(S=C(b,S));const N=m.fn({...i,[x]:w,[b]:S});return{...N,data:{x:N.x-a,y:N.y-l,enabled:{[x]:d,[b]:f}}}}}},PO=function(e){return e===void 0&&(e={}),{options:e,fn(i){var a,l;const{x:s,y:c,placement:d,rects:f,middlewareData:m}=i,{offset:v=0,mainAxis:y=!0,crossAxis:g=!0}=fr(e,i),b={x:s,y:c},x=_a(d),w=Ng(x);let S=b[w],C=b[x];const N=fr(v,i),M=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:(a=N.mainAxis)!=null?a:0,crossAxis:(l=N.crossAxis)!=null?l:0};if(y){const I=w==="y"?"height":"width",D=f.reference[w]-f.floating[I]+M.mainAxis,B=f.reference[w]+f.reference[I]-M.mainAxis;S<D?S=D:S>B&&(S=B)}if(g){var T,A;const I=w==="y"?"width":"height",D=rS.has(el(d)),B=f.reference[x]-f.floating[I]+(D&&((T=m.offset)==null?void 0:T[x])||0)+(D?0:M.crossAxis),P=f.reference[x]+f.reference[I]+(D?0:((A=m.offset)==null?void 0:A[x])||0)-(D?M.crossAxis:0);C<B?C=B:C>P&&(C=P)}return{[w]:S,[x]:C}}}},HO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(i){const{placement:a,rects:l,platform:s,elements:c}=i,{apply:d=()=>{},...f}=fr(e,i),m=await s.detectOverflow(i,f),v=el(a),y=ls(a),g=_a(a)==="y",{width:b,height:x}=l.floating;let w,S;v==="top"||v==="bottom"?(w=v,S=y===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(S=v,w=y==="end"?"top":"bottom");const C=x-m.top-m.bottom,N=b-m.left-m.right,M=Wr(x-m[w],C),T=Wr(b-m[S],N),A=i.middlewareData.shift,I=!A;let D=M,B=T;A!=null&&A.enabled.x&&(B=N),A!=null&&A.enabled.y&&(D=C),I&&!y&&(g?B=b-2*sr(m.left,m.right):D=x-2*sr(m.top,m.bottom)),await d({...i,availableWidth:B,availableHeight:D});const P=await s.getDimensions(c.floating);return b!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function Xd(){return typeof window<"u"}function os(e){return lS(e)?(e.nodeName||"").toLowerCase():"#document"}function ci(e){var i;return(e==null||(i=e.ownerDocument)==null?void 0:i.defaultView)||window}function mr(e){var i;return(i=(lS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:i.documentElement}function lS(e){return Xd()?e instanceof Node||e instanceof ci(e).Node:!1}function Ia(e){return Xd()?e instanceof Element||e instanceof ci(e).Element:!1}function nl(e){return Xd()?e instanceof HTMLElement||e instanceof ci(e).HTMLElement:!1}function $x(e){return!Xd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ci(e).ShadowRoot}function Qd(e){const{overflow:i,overflowX:a,overflowY:l,display:s}=Ba(e);return/auto|scroll|overlay|hidden|clip/.test(i+l+a)&&s!=="inline"&&s!=="contents"}function UO(e){return/^(table|td|th)$/.test(os(e))}function Kd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const qO=/transform|translate|scale|rotate|perspective|filter/,FO=/paint|layout|strict|content/,Il=e=>!!e&&e!=="none";let Vm;function Mg(e){const i=Ia(e)?Ba(e):e;return Il(i.transform)||Il(i.translate)||Il(i.scale)||Il(i.rotate)||Il(i.perspective)||!Og()&&(Il(i.backdropFilter)||Il(i.filter))||qO.test(i.willChange||"")||FO.test(i.contain||"")}function VO(e){let i=Yl(e);for(;nl(i)&&!gc(i);){if(Mg(i))return i;if(Kd(i))return null;i=Yl(i)}return null}function Og(){return Vm==null&&(Vm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Vm}function gc(e){return/^(html|body|#document)$/.test(os(e))}function Ba(e){return ci(e).getComputedStyle(e)}function Zd(e){return Ia(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yl(e){if(os(e)==="html")return e;const i=e.assignedSlot||e.parentNode||$x(e)&&e.host||mr(e);return $x(i)?i.host:i}function oS(e){const i=Yl(e);return gc(i)?(e.ownerDocument||e).body:nl(i)&&Qd(i)?i:oS(i)}function vc(e,i,a){var l;i===void 0&&(i=[]),a===void 0&&(a=!0);const s=oS(e),c=s===((l=e.ownerDocument)==null?void 0:l.body),d=ci(s);if(c){const f=qp(d);return i.concat(d,d.visualViewport||[],Qd(s)?s:[],f&&a?vc(f):[])}else return i.concat(s,vc(s,[],a))}function qp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sS(e){const i=Ba(e);let a=parseFloat(i.width)||0,l=parseFloat(i.height)||0;const s=nl(e),c=s?e.offsetWidth:a,d=s?e.offsetHeight:l,f=Ad(a)!==c||Ad(l)!==d;return f&&(a=c,l=d),{width:a,height:l,$:f}}function Rg(e){return Ia(e)?e:e.contextElement}function Wo(e){const i=Rg(e);if(!nl(i))return cr(1);const a=i.getBoundingClientRect(),{width:l,height:s,$:c}=sS(i);let d=(c?Ad(a.width):a.width)/l,f=(c?Ad(a.height):a.height)/s;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const $O=cr(0);function cS(e){const i=ci(e);return!Og()||!i.visualViewport?$O:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function YO(e,i,a){return i===void 0&&(i=!1),!!a&&i&&a===ci(e)}function Gl(e,i,a,l){i===void 0&&(i=!1),a===void 0&&(a=!1);const s=e.getBoundingClientRect(),c=Rg(e);let d=cr(1);i&&(l?Ia(l)&&(d=Wo(l)):d=Wo(e));const f=YO(c,a,l)?cS(c):cr(0);let m=(s.left+f.x)/d.x,v=(s.top+f.y)/d.y,y=s.width/d.x,g=s.height/d.y;if(c&&l){const b=ci(c),x=Ia(l)?ci(l):l;let w=b,S=qp(w);for(;S&&x!==w;){const C=Wo(S),N=S.getBoundingClientRect(),M=Ba(S),T=N.left+(S.clientLeft+parseFloat(M.paddingLeft))*C.x,A=N.top+(S.clientTop+parseFloat(M.paddingTop))*C.y;m*=C.x,v*=C.y,y*=C.x,g*=C.y,m+=T,v+=A,w=ci(S),S=qp(w)}}return Od({width:y,height:g,x:m,y:v})}function Jd(e,i){const a=Zd(e).scrollLeft;return i?i.left+a:Gl(mr(e)).left+a}function uS(e,i){const a=e.getBoundingClientRect(),l=a.left+i.scrollLeft-Jd(e,a),s=a.top+i.scrollTop;return{x:l,y:s}}function GO(e){let{elements:i,rect:a,offsetParent:l,strategy:s}=e;const c=s==="fixed",d=mr(l),f=i?Kd(i.floating):!1;if(l===d||f&&c)return a;let m={scrollLeft:0,scrollTop:0},v=cr(1);const y=cr(0),g=nl(l);if((g||!c)&&((os(l)!=="body"||Qd(d))&&(m=Zd(l)),g)){const x=Gl(l);v=Wo(l),y.x=x.x+l.clientLeft,y.y=x.y+l.clientTop}const b=d&&!g&&!c?uS(d,m):cr(0);return{width:a.width*v.x,height:a.height*v.y,x:a.x*v.x-m.scrollLeft*v.x+y.x+b.x,y:a.y*v.y-m.scrollTop*v.y+y.y+b.y}}function XO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function QO(e){const i=Zd(e),a=e.ownerDocument.body,l=sr(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),s=sr(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let c=-i.scrollLeft+Jd(e);const d=-i.scrollTop;return Ba(a).direction==="rtl"&&(c+=sr(e.clientWidth,a.clientWidth)-l),{width:l,height:s,x:c,y:d}}const KO=25;function ZO(e,i,a){a===void 0&&(a="viewport");const l=a==="layoutViewport",s=ci(e),c=mr(e),d=s.visualViewport;let f=c.clientWidth,m=c.clientHeight,v=0,y=0;if(d){const b=!Og()||i==="fixed";l?b||(v=-d.offsetLeft,y=-d.offsetTop):(f=d.width,m=d.height,b&&(v=d.offsetLeft,y=d.offsetTop))}if(Jd(c)<=0){const b=c.ownerDocument,x=b.body,w=getComputedStyle(x),S=b.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,C=Math.abs(c.clientWidth-x.clientWidth-S),N=getComputedStyle(c).scrollbarGutter==="stable both-edges"?C/2:C;N<=KO&&(f-=N)}return{width:f,height:m,x:v,y}}function JO(e,i){const a=Gl(e,!0,i==="fixed"),l=a.top+e.clientTop,s=a.left+e.clientLeft,c=Wo(e),d=e.clientWidth*c.x,f=e.clientHeight*c.y,m=s*c.x,v=l*c.y;return{width:d,height:f,x:m,y:v}}function Yx(e,i,a){let l;if(i==="viewport"||i==="layoutViewport")l=ZO(e,a,i);else if(i==="document")l=QO(mr(e));else if(Ia(i))l=JO(i,a);else{const s=cS(e);l={x:i.x-s.x,y:i.y-s.y,width:i.width,height:i.height}}return Od(l)}function WO(e,i){const a=i.get(e);if(a)return a;let l=vc(e,[],!1).filter(f=>Ia(f)&&os(f)!=="body"),s=null;const c=Ba(e).position==="fixed";let d=c?Yl(e):e;for(;Ia(d)&&!gc(d);){const f=Ba(d),m=Mg(d),v=s?s.position:c?"fixed":"";!m&&(v==="fixed"||v==="absolute"&&f.position==="static")?l=l.filter(g=>g!==d):s=f,d=Yl(d)}return i.set(e,l),l}function eR(e){let{element:i,boundary:a,rootBoundary:l,strategy:s}=e;const d=[...a==="clippingAncestors"?Kd(i)?[]:WO(i,this._c):[].concat(a),l],f=Yx(i,d[0],s);let m=f.top,v=f.right,y=f.bottom,g=f.left;for(let b=1;b<d.length;b++){const x=Yx(i,d[b],s);m=sr(x.top,m),v=Wr(x.right,v),y=Wr(x.bottom,y),g=sr(x.left,g)}return{width:v-g,height:y-m,x:g,y:m}}function tR(e){const{width:i,height:a}=sS(e);return{width:i,height:a}}function nR(e,i,a){const l=nl(i),s=mr(i),c=a==="fixed",d=Gl(e,!0,c,i);let f={scrollLeft:0,scrollTop:0};const m=cr(0);if((l||!c)&&((os(i)!=="body"||Qd(s))&&(f=Zd(i)),l)){const b=Gl(i,!0,c,i);m.x=b.x+i.clientLeft,m.y=b.y+i.clientTop}!l&&s&&(m.x=Jd(s));const v=s&&!l&&!c?uS(s,f):cr(0),y=d.left+f.scrollLeft-m.x-v.x,g=d.top+f.scrollTop-m.y-v.y;return{x:y,y:g,width:d.width,height:d.height}}function $m(e){return Ba(e).position==="static"}function Gx(e,i){if(!nl(e)||Ba(e).position==="fixed")return null;if(i)return i(e);let a=e.offsetParent;return mr(e)===a&&(a=a.ownerDocument.body),a}function dS(e,i){const a=ci(e);if(Kd(e))return a;if(!nl(e)){let s=Yl(e);for(;s&&!gc(s);){if(Ia(s)&&!$m(s))return s;s=Yl(s)}return a}let l=Gx(e,i);for(;l&&UO(l)&&$m(l);)l=Gx(l,i);return l&&gc(l)&&$m(l)&&!Mg(l)?a:l||VO(e)||a}const iR=async function(e){const i=this.getOffsetParent||dS,a=this.getDimensions,l=await a(e.floating);return{reference:nR(e.reference,await i(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function aR(e){return Ba(e).direction==="rtl"}const rR={convertOffsetParentRelativeRectToViewportRelativeRect:GO,getDocumentElement:mr,getClippingRect:eR,getOffsetParent:dS,getElementRects:iR,getClientRects:XO,getDimensions:tR,getScale:Wo,isElement:Ia,isRTL:aR};function fS(e,i){return e.x===i.x&&e.y===i.y&&e.width===i.width&&e.height===i.height}function lR(e,i,a){let l=null,s;const c=mr(e);function d(){var y;clearTimeout(s),(y=l)==null||y.disconnect(),l=null}function f(y,g){y===void 0&&(y=!1),g===void 0&&(g=1),d();const b=e.getBoundingClientRect(),{left:x,top:w,width:S,height:C}=b;if(y||i(),!S||!C)return;const N=od(w),M=od(c.clientWidth-(x+S)),T=od(c.clientHeight-(w+C)),A=od(x),D={rootMargin:-N+"px "+-M+"px "+-T+"px "+-A+"px",threshold:sr(0,Wr(1,g))||1};let B=!0;function P(V){const z=V[0].intersectionRatio;if(!fS(b,e.getBoundingClientRect()))return f();if(z!==g){if(!B)return f();z?f(!1,z):s=setTimeout(()=>{f(!1,1e-7)},1e3)}B=!1}try{l=new IntersectionObserver(P,{...D,root:c.ownerDocument})}catch{l=new IntersectionObserver(P,D)}l.observe(e)}const m=ci(e),v=()=>f(a);return m.addEventListener("resize",v),f(!0),()=>{m.removeEventListener("resize",v),d()}}function oR(e,i,a,l){l===void 0&&(l={});const{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:m=!1}=l,v=Rg(e),y=s||c?[...v?vc(v):[],...i?vc(i):[]]:[];y.forEach(N=>{s&&N.addEventListener("scroll",a),c&&N.addEventListener("resize",a)});const g=v&&f?lR(v,a,c):null;let b=-1,x=null;d&&(x=new ResizeObserver(N=>{let[M]=N;M&&M.target===v&&x&&i&&(x.unobserve(i),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var T;(T=x)==null||T.observe(i)})),a()}),v&&!m&&x.observe(v),i&&x.observe(i));let w,S=m?Gl(e):null;m&&C();function C(){const N=Gl(e);S&&!fS(S,N)&&a(),S=N,w=requestAnimationFrame(C)}return a(),()=>{var N;y.forEach(M=>{s&&M.removeEventListener("scroll",a),c&&M.removeEventListener("resize",a)}),g==null||g(),(N=x)==null||N.disconnect(),x=null,m&&cancelAnimationFrame(w)}}const sR=IO,cR=BO,uR=DO,dR=HO,fR=zO,Xx=_O,hR=PO,mR=(e,i,a)=>{const l=new Map,s=a??{},c={...rR,...s.platform,_c:l};return RO(e,i,{...s,platform:c})};var pR=typeof document<"u",gR=function(){},Sd=pR?k.useLayoutEffect:gR;function Rd(e,i){if(e===i)return!0;if(typeof e!=typeof i)return!1;if(typeof e=="function"&&e.toString()===i.toString())return!0;let a,l,s;if(e&&i&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==i.length)return!1;for(l=a;l--!==0;)if(!Rd(e[l],i[l]))return!1;return!0}if(s=Object.keys(e),a=s.length,a!==Object.keys(i).length)return!1;for(l=a;l--!==0;)if(!{}.hasOwnProperty.call(i,s[l]))return!1;for(l=a;l--!==0;){const c=s[l];if(!(c==="_owner"&&e.$$typeof)&&!Rd(e[c],i[c]))return!1}return!0}return e!==e&&i!==i}function hS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qx(e,i){const a=hS(e);return Math.round(i*a)/a}function Ym(e){const i=k.useRef(e);return Sd(()=>{i.current=e}),i}function vR(e){e===void 0&&(e={});const{placement:i="bottom",strategy:a="absolute",middleware:l=[],platform:s,elements:{reference:c,floating:d}={},transform:f=!0,whileElementsMounted:m,open:v}=e,[y,g]=k.useState({x:0,y:0,strategy:a,placement:i,middlewareData:{},isPositioned:!1}),[b,x]=k.useState(l);Rd(b,l)||x(l);const[w,S]=k.useState(null),[C,N]=k.useState(null),M=k.useCallback(F=>{F!==D.current&&(D.current=F,S(F))},[]),T=k.useCallback(F=>{F!==B.current&&(B.current=F,N(F))},[]),A=c||w,I=d||C,D=k.useRef(null),B=k.useRef(null),P=k.useRef(y),V=m!=null,z=Ym(m),Y=Ym(s),q=Ym(v),W=k.useCallback(()=>{if(!D.current||!B.current)return;const F={placement:i,strategy:a,middleware:b};Y.current&&(F.platform=Y.current),mR(D.current,B.current,F).then(ne=>{const _={...ne,isPositioned:q.current!==!1};Q.current&&!Rd(P.current,_)&&(P.current=_,to.flushSync(()=>{g(_)}))})},[b,i,a,Y,q]);Sd(()=>{v===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[v]);const Q=k.useRef(!1);Sd(()=>(Q.current=!0,()=>{Q.current=!1}),[]),Sd(()=>{if(A&&(D.current=A),I&&(B.current=I),A&&I){if(z.current)return z.current(A,I,W);W()}},[A,I,W,z,V]);const U=k.useMemo(()=>({reference:D,floating:B,setReference:M,setFloating:T}),[M,T]),X=k.useMemo(()=>({reference:A,floating:I}),[A,I]),O=k.useMemo(()=>{const F={position:a,left:0,top:0};if(!X.floating)return F;const ne=Qx(X.floating,y.x),_=Qx(X.floating,y.y);return f?{...F,transform:"translate("+ne+"px, "+_+"px)",...hS(X.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:ne,top:_}},[a,f,X.floating,y.x,y.y]);return k.useMemo(()=>({...y,update:W,refs:U,elements:X,floatingStyles:O}),[y,W,U,X,O])}const yR=e=>{function i(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:l,padding:s}=typeof e=="function"?e(a):e;return l&&i(l)?l.current!=null?Xx({element:l.current,padding:s}).fn(a):{}:l?Xx({element:l,padding:s}).fn(a):{}}}},bR=(e,i)=>{const a=sR(e);return{name:a.name,fn:a.fn,options:[e,i]}},xR=(e,i)=>{const a=cR(e);return{name:a.name,fn:a.fn,options:[e,i]}},jR=(e,i)=>({fn:hR(e).fn,options:[e,i]}),wR=(e,i)=>{const a=uR(e);return{name:a.name,fn:a.fn,options:[e,i]}},SR=(e,i)=>{const a=dR(e);return{name:a.name,fn:a.fn,options:[e,i]}},kR=(e,i)=>{const a=fR(e);return{name:a.name,fn:a.fn,options:[e,i]}},CR=(e,i)=>{const a=yR(e);return{name:a.name,fn:a.fn,options:[e,i]}};var ER=Object.defineProperty,Zr=(e,i)=>ER(e,"name",{value:i,configurable:!0}),mS="Popper",[pS,Wd]=tl(mS),[NR,gS]=pS(mS),TR=Zr(e=>{const{__scopePopper:i,children:a}=e,[l,s]=k.useState(null),[c,d]=k.useState(void 0);return u.jsx(NR,{scope:i,anchor:l,onAnchorChange:s,placementState:c,setPlacementState:d,children:a})},"Popper"),AR="PopperAnchor",MR=k.forwardRef(Zr(function(i,a){const{__scopePopper:l,virtualRef:s,...c}=i,d=gS(AR,l),f=k.useRef(null),m=d.onAnchorChange,v=k.useCallback(S=>{f.current=S,S&&m(S)},[m]),y=xt(a,v),g=k.useRef(null);k.useEffect(()=>{if(!s)return;const S=g.current;g.current=s.current,S!==g.current&&m(g.current)});const b=d.placementState&&ef(d.placementState),x=b==null?void 0:b[0],w=b==null?void 0:b[1];return s?null:u.jsx(Dt.div,{"data-radix-popper-side":x,"data-radix-popper-align":w,...c,ref:y})},"PopperAnchor")),vS="PopperContent",[OR,EB]=pS(vS),RR=k.forwardRef(Zr(function(i,a){var be,oe,ce,me,Ee,ze,Fe;const{__scopePopper:l,side:s="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:v=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:b="partial",hideWhenDetached:x=!1,updatePositionStrategy:w="optimized",onPlaced:S,...C}=i,N=gS(vS,l),[M,T]=k.useState(null),A=xt(a,T),[I,D]=k.useState(null),B=nS(I),P=(B==null?void 0:B.width)??0,V=(B==null?void 0:B.height)??0,z=s+(d!=="center"?"-"+d:""),Y=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},q=Array.isArray(y)?y:[y],W=q.length>0,Q={padding:Y,boundary:q.filter(yS),altBoundary:W},{refs:U,floatingStyles:X,placement:O,isPositioned:F,middlewareData:ne}=vR({strategy:"fixed",placement:z,whileElementsMounted:Zr((...ht)=>oR(...ht,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:N.anchor},middleware:[bR({mainAxis:c+V,alignmentAxis:f}),v&&xR({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?jR():void 0,...Q}),v&&wR({...Q}),SR({...Q,apply:Zr(({elements:ht,rects:ot,availableWidth:Je,availableHeight:At})=>{const{width:gn,height:vn}=ot.reference,Hn=ht.floating.style;Hn.setProperty("--radix-popper-available-width",`${Je}px`),Hn.setProperty("--radix-popper-available-height",`${At}px`),Hn.setProperty("--radix-popper-anchor-width",`${gn}px`),Hn.setProperty("--radix-popper-anchor-height",`${vn}px`)},"apply")}),I&&CR({element:I,padding:m}),_R({arrowWidth:P,arrowHeight:V}),x&&kR({strategy:"referenceHidden",...Q,boundary:W?Q.boundary:void 0})]}),_=N.setPlacementState;Mn(()=>(_(O),()=>{_(void 0)}),[O,_]);const[J,ee]=ef(O),H=An(S);Mn(()=>{F&&(H==null||H())},[F,H]);const $=(be=ne.arrow)==null?void 0:be.x,fe=(oe=ne.arrow)==null?void 0:oe.y,ye=((ce=ne.arrow)==null?void 0:ce.centerOffset)!==0,[xe,re]=k.useState();return Mn(()=>{M&&re(window.getComputedStyle(M).zIndex)},[M]),u.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:F?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[(me=ne.transformOrigin)==null?void 0:me.x,(Ee=ne.transformOrigin)==null?void 0:Ee.y].join(" "),...((ze=ne.hide)==null?void 0:ze.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:i.dir,children:u.jsx(OR,{scope:l,placedSide:J,placedAlign:ee,onArrowChange:D,arrowX:$,arrowY:fe,shouldHideArrow:ye,children:u.jsx(Dt.div,{"data-side":J,"data-align":ee,...C,ref:A,style:{...C.style,animation:F?(Fe=C.style)==null?void 0:Fe.animation:"none"}})})})},"PopperContent"));function yS(e){return e!==null}Zr(yS,"isNotNull");var _R=Zr(e=>({name:"transformOrigin",options:e,fn(i){var C,N,M;const{placement:a,rects:l,middlewareData:s}=i,d=((C=s.arrow)==null?void 0:C.centerOffset)!==0,f=d?0:e.arrowWidth,m=d?0:e.arrowHeight,[v,y]=ef(a),g={start:"0%",center:"50%",end:"100%"}[y],b=(((N=s.arrow)==null?void 0:N.x)??0)+f/2,x=(((M=s.arrow)==null?void 0:M.y)??0)+m/2;let w="",S="";return v==="bottom"?(w=d?g:`${b}px`,S=`${-m}px`):v==="top"?(w=d?g:`${b}px`,S=`${l.floating.height+m}px`):v==="right"?(w=`${-m}px`,S=d?g:`${x}px`):v==="left"&&(w=`${l.floating.width+m}px`,S=d?g:`${x}px`),{data:{x:w,y:S}}}}),"transformOrigin");function ef(e){const[i,a="center"]=e.split("-");return[i,a]}Zr(ef,"getSideAndAlignFromPlacement");var bS=TR,xS=MR,jS=RR,DR=Object.defineProperty,zR=(e,i)=>DR(e,"name",{value:i,configurable:!0}),LR=k.forwardRef(zR(function(i,a){return u.jsx(Dt.label,{...i,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=i.onMouseDown)==null||c.call(i,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}})},"Label")),IR=LR,BR=Object.defineProperty,PR=(e,i)=>BR(e,"name",{value:i,configurable:!0});function wS(e){const i=k.useRef({value:e,previous:e});return k.useMemo(()=>(i.current.value!==e&&(i.current.previous=i.current.value,i.current.value=e),i.current.previous),[e])}PR(wS,"usePrevious");var HR=Object.defineProperty,UR=(e,i)=>HR(e,"name",{value:i,configurable:!0});function _d(e,[i,a]){return Math.min(a,Math.max(i,e))}UR(_d,"clamp");var qR=Object.defineProperty,il=(e,i)=>qR(e,"name",{value:i,configurable:!0}),_g="Popover",[SS,NB]=tl(_g,[Wd]),Dg=Wd(),[FR,ss]=SS(_g),VR=il(e=>{const{__scopePopover:i,children:a,open:l,defaultOpen:s,onOpenChange:c,modal:d=!1}=e,f=Dg(i),m=k.useRef(null),[v,y]=k.useState(!1),[g,b]=mc({prop:l,defaultProp:s??!1,onChange:c,caller:_g});return u.jsx(bS,{...f,children:u.jsx(FR,{scope:i,contentId:Vl(),triggerRef:m,open:g,onOpenChange:b,onOpenToggle:k.useCallback(()=>b(x=>!x),[b]),hasCustomAnchor:v,onCustomAnchorAdd:k.useCallback(()=>y(!0),[]),onCustomAnchorRemove:k.useCallback(()=>y(!1),[]),modal:d,children:a})})},"Popover"),$R="PopoverTrigger",YR=k.forwardRef(il(function(i,a){const{__scopePopover:l,...s}=i,c=ss($R,l),d=Dg(l),f=xt(a,c.triggerRef),m=u.jsx(Dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":zg(c.open),...s,ref:f,onClick:mt(i.onClick,c.onOpenToggle)});return c.hasCustomAnchor?m:u.jsx(xS,{asChild:!0,...d,children:m})},"PopoverTrigger")),kS="PopoverPortal",[GR,XR]=SS(kS,{forceMount:void 0}),QR=il(e=>{const{__scopePopover:i,forceMount:a,children:l,container:s}=e,c=ss(kS,i);return u.jsx(GR,{scope:i,forceMount:a,children:u.jsx(qa,{present:a||c.open,children:u.jsx(wg,{asChild:!0,container:s,children:l})})})},"PopoverPortal"),yc="PopoverContent",KR=k.forwardRef(il(function(i,a){const l=XR(yc,i.__scopePopover),{forceMount:s=l.forceMount,...c}=i,d=ss(yc,i.__scopePopover);return u.jsx(qa,{present:s||d.open,children:d.modal?u.jsx(JR,{...c,ref:a}):u.jsx(WR,{...c,ref:a})})},"PopoverContent")),ZR=La("PopoverContent.RemoveScroll"),JR=k.forwardRef(il(function(i,a){const l=ss(yc,i.__scopePopover),s=k.useRef(null),c=xt(a,s),d=k.useRef(!1);return k.useEffect(()=>{const f=s.current;if(f)return kg(f)},[]),u.jsx(Gd,{as:ZR,allowPinchZoom:!0,children:u.jsx(CS,{...i,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:mt(i.onCloseAutoFocus,f=>{var m;f.preventDefault(),d.current||(m=l.triggerRef.current)==null||m.focus()}),onPointerDownOutside:mt(i.onPointerDownOutside,f=>{const m=f.detail.originalEvent,v=m.button===0&&m.ctrlKey===!0,y=m.button===2||v;d.current=y},{checkForDefaultPrevented:!1}),onFocusOutside:mt(i.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),WR=k.forwardRef(il(function(i,a){const l=ss(yc,i.__scopePopover),s=k.useRef(!1),c=k.useRef(!1);return u.jsx(CS,{...i,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,m;(f=i.onCloseAutoFocus)==null||f.call(i,d),d.defaultPrevented||(s.current||(m=l.triggerRef.current)==null||m.focus(),d.preventDefault()),s.current=!1,c.current=!1},onInteractOutside:d=>{var v,y;(v=i.onInteractOutside)==null||v.call(i,d),d.defaultPrevented||(s.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((y=l.triggerRef.current)==null?void 0:y.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})},"PopoverContentNonModal")),CS=k.forwardRef(il(function(i,a){const{__scopePopover:l,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:g,...b}=i,x=ss(yc,l),w=Dg(l);return Nc(),u.jsx(xg,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:c,onUnmountAutoFocus:d,children:u.jsx(yg,{asChild:!0,disableOutsidePointerEvents:f,onInteractOutside:g,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:y,onDismiss:()=>x.onOpenChange(!1),deferPointerDownOutside:!0,children:u.jsx(jS,{"data-state":zg(x.open),role:"dialog",id:x.contentId,...w,...b,ref:a,style:{...b.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 zg(e){return e?"open":"closed"}il(zg,"getState");var e_=VR,t_=YR,n_=QR,i_=KR,a_=Object.defineProperty,at=(e,i)=>a_(e,"name",{value:i,configurable:!0});function ES(e,i){return k.useReducer((a,l)=>i[a][l]??a,e)}at(ES,"useStateMachine");var NS="ScrollArea",[TS,TB]=tl(NS),[r_,$i]=TS(NS),l_=k.forwardRef(at(function(i,a){const{__scopeScrollArea:l,type:s="hover",dir:c,scrollHideDelay:d=600,...f}=i,[m,v]=k.useState(null),[y,g]=k.useState(null),[b,x]=k.useState(null),[w,S]=k.useState(null),[C,N]=k.useState(null),[M,T]=k.useState(0),[A,I]=k.useState(0),[D,B]=k.useState(!1),[P,V]=k.useState(!1),z=xt(a,v),Y=vg(c);return u.jsx(r_,{scope:l,type:s,dir:Y,scrollHideDelay:d,scrollArea:m,viewport:y,onViewportChange:g,content:b,onContentChange:x,scrollbarX:w,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:B,scrollbarY:C,onScrollbarYChange:N,scrollbarYEnabled:P,onScrollbarYEnabledChange:V,onCornerWidthChange:T,onCornerHeightChange:I,children:u.jsx(Dt.div,{dir:Y,...f,ref:z,style:{position:"relative","--radix-scroll-area-corner-width":M+"px","--radix-scroll-area-corner-height":A+"px",...i.style}})})},"ScrollArea")),o_="ScrollAreaViewport",s_=k.forwardRef(at(function(i,a){const{__scopeScrollArea:l,children:s,nonce:c,...d}=i,f=$i(o_,l),m=k.useRef(null),v=xt(a,m,f.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx(c_,{nonce:c}),u.jsx(Dt.div,{"data-radix-scroll-area-viewport":"",...d,ref:v,style:{overflowX:f.scrollbarXEnabled?"scroll":"hidden",overflowY:f.scrollbarYEnabled?"scroll":"hidden",...i.style},children:u.jsx("div",{ref:f.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})},"ScrollAreaViewport")),c_=k.memo(at(function({nonce:i}){return u.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:i})},"ScrollAreaViewportStyle"),(e,i)=>e.nonce===i.nonce),pr="ScrollAreaScrollbar",u_=k.forwardRef(at(function(i,a){const{forceMount:l,...s}=i,c=$i(pr,i.__scopeScrollArea),{onScrollbarXEnabledChange:d,onScrollbarYEnabledChange:f}=c,m=i.orientation==="horizontal";return k.useEffect(()=>(m?d(!0):f(!0),()=>{m?d(!1):f(!1)}),[m,d,f]),c.type==="hover"?u.jsx(d_,{...s,ref:a,forceMount:l}):c.type==="scroll"?u.jsx(f_,{...s,ref:a,forceMount:l}):c.type==="auto"?u.jsx(AS,{...s,ref:a,forceMount:l}):c.type==="always"?u.jsx(Lg,{...s,ref:a,"data-state":"visible"}):null},"ScrollAreaScrollbar")),d_=k.forwardRef(at(function(i,a){const{forceMount:l,...s}=i,c=$i(pr,i.__scopeScrollArea),[d,f]=k.useState(!1);return k.useEffect(()=>{const m=c.scrollArea;let v=0;if(m){const y=at(()=>{window.clearTimeout(v),f(!0)},"handlePointerEnter"),g=at(()=>{v=window.setTimeout(()=>f(!1),c.scrollHideDelay)},"handlePointerLeave");return m.addEventListener("pointerenter",y),m.addEventListener("pointerleave",g),()=>{window.clearTimeout(v),m.removeEventListener("pointerenter",y),m.removeEventListener("pointerleave",g)}}},[c.scrollArea,c.scrollHideDelay]),u.jsx(qa,{present:l||d,children:u.jsx(AS,{"data-state":d?"visible":"hidden",...s,ref:a})})},"ScrollAreaScrollbarHover")),f_=k.forwardRef(at(function(i,a){const{forceMount:l,...s}=i,c=$i(pr,i.__scopeScrollArea),d=i.orientation==="horizontal",f=Ac(()=>v("SCROLL_END"),100),[m,v]=ES("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 k.useEffect(()=>{if(m==="idle"){const y=window.setTimeout(()=>v("HIDE"),c.scrollHideDelay);return()=>window.clearTimeout(y)}},[m,c.scrollHideDelay,v]),k.useEffect(()=>{const y=c.viewport,g=d?"scrollLeft":"scrollTop";if(y){let b=y[g];const x=at(()=>{const w=y[g];b!==w&&(v("SCROLL"),f()),b=w},"handleScroll");return y.addEventListener("scroll",x),()=>y.removeEventListener("scroll",x)}},[c.viewport,d,v,f]),u.jsx(qa,{present:l||m!=="hidden",children:u.jsx(Lg,{"data-state":m==="hidden"?"hidden":"visible",...s,ref:a,onPointerEnter:mt(i.onPointerEnter,()=>v("POINTER_ENTER")),onPointerLeave:mt(i.onPointerLeave,()=>v("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),AS=k.forwardRef(at(function(i,a){const l=$i(pr,i.__scopeScrollArea),{forceMount:s,...c}=i,[d,f]=k.useState(!1),m=i.orientation==="horizontal",v=Ac(()=>{if(l.viewport){const y=l.viewport.offsetWidth<l.viewport.scrollWidth,g=l.viewport.offsetHeight<l.viewport.scrollHeight;f(m?y:g)}},10);return Xl(l.viewport,v),Xl(l.content,v),u.jsx(qa,{present:s||d,children:u.jsx(Lg,{"data-state":d?"visible":"hidden",...c,ref:a})})},"ScrollAreaScrollbarAuto")),Lg=k.forwardRef(at(function(i,a){const{orientation:l="vertical",...s}=i,c=$i(pr,i.__scopeScrollArea),d=k.useRef(null),f=k.useRef(0),[m,v]=k.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),y=Ig(m.viewport,m.content),g={...s,sizes:m,onSizesChange:v,hasThumb:y>0&&y<1,onThumbChange:at(x=>d.current=x,"onThumbChange"),onThumbPointerUp:at(()=>f.current=0,"onThumbPointerUp"),onThumbPointerDown:at(x=>f.current=x,"onThumbPointerDown")};function b(x,w){return _S(x,f.current,m,w)}return at(b,"getScrollPosition"),l==="horizontal"?u.jsx(h_,{...g,ref:a,onThumbPositionChange:()=>{if(c.viewport&&d.current){const x=c.viewport.scrollLeft,w=Vp(x,m,c.dir);d.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:x=>{c.viewport&&(c.viewport.scrollLeft=x)},onDragScroll:x=>{c.viewport&&(c.viewport.scrollLeft=b(x,c.dir))}}):l==="vertical"?u.jsx(m_,{...g,ref:a,onThumbPositionChange:()=>{if(c.viewport&&d.current){const x=c.viewport.scrollTop,w=Vp(x,m);d.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:x=>{c.viewport&&(c.viewport.scrollTop=x)},onDragScroll:x=>{c.viewport&&(c.viewport.scrollTop=b(x))}}):null},"ScrollAreaScrollbarVisible")),h_=k.forwardRef(at(function(i,a){const{sizes:l,onSizesChange:s,...c}=i,d=$i(pr,i.__scopeScrollArea),[f,m]=k.useState(),v=k.useRef(null),y=xt(a,v,d.onScrollbarXChange);return k.useEffect(()=>{v.current&&m(getComputedStyle(v.current))},[v]),u.jsx(OS,{"data-orientation":"horizontal",...c,ref:y,sizes:l,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":Tc(l)+"px",...i.style},onThumbPointerDown:g=>i.onThumbPointerDown(g.x),onDragScroll:g=>i.onDragScroll(g.x),onWheelScroll:(g,b)=>{if(d.viewport){const x=d.viewport.scrollLeft+g.deltaX;i.onWheelScroll(x),Pg(x,b)&&g.preventDefault()}},onResize:()=>{v.current&&d.viewport&&f&&s({content:d.viewport.scrollWidth,viewport:d.viewport.offsetWidth,scrollbar:{size:v.current.clientWidth,paddingStart:bc(f.paddingLeft),paddingEnd:bc(f.paddingRight)}})}})},"ScrollAreaScrollbarX")),m_=k.forwardRef(at(function(i,a){const{sizes:l,onSizesChange:s,...c}=i,d=$i(pr,i.__scopeScrollArea),[f,m]=k.useState(),v=k.useRef(null),y=xt(a,v,d.onScrollbarYChange);return k.useEffect(()=>{v.current&&m(getComputedStyle(v.current))},[v]),u.jsx(OS,{"data-orientation":"vertical",...c,ref:y,sizes:l,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":Tc(l)+"px",...i.style},onThumbPointerDown:g=>i.onThumbPointerDown(g.y),onDragScroll:g=>i.onDragScroll(g.y),onWheelScroll:(g,b)=>{if(d.viewport){const x=d.viewport.scrollTop+g.deltaY;i.onWheelScroll(x),Pg(x,b)&&g.preventDefault()}},onResize:()=>{v.current&&d.viewport&&f&&s({content:d.viewport.scrollHeight,viewport:d.viewport.offsetHeight,scrollbar:{size:v.current.clientHeight,paddingStart:bc(f.paddingTop),paddingEnd:bc(f.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[p_,MS]=TS(pr),OS=k.forwardRef(at(function(i,a){const{__scopeScrollArea:l,sizes:s,hasThumb:c,onThumbChange:d,onThumbPointerUp:f,onThumbPointerDown:m,onThumbPositionChange:v,onDragScroll:y,onWheelScroll:g,onResize:b,...x}=i,w=$i(pr,l),[S,C]=k.useState(null),N=xt(a,C),M=k.useRef(null),T=k.useRef(""),A=w.viewport,I=s.content-s.viewport,D=An(g),B=An(v),P=Ac(b,10);function V(z){if(M.current){const Y=z.clientX-M.current.left,q=z.clientY-M.current.top;y({x:Y,y:q})}}return at(V,"handleDragScroll"),k.useEffect(()=>{const z=at(Y=>{const q=Y.target;(S==null?void 0:S.contains(q))&&D(Y,I)},"handleWheel");return document.addEventListener("wheel",z,{passive:!1}),()=>document.removeEventListener("wheel",z,{passive:!1})},[A,S,I,D]),k.useEffect(B,[s,B]),Xl(S,P),Xl(w.content,P),u.jsx(p_,{scope:l,scrollbar:S,hasThumb:c,onThumbChange:An(d),onThumbPointerUp:An(f),onThumbPositionChange:B,onThumbPointerDown:An(m),children:u.jsx(Dt.div,{...x,ref:N,style:{position:"absolute",...x.style},onPointerDown:mt(i.onPointerDown,z=>{z.button===0&&(z.target.setPointerCapture(z.pointerId),M.current=S.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",w.viewport&&(w.viewport.style.scrollBehavior="auto"),V(z))}),onPointerMove:mt(i.onPointerMove,V),onPointerUp:mt(i.onPointerUp,z=>{const Y=z.target;Y.hasPointerCapture(z.pointerId)&&Y.releasePointerCapture(z.pointerId),document.body.style.webkitUserSelect=T.current,w.viewport&&(w.viewport.style.scrollBehavior=""),M.current=null})})})},"ScrollAreaScrollbarImpl")),Fp="ScrollAreaThumb",g_=k.forwardRef(at(function(i,a){const{forceMount:l,...s}=i,c=MS(Fp,i.__scopeScrollArea);return u.jsx(qa,{present:l||c.hasThumb,children:u.jsx(v_,{ref:a,...s})})},"ScrollAreaThumb")),v_=k.forwardRef(at(function(i,a){const{__scopeScrollArea:l,style:s,...c}=i,d=$i(Fp,l),f=MS(Fp,l),{onThumbPositionChange:m}=f,v=xt(a,f.onThumbChange),y=k.useRef(void 0),g=Ac(()=>{y.current&&(y.current(),y.current=void 0)},100);return k.useEffect(()=>{const b=d.viewport;if(b){const x=at(()=>{if(g(),!y.current){const w=x_(b,m);y.current=w,m()}},"handleScroll");return m(),b.addEventListener("scroll",x),()=>b.removeEventListener("scroll",x)}},[d.viewport,g,m]),u.jsx(Dt.div,{"data-state":f.hasThumb?"visible":"hidden",...c,ref:v,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:mt(i.onPointerDownCapture,b=>{const w=b.target.getBoundingClientRect(),S=b.clientX-w.left,C=b.clientY-w.top;f.onThumbPointerDown({x:S,y:C})}),onPointerUp:mt(i.onPointerUp,f.onThumbPointerUp)})},"ScrollAreaThumbImpl")),RS="ScrollAreaCorner",y_=k.forwardRef(at(function(i,a){const l=$i(RS,i.__scopeScrollArea),s=!!(l.scrollbarX&&l.scrollbarY);return l.type!=="scroll"&&s?u.jsx(b_,{...i,ref:a}):null},"ScrollAreaCorner")),b_=k.forwardRef(at(function(i,a){const{__scopeScrollArea:l,...s}=i,c=$i(RS,l),[d,f]=k.useState(0),[m,v]=k.useState(0),y=!!(d&&m),{onCornerWidthChange:g,onCornerHeightChange:b}=c;return Xl(c.scrollbarX,()=>{var w;const x=((w=c.scrollbarX)==null?void 0:w.offsetHeight)||0;c.onCornerHeightChange(x),v(x)}),Xl(c.scrollbarY,()=>{var w;const x=((w=c.scrollbarY)==null?void 0:w.offsetWidth)||0;c.onCornerWidthChange(x),f(x)}),k.useEffect(()=>()=>{g(0),b(0)},[g,b]),y?u.jsx(Dt.div,{...s,ref:a,style:{width:d,height:m,position:"absolute",right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:0,...i.style}}):null},"ScrollAreaCornerImpl"));function bc(e){return e?parseInt(e,10):0}at(bc,"toInt");function Ig(e,i){const a=e/i;return isNaN(a)?0:a}at(Ig,"getThumbRatio");function Tc(e){const i=Ig(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,l=(e.scrollbar.size-a)*i;return Math.max(l,18)}at(Tc,"getThumbSize");function _S(e,i,a,l="ltr"){const s=Tc(a),c=s/2,d=i||c,f=s-d,m=a.scrollbar.paddingStart+d,v=a.scrollbar.size-a.scrollbar.paddingEnd-f,y=a.content-a.viewport,g=l==="ltr"?[0,y]:[y*-1,0];return Bg([m,v],g)(e)}at(_S,"getScrollPositionFromPointer");function Vp(e,i,a="ltr"){const l=Tc(i),s=i.scrollbar.paddingStart+i.scrollbar.paddingEnd,c=i.scrollbar.size-s,d=i.content-i.viewport,f=c-l,m=a==="ltr"?[0,d]:[d*-1,0],v=_d(e,m);return Bg([0,d],[0,f])(v)}at(Vp,"getThumbOffsetFromScroll");function Bg(e,i){return a=>{if(e[0]===e[1]||i[0]===i[1])return i[0];const l=(i[1]-i[0])/(e[1]-e[0]);return i[0]+l*(a-e[0])}}at(Bg,"linearScale");function Pg(e,i){return e>0&&e<i}at(Pg,"isScrollingWithinScrollbarBounds");var x_=at((e,i=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},l=0;return at((function s(){const c={left:e.scrollLeft,top:e.scrollTop},d=a.left!==c.left,f=a.top!==c.top;(d||f)&&i(),a=c,l=window.requestAnimationFrame(s)}),"loop")(),()=>window.cancelAnimationFrame(l)},"addUnlinkedScrollListener");function Ac(e,i){const a=An(e),l=k.useRef(0);return k.useEffect(()=>()=>window.clearTimeout(l.current),[]),k.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(a,i)},[a,i])}at(Ac,"useDebounceCallback");function Xl(e,i){const a=An(i);Mn(()=>{let l=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(a)});return s.observe(e),()=>{window.cancelAnimationFrame(l),s.unobserve(e)}}},[e,a])}at(Xl,"useResizeObserver");var j_=l_,w_=s_,S_=y_,k_=Object.defineProperty,St=(e,i)=>k_(e,"name",{value:i,configurable:!0}),C_=[" ","Enter","ArrowUp","ArrowDown"],E_=[" ","Enter"],ns="Select",[tf,Hg,N_]=bw(ns),[no,AB]=tl(ns,[N_,Wd]),Ug=Wd(),[T_,al]=no(ns),[A_,M_]=no(ns);function DS(e){const{__scopeSelect:i,children:a,open:l,defaultOpen:s,onOpenChange:c,value:d,defaultValue:f,onValueChange:m,dir:v,name:y,autoComplete:g,disabled:b,required:x,form:w,internal_do_not_use_render:S}=e,C=Ug(i),[N,M]=k.useState(null),[T,A]=k.useState(null),[I,D]=k.useState(!1),B=vg(v),[P,V]=mc({prop:l,defaultProp:s??!1,onChange:c,caller:ns}),[z,Y]=mc({prop:d,defaultProp:f,onChange:m,caller:ns}),q=k.useRef(null),W=k.useRef(z);k.useEffect(()=>{const ee=w?N==null?void 0:N.ownerDocument.getElementById(w):N==null?void 0:N.form;if(ee instanceof HTMLFormElement){const H=St(()=>Y(W.current),"reset");return ee.addEventListener("reset",H),()=>ee.removeEventListener("reset",H)}},[w,N,Y]);const Q=N?!!w||!!N.closest("form"):!0,[U,X]=k.useState(new Set),O=Vl(),F=Array.from(U).map(ee=>ee.props.value).join(";"),ne=k.useCallback(ee=>{X(H=>new Set(H).add(ee))},[]),_=k.useCallback(ee=>{X(H=>{const $=new Set(H);return $.delete(ee),$})},[]),J={required:x,trigger:N,onTriggerChange:M,valueNode:T,onValueNodeChange:A,valueNodeHasChildren:I,onValueNodeHasChildrenChange:D,contentId:O,value:z,onValueChange:Y,open:P,onOpenChange:V,dir:B,triggerPointerDownPosRef:q,disabled:b,name:y,autoComplete:g,form:w,nativeOptions:U,nativeSelectKey:F,isFormControl:Q};return u.jsx(bS,{...C,children:u.jsx(T_,{scope:i,...J,children:u.jsx(tf.Provider,{scope:i,children:u.jsx(A_,{scope:i,onNativeOptionAdd:ne,onNativeOptionRemove:_,children:IS(S)?S(J):a})})})})}St(DS,"SelectProvider");var O_=St(e=>{const{__scopeSelect:i,children:a,...l}=e;return u.jsx(DS,{__scopeSelect:i,...l,internal_do_not_use_render:({isFormControl:s})=>u.jsxs(u.Fragment,{children:[a,s?u.jsx(n3,{__scopeSelect:i}):null]})})},"Select"),R_="SelectTrigger",__=k.forwardRef(St(function(i,a){const{__scopeSelect:l,disabled:s=!1,...c}=i,d=Ug(l),f=al(R_,l),m=f.disabled||s,v=xt(a,f.onTriggerChange),y=Hg(l),g=k.useRef("touch"),[b,x,w]=qg(C=>{const N=y().filter(A=>!A.disabled),M=N.find(A=>A.value===f.value),T=Fg(N,C,M);T!==void 0&&f.onValueChange(T.value)}),S=St(C=>{m||(f.onOpenChange(!0),w()),C&&(f.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return u.jsx(xS,{asChild:!0,...d,children:u.jsx(Dt.button,{type:"button",role:"combobox","aria-controls":f.open?f.contentId:void 0,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":Mc(f.value)?"":void 0,...c,ref:v,onClick:mt(c.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&S(C)}),onPointerDown:mt(c.onPointerDown,C=>{g.current=C.pointerType;const N=C.target;N.hasPointerCapture(C.pointerId)&&N.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(S(C),C.preventDefault())}),onKeyDown:mt(c.onKeyDown,C=>{const N=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&x(C.key),!(N&&C.key===" ")&&C_.includes(C.key)&&(S(),C.preventDefault())})})})},"SelectTrigger")),D_="SelectValue",z_=k.forwardRef(St(function(i,a){const{__scopeSelect:l,className:s,style:c,children:d,placeholder:f="",...m}=i,v=al(D_,l),{onValueNodeHasChildrenChange:y}=v,g=d!==void 0,b=xt(a,v.onValueNodeChange);Mn(()=>{y(g)},[y,g]);const x=Mc(v.value);return u.jsx(Dt.span,{...m,asChild:x?!1:m.asChild,ref:b,style:{pointerEvents:"none"},children:u.jsx(k.Fragment,{children:x?f:d},x?"placeholder":"value")})},"SelectValue")),L_=k.forwardRef(St(function(i,a){const{__scopeSelect:l,children:s,...c}=i;return u.jsx(Dt.span,{"aria-hidden":!0,...c,ref:a,children:s||"▼"})},"SelectIcon")),I_="SelectPortal",[B_,P_]=no(I_,{forceMount:void 0}),H_=St(e=>{const{__scopeSelect:i,forceMount:a,...l}=e;return u.jsx(B_,{scope:e.__scopeSelect,forceMount:a,children:u.jsx(wg,{asChild:!0,...l})})},"SelectPortal"),Ql="SelectContent",U_=k.forwardRef(St(function(i,a){const l=P_(Ql,i.__scopeSelect),{forceMount:s=l.forceMount,...c}=i,d=al(Ql,i.__scopeSelect),[f,m]=k.useState();return Mn(()=>{m(new DocumentFragment)},[]),u.jsx(qa,{present:s||d.open,children:({present:v})=>v?u.jsx(V_,{...c,ref:a}):u.jsx(q_,{...c,fragment:f})})},"SelectContent")),q_=k.forwardRef(St(function(i,a){const{__scopeSelect:l,children:s,fragment:c}=i;return c?to.createPortal(u.jsx(zS,{scope:l,children:u.jsx(tf.Slot,{scope:l,children:u.jsx("div",{ref:a,children:s})})}),c):null},"SelectContentFragment")),ia=10,[zS,nf]=no(Ql),F_=La("SelectContent.RemoveScroll"),V_=k.forwardRef(St(function(i,a){const{__scopeSelect:l}=i,{position:s="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,side:m,sideOffset:v,align:y,alignOffset:g,arrowPadding:b,collisionBoundary:x,collisionPadding:w,sticky:S,hideWhenDetached:C,avoidCollisions:N,...M}=i,T=al(Ql,l),[A,I]=k.useState(null),[D,B]=k.useState(null),P=xt(a,I),[V,z]=k.useState(null),[Y,q]=k.useState(null),W=Hg(l),[Q,U]=k.useState(!1),X=k.useRef(!1);k.useEffect(()=>{if(A)return kg(A)},[A]),Nc();const O=k.useCallback(re=>{const[be,...oe]=W().map(Ee=>Ee.ref.current),[ce]=oe.slice(-1),me=document.activeElement;for(const Ee of re)if(Ee===me||(Ee==null||Ee.scrollIntoView({block:"nearest"}),Ee===be&&D&&(D.scrollTop=0),Ee===ce&&D&&(D.scrollTop=D.scrollHeight),Ee==null||Ee.focus(),document.activeElement!==me))return},[W,D]),F=k.useCallback(()=>O([V,A]),[O,V,A]);k.useEffect(()=>{Q&&F()},[Q,F]);const{onOpenChange:ne,triggerPointerDownPosRef:_}=T;k.useEffect(()=>{if(A){let re={x:0,y:0};const be=St(ce=>{var me,Ee;re={x:Math.abs(Math.round(ce.pageX)-(((me=_.current)==null?void 0:me.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((Ee=_.current)==null?void 0:Ee.y)??0))}},"handlePointerMove"),oe=St(ce=>{re.x<=10&&re.y<=10?ce.preventDefault():ce.composedPath().includes(A)||ne(!1),document.removeEventListener("pointermove",be),_.current=null},"handlePointerUp");return _.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",oe,{capture:!0})}}},[A,ne,_]),k.useEffect(()=>{const re=St(()=>ne(!1),"close");return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[ne]);const[J,ee]=qg(re=>{const be=W().filter(me=>!me.disabled),oe=be.find(me=>me.ref.current===document.activeElement),ce=Fg(be,re,oe);ce&&setTimeout(()=>{var me;return(me=ce.ref.current)==null?void 0:me.focus()})}),H=k.useCallback((re,be,oe)=>{const ce=!X.current&&!oe;(T.value!==void 0&&T.value===be||ce)&&(z(re),ce&&(X.current=!0))},[T.value]),$=k.useCallback(()=>A==null?void 0:A.focus(),[A]),fe=k.useCallback((re,be,oe)=>{const ce=!X.current&&!oe;(T.value!==void 0&&T.value===be||ce)&&q(re)},[T.value]),ye=s==="popper"?Kx:$_,xe=ye===Kx?{side:m,sideOffset:v,align:y,alignOffset:g,arrowPadding:b,collisionBoundary:x,collisionPadding:w,sticky:S,hideWhenDetached:C,avoidCollisions:N}:{};return u.jsx(zS,{scope:l,content:A,viewport:D,onViewportChange:B,itemRefCallback:H,selectedItem:V,onItemLeave:$,itemTextRefCallback:fe,focusSelectedItem:F,selectedItemText:Y,position:s,isPositioned:Q,searchRef:J,children:u.jsx(Gd,{as:F_,allowPinchZoom:!0,children:u.jsx(xg,{asChild:!0,trapped:T.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:mt(c,re=>{var be;(be=T.trigger)==null||be.focus({preventScroll:!0}),re.preventDefault()}),children:u.jsx(yg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:u.jsx(ye,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:re=>re.preventDefault(),...M,...xe,onPlaced:()=>U(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:mt(M.onKeyDown,re=>{const be=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!be&&re.key.length===1&&ee(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let ce=W().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(re.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const me=re.target,Ee=ce.indexOf(me);ce=ce.slice(Ee+1)}setTimeout(()=>O(ce)),re.preventDefault()}})})})})})})},"SelectContentImpl")),$_=k.forwardRef(St(function(i,a){const{__scopeSelect:l,onPlaced:s,...c}=i,d=al(Ql,l),f=nf(Ql,l),[m,v]=k.useState(null),[y,g]=k.useState(null),b=xt(a,g),x=Hg(l),w=k.useRef(!1),S=k.useRef(!0),{viewport:C,selectedItem:N,selectedItemText:M,focusSelectedItem:T}=f,A=k.useCallback(()=>{if(d.trigger&&d.valueNode&&m&&y&&C&&N&&M){const P=d.trigger.getBoundingClientRect(),V=y.getBoundingClientRect(),z=d.valueNode.getBoundingClientRect(),Y=M.getBoundingClientRect();if(d.dir!=="rtl"){const me=Y.left-V.left,Ee=z.left-me,ze=P.left-Ee,Fe=P.width+ze,ht=Math.max(Fe,V.width),ot=window.innerWidth-ia,Je=_d(Ee,[ia,Math.max(ia,ot-ht)]);m.style.minWidth=Fe+"px",m.style.left=Je+"px"}else{const me=V.right-Y.right,Ee=window.innerWidth-z.right-me,ze=window.innerWidth-P.right-Ee,Fe=P.width+ze,ht=Math.max(Fe,V.width),ot=window.innerWidth-ia,Je=_d(Ee,[ia,Math.max(ia,ot-ht)]);m.style.minWidth=Fe+"px",m.style.right=Je+"px"}const q=x(),W=window.innerHeight-ia*2,Q=C.scrollHeight,U=window.getComputedStyle(y),X=parseInt(U.borderTopWidth,10),O=parseInt(U.paddingTop,10),F=parseInt(U.borderBottomWidth,10),ne=parseInt(U.paddingBottom,10),_=X+O+Q+ne+F,J=Math.min(N.offsetHeight*5,_),ee=window.getComputedStyle(C),H=parseInt(ee.paddingTop,10),$=parseInt(ee.paddingBottom,10),fe=P.top+P.height/2-ia,ye=W-fe,xe=N.offsetHeight/2,re=N.offsetTop+xe,be=X+O+re,oe=_-be;if(be<=fe){const me=q.length>0&&N===q[q.length-1].ref.current;m.style.bottom="0px";const Ee=y.clientHeight-C.offsetTop-C.offsetHeight,ze=Math.max(ye,xe+(me?$:0)+Ee+F),Fe=be+ze;m.style.height=Fe+"px"}else{const me=q.length>0&&N===q[0].ref.current;m.style.top="0px";const ze=Math.max(fe,X+C.offsetTop+(me?H:0)+xe)+oe;m.style.height=ze+"px",C.scrollTop=be-fe+C.offsetTop}m.style.margin=`${ia}px 0`,m.style.minHeight=J+"px",m.style.maxHeight=W+"px",s==null||s(),requestAnimationFrame(()=>w.current=!0)}},[x,d.trigger,d.valueNode,m,y,C,N,M,d.dir,s]);Mn(()=>A(),[A]);const[I,D]=k.useState();Mn(()=>{y&&D(window.getComputedStyle(y).zIndex)},[y]);const B=k.useCallback(P=>{P&&S.current===!0&&(A(),T==null||T(),S.current=!1)},[A,T]);return u.jsx(Y_,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:w,onScrollButtonChange:B,children:u.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:u.jsx(Dt.div,{...c,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})},"SelectItemAlignedPosition")),Kx=k.forwardRef(St(function(i,a){const{__scopeSelect:l,align:s="start",collisionPadding:c=ia,...d}=i,f=Ug(l);return u.jsx(jS,{...f,...d,ref:a,align:s,collisionPadding:c,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")),[Y_,G_]=no(Ql,{}),Zx="SelectViewport",X_=k.forwardRef(St(function(i,a){const{__scopeSelect:l,nonce:s,...c}=i,d=nf(Zx,l),f=G_(Zx,l),m=xt(a,d.onViewportChange),v=k.useRef(0);return u.jsxs(u.Fragment,{children:[u.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:s}),u.jsx(tf.Slot,{scope:l,children:u.jsx(Dt.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:mt(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:x}=f;if(x!=null&&x.current&&b){const w=Math.abs(v.current-g.scrollTop);if(w>0){const S=window.innerHeight-ia*2,C=parseFloat(b.style.minHeight),N=parseFloat(b.style.height),M=Math.max(C,N);if(M<S){const T=M+w,A=Math.min(S,T),I=T-A;b.style.height=A+"px",b.style.bottom==="0px"&&(g.scrollTop=I>0?I:0,b.style.justifyContent="flex-end")}}}v.current=g.scrollTop})})})]})},"SelectViewport")),Q_="SelectGroup",[MB,OB]=no(Q_),$p="SelectItem",[K_,LS]=no($p),Z_=k.forwardRef(St(function(i,a){const{__scopeSelect:l,value:s,disabled:c=!1,textValue:d,...f}=i,m=al($p,l),v=nf($p,l),y=m.value===s,[g,b]=k.useState(d??""),[x,w]=k.useState(!1),S=An(A=>{var I;return(I=v.itemRefCallback)==null?void 0:I.call(v,A,s,c)}),C=xt(a,S),N=Vl(),M=k.useRef("touch"),T=St(()=>{c||(m.onValueChange(s),m.onOpenChange(!1))},"handleSelect");return u.jsx(K_,{scope:l,value:s,disabled:c,textId:N,isSelected:y,onItemTextChange:k.useCallback(A=>{b(I=>I||((A==null?void 0:A.textContent)??"").trim())},[]),children:u.jsx(tf.ItemSlot,{scope:l,value:s,disabled:c,textValue:g,children:u.jsx(Dt.div,{role:"option","aria-labelledby":N,"data-highlighted":x?"":void 0,"aria-selected":y&&x,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:C,onFocus:mt(f.onFocus,()=>w(!0)),onBlur:mt(f.onBlur,()=>w(!1)),onClick:mt(f.onClick,()=>{M.current!=="mouse"&&T()}),onPointerUp:mt(f.onPointerUp,()=>{M.current==="mouse"&&T()}),onPointerDown:mt(f.onPointerDown,A=>{M.current=A.pointerType}),onPointerMove:mt(f.onPointerMove,A=>{var I;M.current=A.pointerType,c?(I=v.onItemLeave)==null||I.call(v):M.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:mt(f.onPointerLeave,A=>{var I;A.currentTarget===document.activeElement&&((I=v.onItemLeave)==null||I.call(v))}),onKeyDown:mt(f.onKeyDown,A=>{var D;c||A.target!==A.currentTarget||((D=v.searchRef)==null?void 0:D.current)!==""&&A.key===" "||(E_.includes(A.key)&&T(),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),sd="SelectItemText",J_=k.forwardRef(St(function(i,a){const{__scopeSelect:l,className:s,style:c,...d}=i,f=al(sd,l),m=nf(sd,l),v=LS(sd,l),y=M_(sd,l),[g,b]=k.useState(null),x=An(T=>{var A;return(A=m.itemTextRefCallback)==null?void 0:A.call(m,T,v.value,v.disabled)}),w=xt(a,b,v.onItemTextChange,x),S=g==null?void 0:g.textContent,C=k.useMemo(()=>u.jsx("option",{value:v.value,disabled:v.disabled,children:S},v.value),[v.disabled,v.value,S]),{onNativeOptionAdd:N,onNativeOptionRemove:M}=y;return Mn(()=>(N(C),()=>M(C)),[N,M,C]),u.jsxs(u.Fragment,{children:[u.jsx(Dt.span,{id:v.textId,...d,ref:w}),v.isSelected&&f.valueNode&&!f.valueNodeHasChildren&&!Mc(f.value)?to.createPortal(d.children,f.valueNode):null]})},"SelectItemText")),W_="SelectItemIndicator",e3=k.forwardRef(St(function(i,a){const{__scopeSelect:l,...s}=i;return LS(W_,l).isSelected?u.jsx(Dt.span,{"aria-hidden":!0,...s,ref:a}):null},"SelectItemIndicator")),t3="SelectBubbleInput",n3=k.forwardRef(St(function({__scopeSelect:i,...a},l){const s=al(t3,i),{value:c,onValueChange:d,required:f,disabled:m,name:v,autoComplete:y,form:g}=s,{nativeOptions:b,nativeSelectKey:x}=s,w=k.useRef(null),S=xt(l,w),C=c??"",N=wS(C),M=Array.from(b).some(T=>(T.props.value??"")==="");return k.useEffect(()=>{const T=w.current;if(!T)return;const A=window.HTMLSelectElement.prototype,D=Object.getOwnPropertyDescriptor(A,"value").set;if(N!==C&&D){const B=new Event("change",{bubbles:!0});D.call(T,C),T.dispatchEvent(B)}},[N,C]),u.jsxs(Dt.select,{"aria-hidden":!0,required:f,tabIndex:-1,name:v,autoComplete:y,disabled:m,form:g,onChange:T=>d(T.target.value),...a,style:{...q4,...a.style},ref:S,defaultValue:C,children:[Mc(c)&&!M?u.jsx("option",{value:""}):null,Array.from(b)]},x)},"SelectBubbleInput"));function IS(e){return typeof e=="function"}St(IS,"isFunction");function Mc(e){return e===""||e===void 0}St(Mc,"shouldShowPlaceholder");function qg(e){const i=An(e),a=k.useRef(""),l=k.useRef(0),s=k.useCallback(d=>{const f=a.current+d;i(f),St((function m(v){a.current=v,window.clearTimeout(l.current),v!==""&&(l.current=window.setTimeout(()=>m(""),1e3))}),"updateSearch")(f)},[i]),c=k.useCallback(()=>{a.current="",window.clearTimeout(l.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(l.current),[]),[a,s,c]}St(qg,"useTypeaheadSearch");function Fg(e,i,a){const s=i.length>1&&Array.from(i).every(v=>v===i[0])?i[0]:i,c=a?e.indexOf(a):-1;let d=BS(e,Math.max(c,0));s.length===1&&(d=d.filter(v=>v!==a));const m=d.find(v=>v.textValue.toLowerCase().startsWith(s.toLowerCase()));return m!==a?m:void 0}St(Fg,"findNextItem");function BS(e,i){return e.map((a,l)=>e[(i+l)%e.length])}St(BS,"wrapArray");const i3=mg("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ve({className:e,variant:i="default",size:a="default",asChild:l=!1,...s}){const c=l?_4:"button";return u.jsx(c,{"data-slot":"button","data-variant":i,"data-size":a,className:nn(i3({variant:i,size:a,className:e})),...s})}const Vg=e=>Ha(e,{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function ql({value:e}){return u.jsx("pre",{className:"jv-history-json",children:JSON.stringify(e,null,2)})}function PS({blocks:e,links:i,onSelect:a}){return u.jsx(u.Fragment,{children:e.map((l,s)=>{if(l.type==="text"||l.type==="reasoning")return u.jsxs("section",{className:"jv-history-block",children:[u.jsx("h4",{children:j(l.type==="reasoning"?"history.reasoning":"history.text")}),u.jsx("pre",{className:"jv-history-text",children:l.text||j("history.empty")})]},s);if(l.type==="image")return u.jsxs("section",{className:"jv-history-block",children:[u.jsxs("h4",{children:[j("files.kindImage")," · ",l.mime_type]}),u.jsx("img",{className:"jv-history-image",src:`data:${l.mime_type};base64,${l.data}`,alt:j("history.image")})]},s);if(l.type==="tool_call"||l.type==="tool_result"){const c=i.filter(d=>d.tool_call_id===l.tool_call_id);return u.jsxs("section",{className:"jv-history-block",children:[u.jsxs("h4",{children:[j(l.type==="tool_call"?"history.toolCall":"history.toolResult")," · ",u.jsx("strong",{children:l.name}),l.type==="tool_result"&&l.is_error&&u.jsx("span",{className:"jv-history-error-tag",children:j("history.error")})]}),u.jsxs("div",{className:"jv-history-call",children:[u.jsx("code",{children:l.tool_call_id}),c.map(d=>u.jsxs("button",{type:"button",onClick:()=>a(d.id),"aria-label":j("history.related",{id:d.id}),children:[j(d.role==="tool"?"history.result":"history.call")," #",d.id]},d.id))]}),l.type==="tool_call"?u.jsx(ql,{value:l.arguments}):u.jsxs(u.Fragment,{children:[u.jsx(PS,{blocks:l.result.content,links:[],onSelect:a}),l.result.details!==void 0&&u.jsxs("details",{children:[u.jsx("summary",{children:j("history.details")}),u.jsx(ql,{value:l.result.details})]})]})]},s)}})})}function a3({detail:e,onSelect:i}){const[a,l]=k.useState("content"),{record:s,links:c}=e;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"jv-history-detail-head",children:[u.jsxs("div",{children:[u.jsxs("h3",{children:["#",s.id," ",u.jsx("span",{children:s.role})]}),u.jsx("p",{children:Vg(s.timestamp)})]}),u.jsxs("div",{role:"tablist","aria-label":j("history.view"),children:[u.jsx(Ve,{type:"button",variant:"ghost",size:"sm",role:"tab","aria-selected":a==="content",onClick:()=>l("content"),children:j("history.content")}),u.jsx(Ve,{type:"button",variant:"ghost",size:"sm",role:"tab","aria-selected":a==="json",onClick:()=>l("json"),children:j("history.json")})]})]}),u.jsx("div",{className:"jv-history-detail-scroll",role:"tabpanel","aria-label":j(a==="content"?"history.contentLabel":"history.json"),children:a==="json"?u.jsx(ql,{value:s}):u.jsxs(u.Fragment,{children:[s.model&&u.jsxs("div",{className:"jv-history-model",children:[u.jsx("span",{children:j("usage.model")}),u.jsx("strong",{children:s.model.id}),u.jsx("small",{children:s.model.provider})]}),u.jsx(PS,{blocks:s.message.content,links:c,onSelect:i}),s.message.tools&&u.jsxs("details",{className:"jv-history-fold",children:[u.jsxs("summary",{children:[j("history.tools")," · ",s.message.tools.length]}),u.jsx(ql,{value:s.message.tools})]}),s.message.tools_removed!==void 0&&u.jsxs("details",{className:"jv-history-fold",children:[u.jsx("summary",{children:j("history.toolsRemoved")}),u.jsx(ql,{value:s.message.tools_removed})]}),s.message.stop_reason&&u.jsxs("p",{className:"jv-history-note",children:[j("history.stopReason")," · ",s.message.stop_reason]}),s.message.error&&u.jsx("pre",{className:"jv-history-failure",children:s.message.error}),u.jsxs("details",{className:"jv-history-fold",children:[u.jsx("summary",{children:"Usage"}),u.jsx(ql,{value:s.usage})]}),u.jsxs("details",{className:"jv-history-fold",children:[u.jsx("summary",{children:"Extra"}),u.jsx(ql,{value:s.extra})]})]})})]})}const Jx={system:"activity.roleSystem",user:"activity.roleUser",assistant:"activity.roleAssistant",tool:"history.toolResult"},Wx=e=>Ha(e,{year:"numeric",month:"long",day:"numeric"}),r3=e=>[e.preview,...e.tools.map(i=>j(i.kind==="call"?"activity.toolCall":i.error?"activity.toolFailed":"activity.toolResult",{name:i.name})),e.images?j("activity.images",{count:e.images}):""].filter(Boolean).join(" "),l3=e=>Ha(e,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function o3({items:e,onSelect:i}){return u.jsx("ol",{className:"jv-activity-timeline","aria-label":j("activity.timeline"),children:e.map((a,l)=>{const{record:s}=a,c=Wx(s.timestamp);return u.jsxs(k.Fragment,{children:[(l===0||Wx(e[l-1].record.timestamp)!==c)&&u.jsx("li",{className:"jv-activity-day",children:u.jsx("span",{children:c})}),u.jsxs("li",{className:`jv-activity-row is-${a.kind}`,"data-kind":a.kind,children:[u.jsxs("div",{className:"jv-activity-time",children:[u.jsx("time",{dateTime:new Date(s.timestamp).toISOString(),title:`${Vg(s.timestamp)}.${String(s.timestamp%1e3).padStart(3,"0")}`,children:l3(s.timestamp)}),u.jsx("span",{className:"jv-activity-dot"})]}),a.kind==="chat"?u.jsxs("article",{className:"jv-activity-card jv-activity-chat","aria-label":j("activity.chatMessage",{id:a.record.id}),children:[u.jsxs("button",{type:"button",className:"jv-activity-card-main",onClick:()=>i({kind:"chat",id:a.record.id}),"aria-label":j("activity.viewMessage",{sequence:a.record.sequence,chat:a.record.chatTitle}),children:[u.jsxs("span",{className:"jv-activity-card-head",children:[u.jsx(DA,{}),u.jsx("strong",{title:a.record.chatTitle,children:a.record.chatTitle}),u.jsxs("span",{children:["#",a.record.sequence]})]}),u.jsx("span",{className:"jv-activity-preview",children:a.record.preview||j("activity.attachmentOnly")}),a.record.attachmentCount>0&&u.jsxs("span",{className:"jv-activity-attachment",children:[u.jsx(fg,{}),j("activity.attachments",{count:a.record.attachmentCount})]})]}),a.record.source&&u.jsxs("button",{type:"button",className:"jv-activity-source",onClick:()=>i({kind:"history",id:a.record.source.historyId}),"aria-label":j("activity.viewSentBy",{id:a.record.source.historyId}),children:[j("activity.sentBy",{id:a.record.source.historyId}),u.jsx(Cp,{})]})]}):u.jsx("article",{className:"jv-activity-card jv-activity-history","aria-label":j("activity.historyRecord",{id:a.record.id}),children:u.jsxs("button",{type:"button",className:"jv-activity-card-main",onClick:()=>i({kind:"history",id:a.record.id}),"aria-label":j("activity.viewHistory",{id:a.record.id,role:a.record.role}),children:[u.jsxs("span",{className:"jv-activity-card-head",children:[u.jsx("strong",{children:Jx[a.record.role]?j(Jx[a.record.role]):a.record.role}),u.jsxs("span",{children:["#",a.record.id]})]}),u.jsx("span",{className:"jv-activity-preview",children:r3(a.record)||j("activity.emptyMessage")})]})})]})]},`${a.kind}:${s.id}`)})})}const s3={read:(e,i)=>Re(`/bots/${e}/history/${i}`)};function c3(e,i){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const u3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f3={};function e1(e,i){return(f3.jsx?d3:u3).test(e)}const h3=/[ \t\n\f\r]/g;function m3(e){return typeof e=="object"?e.type==="text"?t1(e.value):!1:t1(e)}function t1(e){return e.replace(h3,"")===""}class Oc{constructor(i,a,l){this.normal=a,this.property=i,l&&(this.space=l)}}Oc.prototype.normal={};Oc.prototype.property={};Oc.prototype.space=void 0;function HS(e,i){const a={},l={};for(const s of e)Object.assign(a,s.property),Object.assign(l,s.normal);return new Oc(a,l,i)}function Yp(e){return e.toLowerCase()}class ui{constructor(i,a){this.attribute=a,this.property=i}}ui.prototype.attribute="";ui.prototype.booleanish=!1;ui.prototype.boolean=!1;ui.prototype.commaOrSpaceSeparated=!1;ui.prototype.commaSeparated=!1;ui.prototype.defined=!1;ui.prototype.mustUseProperty=!1;ui.prototype.number=!1;ui.prototype.overloadedBoolean=!1;ui.prototype.property="";ui.prototype.spaceSeparated=!1;ui.prototype.space=void 0;let p3=0;const Ge=io(),tn=io(),Gp=io(),we=io(),Ct=io(),$l=io(),Ti=io();function io(){return 2**++p3}const Xp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:tn,commaOrSpaceSeparated:Ti,commaSeparated:$l,number:we,overloadedBoolean:Gp,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),Gm=Object.keys(Xp);class $g extends ui{constructor(i,a,l,s){let c=-1;if(super(i,a),n1(this,"space",s),typeof l=="number")for(;++c<Gm.length;){const d=Gm[c];n1(this,Gm[c],(l&Xp[d])===Xp[d])}}}$g.prototype.defined=!0;function n1(e,i,a){a&&(e[i]=a)}function cs(e){const i={},a={};for(const[l,s]of Object.entries(e.properties)){const c=new $g(l,e.transform(e.attributes||{},l),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(c.mustUseProperty=!0),i[l]=c,a[Yp(l)]=l,a[Yp(c.attribute)]=l}return new Oc(i,a,e.space)}const US=cs({properties:{ariaActiveDescendant:null,ariaAtomic:tn,ariaAutoComplete:null,ariaBusy:tn,ariaChecked:tn,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:tn,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:tn,ariaFlowTo:Ct,ariaGrabbed:tn,ariaHasPopup:null,ariaHidden:tn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:we,ariaLive:null,ariaModal:tn,ariaMultiLine:tn,ariaMultiSelectable:tn,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:tn,ariaReadOnly:tn,ariaRelevant:null,ariaRequired:tn,ariaRoleDescription:Ct,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:tn,ariaSetSize:we,ariaSort:null,ariaValueMax:we,ariaValueMin:we,ariaValueNow:we,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function qS(e,i){return i in e?e[i]:i}function FS(e,i){return qS(e,i.toLowerCase())}const g3=cs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$l,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alpha:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:Ct,autoFocus:Ge,autoPlay:Ge,blocking:Ct,capture:null,charSet:null,checked:Ge,cite:null,className:Ct,closedBy:null,colorSpace:null,cols:we,colSpan:we,command:null,commandFor:null,content:null,contentEditable:tn,controls:Ge,controlsList:Ct,coords:we|$l,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:Gp,draggable:tn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:Ct,height:we,hidden:Gp,high:we,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Ge,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ge,optimum:we,pattern:null,ping:Ct,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:Ct,required:Ge,reversed:Ge,rows:we,rowSpan:we,sandbox:Ct,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootCustomElementRegistry:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shadowRootSerializable:Ge,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:tn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:we,step:null,style:null,tabIndex:we,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:tn,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:we,borderColor:null,bottomMargin:we,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:tn,standby:null,summary:null,text:null,topMargin:we,valueType:null,version:null,vAlign:null,vLink:null,vSpace:we,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ge,disablePictureInPicture:Ge,disableRemotePlayback:Ge,exportParts:$l,part:Ct,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:FS}),v3=cs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ti,accentHeight:we,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:we,amplitude:we,arabicForm:null,ascent:we,attributeName:null,attributeType:null,azimuth:we,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:we,by:null,calcMode:null,capHeight:we,className:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:we,diffuseConstant:we,direction:null,display:null,dur:null,divisor:we,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:we,enableBackground:null,end:null,event:null,exponent:we,externalResourcesRequired:null,fill:null,fillOpacity:we,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$l,g2:$l,glyphName:$l,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:we,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:we,horizOriginX:we,horizOriginY:we,id:null,ideographic:we,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:we,k:we,k1:we,k2:we,k3:we,k4:we,kernelMatrix:Ti,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:we,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:we,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:we,overlineThickness:we,paintOrder:null,panose1:null,path:null,pathLength:we,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ti,rev:Ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ti,requiredFeatures:Ti,requiredFonts:Ti,requiredFormats:Ti,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:we,specularExponent:we,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:we,strikethroughThickness:we,string:null,stroke:null,strokeDashArray:Ti,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:we,strokeOpacity:we,strokeWidth:null,style:null,surfaceScale:we,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ti,tabIndex:we,tableValues:null,target:null,targetX:we,targetY:we,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ti,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:we,underlineThickness:we,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:we,values:null,vAlphabetic:we,vMathematical:we,vectorEffect:null,vHanging:we,vIdeographic:we,version:null,vertAdvY:we,vertOriginX:we,vertOriginY:we,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:we,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qS}),VS=cs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),$S=cs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:FS}),YS=cs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),y3={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},b3=/[A-Z]/g,i1=/-[a-z]/g,x3=/^data[-\w.:]+$/i;function j3(e,i){const a=Yp(i);let l=i,s=ui;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&x3.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(i1,S3);l="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!i1.test(c)){let d=c.replace(b3,w3);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}s=$g}return new s(l,i)}function w3(e){return"-"+e.toLowerCase()}function S3(e){return e.charAt(1).toUpperCase()}const k3=HS([US,g3,VS,$S,YS],"html"),Yg=HS([US,v3,VS,$S,YS],"svg");function C3(e){return e.join(" ").trim()}var Xo={},Xm,a1;function E3(){if(a1)return Xm;a1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
485
- `,v="/",y="*",g="",b="comment",x="declaration";function w(C,N){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];N=N||{};var M=1,T=1;function A(Q){var U=Q.match(i);U&&(M+=U.length);var X=Q.lastIndexOf(m);T=~X?Q.length-X:T+Q.length}function I(){var Q={line:M,column:T};return function(U){return U.position=new D(Q),V(),U}}function D(Q){this.start=Q,this.end={line:M,column:T},this.source=N.source}D.prototype.content=C;function B(Q){var U=new Error(N.source+":"+M+":"+T+": "+Q);if(U.reason=Q,U.filename=N.source,U.line=M,U.column=T,U.source=C,!N.silent)throw U}function P(Q){var U=Q.exec(C);if(U){var X=U[0];return A(X),C=C.slice(X.length),U}}function V(){P(a)}function z(Q){var U;for(Q=Q||[];U=Y();)U!==!1&&Q.push(U);return Q}function Y(){var Q=I();if(!(v!=C.charAt(0)||y!=C.charAt(1))){for(var U=2;g!=C.charAt(U)&&(y!=C.charAt(U)||v!=C.charAt(U+1));)++U;if(U+=2,g===C.charAt(U-1))return B("End of comment missing");var X=C.slice(2,U-2);return T+=2,A(X),C=C.slice(U),T+=2,Q({type:b,comment:X})}}function q(){var Q=I(),U=P(l);if(U){if(Y(),!P(s))return B("property missing ':'");var X=P(c),O=Q({type:x,property:S(U[0].replace(e,g)),value:X?S(X[0].replace(e,g)):g});return P(d),O}}function W(){var Q=[];z(Q);for(var U;U=q();)U!==!1&&(Q.push(U),z(Q));return Q}return V(),W()}function S(C){return C?C.replace(f,g):g}return Xm=w,Xm}var r1;function N3(){if(r1)return Xo;r1=1;var e=Xo&&Xo.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=a;const i=e(E3());function a(l,s){let c=null;if(!l||typeof l!="string")return c;const d=(0,i.default)(l),f=typeof s=="function";return d.forEach(m=>{if(m.type!=="declaration")return;const{property:v,value:y}=m;f?s(v,y,m):y&&(c=c||{},c[v]=y)}),c}return Xo}var rc={},l1;function T3(){if(l1)return rc;l1=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,c=function(v){return!v||a.test(v)||e.test(v)},d=function(v,y){return y.toUpperCase()},f=function(v,y){return"".concat(y,"-")},m=function(v,y){return y===void 0&&(y={}),c(v)?v:(v=v.toLowerCase(),y.reactCompat?v=v.replace(s,f):v=v.replace(l,f),v.replace(i,d))};return rc.camelCase=m,rc}var lc,o1;function A3(){if(o1)return lc;o1=1;var e=lc&&lc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},i=e(N3()),a=T3();function l(s,c){var d={};return!s||typeof s!="string"||(0,i.default)(s,function(f,m){f&&m&&(d[(0,a.camelCase)(f,c)]=m)}),d}return l.default=l,lc=l,lc}var M3=A3();const O3=cg(M3),GS=XS("end"),Gg=XS("start");function XS(e){return i;function i(a){const l=a&&a.position&&a.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function R3(e){const i=Gg(e),a=GS(e);if(i&&a)return{start:i,end:a}}function uc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?s1(e.position):"start"in e||"end"in e?s1(e):"line"in e||"column"in e?Qp(e):""}function Qp(e){return c1(e&&e.line)+":"+c1(e&&e.column)}function s1(e){return Qp(e&&e.start)+"-"+Qp(e&&e.end)}function c1(e){return e&&typeof e=="number"?e:1}class Pn extends Error{constructor(i,a,l){super(),typeof a=="string"&&(l=a,a=void 0);let s="",c={},d=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c={...a}),typeof i=="string"?s=i:!c.cause&&i&&(d=!0,s=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof l=="string"){const m=l.indexOf(":");m===-1?c.ruleId=l:(c.source=l.slice(0,m),c.ruleId=l.slice(m+1))}if(!c.place&&c.ancestors&&c.ancestors){const m=c.ancestors[c.ancestors.length-1];m&&(c.place=m.position)}const f=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=uc(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Pn.prototype.file="";Pn.prototype.name="";Pn.prototype.reason="";Pn.prototype.message="";Pn.prototype.stack="";Pn.prototype.column=void 0;Pn.prototype.line=void 0;Pn.prototype.ancestors=void 0;Pn.prototype.cause=void 0;Pn.prototype.fatal=void 0;Pn.prototype.place=void 0;Pn.prototype.ruleId=void 0;Pn.prototype.source=void 0;const Xg={}.hasOwnProperty,_3=new Map,D3=/[A-Z]/g,z3=new Set(["table","tbody","thead","tfoot","tr"]),L3=new Set(["td","th"]),QS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function I3(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=i.filePath||void 0;let l;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=$3(a,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=V3(a,i.jsx,i.jsxs)}const s={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:l,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?Yg:k3,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=KS(s,e,void 0);return c&&typeof c!="string"?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}function KS(e,i,a){if(i.type==="element")return B3(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return P3(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return U3(e,i,a);if(i.type==="mdxjsEsm")return H3(e,i);if(i.type==="root")return q3(e,i,a);if(i.type==="text")return F3(e,i)}function B3(e,i,a){const l=e.schema;let s=l;i.tagName.toLowerCase()==="svg"&&l.space==="html"&&(s=Yg,e.schema=s),e.ancestors.push(i);const c=JS(e,i.tagName,!1),d=Y3(e,i);let f=Kg(e,i);return z3.has(i.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!m3(m):!0})),ZS(e,d,c,i),Qg(d,f),e.ancestors.pop(),e.schema=l,e.create(i,c,d,a)}function P3(e,i){if(i.data&&i.data.estree&&e.evaluater){const l=i.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}xc(e,i.position)}function H3(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);xc(e,i.position)}function U3(e,i,a){const l=e.schema;let s=l;i.name==="svg"&&l.space==="html"&&(s=Yg,e.schema=s),e.ancestors.push(i);const c=i.name===null?e.Fragment:JS(e,i.name,!0),d=G3(e,i),f=Kg(e,i);return ZS(e,d,c,i),Qg(d,f),e.ancestors.pop(),e.schema=l,e.create(i,c,d,a)}function q3(e,i,a){const l={};return Qg(l,Kg(e,i)),e.create(i,e.Fragment,l,a)}function F3(e,i){return i.value}function ZS(e,i,a,l){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=l)}function Qg(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function V3(e,i,a){return l;function l(s,c,d,f){const v=Array.isArray(d.children)?a:i;return f?v(c,d,f):v(c,d)}}function $3(e,i){return a;function a(l,s,c,d){const f=Array.isArray(c.children),m=Gg(l);return i(s,c,d,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function Y3(e,i){const a={};let l,s;for(s in i.properties)if(s!=="children"&&Xg.call(i.properties,s)){const c=X3(e,s,i.properties[s]);if(c){const[d,f]=c;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&L3.has(i.tagName)?l=f:a[d]=f}}if(l){const c=a.style||(a.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return a}function G3(e,i){const a={};for(const l of i.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const c=l.data.estree.body[0];c.type;const d=c.expression;d.type;const f=d.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else xc(e,i.position);else{const s=l.name;let c;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const f=l.value.data.estree.body[0];f.type,c=e.evaluater.evaluateExpression(f.expression)}else xc(e,i.position);else c=l.value===null?!0:l.value;a[s]=c}return a}function Kg(e,i){const a=[];let l=-1;const s=e.passKeys?new Map:_3;for(;++l<i.children.length;){const c=i.children[l];let d;if(e.passKeys){const m=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(m){const v=s.get(m)||0;d=m+"-"+v,s.set(m,v+1)}}const f=KS(e,c,d);f!==void 0&&a.push(f)}return a}function X3(e,i,a){const l=j3(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=l.commaSeparated?c3(a):C3(a)),l.property==="style"){let s=typeof a=="object"?a:Q3(e,String(a));return e.stylePropertyNameCase==="css"&&(s=K3(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&l.space?y3[l.property]||l.property:l.attribute,a]}}function Q3(e,i){try{return O3(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const l=a,s=new Pn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=QS+"#cannot-parse-style-attribute",s}}function JS(e,i,a){let l;if(!a)l={type:"Literal",value:i};else if(i.includes(".")){const s=i.split(".");let c=-1,d;for(;++c<s.length;){const f=e1(s[c])?{type:"Identifier",name:s[c]}:{type:"Literal",value:s[c]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(c&&f.type==="Literal"),optional:!1}:f}l=d}else l=e1(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(l.type==="Literal"){const s=l.value;return Xg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(l);xc(e)}function xc(e,i){const a=new Pn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=QS+"#cannot-handle-mdx-estrees-without-createevaluater",a}function K3(e){const i={};let a;for(a in e)Xg.call(e,a)&&(i[Z3(a)]=e[a]);return i}function Z3(e){let i=e.replace(D3,J3);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function J3(e){return"-"+e.toLowerCase()}const Qm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},W3={};function Zg(e,i){const a=W3,l=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,s=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return WS(e,l,s)}function WS(e,i,a){if(eD(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return u1(e.children,i,a)}return Array.isArray(e)?u1(e,i,a):""}function u1(e,i,a){const l=[];let s=-1;for(;++s<e.length;)l[s]=WS(e[s],i,a);return l.join("")}function eD(e){return!!(e&&typeof e=="object")}const d1=document.createElement("i");function Jg(e){const i="&"+e+";";d1.innerHTML=i;const a=d1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Mi(e,i,a,l){const s=e.length;let c=0,d;if(i<0?i=-i>s?0:s+i:i=i>s?s:i,a=a>0?a:0,l.length<1e4)d=Array.from(l),d.unshift(i,a),e.splice(...d);else for(a&&e.splice(i,a);c<l.length;)d=l.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function Ui(e,i){return e.length>0?(Mi(e,e.length,0,i),e):i}const f1={}.hasOwnProperty;function ek(e){const i={};let a=-1;for(;++a<e.length;)tD(i,e[a]);return i}function tD(e,i){let a;for(a in i){const s=(f1.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){f1.call(s,d)||(s[d]=[]);const f=c[d];nD(s[d],Array.isArray(f)?f:f?[f]:[])}}}function nD(e,i){let a=-1;const l=[];for(;++a<i.length;)(i[a].add==="after"?e:l).push(i[a]);Mi(e,0,0,l)}function tk(e,i){const a=Number.parseInt(e,i);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function aa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Xn=rl(/[A-Za-z]/),Bn=rl(/[\dA-Za-z]/),iD=rl(/[#-'*+\--9=?A-Z^-~]/);function Dd(e){return e!==null&&(e<32||e===127)}const Kp=rl(/\d/),aD=rl(/[\dA-Fa-f]/),rD=rl(/[!-/:-@[-`{-~]/);function He(e){return e!==null&&e<-2}function Et(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const af=rl(new RegExp("\\p{P}|\\p{S}","u")),Kl=rl(/\s/);function rl(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function us(e){const i=[];let a=-1,l=0,s=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&Bn(e.charCodeAt(a+1))&&Bn(e.charCodeAt(a+2)))s=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const f=e.charCodeAt(a+1);c<56320&&f>56319&&f<57344?(d=String.fromCharCode(c,f),s=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(e.slice(l,a),encodeURIComponent(d)),l=a+s+1,d=""),s&&(a+=s,s=0)}return i.join("")+e.slice(l)}function ft(e,i,a,l){const s=l?l-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(m){return it(m)?(e.enter(a),f(m)):i(m)}function f(m){return it(m)&&c++<s?(e.consume(m),f):(e.exit(a),i(m))}}const lD={tokenize:oD};function oD(e){const i=e.attempt(this.parser.constructs.contentInitial,l,s);let a;return i;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ft(e,i,"linePrefix")}function s(f){return e.enter("paragraph"),c(f)}function c(f){const m=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=m),a=m,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return He(f)?(e.consume(f),e.exit("chunkText"),c):(e.consume(f),d)}}const sD={tokenize:cD},h1={tokenize:uD};function cD(e){const i=this,a=[];let l=0,s,c,d;return f;function f(T){if(l<a.length){const A=a[l];return i.containerState=A[1],e.attempt(A[0].continuation,m,v)(T)}return v(T)}function m(T){if(l++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,s&&M();const A=i.events.length;let I=A,D;for(;I--;)if(i.events[I][0]==="exit"&&i.events[I][1].type==="chunkFlow"){D=i.events[I][1].end;break}N(l);let B=A;for(;B<i.events.length;)i.events[B][1].end={...D},B++;return Mi(i.events,I+1,0,i.events.slice(A)),i.events.length=B,v(T)}return f(T)}function v(T){if(l===a.length){if(!s)return b(T);if(s.currentConstruct&&s.currentConstruct.concrete)return w(T);i.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(h1,y,g)(T)}function y(T){return s&&M(),N(l),b(T)}function g(T){return i.parser.lazy[i.now().line]=l!==a.length,d=i.now().offset,w(T)}function b(T){return i.containerState={},e.attempt(h1,x,w)(T)}function x(T){return l++,a.push([i.currentConstruct,i.containerState]),b(T)}function w(T){if(T===null){s&&M(),N(0),e.consume(T);return}return s=s||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:c}),S(T)}function S(T){if(T===null){C(e.exit("chunkFlow"),!0),N(0),e.consume(T);return}return He(T)?(e.consume(T),C(e.exit("chunkFlow")),l=0,i.interrupt=void 0,f):(e.consume(T),S)}function C(T,A){const I=i.sliceStream(T);if(A&&I.push(null),T.previous=c,c&&(c.next=T),c=T,s.defineSkip(T.start),s.write(I),i.parser.lazy[T.start.line]){let D=s.events.length;for(;D--;)if(s.events[D][1].start.offset<d&&(!s.events[D][1].end||s.events[D][1].end.offset>d))return;const B=i.events.length;let P=B,V,z;for(;P--;)if(i.events[P][0]==="exit"&&i.events[P][1].type==="chunkFlow"){if(V){z=i.events[P][1].end;break}V=!0}for(N(l),D=B;D<i.events.length;)i.events[D][1].end={...z},D++;Mi(i.events,P+1,0,i.events.slice(B)),i.events.length=D}}function N(T){let A=a.length;for(;A-- >T;){const I=a[A];i.containerState=I[1],I[0].exit.call(i,e)}a.length=T}function M(){s.write([null]),c=void 0,s=void 0,i.containerState._closeFlow=void 0}}function uD(e,i,a){return ft(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function is(e){if(e===null||Et(e)||Kl(e))return 1;if(af(e))return 2}function rf(e,i,a){const l=[];let s=-1;for(;++s<e.length;){const c=e[s].resolveAll;c&&!l.includes(c)&&(i=c(i,a),l.push(c))}return i}const Zp={name:"attention",resolveAll:dD,tokenize:fD};function dD(e,i){let a=-1,l,s,c,d,f,m,v,y;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(l=a;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&i.sliceSerialize(e[l][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[l][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;m=e[l][1].end.offset-e[l][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const g={...e[l][1].end},b={...e[a][1].start};m1(g,-m),m1(b,m),d={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[l][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:b},c={type:m>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[a][1].start}},s={type:m>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[l][1].end={...d.start},e[a][1].start={...f.end},v=[],e[l][1].end.offset-e[l][1].start.offset&&(v=Ui(v,[["enter",e[l][1],i],["exit",e[l][1],i]])),v=Ui(v,[["enter",s,i],["enter",d,i],["exit",d,i],["enter",c,i]]),v=Ui(v,rf(i.parser.constructs.insideSpan.null,e.slice(l+1,a),i)),v=Ui(v,[["exit",c,i],["enter",f,i],["exit",f,i],["exit",s,i]]),e[a][1].end.offset-e[a][1].start.offset?(y=2,v=Ui(v,[["enter",e[a][1],i],["exit",e[a][1],i]])):y=0,Mi(e,l-1,a-l+3,v),a=l+v.length-y-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function fD(e,i){const a=this.parser.constructs.attentionMarkers.null,l=this.previous,s=is(l);let c;return d;function d(m){return c=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===c)return e.consume(m),f;const v=e.exit("attentionSequence"),y=is(m),g=!y||y===2&&s||a.includes(m),b=!s||s===2&&y||a.includes(l);return v._open=!!(c===42?g:g&&(s||!b)),v._close=!!(c===42?b:b&&(y||!g)),i(m)}}function m1(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const hD={name:"autolink",tokenize:mD};function mD(e,i,a){let l=0;return s;function s(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(x){return Xn(x)?(e.consume(x),d):x===64?a(x):v(x)}function d(x){return x===43||x===45||x===46||Bn(x)?(l=1,f(x)):v(x)}function f(x){return x===58?(e.consume(x),l=0,m):(x===43||x===45||x===46||Bn(x))&&l++<32?(e.consume(x),f):(l=0,v(x))}function m(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):x===null||x===32||x===60||Dd(x)?a(x):(e.consume(x),m)}function v(x){return x===64?(e.consume(x),y):iD(x)?(e.consume(x),v):a(x)}function y(x){return Bn(x)?g(x):a(x)}function g(x){return x===46?(e.consume(x),l=0,y):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),i):b(x)}function b(x){if((x===45||Bn(x))&&l++<63){const w=x===45?b:g;return e.consume(x),w}return a(x)}}const Rc={partial:!0,tokenize:pD};function pD(e,i,a){return l;function l(c){return it(c)?ft(e,s,"linePrefix")(c):s(c)}function s(c){return c===null||He(c)?i(c):a(c)}}const nk={continuation:{tokenize:vD},exit:yD,name:"blockQuote",tokenize:gD};function gD(e,i,a){const l=this;return s;function s(d){if(d===62){const f=l.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return a(d)}function c(d){return it(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function vD(e,i,a){const l=this;return s;function s(d){return it(d)?ft(e,c,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(nk,i,a)(d)}}function yD(e){e.exit("blockQuote")}const ik={name:"characterEscape",tokenize:bD};function bD(e,i,a){return l;function l(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),s}function s(c){return rD(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const ak={name:"characterReference",tokenize:xD};function xD(e,i,a){const l=this;let s=0,c,d;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),v):(e.enter("characterReferenceValue"),c=31,d=Bn,y(g))}function v(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=aD,y):(e.enter("characterReferenceValue"),c=7,d=Kp,y(g))}function y(g){if(g===59&&s){const b=e.exit("characterReferenceValue");return d===Bn&&!Jg(l.sliceSerialize(b))?a(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(g)&&s++<c?(e.consume(g),y):a(g)}}const p1={partial:!0,tokenize:wD},g1={concrete:!0,name:"codeFenced",tokenize:jD};function jD(e,i,a){const l=this,s={partial:!0,tokenize:I};let c=0,d=0,f;return m;function m(D){return v(D)}function v(D){const B=l.events[l.events.length-1];return c=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,f=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(D)}function y(D){return D===f?(d++,e.consume(D),y):d<3?a(D):(e.exit("codeFencedFenceSequence"),it(D)?ft(e,g,"whitespace")(D):g(D))}function g(D){return D===null||He(D)?(e.exit("codeFencedFence"),l.interrupt?i(D):e.check(p1,S,A)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||He(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(D)):it(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ft(e,x,"whitespace")(D)):D===96&&D===f?a(D):(e.consume(D),b)}function x(D){return D===null||He(D)?g(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(D))}function w(D){return D===null||He(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(D)):D===96&&D===f?a(D):(e.consume(D),w)}function S(D){return e.attempt(s,A,C)(D)}function C(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),N}function N(D){return c>0&&it(D)?ft(e,M,"linePrefix",c+1)(D):M(D)}function M(D){return D===null||He(D)?e.check(p1,S,A)(D):(e.enter("codeFlowValue"),T(D))}function T(D){return D===null||He(D)?(e.exit("codeFlowValue"),M(D)):(e.consume(D),T)}function A(D){return e.exit("codeFenced"),i(D)}function I(D,B,P){let V=0;return z;function z(U){return D.enter("lineEnding"),D.consume(U),D.exit("lineEnding"),Y}function Y(U){return D.enter("codeFencedFence"),it(U)?ft(D,q,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):q(U)}function q(U){return U===f?(D.enter("codeFencedFenceSequence"),W(U)):P(U)}function W(U){return U===f?(V++,D.consume(U),W):V>=d?(D.exit("codeFencedFenceSequence"),it(U)?ft(D,Q,"whitespace")(U):Q(U)):P(U)}function Q(U){return U===null||He(U)?(D.exit("codeFencedFence"),B(U)):P(U)}}}function wD(e,i,a){const l=this;return s;function s(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return l.parser.lazy[l.now().line]?a(d):i(d)}}const Km={name:"codeIndented",tokenize:kD},SD={partial:!0,tokenize:CD};function kD(e,i,a){const l=this;return s;function s(v){return e.enter("codeIndented"),ft(e,c,"linePrefix",5)(v)}function c(v){const y=l.events[l.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?d(v):a(v)}function d(v){return v===null?m(v):He(v)?e.attempt(SD,d,m)(v):(e.enter("codeFlowValue"),f(v))}function f(v){return v===null||He(v)?(e.exit("codeFlowValue"),d(v)):(e.consume(v),f)}function m(v){return e.exit("codeIndented"),i(v)}}function CD(e,i,a){const l=this;return s;function s(d){return l.parser.lazy[l.now().line]?a(d):He(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),s):ft(e,c,"linePrefix",5)(d)}function c(d){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?i(d):He(d)?s(d):a(d)}}const ED={name:"codeText",previous:TD,resolve:ND,tokenize:AD};function ND(e){let i=e.length-4,a=3,l,s;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(l=a;++l<i;)if(e[l][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(l=a-1,i++;++l<=i;)s===void 0?l!==i&&e[l][1].type!=="lineEnding"&&(s=l):(l===i||e[l][1].type==="lineEnding")&&(e[s][1].type="codeTextData",l!==s+2&&(e[s][1].end=e[l-1][1].end,e.splice(s+2,l-s-2),i-=l-s-2,l=s+2),s=void 0);return e}function TD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function AD(e,i,a){let l=0,s,c;return d;function d(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),l++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?a(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(c=e.enter("codeTextSequence"),s=0,y(g)):He(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),v(g))}function v(g){return g===null||g===32||g===96||He(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),v)}function y(g){return g===96?(e.consume(g),s++,y):s===l?(e.exit("codeTextSequence"),e.exit("codeText"),i(g)):(c.type="codeTextData",v(g))}}class MD{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,a){const l=a??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(i,l):i>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(i,a,l){const s=a||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return l&&oc(this.left,l),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),oc(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),oc(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const a=this.left.splice(i,Number.POSITIVE_INFINITY);oc(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);oc(this.left,a.reverse())}}}function oc(e,i){let a=0;if(i.length<1e4)e.push(...i);else for(;a<i.length;)e.push(...i.slice(a,a+1e4)),a+=1e4}function rk(e){const i={};let a=-1,l,s,c,d,f,m,v;const y=new MD(e);for(;++a<y.length;){for(;a in i;)a=i[a];if(l=y.get(a),a&&l[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(m=l[1]._tokenizer.events,c=0,c<m.length&&m[c][1].type==="lineEndingBlank"&&(c+=2),c<m.length&&m[c][1].type==="content"))for(;++c<m.length&&m[c][1].type!=="content";)m[c][1].type==="chunkText"&&(m[c][1]._isInFirstContentOfListItem=!0,c++);if(l[0]==="enter")l[1].contentType&&(Object.assign(i,OD(y,a)),a=i[a],v=!0);else if(l[1]._container){for(c=a,s=void 0;c--;)if(d=y.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(s&&(y.get(s)[1].type="lineEndingBlank"),d[1].type="lineEnding",s=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;s&&(l[1].end={...y.get(s)[1].start},f=y.slice(s,a),f.unshift(l),y.splice(s,a-s+1,f))}}return Mi(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!v}function OD(e,i){const a=e.get(i)[1],l=e.get(i)[2];let s=i-1;const c=[];let d=a._tokenizer;d||(d=l.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,m=[],v={};let y,g,b=-1,x=a,w=0,S=0;const C=[S];for(;x;){for(;e.get(++s)[1]!==x;);c.push(s),x._tokenizer||(y=l.sliceStream(x),x.next||y.push(null),g&&d.defineSkip(x.start),x._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(y),x._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),g=x,x=x.next}for(x=a;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(S=b+1,C.push(S),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(d.events=[],x?(x._tokenizer=void 0,x.previous=void 0):C.pop(),b=C.length;b--;){const N=f.slice(C[b],C[b+1]),M=c.pop();m.push([M,M+N.length-1]),e.splice(M,2,N)}for(m.reverse(),b=-1;++b<m.length;)v[w+m[b][0]]=w+m[b][1],w+=m[b][1]-m[b][0]-1;return v}const RD={resolve:DD,tokenize:zD},_D={partial:!0,tokenize:LD};function DD(e){return rk(e),e}function zD(e,i){let a;return l;function l(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?c(f):He(f)?e.check(_D,d,c)(f):(e.consume(f),s)}function c(f){return e.exit("chunkContent"),e.exit("content"),i(f)}function d(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,s}}function LD(e,i,a){const l=this;return s;function s(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ft(e,c,"linePrefix")}function c(d){if(d===null||He(d))return a(d);const f=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?i(d):e.interrupt(l.parser.constructs.flow,a,i)(d)}}function lk(e,i,a,l,s,c,d,f,m){const v=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(N){return N===60?(e.enter(l),e.enter(s),e.enter(c),e.consume(N),e.exit(c),b):N===null||N===32||N===41||Dd(N)?a(N):(e.enter(l),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(N))}function b(N){return N===62?(e.enter(c),e.consume(N),e.exit(c),e.exit(s),e.exit(l),i):(e.enter(f),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===62?(e.exit("chunkString"),e.exit(f),b(N)):N===null||N===60||He(N)?a(N):(e.consume(N),N===92?w:x)}function w(N){return N===60||N===62||N===92?(e.consume(N),x):x(N)}function S(N){return!y&&(N===null||N===41||Et(N))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(l),i(N)):y<v&&N===40?(e.consume(N),y++,S):N===41?(e.consume(N),y--,S):N===null||N===32||N===40||Dd(N)?a(N):(e.consume(N),N===92?C:S)}function C(N){return N===40||N===41||N===92?(e.consume(N),S):S(N)}}function ok(e,i,a,l,s,c){const d=this;let f=0,m;return v;function v(x){return e.enter(l),e.enter(s),e.consume(x),e.exit(s),e.enter(c),y}function y(x){return f>999||x===null||x===91||x===93&&!m||x===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?a(x):x===93?(e.exit(c),e.enter(s),e.consume(x),e.exit(s),e.exit(l),i):He(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||He(x)||f++>999?(e.exit("chunkString"),y(x)):(e.consume(x),m||(m=!it(x)),x===92?b:g)}function b(x){return x===91||x===92||x===93?(e.consume(x),f++,g):g(x)}}function sk(e,i,a,l,s,c){let d;return f;function f(b){return b===34||b===39||b===40?(e.enter(l),e.enter(s),e.consume(b),e.exit(s),d=b===40?41:b,m):a(b)}function m(b){return b===d?(e.enter(s),e.consume(b),e.exit(s),e.exit(l),i):(e.enter(c),v(b))}function v(b){return b===d?(e.exit(c),m(d)):b===null?a(b):He(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ft(e,v,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===d||b===null||He(b)?(e.exit("chunkString"),v(b)):(e.consume(b),b===92?g:y)}function g(b){return b===d||b===92?(e.consume(b),y):y(b)}}function dc(e,i){let a;return l;function l(s){return He(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a=!0,l):it(s)?ft(e,l,a?"linePrefix":"lineSuffix")(s):i(s)}}const ID={name:"definition",tokenize:PD},BD={partial:!0,tokenize:HD};function PD(e,i,a){const l=this;let s;return c;function c(x){return e.enter("definition"),d(x)}function d(x){return ok.call(l,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function f(x){return s=aa(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),m):a(x)}function m(x){return Et(x)?dc(e,v)(x):v(x)}function v(x){return lk(e,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function y(x){return e.attempt(BD,g,g)(x)}function g(x){return it(x)?ft(e,b,"whitespace")(x):b(x)}function b(x){return x===null||He(x)?(e.exit("definition"),l.parser.defined.push(s),i(x)):a(x)}}function HD(e,i,a){return l;function l(f){return Et(f)?dc(e,s)(f):a(f)}function s(f){return sk(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function c(f){return it(f)?ft(e,d,"whitespace")(f):d(f)}function d(f){return f===null||He(f)?i(f):a(f)}}const UD={name:"hardBreakEscape",tokenize:qD};function qD(e,i,a){return l;function l(c){return e.enter("hardBreakEscape"),e.consume(c),s}function s(c){return He(c)?(e.exit("hardBreakEscape"),i(c)):a(c)}}const FD={name:"headingAtx",resolve:VD,tokenize:$D};function VD(e,i){let a=e.length-2,l=3,s,c;return e[l][1].type==="whitespace"&&(l+=2),a-2>l&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(l===a-1||a-4>l&&e[a-2][1].type==="whitespace")&&(a-=l+1===a?2:4),a>l&&(s={type:"atxHeadingText",start:e[l][1].start,end:e[a][1].end},c={type:"chunkText",start:e[l][1].start,end:e[a][1].end,contentType:"text"},Mi(e,l,a-l+1,[["enter",s,i],["enter",c,i],["exit",c,i],["exit",s,i]])),e}function $D(e,i,a){let l=0;return s;function s(y){return e.enter("atxHeading"),c(y)}function c(y){return e.enter("atxHeadingSequence"),d(y)}function d(y){return y===35&&l++<6?(e.consume(y),d):y===null||Et(y)?(e.exit("atxHeadingSequence"),f(y)):a(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||He(y)?(e.exit("atxHeading"),i(y)):it(y)?ft(e,f,"whitespace")(y):(e.enter("atxHeadingText"),v(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),f(y))}function v(y){return y===null||y===35||Et(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),v)}}const YD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],v1=["pre","script","style","textarea"],GD={concrete:!0,name:"htmlFlow",resolveTo:KD,tokenize:ZD},XD={partial:!0,tokenize:WD},QD={partial:!0,tokenize:JD};function KD(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function ZD(e,i,a){const l=this;let s,c,d,f,m;return v;function v(H){return y(H)}function y(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),g}function g(H){return H===33?(e.consume(H),b):H===47?(e.consume(H),c=!0,S):H===63?(e.consume(H),s=3,l.interrupt?i:_):Xn(H)?(e.consume(H),d=String.fromCharCode(H),C):a(H)}function b(H){return H===45?(e.consume(H),s=2,x):H===91?(e.consume(H),s=5,f=0,w):Xn(H)?(e.consume(H),s=4,l.interrupt?i:_):a(H)}function x(H){return H===45?(e.consume(H),l.interrupt?i:_):a(H)}function w(H){const $="CDATA[";return H===$.charCodeAt(f++)?(e.consume(H),f===$.length?l.interrupt?i:q:w):a(H)}function S(H){return Xn(H)?(e.consume(H),d=String.fromCharCode(H),C):a(H)}function C(H){if(H===null||H===47||H===62||Et(H)){const $=H===47,fe=d.toLowerCase();return!$&&!c&&v1.includes(fe)?(s=1,l.interrupt?i(H):q(H)):YD.includes(d.toLowerCase())?(s=6,$?(e.consume(H),N):l.interrupt?i(H):q(H)):(s=7,l.interrupt&&!l.parser.lazy[l.now().line]?a(H):c?M(H):T(H))}return H===45||Bn(H)?(e.consume(H),d+=String.fromCharCode(H),C):a(H)}function N(H){return H===62?(e.consume(H),l.interrupt?i:q):a(H)}function M(H){return it(H)?(e.consume(H),M):z(H)}function T(H){return H===47?(e.consume(H),z):H===58||H===95||Xn(H)?(e.consume(H),A):it(H)?(e.consume(H),T):z(H)}function A(H){return H===45||H===46||H===58||H===95||Bn(H)?(e.consume(H),A):I(H)}function I(H){return H===61?(e.consume(H),D):it(H)?(e.consume(H),I):T(H)}function D(H){return H===null||H===60||H===61||H===62||H===96?a(H):H===34||H===39?(e.consume(H),m=H,B):it(H)?(e.consume(H),D):P(H)}function B(H){return H===m?(e.consume(H),m=null,V):H===null||He(H)?a(H):(e.consume(H),B)}function P(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||Et(H)?I(H):(e.consume(H),P)}function V(H){return H===47||H===62||it(H)?T(H):a(H)}function z(H){return H===62?(e.consume(H),Y):a(H)}function Y(H){return H===null||He(H)?q(H):it(H)?(e.consume(H),Y):a(H)}function q(H){return H===45&&s===2?(e.consume(H),X):H===60&&s===1?(e.consume(H),O):H===62&&s===4?(e.consume(H),J):H===63&&s===3?(e.consume(H),_):H===93&&s===5?(e.consume(H),ne):He(H)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(XD,ee,W)(H)):H===null||He(H)?(e.exit("htmlFlowData"),W(H)):(e.consume(H),q)}function W(H){return e.check(QD,Q,ee)(H)}function Q(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),U}function U(H){return H===null||He(H)?W(H):(e.enter("htmlFlowData"),q(H))}function X(H){return H===45?(e.consume(H),_):q(H)}function O(H){return H===47?(e.consume(H),d="",F):q(H)}function F(H){if(H===62){const $=d.toLowerCase();return v1.includes($)?(e.consume(H),J):q(H)}return Xn(H)&&d.length<8?(e.consume(H),d+=String.fromCharCode(H),F):q(H)}function ne(H){return H===93?(e.consume(H),_):q(H)}function _(H){return H===62?(e.consume(H),J):H===45&&s===2?(e.consume(H),_):q(H)}function J(H){return H===null||He(H)?(e.exit("htmlFlowData"),ee(H)):(e.consume(H),J)}function ee(H){return e.exit("htmlFlow"),i(H)}}function JD(e,i,a){const l=this;return s;function s(d){return He(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):a(d)}function c(d){return l.parser.lazy[l.now().line]?a(d):i(d)}}function WD(e,i,a){return l;function l(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Rc,i,a)}}const ez={name:"htmlText",tokenize:tz};function tz(e,i,a){const l=this;let s,c,d;return f;function f(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),m}function m(_){return _===33?(e.consume(_),v):_===47?(e.consume(_),I):_===63?(e.consume(_),T):Xn(_)?(e.consume(_),P):a(_)}function v(_){return _===45?(e.consume(_),y):_===91?(e.consume(_),c=0,w):Xn(_)?(e.consume(_),M):a(_)}function y(_){return _===45?(e.consume(_),x):a(_)}function g(_){return _===null?a(_):_===45?(e.consume(_),b):He(_)?(d=g,O(_)):(e.consume(_),g)}function b(_){return _===45?(e.consume(_),x):g(_)}function x(_){return _===62?X(_):_===45?b(_):g(_)}function w(_){const J="CDATA[";return _===J.charCodeAt(c++)?(e.consume(_),c===J.length?S:w):a(_)}function S(_){return _===null?a(_):_===93?(e.consume(_),C):He(_)?(d=S,O(_)):(e.consume(_),S)}function C(_){return _===93?(e.consume(_),N):S(_)}function N(_){return _===62?X(_):_===93?(e.consume(_),N):S(_)}function M(_){return _===null||_===62?X(_):He(_)?(d=M,O(_)):(e.consume(_),M)}function T(_){return _===null?a(_):_===63?(e.consume(_),A):He(_)?(d=T,O(_)):(e.consume(_),T)}function A(_){return _===62?X(_):T(_)}function I(_){return Xn(_)?(e.consume(_),D):a(_)}function D(_){return _===45||Bn(_)?(e.consume(_),D):B(_)}function B(_){return He(_)?(d=B,O(_)):it(_)?(e.consume(_),B):X(_)}function P(_){return _===45||Bn(_)?(e.consume(_),P):_===47||_===62||Et(_)?V(_):a(_)}function V(_){return _===47?(e.consume(_),X):_===58||_===95||Xn(_)?(e.consume(_),z):He(_)?(d=V,O(_)):it(_)?(e.consume(_),V):X(_)}function z(_){return _===45||_===46||_===58||_===95||Bn(_)?(e.consume(_),z):Y(_)}function Y(_){return _===61?(e.consume(_),q):He(_)?(d=Y,O(_)):it(_)?(e.consume(_),Y):V(_)}function q(_){return _===null||_===60||_===61||_===62||_===96?a(_):_===34||_===39?(e.consume(_),s=_,W):He(_)?(d=q,O(_)):it(_)?(e.consume(_),q):(e.consume(_),Q)}function W(_){return _===s?(e.consume(_),s=void 0,U):_===null?a(_):He(_)?(d=W,O(_)):(e.consume(_),W)}function Q(_){return _===null||_===34||_===39||_===60||_===61||_===96?a(_):_===47||_===62||Et(_)?V(_):(e.consume(_),Q)}function U(_){return _===47||_===62||Et(_)?V(_):a(_)}function X(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),i):a(_)}function O(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),F}function F(_){return it(_)?ft(e,ne,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):ne(_)}function ne(_){return e.enter("htmlTextData"),d(_)}}const Wg={name:"labelEnd",resolveAll:rz,resolveTo:lz,tokenize:oz},nz={tokenize:sz},iz={tokenize:cz},az={tokenize:uz};function rz(e){let i=-1;const a=[];for(;++i<e.length;){const l=e[i][1];if(a.push(e[i]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const s=l.type==="labelImage"?4:2;l.type="data",i+=s}}return e.length!==a.length&&Mi(e,0,e.length,a),e}function lz(e,i){let a=e.length,l=0,s,c,d,f;for(;a--;)if(s=e[a][1],c){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[a][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(c=a,s.type!=="labelLink")){l=2;break}}else s.type==="labelEnd"&&(d=a);const m={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},v={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},y={type:"labelText",start:{...e[c+l+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",m,i],["enter",v,i]],f=Ui(f,e.slice(c+1,c+l+3)),f=Ui(f,[["enter",y,i]]),f=Ui(f,rf(i.parser.constructs.insideSpan.null,e.slice(c+l+4,d-3),i)),f=Ui(f,[["exit",y,i],e[d-2],e[d-1],["exit",v,i]]),f=Ui(f,e.slice(d+1)),f=Ui(f,[["exit",m,i]]),Mi(e,c,e.length,f),e}function oz(e,i,a){const l=this;let s=l.events.length,c,d;for(;s--;)if((l.events[s][1].type==="labelImage"||l.events[s][1].type==="labelLink")&&!l.events[s][1]._balanced){c=l.events[s][1];break}return f;function f(b){return c?c._inactive?g(b):(d=l.parser.defined.includes(aa(l.sliceSerialize({start:c.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),m):a(b)}function m(b){return b===40?e.attempt(nz,y,d?y:g)(b):b===91?e.attempt(iz,y,d?v:g)(b):d?y(b):g(b)}function v(b){return e.attempt(az,y,g)(b)}function y(b){return i(b)}function g(b){return c._balanced=!0,a(b)}}function sz(e,i,a){return l;function l(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return Et(g)?dc(e,c)(g):c(g)}function c(g){return g===41?y(g):lk(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function d(g){return Et(g)?dc(e,m)(g):y(g)}function f(g){return a(g)}function m(g){return g===34||g===39||g===40?sk(e,v,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function v(g){return Et(g)?dc(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),i):a(g)}}function cz(e,i,a){const l=this;return s;function s(f){return ok.call(l,e,c,d,"reference","referenceMarker","referenceString")(f)}function c(f){return l.parser.defined.includes(aa(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?i(f):a(f)}function d(f){return a(f)}}function uz(e,i,a){return l;function l(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),s}function s(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),i):a(c)}}const dz={name:"labelStartImage",resolveAll:Wg.resolveAll,tokenize:fz};function fz(e,i,a){const l=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),c}function c(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):a(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?a(f):i(f)}}const hz={name:"labelStartLink",resolveAll:Wg.resolveAll,tokenize:mz};function mz(e,i,a){const l=this;return s;function s(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in l.parser.constructs?a(d):i(d)}}const Zm={name:"lineEnding",tokenize:pz};function pz(e,i){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ft(e,i,"linePrefix")}}const kd={name:"thematicBreak",tokenize:gz};function gz(e,i,a){let l=0,s;return c;function c(v){return e.enter("thematicBreak"),d(v)}function d(v){return s=v,f(v)}function f(v){return v===s?(e.enter("thematicBreakSequence"),m(v)):l>=3&&(v===null||He(v))?(e.exit("thematicBreak"),i(v)):a(v)}function m(v){return v===s?(e.consume(v),l++,m):(e.exit("thematicBreakSequence"),it(v)?ft(e,f,"whitespace")(v):f(v))}}const si={continuation:{tokenize:xz},exit:wz,name:"list",tokenize:bz},vz={partial:!0,tokenize:Sz},yz={partial:!0,tokenize:jz};function bz(e,i,a){const l=this,s=l.events[l.events.length-1];let c=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,d=0;return f;function f(x){const w=l.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!l.containerState.marker||x===l.containerState.marker:Kp(x)){if(l.containerState.type||(l.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(kd,a,v)(x):v(x);if(!l.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(x)}return a(x)}function m(x){return Kp(x)&&++d<10?(e.consume(x),m):(!l.interrupt||d<2)&&(l.containerState.marker?x===l.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),v(x)):a(x)}function v(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||x,e.check(Rc,l.interrupt?a:y,e.attempt(vz,b,g))}function y(x){return l.containerState.initialBlankLine=!0,c++,b(x)}function g(x){return it(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):a(x)}function b(x){return l.containerState.size=c+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(x)}}function xz(e,i,a){const l=this;return l.containerState._closeFlow=void 0,e.check(Rc,s,c);function s(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,ft(e,i,"listItemIndent",l.containerState.size+1)(f)}function c(f){return l.containerState.furtherBlankLines||!it(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,d(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(yz,i,d)(f))}function d(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,ft(e,e.attempt(si,i,a),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function jz(e,i,a){const l=this;return ft(e,s,"listItemIndent",l.containerState.size+1);function s(c){const d=l.events[l.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===l.containerState.size?i(c):a(c)}}function wz(e){e.exit(this.containerState.type)}function Sz(e,i,a){const l=this;return ft(e,s,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(c){const d=l.events[l.events.length-1];return!it(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):a(c)}}const y1={name:"setextUnderline",resolveTo:kz,tokenize:Cz};function kz(e,i){let a=e.length,l,s,c;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){l=a;break}e[a][1].type==="paragraph"&&(s=a)}else e[a][1].type==="content"&&e.splice(a,1),!c&&e[a][1].type==="definition"&&(c=a);const d={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",c?(e.splice(s,0,["enter",d,i]),e.splice(c+1,0,["exit",e[l][1],i]),e[l][1].end={...e[c][1].end}):e[l][1]=d,e.push(["exit",d,i]),e}function Cz(e,i,a){const l=this;let s;return c;function c(v){let y=l.events.length,g;for(;y--;)if(l.events[y][1].type!=="lineEnding"&&l.events[y][1].type!=="linePrefix"&&l.events[y][1].type!=="content"){g=l.events[y][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||g)?(e.enter("setextHeadingLine"),s=v,d(v)):a(v)}function d(v){return e.enter("setextHeadingLineSequence"),f(v)}function f(v){return v===s?(e.consume(v),f):(e.exit("setextHeadingLineSequence"),it(v)?ft(e,m,"lineSuffix")(v):m(v))}function m(v){return v===null||He(v)?(e.exit("setextHeadingLine"),i(v)):a(v)}}const Ez={tokenize:Nz};function Nz(e){const i=this,a=e.attempt(Rc,l,e.attempt(this.parser.constructs.flowInitial,s,ft(e,e.attempt(this.parser.constructs.flow,s,e.attempt(RD,s)),"linePrefix")));return a;function l(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function s(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const Tz={resolveAll:uk()},Az=ck("string"),Mz=ck("text");function ck(e){return{resolveAll:uk(e==="text"?Oz:void 0),tokenize:i};function i(a){const l=this,s=this.parser.constructs[e],c=a.attempt(s,d,f);return d;function d(y){return v(y)?c(y):f(y)}function f(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),m}function m(y){return v(y)?(a.exit("data"),c(y)):(a.consume(y),m)}function v(y){if(y===null)return!0;const g=s[y];let b=-1;if(g)for(;++b<g.length;){const x=g[b];if(!x.previous||x.previous.call(l,l.previous))return!0}return!1}}}function uk(e){return i;function i(a,l){let s=-1,c;for(;++s<=a.length;)c===void 0?a[s]&&a[s][1].type==="data"&&(c=s,s++):(!a[s]||a[s][1].type!=="data")&&(s!==c+2&&(a[c][1].end=a[s-1][1].end,a.splice(c+2,s-c-2),s=c+2),c=void 0);return e?e(a,l):a}}function Oz(e,i){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const l=e[a-1][1],s=i.sliceStream(l);let c=s.length,d=-1,f=0,m;for(;c--;){const v=s[c];if(typeof v=="string"){for(d=v.length;v.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(v===-2)m=!0,f++;else if(v!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(f=0),f){const v={type:a===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:l.start._bufferIndex+d,_index:l.start._index+c,line:l.end.line,column:l.end.column-f,offset:l.end.offset-f},end:{...l.end}};l.end={...v.start},l.start.offset===l.end.offset?Object.assign(l,v):(e.splice(a,0,["enter",v,i],["exit",v,i]),a+=2)}a++}return e}const Rz={42:si,43:si,45:si,48:si,49:si,50:si,51:si,52:si,53:si,54:si,55:si,56:si,57:si,62:nk},_z={91:ID},Dz={[-2]:Km,[-1]:Km,32:Km},zz={35:FD,42:kd,45:[y1,kd],60:GD,61:y1,95:kd,96:g1,126:g1},Lz={38:ak,92:ik},Iz={[-5]:Zm,[-4]:Zm,[-3]:Zm,33:dz,38:ak,42:Zp,60:[hD,ez],91:hz,92:[UD,ik],93:Wg,95:Zp,96:ED},Bz={null:[Zp,Tz]},Pz={null:[42,95]},Hz={null:[]},Uz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Pz,contentInitial:_z,disable:Hz,document:Rz,flow:zz,flowInitial:Dz,insideSpan:Bz,string:Lz,text:Iz},Symbol.toStringTag,{value:"Module"}));function qz(e,i,a){let l={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const s={},c=[];let d=[],f=[];const m={attempt:B(I),check:B(D),consume:M,enter:T,exit:A,interrupt:B(D,{interrupt:!0})},v={code:null,containerState:{},defineSkip:S,events:[],now:w,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:g};let y=i.tokenize.call(v,m);return i.resolveAll&&c.push(i),v;function g(Y){return d=Ui(d,Y),C(),d[d.length-1]!==null?[]:(P(i,0),v.events=rf(c,v.events,v),v.events)}function b(Y,q){return Vz(x(Y),q)}function x(Y){return Fz(d,Y)}function w(){const{_bufferIndex:Y,_index:q,line:W,column:Q,offset:U}=l;return{_bufferIndex:Y,_index:q,line:W,column:Q,offset:U}}function S(Y){s[Y.line]=Y.column,z()}function C(){let Y;for(;l._index<d.length;){const q=d[l._index];if(typeof q=="string")for(Y=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===Y&&l._bufferIndex<q.length;)N(q.charCodeAt(l._bufferIndex));else N(q)}}function N(Y){y=y(Y)}function M(Y){He(Y)?(l.line++,l.column=1,l.offset+=Y===-3?2:1,z()):Y!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===d[l._index].length&&(l._bufferIndex=-1,l._index++)),v.previous=Y}function T(Y,q){const W=q||{};return W.type=Y,W.start=w(),v.events.push(["enter",W,v]),f.push(W),W}function A(Y){const q=f.pop();return q.end=w(),v.events.push(["exit",q,v]),q}function I(Y,q){P(Y,q.from)}function D(Y,q){q.restore()}function B(Y,q){return W;function W(Q,U,X){let O,F,ne,_;return Array.isArray(Q)?ee(Q):"tokenize"in Q?ee([Q]):J(Q);function J(ye){return xe;function xe(re){const be=re!==null&&ye[re],oe=re!==null&&ye.null,ce=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(oe)?oe:oe?[oe]:[]];return ee(ce)(re)}}function ee(ye){return O=ye,F=0,ye.length===0?X:H(ye[F])}function H(ye){return xe;function xe(re){return _=V(),ne=ye,ye.partial||(v.currentConstruct=ye),ye.name&&v.parser.constructs.disable.null.includes(ye.name)?fe():ye.tokenize.call(q?Object.assign(Object.create(v),q):v,m,$,fe)(re)}}function $(ye){return Y(ne,_),U}function fe(ye){return _.restore(),++F<O.length?H(O[F]):X}}}function P(Y,q){Y.resolveAll&&!c.includes(Y)&&c.push(Y),Y.resolve&&Mi(v.events,q,v.events.length-q,Y.resolve(v.events.slice(q),v)),Y.resolveTo&&(v.events=Y.resolveTo(v.events,v))}function V(){const Y=w(),q=v.previous,W=v.currentConstruct,Q=v.events.length,U=Array.from(f);return{from:Q,restore:X};function X(){l=Y,v.previous=q,v.currentConstruct=W,v.events.length=Q,f=U,z()}}function z(){l.line in s&&l.column<2&&(l.column=s[l.line],l.offset+=s[l.line]-1)}}function Fz(e,i){const a=i.start._index,l=i.start._bufferIndex,s=i.end._index,c=i.end._bufferIndex;let d;if(a===s)d=[e[a].slice(l,c)];else{if(d=e.slice(a,s),l>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(l):d.shift()}c>0&&d.push(e[s].slice(0,c))}return d}function Vz(e,i){let a=-1;const l=[];let s;for(;++a<e.length;){const c=e[a];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
486
- `;break}case-3:{d=`\r
487
- `;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&s)continue;d=" ";break}default:d=String.fromCharCode(c)}s=c===-2,l.push(d)}return l.join("")}function $z(e){const l={constructs:ek([Uz,...(e||{}).extensions||[]]),content:s(lD),defined:[],document:s(sD),flow:s(Ez),lazy:{},string:s(Az),text:s(Mz)};return l;function s(c){return d;function d(f){return qz(l,c,f)}}}function Yz(e){for(;!rk(e););return e}const b1=/[\0\t\n\r]/g;function Gz(){let e=1,i="",a=!0,l;return s;function s(c,d,f){const m=[];let v,y,g,b,x;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),g=0,i="",a&&(c.charCodeAt(0)===65279&&g++,a=void 0);g<c.length;){if(b1.lastIndex=g,v=b1.exec(c),b=v&&v.index!==void 0?v.index:c.length,x=c.charCodeAt(b),!v){i=c.slice(g);break}if(x===10&&g===b&&l)m.push(-3),l=void 0;else switch(l&&(m.push(-5),l=void 0),g<b&&(m.push(c.slice(g,b)),e+=b-g),x){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:l=!0,e=1}g=b+1}return f&&(l&&m.push(-5),i&&m.push(i),m.push(null)),m}}const Xz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qz(e){return e.replace(Xz,Kz)}function Kz(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const s=a.charCodeAt(1),c=s===120||s===88;return tk(a.slice(c?2:1),c?16:10)}return Jg(a)||e}const dk={}.hasOwnProperty;function Zz(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),Jz(a)(Yz($z(a).document().write(Gz()(e,i,!0))))}function Jz(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(At),autolinkProtocol:V,autolinkEmail:V,atxHeading:c(Fe),blockQuote:c(oe),characterEscape:V,characterReference:V,codeFenced:c(ce),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(ce,d),codeText:c(me,d),codeTextData:V,data:V,codeFlowValue:V,definition:c(Ee),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(ze),hardBreakEscape:c(ht),hardBreakTrailing:c(ht),htmlFlow:c(ot,d),htmlFlowData:V,htmlText:c(ot,d),htmlTextData:V,image:c(Je),label:d,link:c(At),listItem:c(vn),listItemValue:b,listOrdered:c(gn,g),listUnordered:c(gn),paragraph:c(Hn),reference:H,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Fe),strong:c(di),thematicBreak:c(Yi)},exit:{atxHeading:m(),atxHeadingSequence:I,autolink:m(),autolinkEmail:be,autolinkProtocol:re,blockQuote:m(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ye,characterReference:xe,codeFenced:m(C),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:w,codeFlowValue:z,codeIndented:m(N),codeText:m(U),codeTextData:z,data:z,definition:m(),definitionDestinationString:A,definitionLabelString:M,definitionTitleString:T,emphasis:m(),hardBreakEscape:m(q),hardBreakTrailing:m(q),htmlFlow:m(W),htmlFlowData:z,htmlText:m(Q),htmlTextData:z,image:m(O),label:ne,labelText:F,lineEnding:Y,link:m(X),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:$,resourceDestinationString:_,resourceTitleString:J,resource:ee,setextHeading:m(P),setextHeadingLineSequence:B,setextHeadingText:D,strong:m(),thematicBreak:m()}};fk(i,(e||{}).mdastExtensions||[]);const a={};return l;function l(pe){let ke={type:"root",children:[]};const Be={stack:[ke],tokenStack:[],config:i,enter:f,exit:v,buffer:d,resume:y,data:a},Ue=[];let We=-1;for(;++We<pe.length;)if(pe[We][1].type==="listOrdered"||pe[We][1].type==="listUnordered")if(pe[We][0]==="enter")Ue.push(We);else{const Ht=Ue.pop();We=s(pe,Ht,We)}for(We=-1;++We<pe.length;){const Ht=i[pe[We][0]];dk.call(Ht,pe[We][1].type)&&Ht[pe[We][1].type].call(Object.assign({sliceSerialize:pe[We][2].sliceSerialize},Be),pe[We][1])}if(Be.tokenStack.length>0){const Ht=Be.tokenStack[Be.tokenStack.length-1];(Ht[1]||x1).call(Be,void 0,Ht[0])}for(ke.position={start:Qr(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Qr(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We<i.transforms.length;)ke=i.transforms[We](ke)||ke;return ke}function s(pe,ke,Be){let Ue=ke-1,We=-1,Ht=!1,yn,Ut,On,Un;for(;++Ue<=Be;){const Rt=pe[Ue];switch(Rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Rt[0]==="enter"?We++:We--,Un=void 0;break}case"lineEndingBlank":{Rt[0]==="enter"&&(yn&&!Un&&!We&&!On&&(On=Ue),Un=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Un=void 0}if(!We&&Rt[0]==="enter"&&Rt[1].type==="listItemPrefix"||We===-1&&Rt[0]==="exit"&&(Rt[1].type==="listUnordered"||Rt[1].type==="listOrdered")){if(yn){let Rn=Ue;for(Ut=void 0;Rn--;){const Xe=pe[Rn];if(Xe[1].type==="lineEnding"||Xe[1].type==="lineEndingBlank"){if(Xe[0]==="exit")continue;Ut&&(pe[Ut][1].type="lineEndingBlank",Ht=!0),Xe[1].type="lineEnding",Ut=Rn}else if(!(Xe[1].type==="linePrefix"||Xe[1].type==="blockQuotePrefix"||Xe[1].type==="blockQuotePrefixWhitespace"||Xe[1].type==="blockQuoteMarker"||Xe[1].type==="listItemIndent"))break}On&&(!Ut||On<Ut)&&(yn._spread=!0),yn.end=Object.assign({},Ut?pe[Ut][1].start:Rt[1].end),pe.splice(Ut||Ue,0,["exit",yn,Rt[2]]),Ue++,Be++}if(Rt[1].type==="listItemPrefix"){const Rn={type:"listItem",_spread:!1,start:Object.assign({},Rt[1].start),end:void 0};yn=Rn,pe.splice(Ue,0,["enter",Rn,Rt[2]]),Ue++,Be++,On=void 0,Un=!0}}}return pe[ke][1]._spread=Ht,Be}function c(pe,ke){return Be;function Be(Ue){f.call(this,pe(Ue),Ue),ke&&ke.call(this,Ue)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(pe,ke,Be){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([ke,Be||void 0]),pe.position={start:Qr(ke.start),end:void 0}}function m(pe){return ke;function ke(Be){pe&&pe.call(this,Be),v.call(this,Be)}}function v(pe,ke){const Be=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==pe.type&&(ke?ke.call(this,pe,Ue[0]):(Ue[1]||x1).call(this,pe,Ue[0]));else throw new Error("Cannot close `"+pe.type+"` ("+uc({start:pe.start,end:pe.end})+"): it’s not open");Be.position.end=Qr(pe.end)}function y(){return Zg(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(pe){if(this.data.expectingFirstListItemValue){const ke=this.stack[this.stack.length-2];ke.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function x(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.lang=pe}function w(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.meta=pe}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe.replace(/(\r?\n|\r)$/g,"")}function M(pe){const ke=this.resume(),Be=this.stack[this.stack.length-1];Be.label=ke,Be.identifier=aa(this.sliceSerialize(pe)).toLowerCase()}function T(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.title=pe}function A(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.url=pe}function I(pe){const ke=this.stack[this.stack.length-1];if(!ke.depth){const Be=this.sliceSerialize(pe).length;ke.depth=Be}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function B(pe){const ke=this.stack[this.stack.length-1];ke.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function V(pe){const Be=this.stack[this.stack.length-1].children;let Ue=Be[Be.length-1];(!Ue||Ue.type!=="text")&&(Ue=an(),Ue.position={start:Qr(pe.start),end:void 0},Be.push(Ue)),this.stack.push(Ue)}function z(pe){const ke=this.stack.pop();ke.value+=this.sliceSerialize(pe),ke.position.end=Qr(pe.end)}function Y(pe){const ke=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Be=ke.children[ke.children.length-1];Be.position.end=Qr(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ke.type)&&(V.call(this,pe),z.call(this,pe))}function q(){this.data.atHardBreak=!0}function W(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe}function Q(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe}function U(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=pe}function X(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=ke,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function O(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=ke,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function F(pe){const ke=this.sliceSerialize(pe),Be=this.stack[this.stack.length-2];Be.label=Qz(ke),Be.identifier=aa(ke).toLowerCase()}function ne(){const pe=this.stack[this.stack.length-1],ke=this.resume(),Be=this.stack[this.stack.length-1];if(this.data.inReference=!0,Be.type==="link"){const Ue=pe.children;Be.children=Ue}else Be.alt=ke}function _(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.url=pe}function J(){const pe=this.resume(),ke=this.stack[this.stack.length-1];ke.title=pe}function ee(){this.data.inReference=void 0}function H(){this.data.referenceType="collapsed"}function $(pe){const ke=this.resume(),Be=this.stack[this.stack.length-1];Be.label=ke,Be.identifier=aa(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function fe(pe){this.data.characterReferenceType=pe.type}function ye(pe){const ke=this.sliceSerialize(pe),Be=this.data.characterReferenceType;let Ue;Be?(Ue=tk(ke,Be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=Jg(ke);const We=this.stack[this.stack.length-1];We.value+=Ue}function xe(pe){const ke=this.stack.pop();ke.position.end=Qr(pe.end)}function re(pe){z.call(this,pe);const ke=this.stack[this.stack.length-1];ke.url=this.sliceSerialize(pe)}function be(pe){z.call(this,pe);const ke=this.stack[this.stack.length-1];ke.url="mailto:"+this.sliceSerialize(pe)}function oe(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function me(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function ht(){return{type:"break"}}function ot(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function At(){return{type:"link",title:null,url:"",children:[]}}function gn(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function vn(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function Hn(){return{type:"paragraph",children:[]}}function di(){return{type:"strong",children:[]}}function an(){return{type:"text",value:""}}function Yi(){return{type:"thematicBreak"}}}function Qr(e){return{line:e.line,column:e.column,offset:e.offset}}function fk(e,i){let a=-1;for(;++a<i.length;){const l=i[a];Array.isArray(l)?fk(e,l):Wz(e,l)}}function Wz(e,i){let a;for(a in i)if(dk.call(i,a))switch(a){case"canContainEols":{const l=i[a];l&&e[a].push(...l);break}case"transforms":{const l=i[a];l&&e[a].push(...l);break}case"enter":case"exit":{const l=i[a];l&&Object.assign(e[a],l);break}}}function x1(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+uc({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+uc({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+uc({start:i.start,end:i.end})+") is still open")}function e6(e){const i=this;i.parser=a;function a(l){return Zz(l,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function t6(e,i){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,a),e.applyData(i,a)}function n6(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
488
- `}]}function i6(e,i){const a=i.value?i.value+`
489
- `:"",l={},s=i.lang?i.lang.split(/\s+/):[];s.length>0&&(l.className=["language-"+s[0]]);let c={type:"element",tagName:"code",properties:l,children:[{type:"text",value:a}]};return i.meta&&(c.data={meta:i.meta}),e.patch(i,c),c=e.applyData(i,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(i,c),c}function a6(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function r6(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function l6(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(i.identifier).toUpperCase(),s=us(l.toLowerCase()),c=e.footnoteOrder.indexOf(l);let d,f=e.footnoteCounts.get(l);f===void 0?(f=0,e.footnoteOrder.push(l),d=e.footnoteOrder.length):d=c+1,f+=1,e.footnoteCounts.set(l,f);const m={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,m);const v={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(i,v),e.applyData(i,v)}function o6(e,i){const a={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function s6(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function hk(e,i){const a=i.referenceType;let l="]";if(a==="collapsed"?l+="[]":a==="full"&&(l+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+l}];const s=e.all(i),c=s[0];c&&c.type==="text"?c.value="["+c.value:s.unshift({type:"text",value:"["});const d=s[s.length-1];return d&&d.type==="text"?d.value+=l:s.push({type:"text",value:l}),s}function c6(e,i){const a=String(i.identifier).toUpperCase(),l=e.definitionById.get(a);if(!l)return hk(e,i);const s={src:us(l.url||""),alt:i.alt};l.title!==null&&l.title!==void 0&&(s.title=l.title);const c={type:"element",tagName:"img",properties:s,children:[]};return e.patch(i,c),e.applyData(i,c)}function u6(e,i){const a={src:us(i.url)};i.alt!==null&&i.alt!==void 0&&(a.alt=i.alt),i.title!==null&&i.title!==void 0&&(a.title=i.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(i,l),e.applyData(i,l)}function d6(e,i){const a={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,a);const l={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(i,l),e.applyData(i,l)}function f6(e,i){const a=String(i.identifier).toUpperCase(),l=e.definitionById.get(a);if(!l)return hk(e,i);const s={href:us(l.url||"")};l.title!==null&&l.title!==void 0&&(s.title=l.title);const c={type:"element",tagName:"a",properties:s,children:e.all(i)};return e.patch(i,c),e.applyData(i,c)}function h6(e,i){const a={href:us(i.url)};i.title!==null&&i.title!==void 0&&(a.title=i.title);const l={type:"element",tagName:"a",properties:a,children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function m6(e,i,a){const l=e.all(i),s=a?p6(a):mk(i),c={},d=[];if(typeof i.checked=="boolean"){const y=l[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},l.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const y=l[f];(s||f!==0||y.type!=="element"||y.tagName!=="p")&&d.push({type:"text",value:`
490
- `}),y.type==="element"&&y.tagName==="p"&&!s?d.push(...y.children):d.push(y)}const m=l[l.length-1];m&&(s||m.type!=="element"||m.tagName!=="p")&&d.push({type:"text",value:`
491
- `});const v={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,v),e.applyData(i,v)}function p6(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const a=e.children;let l=-1;for(;!i&&++l<a.length;)i=mk(a[l])}return i}function mk(e){const i=e.spread;return i??e.children.length>1}function g6(e,i){const a={},l=e.all(i);let s=-1;for(typeof i.start=="number"&&i.start!==1&&(a.start=i.start);++s<l.length;){const d=l[s];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:a,children:e.wrap(l,!0)};return e.patch(i,c),e.applyData(i,c)}function v6(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function y6(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function b6(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function x6(e,i){const a=e.all(i),l=a.shift(),s=[];if(l){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(i.children[0],d),s.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=Gg(i.children[1]),m=GS(i.children[i.children.length-1]);f&&m&&(d.position={start:f,end:m}),s.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(i,c),e.applyData(i,c)}function j6(e,i,a){const l=a?a.children:void 0,c=(l?l.indexOf(i):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,f=d?d.length:i.children.length;let m=-1;const v=[];for(;++m<f;){const g=i.children[m],b={},x=d?d[m]:void 0;x&&(b.align=x);let w={type:"element",tagName:c,properties:b,children:[]};g&&(w.children=e.all(g),e.patch(g,w),w=e.applyData(g,w)),v.push(w)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(v,!0)};return e.patch(i,y),e.applyData(i,y)}function w6(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const j1=9,w1=32;function S6(e){const i=String(e),a=/\r?\n|\r/g;let l=a.exec(i),s=0;const c=[];for(;l;)c.push(S1(i.slice(s,l.index),s>0,!0),l[0]),s=l.index+l[0].length,l=a.exec(i);return c.push(S1(i.slice(s),s>0,!1)),c.join("")}function S1(e,i,a){let l=0,s=e.length;if(i){let c=e.codePointAt(l);for(;c===j1||c===w1;)l++,c=e.codePointAt(l)}if(a){let c=e.codePointAt(s-1);for(;c===j1||c===w1;)s--,c=e.codePointAt(s-1)}return s>l?e.slice(l,s):""}function k6(e,i){const a={type:"text",value:S6(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function C6(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const E6={blockquote:t6,break:n6,code:i6,delete:a6,emphasis:r6,footnoteReference:l6,heading:o6,html:s6,imageReference:c6,image:u6,inlineCode:d6,linkReference:f6,link:h6,listItem:m6,list:g6,paragraph:v6,root:y6,strong:b6,table:x6,tableCell:w6,tableRow:j6,text:k6,thematicBreak:C6,toml:cd,yaml:cd,definition:cd,footnoteDefinition:cd};function cd(){}const pk=-1,lf=0,fc=1,zd=2,ev=3,tv=4,nv=5,iv=6,gk=7,vk=8,{defineProperty:N6}=Object,yk=typeof self=="object"?self:globalThis,k1=(e,i)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new yk[e](i)},T6=(e,i)=>{const a=(s,c)=>(e.set(c,s),s),l=s=>{if(e.has(s))return e.get(s);const[c,d]=i[s];switch(c){case lf:case pk:return a(d,s);case fc:{const f=a([],s);for(const m of d)f.push(l(m));return f}case zd:{const f=a({},s);for(const[m,v]of d){const y=l(m),g=l(v);y==="__proto__"?N6(f,y,{value:g,configurable:!0,enumerable:!0,writable:!0}):f[y]=g}return f}case ev:return a(new Date(d),s);case tv:{const{source:f,flags:m}=d;return a(new RegExp(f,m),s)}case nv:{const f=a(new Map,s);for(const[m,v]of d)f.set(l(m),l(v));return f}case iv:{const f=a(new Set,s);for(const m of d)f.add(l(m));return f}case gk:{const{name:f,message:m}=d;return a(typeof yk[f]=="function"?k1(f,m):new Error(m),s)}case vk:return a(BigInt(d),s);case"BigInt":return a(Object(BigInt(d)),s);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return a(new DataView(f),d)}case"-0":return-0}return a(k1(c,d),s)};return l},C1=e=>T6(new Map,e)(0),Ul="",{toString:A6}={},{keys:M6,is:O6}=Object,sc=e=>{const i=typeof e;if(i!=="object"||!e)return[lf,i];const a=A6.call(e).slice(8,-1);switch(a){case"Array":return[fc,Ul];case"Object":return[zd,Ul];case"Date":return[ev,Ul];case"RegExp":return[tv,Ul];case"Map":return[nv,Ul];case"Set":return[iv,Ul];case"DataView":return[fc,a]}return a.includes("Array")?[fc,a]:e instanceof Error?[gk,e.name||"Error"]:[zd,a]},ud=([e,i])=>e===lf&&(i==="function"||i==="symbol"),R6=(e,i,a,l)=>{const s=(d,f)=>{const m=l.push(d)-1;return a.set(f,m),m},c=d=>{if(a.has(d))return a.get(d);let[f,m]=sc(d);switch(f){case lf:{let y=d;switch(m){case"bigint":f=vk,y=d.toString();break;case"number":if(!d&&O6(d,-0))return l.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return s([pk],d)}return s([f,y],d)}case fc:{if(m){let b=d;return m==="DataView"?b=new Uint8Array(d.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(d)),s([m,[...b]],d)}const y=[],g=s([f,y],d);for(const b of d)y.push(c(b));return g}case zd:{if(m)switch(m){case"BigInt":return s([m,d.toString()],d);case"Boolean":case"Number":case"String":return s([m,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const y=[],g=s([f,y],d);for(const b of M6(d))(e||!ud(sc(d[b])))&&y.push([c(b),c(d[b])]);return g}case ev:return s([f,isNaN(d.getTime())?Ul:d.toISOString()],d);case tv:{const{source:y,flags:g}=d;return s([f,{source:y,flags:g}],d)}case nv:{const y=[],g=s([f,y],d);for(const[b,x]of d)(e||!(ud(sc(b))||ud(sc(x))))&&y.push([c(b),c(x)]);return g}case iv:{const y=[],g=s([f,y],d);for(const b of d)(e||!ud(sc(b)))&&y.push(c(b));return g}}const{message:v}=d;return s([f,{name:m,message:v}],d)};return c},E1=(e,{json:i,lossy:a}={})=>{const l=[];return R6(!(i||a),!!i,new Map,l)(e),l},Ld=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?C1(E1(e,i)):structuredClone(e):(e,i)=>C1(E1(e,i));function _6(e,i){const a=[{type:"text",value:"↩"}];return i>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),a}function D6(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function z6(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||_6,l=e.options.footnoteBackLabel||D6,s=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const v=e.footnoteById.get(e.footnoteOrder[m]);if(!v)continue;const y=e.all(v),g=String(v.identifier).toUpperCase(),b=us(g.toLowerCase());let x=0;const w=[],S=e.footnoteCounts.get(g);for(;S!==void 0&&++x<=S;){w.length>0&&w.push({type:"text",value:" "});let M=typeof a=="string"?a:a(m,x);typeof M=="string"&&(M={type:"text",value:M}),w.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+b+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(m,x),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const C=y[y.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const M=C.children[C.children.length-1];M&&M.type==="text"?M.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...w)}else y.push(...w);const N={type:"element",tagName:"li",properties:{id:i+"fn-"+b},children:e.wrap(y,!0)};e.patch(v,N),f.push(N)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Ld(d),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
492
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
493
- `}]}}const of=(function(e){if(e==null)return P6;if(typeof e=="function")return sf(e);if(typeof e=="object")return Array.isArray(e)?L6(e):I6(e);if(typeof e=="string")return B6(e);throw new Error("Expected function, string, or object as test")});function L6(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=of(e[a]);return sf(l);function l(...s){let c=-1;for(;++c<i.length;)if(i[c].apply(this,s))return!0;return!1}}function I6(e){const i=e;return sf(a);function a(l){const s=l;let c;for(c in e)if(s[c]!==i[c])return!1;return!0}}function B6(e){return sf(i);function i(a){return a&&a.type===e}}function sf(e){return i;function i(a,l,s){return!!(H6(a)&&e.call(this,a,typeof l=="number"?l:void 0,s||void 0))}}function P6(){return!0}function H6(e){return e!==null&&typeof e=="object"&&"type"in e}const bk=[],U6=!0,Jp=!1,q6="skip";function xk(e,i,a,l){let s;typeof i=="function"&&typeof a!="function"?(l=a,a=i):s=i;const c=of(s),d=l?-1:1;f(e,void 0,[])();function f(m,v,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const x=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=bk,w,S,C;if((!i||c(m,v,y[y.length-1]||void 0))&&(x=F6(a(m,y)),x[0]===Jp))return x;if("children"in m&&m.children){const N=m;if(N.children&&x[0]!==q6)for(S=(l?N.children.length:-1)+d,C=y.concat(N);S>-1&&S<N.children.length;){const M=N.children[S];if(w=f(M,S,C)(),w[0]===Jp)return w;S=typeof w[1]=="number"?w[1]:S+d}}return x}}}function F6(e){return Array.isArray(e)?e:typeof e=="number"?[U6,e]:e==null?bk:[e]}function av(e,i,a,l){let s,c,d;typeof i=="function"&&typeof a!="function"?(c=void 0,d=i,s=a):(c=i,d=a,s=l),xk(e,c,f,s);function f(m,v){const y=v[v.length-1],g=y?y.children.indexOf(m):void 0;return d(m,g,y)}}const Wp={}.hasOwnProperty,V6={};function $6(e,i){const a=i||V6,l=new Map,s=new Map,c=new Map,d={...E6,...a.handlers},f={all:v,applyData:G6,definitionById:l,footnoteById:s,footnoteCounts:c,footnoteOrder:[],handlers:d,one:m,options:a,patch:Y6,wrap:Q6};return av(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?l:s,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),f;function m(y,g){const b=y.type,x=f.handlers[b];if(Wp.call(f.handlers,b)&&x)return x(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:S,...C}=y,N=Ld(C);return N.children=f.all(y),N}return Ld(y)}return(f.options.unknownHandler||X6)(f,y,g)}function v(y){const g=[];if("children"in y){const b=y.children;let x=-1;for(;++x<b.length;){const w=f.one(b[x],y);if(w){if(x&&b[x-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=N1(w.value)),!Array.isArray(w)&&w.type==="element")){const S=w.children[0];S&&S.type==="text"&&(S.value=N1(S.value))}Array.isArray(w)?g.push(...w):g.push(w)}}}return g}}function Y6(e,i){e.position&&(i.position=R3(e))}function G6(e,i){let a=i;if(e&&e.data){const l=e.data.hName,s=e.data.hChildren,c=e.data.hProperties;if(typeof l=="string")if(a.type==="element")a.tagName=l;else{const d="children"in a?a.children:[a];a={type:"element",tagName:l,properties:{},children:d}}a.type==="element"&&c&&Object.assign(a.properties,Ld(c)),"children"in a&&a.children&&s!==null&&s!==void 0&&(a.children=s)}return a}function X6(e,i){const a=i.data||{},l="value"in i&&!(Wp.call(a,"hProperties")||Wp.call(a,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function Q6(e,i){const a=[];let l=-1;for(i&&a.push({type:"text",value:`
494
- `});++l<e.length;)l&&a.push({type:"text",value:`
495
- `}),a.push(e[l]);return i&&e.length>0&&a.push({type:"text",value:`
496
- `}),a}function N1(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function T1(e,i){const a=$6(e,i),l=a.one(e,void 0),s=z6(a),c=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return s&&c.children.push({type:"text",value:`
497
- `},s),c}function K6(e,i){return e&&"run"in e?async function(a,l){const s=T1(a,{file:l,...i});await e.run(s,l)}:function(a,l){return T1(a,{file:l,...e||i})}}function A1(e){if(e)throw e}var Jm,M1;function Z6(){if(M1)return Jm;M1=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=function(v){return typeof Array.isArray=="function"?Array.isArray(v):i.call(v)==="[object Array]"},c=function(v){if(!v||i.call(v)!=="[object Object]")return!1;var y=e.call(v,"constructor"),g=v.constructor&&v.constructor.prototype&&e.call(v.constructor.prototype,"isPrototypeOf");if(v.constructor&&!y&&!g)return!1;var b;for(b in v);return typeof b>"u"||e.call(v,b)},d=function(v,y){a&&y.name==="__proto__"?a(v,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):v[y.name]=y.newValue},f=function(v,y){if(y==="__proto__")if(e.call(v,y)){if(l)return l(v,y).value}else return;return v[y]};return Jm=function m(){var v,y,g,b,x,w,S=arguments[0],C=1,N=arguments.length,M=!1;for(typeof S=="boolean"&&(M=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<N;++C)if(v=arguments[C],v!=null)for(y in v)g=f(S,y),b=f(v,y),S!==b&&(M&&b&&(c(b)||(x=s(b)))?(x?(x=!1,w=g&&s(g)?g:[]):w=g&&c(g)?g:{},d(S,{name:y,newValue:m(M,w,b)})):typeof b<"u"&&d(S,{name:y,newValue:b}));return S},Jm}var J6=Z6();const Wm=cg(J6);function eg(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function W6(){const e=[],i={run:a,use:l};return i;function a(...s){let c=-1;const d=s.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...s);function f(m,...v){const y=e[++c];let g=-1;if(m){d(m);return}for(;++g<s.length;)(v[g]===null||v[g]===void 0)&&(v[g]=s[g]);s=v,y?e5(y,f)(...v):d(null,...v)}}function l(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),i}}function e5(e,i){let a;return l;function l(...d){const f=e.length>d.length;let m;f&&d.push(s);try{m=e.apply(this,d)}catch(v){const y=v;if(f&&a)throw y;return s(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(c,s):m instanceof Error?s(m):c(m))}function s(d,...f){a||(a=!0,i(d,...f))}function c(d){s(null,d)}}const Ma={basename:t5,dirname:n5,extname:i5,join:a5,sep:"/"};function t5(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');_c(e);let a=0,l=-1,s=e.length,c;if(i===void 0||i.length===0||i.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(c){a=s+1;break}}else l<0&&(c=!0,l=s+1);return l<0?"":e.slice(a,l)}if(i===e)return"";let d=-1,f=i.length-1;for(;s--;)if(e.codePointAt(s)===47){if(c){a=s+1;break}}else d<0&&(c=!0,d=s+1),f>-1&&(e.codePointAt(s)===i.codePointAt(f--)?f<0&&(l=s):(f=-1,l=d));return a===l?l=d:l<0&&(l=e.length),e.slice(a,l)}function n5(e){if(_c(e),e.length===0)return".";let i=-1,a=e.length,l;for(;--a;)if(e.codePointAt(a)===47){if(l){i=a;break}}else l||(l=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function i5(e){_c(e);let i=e.length,a=-1,l=0,s=-1,c=0,d;for(;i--;){const f=e.codePointAt(i);if(f===47){if(d){l=i+1;break}continue}a<0&&(d=!0,a=i+1),f===46?s<0?s=i:c!==1&&(c=1):s>-1&&(c=-1)}return s<0||a<0||c===0||c===1&&s===a-1&&s===l+1?"":e.slice(s,a)}function a5(...e){let i=-1,a;for(;++i<e.length;)_c(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":r5(a)}function r5(e){_c(e);const i=e.codePointAt(0)===47;let a=l5(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function l5(e,i){let a="",l=0,s=-1,c=0,d=-1,f,m;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(s===d-1||c===1))if(s!==d-1&&c===2){if(a.length<2||l!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(m=a.lastIndexOf("/"),m!==a.length-1){m<0?(a="",l=0):(a=a.slice(0,m),l=a.length-1-a.lastIndexOf("/")),s=d,c=0;continue}}else if(a.length>0){a="",l=0,s=d,c=0;continue}}i&&(a=a.length>0?a+"/..":"..",l=2)}else a.length>0?a+="/"+e.slice(s+1,d):a=e.slice(s+1,d),l=d-s-1;s=d,c=0}else f===46&&c>-1?c++:c=-1}return a}function _c(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const o5={cwd:s5};function s5(){return"/"}function tg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function c5(e){if(typeof e=="string")e=new URL(e);else if(!tg(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return u5(e)}function u5(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const i=e.pathname;let a=-1;for(;++a<i.length;)if(i.codePointAt(a)===37&&i.codePointAt(a+1)===50){const l=i.codePointAt(a+2);if(l===70||l===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(i)}const ep=["history","path","basename","stem","extname","dirname"];class jk{constructor(i){let a;i?tg(i)?a={path:i}:typeof i=="string"||d5(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":o5.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<ep.length;){const c=ep[l];c in a&&a[c]!==void 0&&a[c]!==null&&(this[c]=c==="history"?[...a[c]]:a[c])}let s;for(s in a)ep.includes(s)||(this[s]=a[s])}get basename(){return typeof this.path=="string"?Ma.basename(this.path):void 0}set basename(i){np(i,"basename"),tp(i,"basename"),this.path=Ma.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ma.dirname(this.path):void 0}set dirname(i){O1(this.basename,"dirname"),this.path=Ma.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ma.extname(this.path):void 0}set extname(i){if(tp(i,"extname"),O1(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ma.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){tg(i)&&(i=c5(i)),np(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ma.basename(this.path,this.extname):void 0}set stem(i){np(i,"stem"),tp(i,"stem"),this.path=Ma.join(this.dirname||"",i+(this.extname||""))}fail(i,a,l){const s=this.message(i,a,l);throw s.fatal=!0,s}info(i,a,l){const s=this.message(i,a,l);return s.fatal=void 0,s}message(i,a,l){const s=new Pn(i,a,l);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function tp(e,i){if(e&&e.includes(Ma.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ma.sep+"`")}function np(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function O1(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function d5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const f5=(function(e){const l=this.constructor.prototype,s=l[e],c=function(){return s.apply(c,arguments)};return Object.setPrototypeOf(c,l),c}),h5={}.hasOwnProperty;class rv extends f5{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=W6()}copy(){const i=new rv;let a=-1;for(;++a<this.attachers.length;){const l=this.attachers[a];i.use(...l)}return i.data(Wm(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(rp("data",this.frozen),this.namespace[i]=a,this):h5.call(this.namespace,i)&&this.namespace[i]||void 0:i?(rp("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const s=a.call(i,...l);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const a=dd(i),l=this.parser||this.Parser;return ip("parse",l),l(String(a),a)}process(i,a){const l=this;return this.freeze(),ip("process",this.parser||this.Parser),ap("process",this.compiler||this.Compiler),a?s(void 0,a):new Promise(s);function s(c,d){const f=dd(i),m=l.parse(f);l.run(m,f,function(y,g,b){if(y||!g||!b)return v(y);const x=g,w=l.stringify(x,b);g5(w)?b.value=w:b.result=w,v(y,b)});function v(y,g){y||!g?d(y):c?c(g):a(void 0,g)}}}processSync(i){let a=!1,l;return this.freeze(),ip("processSync",this.parser||this.Parser),ap("processSync",this.compiler||this.Compiler),this.process(i,s),_1("processSync","process",a),l;function s(c,d){a=!0,A1(c),l=d}}run(i,a,l){R1(i),this.freeze();const s=this.transformers;return!l&&typeof a=="function"&&(l=a,a=void 0),l?c(void 0,l):new Promise(c);function c(d,f){const m=dd(a);s.run(i,m,v);function v(y,g,b){const x=g||i;y?f(y):d?d(x):l(void 0,x,b)}}}runSync(i,a){let l=!1,s;return this.run(i,a,c),_1("runSync","run",l),s;function c(d,f){A1(d),s=f,l=!0}}stringify(i,a){this.freeze();const l=dd(a),s=this.compiler||this.Compiler;return ap("stringify",s),R1(i),s(i,l)}use(i,...a){const l=this.attachers,s=this.namespace;if(rp("use",this.frozen),i!=null)if(typeof i=="function")m(i,a);else if(typeof i=="object")Array.isArray(i)?f(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(v){if(typeof v=="function")m(v,[]);else if(typeof v=="object")if(Array.isArray(v)){const[y,...g]=v;m(y,g)}else d(v);else throw new TypeError("Expected usable value, not `"+v+"`")}function d(v){if(!("plugins"in v)&&!("settings"in v))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(v.plugins),v.settings&&(s.settings=Wm(!0,s.settings,v.settings))}function f(v){let y=-1;if(v!=null)if(Array.isArray(v))for(;++y<v.length;){const g=v[y];c(g)}else throw new TypeError("Expected a list of plugins, not `"+v+"`")}function m(v,y){let g=-1,b=-1;for(;++g<l.length;)if(l[g][0]===v){b=g;break}if(b===-1)l.push([v,...y]);else if(y.length>0){let[x,...w]=y;const S=l[b][1];eg(S)&&eg(x)&&(x=Wm(!0,S,x)),l[b]=[v,x,...w]}}}}const m5=new rv().freeze();function ip(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ap(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function rp(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function R1(e){if(!eg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function _1(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function dd(e){return p5(e)?e:new jk(e)}function p5(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function g5(e){return typeof e=="string"||v5(e)}function v5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const y5="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",D1=[],z1={allowDangerousHtml:!0},b5=/^(https?|ircs?|mailto|xmpp)$/i,x5=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function j5(e){const i=w5(e),a=S5(e);return k5(i.runSync(i.parse(a),a),e)}function w5(e){const i=e.rehypePlugins||D1,a=e.remarkPlugins||D1,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...z1}:z1;return m5().use(e6).use(a).use(K6,l).use(i)}function S5(e){const i=e.children||"",a=new jk;return typeof i=="string"&&(a.value=i),a}function k5(e,i){const a=i.allowedElements,l=i.allowElement,s=i.components,c=i.disallowedElements,d=i.skipHtml,f=i.unwrapDisallowed,m=i.urlTransform||C5;for(const y of x5)Object.hasOwn(i,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+y5+y.id,void 0);return av(e,v),I3(e,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function v(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return d?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let x;for(x in Qm)if(Object.hasOwn(Qm,x)&&Object.hasOwn(y.properties,x)){const w=y.properties[x],S=Qm[x];(S===null||S.includes(y.tagName))&&(y.properties[x]=m(String(w||""),x,y))}}if(y.type==="element"){let x=a?!a.includes(y.tagName):c?c.includes(y.tagName):!1;if(!x&&l&&typeof g=="number"&&(x=!l(y,g,b)),x&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function C5(e){const i=e.indexOf(":"),a=e.indexOf("?"),l=e.indexOf("#"),s=e.indexOf("/");return i===-1||s!==-1&&i>s||a!==-1&&i>a||l!==-1&&i>l||b5.test(e.slice(0,i))?e:""}function E5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wk(e,i,a){const s=of((a||{}).ignore||[]),c=N5(i);let d=-1;for(;++d<c.length;)xk(e,"text",f);function f(v,y){let g=-1,b;for(;++g<y.length;){const x=y[g],w=b?b.children:void 0;if(s(x,w?w.indexOf(x):void 0,b))return;b=x}if(b)return m(v,y)}function m(v,y){const g=y[y.length-1],b=c[d][0],x=c[d][1];let w=0;const C=g.children.indexOf(v);let N=!1,M=[];b.lastIndex=0;let T=b.exec(v.value);for(;T;){const A=T.index,I={index:T.index,input:T.input,stack:[...y,v]};let D=x(...T,I);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?b.lastIndex=A+1:(w!==A&&M.push({type:"text",value:v.value.slice(w,A)}),Array.isArray(D)?M.push(...D):D&&M.push(D),w=A+T[0].length,N=!0),!b.global)break;T=b.exec(v.value)}return N?(w<v.value.length&&M.push({type:"text",value:v.value.slice(w)}),g.children.splice(C,1,...M)):M=[v],C+M.length}}function N5(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<a.length;){const s=a[l];i.push([T5(s[0]),A5(s[1])])}return i}function T5(e){return typeof e=="string"?new RegExp(E5(e),"g"):e}function A5(e){return typeof e=="function"?e:function(){return e}}function M5(e){wk(e,[/\r?\n|\r/g,O5])}function O5(){return{type:"break"}}function R5(){return function(e){M5(e)}}const _5=/[\u3000-\u303f\uff00-\uffef\u2014\u2018-\u201f\u2026]/,D5=/https?:\/\/[^\s<\u3000-\u303f\uff00-\uffef\u2014\u2018-\u201f\u2026]+/g;function z5(e){var l;const i=((l=e.children)==null?void 0:l.length)===1?e.children[0]:void 0;if((i==null?void 0:i.type)!=="text"||!i.value)return;const a=i.value;return e.url===a||e.url===`http://${a}`||e.url===`mailto:${a}`?a:void 0}function Sk(e,i){return{type:"link",url:e,children:[{type:"text",value:i}]}}function L5(e){const i=[];let a=0;for(const l of e.matchAll(D5))l.index>a&&i.push({type:"text",value:e.slice(a,l.index)}),i.push(Sk(l[0],l[0])),a=l.index+l[0].length;return a<e.length&&i.push({type:"text",value:e.slice(a)}),i}function kk(e){const i=e.children;if(i)for(let a=0;a<i.length;a++){const l=i[a];if(l.type!=="link"){kk(l);continue}const s=z5(l),c=s===void 0?-1:s.search(_5);if(s===void 0||c<=0)continue;const d=s.slice(0,c),f=l.url.slice(0,l.url.length-s.length),m=L5(s.slice(c));i.splice(a,1,Sk(f+d,d),...m),a+=m.length}}function I5(){return e=>kk(e)}function L1(e,i){const a=String(e);if(typeof i!="string")throw new TypeError("Expected character");let l=0,s=a.indexOf(i);for(;s!==-1;)l++,s=a.indexOf(i,s+i.length);return l}const lp="phrasing",op=["autolink","link","image","label"];function B5(){return{transforms:[$5],enter:{literalAutolink:H5,literalAutolinkEmail:sp,literalAutolinkHttp:sp,literalAutolinkWww:sp},exit:{literalAutolink:V5,literalAutolinkEmail:F5,literalAutolinkHttp:U5,literalAutolinkWww:q5}}}function P5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:lp,notInConstruct:op},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:lp,notInConstruct:op},{character:":",before:"[ps]",after:"\\/",inConstruct:lp,notInConstruct:op}]}}function H5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function sp(e){this.config.enter.autolinkProtocol.call(this,e)}function U5(e){this.config.exit.autolinkProtocol.call(this,e)}function q5(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function F5(e){this.config.exit.autolinkEmail.call(this,e)}function V5(e){this.exit(e)}function $5(e){wk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Y5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),G5]],{ignore:["link","linkReference"]})}function Y5(e,i,a,l,s){let c="";if(!Ck(s)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!X5(a)))return!1;const d=Q5(a+l);if(!d[0])return!1;const f={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function G5(e,i,a,l){return!Ck(l,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function X5(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function Q5(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let a=i[0],l=a.indexOf(")");const s=L1(e,"(");let c=L1(e,")");for(;l!==-1&&s>c;)e+=a.slice(0,l+1),a=a.slice(l+1),l=a.indexOf(")"),c++;return[e,a]}function Ck(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Kl(a)||af(a))&&(!i||a!==47)}Ek.peek=aL;function K5(){this.buffer()}function Z5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function J5(){this.buffer()}function W5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function eL(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=aa(this.sliceSerialize(e)).toLowerCase(),a.label=i}function tL(e){this.exit(e)}function nL(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=aa(this.sliceSerialize(e)).toLowerCase(),a.label=i}function iL(e){this.exit(e)}function aL(){return"["}function Ek(e,i,a,l){const s=a.createTracker(l);let c=s.move("[^");const d=a.enter("footnoteReference"),f=a.enter("reference");return c+=s.move(a.safe(a.associationId(e),{after:"]",before:c})),f(),d(),c+=s.move("]"),c}function rL(){return{enter:{gfmFootnoteCallString:K5,gfmFootnoteCall:Z5,gfmFootnoteDefinitionLabelString:J5,gfmFootnoteDefinition:W5},exit:{gfmFootnoteCallString:eL,gfmFootnoteCall:tL,gfmFootnoteDefinitionLabelString:nL,gfmFootnoteDefinition:iL}}}function lL(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:Ek},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(l,s,c,d){const f=c.createTracker(d);let m=f.move("[^");const v=c.enter("footnoteDefinition"),y=c.enter("label");return m+=f.move(c.safe(c.associationId(l),{before:m,after:"]"})),y(),m+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),m+=f.move((i?`
498
- `:" ")+c.indentLines(c.containerFlow(l,f.current()),i?Nk:oL))),v(),m}}function oL(e,i,a){return i===0?e:Nk(e,i,a)}function Nk(e,i,a){return(a?"":" ")+e}const sL=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Tk.peek=hL;function cL(){return{canContainEols:["delete"],enter:{strikethrough:dL},exit:{strikethrough:fL}}}function uL(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:sL}],handlers:{delete:Tk}}}function dL(e){this.enter({type:"delete",children:[]},e)}function fL(e){this.exit(e)}function Tk(e,i,a,l){const s=a.createTracker(l),c=a.enter("strikethrough");let d=s.move("~~");return d+=a.containerPhrasing(e,{...s.current(),before:d,after:"~"}),d+=s.move("~~"),c(),d}function hL(){return"~"}function mL(e){return e.length}function pL(e,i){const a=i||{},l=(a.align||[]).concat(),s=a.stringLength||mL,c=[],d=[],f=[],m=[];let v=0,y=-1;for(;++y<e.length;){const S=[],C=[];let N=-1;for(e[y].length>v&&(v=e[y].length);++N<e[y].length;){const M=gL(e[y][N]);if(a.alignDelimiters!==!1){const T=s(M);C[N]=T,(m[N]===void 0||T>m[N])&&(m[N]=T)}S.push(M)}d[y]=S,f[y]=C}let g=-1;if(typeof l=="object"&&"length"in l)for(;++g<v;)c[g]=I1(l[g]);else{const S=I1(l);for(;++g<v;)c[g]=S}g=-1;const b=[],x=[];for(;++g<v;){const S=c[g];let C="",N="";S===99?(C=":",N=":"):S===108?C=":":S===114&&(N=":");let M=a.alignDelimiters===!1?1:Math.max(1,m[g]-C.length-N.length);const T=C+"-".repeat(M)+N;a.alignDelimiters!==!1&&(M=C.length+M+N.length,M>m[g]&&(m[g]=M),x[g]=M),b[g]=T}d.splice(1,0,b),f.splice(1,0,x),y=-1;const w=[];for(;++y<d.length;){const S=d[y],C=f[y];g=-1;const N=[];for(;++g<v;){const M=S[g]||"";let T="",A="";if(a.alignDelimiters!==!1){const I=m[g]-(C[g]||0),D=c[g];D===114?T=" ".repeat(I):D===99?I%2?(T=" ".repeat(I/2+.5),A=" ".repeat(I/2-.5)):(T=" ".repeat(I/2),A=T):A=" ".repeat(I)}a.delimiterStart!==!1&&!g&&N.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&M==="")&&(a.delimiterStart!==!1||g)&&N.push(" "),a.alignDelimiters!==!1&&N.push(T),N.push(M),a.alignDelimiters!==!1&&N.push(A),a.padding!==!1&&N.push(" "),(a.delimiterEnd!==!1||g!==v-1)&&N.push("|")}w.push(a.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return w.join(`
499
- `)}function gL(e){return e==null?"":String(e)}function I1(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}function vL(e,i,a,l){const s=a.enter("blockquote"),c=a.createTracker(l);c.move("> "),c.shift(2);const d=a.indentLines(a.containerFlow(e,c.current()),yL);return s(),d}function yL(e,i,a){return">"+(a?"":" ")+e}function bL(e,i){return B1(e,i.inConstruct,!0)&&!B1(e,i.notInConstruct,!1)}function B1(e,i,a){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return a;let l=-1;for(;++l<i.length;)if(e.includes(i[l]))return!0;return!1}function P1(e,i,a,l){let s=-1;for(;++s<a.unsafe.length;)if(a.unsafe[s].character===`
500
- `&&bL(a.stack,a.unsafe[s]))return/[ \t]/.test(l.before)?"":" ";return`\\
501
- `}function xL(e,i){const a=String(e);let l=a.indexOf(i),s=l,c=0,d=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===s?++c>d&&(d=c):c=1,s=l+i.length,l=a.indexOf(i,s);return d}function jL(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function wL(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function SL(e,i,a,l){const s=wL(a),c=e.value||"",d=s==="`"?"GraveAccent":"Tilde";if(jL(e,a)){const g=a.enter("codeIndented"),b=a.indentLines(c,kL);return g(),b}const f=a.createTracker(l),m=s.repeat(Math.max(xL(c,s)+1,3)),v=a.enter("codeFenced");let y=f.move(m);if(e.lang){const g=a.enter(`codeFencedLang${d}`);y+=f.move(a.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=a.enter(`codeFencedMeta${d}`);y+=f.move(" "),y+=f.move(a.safe(e.meta,{before:y,after:`
502
- `,encode:["`"],...f.current()})),g()}return y+=f.move(`
503
- `),c&&(y+=f.move(c+`
504
- `)),y+=f.move(m),v(),y}function kL(e,i,a){return(a?"":" ")+e}function lv(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function CL(e,i,a,l){const s=lv(a),c=s==='"'?"Quote":"Apostrophe",d=a.enter("definition");let f=a.enter("label");const m=a.createTracker(l);let v=m.move("[");return v+=m.move(a.safe(a.associationId(e),{before:v,after:"]",...m.current()})),v+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),v+=m.move("<"),v+=m.move(a.safe(e.url,{before:v,after:">",...m.current()})),v+=m.move(">")):(f=a.enter("destinationRaw"),v+=m.move(a.safe(e.url,{before:v,after:e.title?" ":`
505
- `,...m.current()}))),f(),e.title&&(f=a.enter(`title${c}`),v+=m.move(" "+s),v+=m.move(a.safe(e.title,{before:v,after:s,...m.current()})),v+=m.move(s),f()),d(),v}function EL(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function jc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Id(e,i,a){const l=is(e),s=is(i);return l===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ak.peek=NL;function Ak(e,i,a,l){const s=EL(a),c=a.enter("emphasis"),d=a.createTracker(l),f=d.move(s);let m=d.move(a.containerPhrasing(e,{after:s,before:f,...d.current()}));const v=m.charCodeAt(0),y=Id(l.before.charCodeAt(l.before.length-1),v,s);y.inside&&(m=jc(v)+m.slice(1));const g=m.charCodeAt(m.length-1),b=Id(l.after.charCodeAt(0),g,s);b.inside&&(m=m.slice(0,-1)+jc(g));const x=d.move(s);return c(),a.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+x}function NL(e,i,a){return a.options.emphasis||"*"}function TL(e,i){let a=!1;return av(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return a=!0,Jp}),!!((!e.depth||e.depth<3)&&Zg(e)&&(i.options.setext||a))}function AL(e,i,a,l){const s=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(l);if(TL(e,a)){const y=a.enter("headingSetext"),g=a.enter("phrasing"),b=a.containerPhrasing(e,{...c.current(),before:`
506
- `,after:`
507
- `});return g(),y(),b+`
508
- `+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
509
- `))+1))}const d="#".repeat(s),f=a.enter("headingAtx"),m=a.enter("phrasing");c.move(d+" ");let v=a.containerPhrasing(e,{before:"# ",after:`
510
- `,...c.current()});return/^[\t ]/.test(v)&&(v=jc(v.charCodeAt(0))+v.slice(1)),v=v?d+" "+v:d,a.options.closeAtx&&(v+=" "+d),m(),f(),v}Mk.peek=ML;function Mk(e){return e.value||""}function ML(){return"<"}Ok.peek=OL;function Ok(e,i,a,l){const s=lv(a),c=s==='"'?"Quote":"Apostrophe",d=a.enter("image");let f=a.enter("label");const m=a.createTracker(l);let v=m.move("![");return v+=m.move(a.safe(e.alt,{before:v,after:"]",...m.current()})),v+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),v+=m.move("<"),v+=m.move(a.safe(e.url,{before:v,after:">",...m.current()})),v+=m.move(">")):(f=a.enter("destinationRaw"),v+=m.move(a.safe(e.url,{before:v,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=a.enter(`title${c}`),v+=m.move(" "+s),v+=m.move(a.safe(e.title,{before:v,after:s,...m.current()})),v+=m.move(s),f()),v+=m.move(")"),d(),v}function OL(){return"!"}Rk.peek=RL;function Rk(e,i,a,l){const s=e.referenceType,c=a.enter("imageReference");let d=a.enter("label");const f=a.createTracker(l);let m=f.move("![");const v=a.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(v+"]["),d();const y=a.stack;a.stack=[],d=a.enter("reference");const g=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return d(),a.stack=y,c(),s==="full"||!v||v!==g?m+=f.move(g+"]"):s==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function RL(){return"!"}_k.peek=_L;function _k(e,i,a){let l=e.value||"",s="`",c=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(l);)s+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++c<a.unsafe.length;){const d=a.unsafe[c],f=a.compilePattern(d);let m;if(d.atBreak)for(;m=f.exec(l);){let v=m.index;l.charCodeAt(v)===10&&l.charCodeAt(v-1)===13&&v--,l=l.slice(0,v)+" "+l.slice(m.index+1)}}return s+l+s}function _L(){return"`"}function Dk(e,i){const a=Zg(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}zk.peek=DL;function zk(e,i,a,l){const s=lv(a),c=s==='"'?"Quote":"Apostrophe",d=a.createTracker(l);let f,m;if(Dk(e,a)){const y=a.stack;a.stack=[],f=a.enter("autolink");let g=d.move("<");return g+=d.move(a.containerPhrasing(e,{before:g,after:">",...d.current()})),g+=d.move(">"),f(),a.stack=y,g}f=a.enter("link"),m=a.enter("label");let v=d.move("[");return v+=d.move(a.containerPhrasing(e,{before:v,after:"](",...d.current()})),v+=d.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=a.enter("destinationLiteral"),v+=d.move("<"),v+=d.move(a.safe(e.url,{before:v,after:">",...d.current()})),v+=d.move(">")):(m=a.enter("destinationRaw"),v+=d.move(a.safe(e.url,{before:v,after:e.title?" ":")",...d.current()}))),m(),e.title&&(m=a.enter(`title${c}`),v+=d.move(" "+s),v+=d.move(a.safe(e.title,{before:v,after:s,...d.current()})),v+=d.move(s),m()),v+=d.move(")"),f(),v}function DL(e,i,a){return Dk(e,a)?"<":"["}Lk.peek=zL;function Lk(e,i,a,l){const s=e.referenceType,c=a.enter("linkReference");let d=a.enter("label");const f=a.createTracker(l);let m=f.move("[");const v=a.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(v+"]["),d();const y=a.stack;a.stack=[],d=a.enter("reference");const g=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return d(),a.stack=y,c(),s==="full"||!v||v!==g?m+=f.move(g+"]"):s==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function zL(){return"["}function ov(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function LL(e){const i=ov(e),a=e.options.bulletOther;if(!a)return i==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+a+"`) to be different");return a}function IL(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function Ik(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function BL(e,i,a,l){const s=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?IL(a):ov(a);const f=e.ordered?d==="."?")":".":LL(a);let m=i&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(m=!0),Ik(a)===d&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(d=f),a.bulletCurrent=d;const v=a.containerFlow(e,l);return a.bulletLastUsed=d,a.bulletCurrent=c,s(),v}function PL(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function HL(e,i,a,l){const s=PL(a);let c=a.bulletCurrent||ov(a);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(e))+c);let d=c.length+1;(s==="tab"||s==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=a.createTracker(l);f.move(c+" ".repeat(d-c.length)),f.shift(d);const m=a.enter("listItem"),v=a.indentLines(a.containerFlow(e,f.current()),y);return m(),v;function y(g,b,x){return b?(x?"":" ".repeat(d))+g:(x?c:c+" ".repeat(d-c.length))+g}}function UL(e,i,a,l){const s=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,l);return c(),s(),d}const qL=of(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function FL(e,i,a,l){return(e.children.some(function(d){return qL(d)})?a.containerPhrasing:a.containerFlow).call(a,e,l)}function VL(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}Bk.peek=$L;function Bk(e,i,a,l){const s=VL(a),c=a.enter("strong"),d=a.createTracker(l),f=d.move(s+s);let m=d.move(a.containerPhrasing(e,{after:s,before:f,...d.current()}));const v=m.charCodeAt(0),y=Id(l.before.charCodeAt(l.before.length-1),v,s);y.inside&&(m=jc(v)+m.slice(1));const g=m.charCodeAt(m.length-1),b=Id(l.after.charCodeAt(0),g,s);b.inside&&(m=m.slice(0,-1)+jc(g));const x=d.move(s+s);return c(),a.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+x}function $L(e,i,a){return a.options.strong||"*"}function YL(e,i,a,l){return a.safe(e.value,l)}function GL(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function XL(e,i,a){const l=(Ik(a)+(a.options.ruleSpaces?" ":"")).repeat(GL(a));return a.options.ruleSpaces?l.slice(0,-1):l}const Pk={blockquote:vL,break:P1,code:SL,definition:CL,emphasis:Ak,hardBreak:P1,heading:AL,html:Mk,image:Ok,imageReference:Rk,inlineCode:_k,link:zk,linkReference:Lk,list:BL,listItem:HL,paragraph:UL,root:FL,strong:Bk,text:YL,thematicBreak:XL};function QL(){return{enter:{table:KL,tableData:H1,tableHeader:H1,tableRow:JL},exit:{codeText:WL,table:ZL,tableData:cp,tableHeader:cp,tableRow:cp}}}function KL(e){const i=e._align;this.enter({type:"table",align:i.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function ZL(e){this.exit(e),this.data.inTable=void 0}function JL(e){this.enter({type:"tableRow",children:[]},e)}function cp(e){this.exit(e)}function H1(e){this.enter({type:"tableCell",children:[]},e)}function WL(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,e8));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function e8(e,i){return i==="|"?i:e}function t8(e){const i=e||{},a=i.tableCellPadding,l=i.tablePipeAlign,s=i.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
511
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:d,tableCell:m,tableRow:f}};function d(x,w,S,C){return v(y(x,S,C),x.align)}function f(x,w,S,C){const N=g(x,S,C),M=v([N]);return M.slice(0,M.indexOf(`
512
- `))}function m(x,w,S,C){const N=S.enter("tableCell"),M=S.enter("phrasing"),T=S.containerPhrasing(x,{...C,before:c,after:c});return M(),N(),T}function v(x,w){return pL(x,{align:w,alignDelimiters:l,padding:a,stringLength:s})}function y(x,w,S){const C=x.children;let N=-1;const M=[],T=w.enter("table");for(;++N<C.length;)M[N]=g(C[N],w,S);return T(),M}function g(x,w,S){const C=x.children;let N=-1;const M=[],T=w.enter("tableRow");for(;++N<C.length;)M[N]=m(C[N],x,w,S);return T(),M}function b(x,w,S){let C=Pk.inlineCode(x,w,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function n8(){return{exit:{taskListCheckValueChecked:U1,taskListCheckValueUnchecked:U1,paragraph:a8}}}function i8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:r8}}}function U1(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function a8(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const l=a.children[0];if(l&&l.type==="text"){const s=i.children;let c=-1,d;for(;++c<s.length;){const f=s[c];if(f.type==="paragraph"){d=f;break}}d===a&&(l.value=l.value.slice(1),l.value.length===0?a.children.shift():a.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,a.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function r8(e,i,a,l){const s=e.children[0],c=typeof e.checked=="boolean"&&s&&s.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=a.createTracker(l);c&&f.move(d);let m=Pk.listItem(e,i,a,{...l,...f.current()});return c&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,v)),m;function v(y){return y+d}}function l8(){return[B5(),rL(),cL(),QL(),n8()]}function o8(e){return{extensions:[P5(),lL(e),uL(),t8(e),i8()]}}const s8={tokenize:m8,partial:!0},Hk={tokenize:p8,partial:!0},Uk={tokenize:g8,partial:!0},qk={tokenize:v8,partial:!0},c8={tokenize:y8,partial:!0},Fk={name:"wwwAutolink",tokenize:f8,previous:$k},Vk={name:"protocolAutolink",tokenize:h8,previous:Yk},gr={name:"emailAutolink",tokenize:d8,previous:Gk},Fa={};function u8(){return{text:Fa}}let Bl=48;for(;Bl<123;)Fa[Bl]=gr,Bl++,Bl===58?Bl=65:Bl===91&&(Bl=97);Fa[43]=gr;Fa[45]=gr;Fa[46]=gr;Fa[95]=gr;Fa[72]=[gr,Vk];Fa[104]=[gr,Vk];Fa[87]=[gr,Fk];Fa[119]=[gr,Fk];function d8(e,i,a){const l=this;let s,c;return d;function d(g){return!ng(g)||!Gk.call(l,l.previous)||sv(l.events)?a(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return ng(g)?(e.consume(g),f):g===64?(e.consume(g),m):a(g)}function m(g){return g===46?e.check(c8,y,v)(g):g===45||g===95||Bn(g)?(c=!0,e.consume(g),m):y(g)}function v(g){return e.consume(g),s=!0,m}function y(g){return c&&s&&Xn(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(g)):a(g)}}function f8(e,i,a){const l=this;return s;function s(d){return d!==87&&d!==119||!$k.call(l,l.previous)||sv(l.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(s8,e.attempt(Hk,e.attempt(Uk,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function h8(e,i,a){const l=this;let s="",c=!1;return d;function d(g){return(g===72||g===104)&&Yk.call(l,l.previous)&&!sv(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),f):a(g)}function f(g){if(Xn(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(g),m}return a(g)}function m(g){return g===47?(e.consume(g),c?v:(c=!0,m)):a(g)}function v(g){return g===null||Dd(g)||Et(g)||Kl(g)||af(g)?a(g):e.attempt(Hk,e.attempt(Uk,y),a)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(g)}}function m8(e,i,a){let l=0;return s;function s(d){return(d===87||d===119)&&l<3?(l++,e.consume(d),s):d===46&&l===3?(e.consume(d),c):a(d)}function c(d){return d===null?a(d):i(d)}}function p8(e,i,a){let l,s,c;return d;function d(v){return v===46||v===95?e.check(qk,m,f)(v):v===null||Et(v)||Kl(v)||v!==45&&af(v)?m(v):(c=!0,e.consume(v),d)}function f(v){return v===95?l=!0:(s=l,l=void 0),e.consume(v),d}function m(v){return s||l||!c?a(v):i(v)}}function g8(e,i){let a=0,l=0;return s;function s(d){return d===40?(a++,e.consume(d),s):d===41&&l<a?c(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(qk,i,c)(d):d===null||Et(d)||Kl(d)?i(d):(e.consume(d),s)}function c(d){return d===41&&l++,e.consume(d),s}}function v8(e,i,a){return l;function l(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),l):f===38?(e.consume(f),c):f===93?(e.consume(f),s):f===60||f===null||Et(f)||Kl(f)?i(f):a(f)}function s(f){return f===null||f===40||f===91||Et(f)||Kl(f)?i(f):l(f)}function c(f){return Xn(f)?d(f):a(f)}function d(f){return f===59?(e.consume(f),l):Xn(f)?(e.consume(f),d):a(f)}}function y8(e,i,a){return l;function l(c){return e.consume(c),s}function s(c){return Bn(c)?a(c):i(c)}}function $k(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Et(e)}function Yk(e){return!Xn(e)}function Gk(e){return!(e===47||ng(e))}function ng(e){return e===43||e===45||e===46||e===95||Bn(e)}function sv(e){let i=e.length,a=!1;for(;i--;){const l=e[i][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){a=!0;break}if(l._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const b8={tokenize:N8,partial:!0};function x8(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:k8,continuation:{tokenize:C8},exit:E8}},text:{91:{name:"gfmFootnoteCall",tokenize:S8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:j8,resolveTo:w8}}}}function j8(e,i,a){const l=this;let s=l.events.length;const c=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let d;for(;s--;){const m=l.events[s][1];if(m.type==="labelImage"){d=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!d||!d._balanced)return a(m);const v=aa(l.sliceSerialize({start:d.end,end:l.now()}));return v.codePointAt(0)!==94||!c.includes(v.slice(1))?a(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),i(m))}}function w8(e,i){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},f=[e[a+1],e[a+2],["enter",l,i],e[a+3],e[a+4],["enter",s,i],["exit",s,i],["enter",c,i],["enter",d,i],["exit",d,i],["exit",c,i],e[e.length-2],e[e.length-1],["exit",l,i]];return e.splice(a,e.length-a+1,...f),e}function S8(e,i,a){const l=this,s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c=0,d;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?a(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",v)}function v(g){if(c>999||g===93&&!d||g===null||g===91||Et(g))return a(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(aa(l.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(g)}return Et(g)||(d=!0),c++,e.consume(g),g===92?y:v}function y(g){return g===91||g===92||g===93?(e.consume(g),c++,v):v(g)}}function k8(e,i,a){const l=this,s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c,d=0,f;return m;function m(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),v}function v(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):a(w)}function y(w){if(d>999||w===93&&!f||w===null||w===91||Et(w))return a(w);if(w===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return c=aa(l.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Et(w)||(f=!0),d++,e.consume(w),w===92?g:y}function g(w){return w===91||w===92||w===93?(e.consume(w),d++,y):y(w)}function b(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(c)||s.push(c),ft(e,x,"gfmFootnoteDefinitionWhitespace")):a(w)}function x(w){return i(w)}}function C8(e,i,a){return e.check(Rc,i,e.attempt(b8,i,a))}function E8(e){e.exit("gfmFootnoteDefinition")}function N8(e,i,a){const l=this;return ft(e,s,"gfmFootnoteDefinitionIndent",5);function s(c){const d=l.events[l.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(c):a(c)}}function T8(e){let a=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:c,resolveAll:s};return a==null&&(a=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function s(d,f){let m=-1;for(;++m<d.length;)if(d[m][0]==="enter"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._close){let v=m;for(;v--;)if(d[v][0]==="exit"&&d[v][1].type==="strikethroughSequenceTemporary"&&d[v][1]._open&&d[m][1].end.offset-d[m][1].start.offset===d[v][1].end.offset-d[v][1].start.offset){d[m][1].type="strikethroughSequence",d[v][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},d[v][1].start),end:Object.assign({},d[m][1].end)},g={type:"strikethroughText",start:Object.assign({},d[v][1].end),end:Object.assign({},d[m][1].start)},b=[["enter",y,f],["enter",d[v][1],f],["exit",d[v][1],f],["enter",g,f]],x=f.parser.constructs.insideSpan.null;x&&Mi(b,b.length,0,rf(x,d.slice(v+1,m),f)),Mi(b,b.length,0,[["exit",g,f],["enter",d[m][1],f],["exit",d[m][1],f],["exit",y,f]]),Mi(d,v-1,m-v+3,b),m=v+b.length-2;break}}for(m=-1;++m<d.length;)d[m][1].type==="strikethroughSequenceTemporary"&&(d[m][1].type="data");return d}function c(d,f,m){const v=this.previous,y=this.events;let g=0;return b;function b(w){return v===126&&y[y.length-1][1].type!=="characterEscape"?m(w):(d.enter("strikethroughSequenceTemporary"),x(w))}function x(w){const S=is(v);if(w===126)return g>1?m(w):(d.consume(w),g++,x);if(g<2&&!a)return m(w);const C=d.exit("strikethroughSequenceTemporary"),N=is(w);return C._open=!N||N===2&&!!S,C._close=!S||S===2&&!!N,f(w)}}}class A8{constructor(){this.map=[],this.index=new Map}add(i,a,l){M8(this,i,a,l)}consume(i){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const l=[];for(;a>0;)a-=1,l.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];l.push(i.slice()),i.length=0;let s=l.pop();for(;s;){for(const c of s)i.push(c);s=l.pop()}this.map.length=0,this.index.clear()}}function M8(e,i,a,l){if(a===0&&l.length===0)return;const s=e.index.get(i);if(s){s[1]+=a,s[2].push(...l);return}const c=[i,a,l];e.map.push(c),e.index.set(i,c)}function O8(e,i){let a=!1;const l=[];for(;i<e.length;){const s=e[i];if(a){if(s[0]==="enter")s[1].type==="tableContent"&&l.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const c=l.length-1;l[c]=l[c]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(a=!0);i+=1}return l}function R8(){return{flow:{null:{name:"table",tokenize:_8,resolveAll:D8}}}}function _8(e,i,a){const l=this;let s=0,c=0,d;return f;function f(z){let Y=l.events.length-1;for(;Y>-1;){const{type:Q}=l.events[Y][1];if(Q==="lineEnding"||Q==="linePrefix")Y--;else break}const q=Y>-1?l.events[Y][1].type:null,W=q==="tableHead"||q==="tableRow"?D:m;return W===D&&l.parser.lazy[l.now().line]?a(z):W(z)}function m(z){return e.enter("tableHead"),e.enter("tableRow"),v(z)}function v(z){return z===124||(d=!0,c+=1),y(z)}function y(z){return z===null?a(z):He(z)?c>1?(c=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),x):a(z):it(z)?ft(e,y,"whitespace")(z):(c+=1,d&&(d=!1,s+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),d=!0,y):(e.enter("data"),g(z)))}function g(z){return z===null||z===124||Et(z)?(e.exit("data"),y(z)):(e.consume(z),z===92?b:g)}function b(z){return z===92||z===124?(e.consume(z),g):g(z)}function x(z){return l.interrupt=!1,l.parser.lazy[l.now().line]?a(z):(e.enter("tableDelimiterRow"),d=!1,it(z)?ft(e,w,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):w(z))}function w(z){return z===45||z===58?C(z):z===124?(d=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),S):I(z)}function S(z){return it(z)?ft(e,C,"whitespace")(z):C(z)}function C(z){return z===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),N):z===45?(c+=1,N(z)):z===null||He(z)?A(z):I(z)}function N(z){return z===45?(e.enter("tableDelimiterFiller"),M(z)):I(z)}function M(z){return z===45?(e.consume(z),M):z===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(z))}function T(z){return it(z)?ft(e,A,"whitespace")(z):A(z)}function A(z){return z===124?w(z):z===null||He(z)?!d||s!==c?I(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(z)):I(z)}function I(z){return a(z)}function D(z){return e.enter("tableRow"),B(z)}function B(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),B):z===null||He(z)?(e.exit("tableRow"),i(z)):it(z)?ft(e,B,"whitespace")(z):(e.enter("data"),P(z))}function P(z){return z===null||z===124||Et(z)?(e.exit("data"),B(z)):(e.consume(z),z===92?V:P)}function V(z){return z===92||z===124?(e.consume(z),P):P(z)}}function D8(e,i){let a=-1,l=!0,s=0,c=[0,0,0,0],d=[0,0,0,0],f=!1,m=0,v,y,g;const b=new A8;for(;++a<e.length;){const x=e[a],w=x[1];x[0]==="enter"?w.type==="tableHead"?(f=!1,m!==0&&(q1(b,i,m,v,y),y=void 0,m=0),v={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},b.add(a,0,[["enter",v,i]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(l=!0,g=void 0,c=[0,0,0,0],d=[0,a+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},b.add(a,0,[["enter",y,i]])),s=w.type==="tableDelimiterRow"?2:y?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(l=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],g=fd(b,i,c,s,void 0,g),c=[0,0,0,0]),d[2]=a)):w.type==="tableCellDivider"&&(l?l=!1:(c[1]!==0&&(d[0]=d[1],g=fd(b,i,c,s,void 0,g)),c=d,d=[c[1],a,0,0])):w.type==="tableHead"?(f=!0,m=a):w.type==="tableRow"||w.type==="tableDelimiterRow"?(m=a,c[1]!==0?(d[0]=d[1],g=fd(b,i,c,s,a,g)):d[1]!==0&&(g=fd(b,i,d,s,a,g)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(d[3]=a)}for(m!==0&&q1(b,i,m,v,y),b.consume(i.events),a=-1;++a<i.events.length;){const x=i.events[a];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=O8(i.events,a))}return e}function fd(e,i,a,l,s,c){const d=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(c.end=Object.assign({},Zo(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const m=Zo(i.events,a[1]);if(c={type:d,start:Object.assign({},m),end:Object.assign({},m)},e.add(a[1],0,[["enter",c,i]]),a[2]!==0){const v=Zo(i.events,a[2]),y=Zo(i.events,a[3]),g={type:f,start:Object.assign({},v),end:Object.assign({},y)};if(e.add(a[2],0,[["enter",g,i]]),l!==2){const b=i.events[a[2]],x=i.events[a[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",a[3]>a[2]+1){const w=a[2]+1,S=a[3]-a[2]-1;e.add(w,S,[])}}e.add(a[3]+1,0,[["exit",g,i]])}return s!==void 0&&(c.end=Object.assign({},Zo(i.events,s)),e.add(s,0,[["exit",c,i]]),c=void 0),c}function q1(e,i,a,l,s){const c=[],d=Zo(i.events,a);s&&(s.end=Object.assign({},d),c.push(["exit",s,i])),l.end=Object.assign({},d),c.push(["exit",l,i]),e.add(a+1,0,c)}function Zo(e,i){const a=e[i],l=a[0]==="enter"?"start":"end";return a[1][l]}const z8={name:"tasklistCheck",tokenize:I8};function L8(){return{text:{91:z8}}}function I8(e,i,a){const l=this;return s;function s(m){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?a(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),c)}function c(m){return Et(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),d):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),d):a(m)}function d(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(m)}function f(m){return He(m)?i(m):it(m)?e.check({tokenize:B8},i,a)(m):a(m)}}function B8(e,i,a){return ft(e,l,"whitespace");function l(s){return s===null?a(s):i(s)}}function P8(e){return ek([u8(),x8(),T8(e),R8(),L8()])}const H8={};function U8(e){const i=this,a=e||H8,l=i.data(),s=l.micromarkExtensions||(l.micromarkExtensions=[]),c=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),d=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);s.push(P8(a)),c.push(l8()),d.push(o8(a))}function Bd(e){document.documentElement.dataset.theme=e,document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e,localStorage.setItem("jarvy-theme",e)}const q8={add:Vd,"chat-bubble":RA,window:lA,close:Cc,"chevron-left":Z2,"chevron-right":Kr,"chevron-down":ts,gear:$A,"person-add":JA,"arrow-bracket-to-left":AA,"arrow-up":cA,copy:tj,check:ur,"cloud-download":aj,bell:dA,"bell-slash":uA,image:NA,paperclip:fg,"smiley-plus":xA,info:dg,people:WA,pencil:HA,file:kA,"file-video":wA,"file-audio":jA,folder:CA,"layout-sidebar-left":BA,sun:ZA,moon:IA,"arrows-expand":gA,"arrows-contract":GA,"arrow-u-up-right":qA,"list-bullets":TA,eye:bA,"eye-slash":yA,pin:Ep,megaphone:MA,trash:Nd,search:kc,quote:UA};function De({name:e}){const i=q8[e]??dg;return u.jsx(i,{className:"ui-icon","aria-hidden":"true",focusable:"false"})}function ct({icon:e,label:i,className:a="",...l}){return u.jsx("button",{type:"button",className:`ui-iconbtn ${a}`,"aria-label":i,title:i,...l,children:u.jsx(De,{name:e})})}function as({title:e,onClose:i,children:a,className:l=""}){const s=k.useRef(null),c=k.useId();return k.useEffect(()=>{const d=s.current,f=document.activeElement;return d.showModal(),()=>{d.close(),f==null||f.focus({preventScroll:!0})}},[]),to.createPortal(u.jsxs("dialog",{ref:s,className:`ui-small-dialog ${l}`,"aria-labelledby":c,onCancel:d=>{d.preventDefault(),i()},children:[u.jsx(ct,{icon:"close",label:j("ui.closeNamed",{name:e}),className:"ui-dialog-close",onClick:i}),u.jsxs("div",{className:"ui-dialog-body",children:[u.jsx("h1",{id:c,children:e}),a]})]}),document.body)}async function cv(e){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const i=document.createElement("textarea");i.value=e,i.setAttribute("readonly",""),i.style.position="fixed",i.style.opacity="0",document.body.append(i),i.select();try{return document.execCommand("copy")}finally{i.remove()}}function F8({children:e}){const i=k.useRef(null),[a,l]=k.useState("idle");k.useEffect(()=>{if(a==="idle")return;const c=setTimeout(()=>l("idle"),1500);return()=>clearTimeout(c)},[a]);const s=async()=>{var c;return l(await cv((((c=i.current)==null?void 0:c.textContent)??"").replace(/\n$/,""))?"copied":"failed")};return u.jsxs("figure",{className:"ui-code-figure",children:[u.jsx("pre",{ref:i,children:e}),u.jsx(ct,{icon:a==="copied"?"check":"copy",label:j(a==="copied"?"ui.copied":a==="failed"?"ui.copyFailed":"ui.copyCode"),onClick:()=>void s()})]})}const V8=[U8,I5,R5],Dc=k.memo(function({text:i,renderQuote:a}){return D2(),u.jsx(j5,{remarkPlugins:V8,skipHtml:!0,components:{a:({href:l,children:s})=>l==="#mention"||l==="#mention-me"?u.jsx("span",{className:"jv-mention","data-me":l==="#mention-me"||void 0,children:s}):a&&(l!=null&&l.startsWith("#quote-"))?a(Number(l.slice(7))):u.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",children:s}),img:({alt:l})=>u.jsx("span",{children:j("ui.image",{alt:l||j("ui.imageHidden")})}),pre:({children:l})=>u.jsx(F8,{children:l})},children:i})}),$8={agent_undeletable:"error.agentUndeletable",autoconfig_model:"error.autoconfigModel",autoconfig_source:"error.autoconfigSource",bot_missing:"error.botMissing",chat_access_changed:"error.chatAccessChanged",connection_missing:"error.connectionMissing",credential_changed:"error.credentialChanged",credential_scope:"error.credentialScope",credentials_missing:"error.credentialsMissing",data_locked:"error.dataLocked",discovery_format:"error.discoveryFormat",discovery_http:"error.discoveryHttp",discovery_key:"error.discoveryKey",discovery_protocol:"error.discoveryProtocol",discovery_url:"error.discoveryUrl",discovery_url_missing:"error.discoveryUrlMissing",discovery_unreachable:"error.discoveryUnreachable",history_missing:"error.historyMissing",invalid_credential:"error.invalidCredential",invalid_run:"error.invalidRun",login_input:"error.loginInput",login_option:"error.loginOption",login_step:"error.loginStep",message_missing:"error.messageMissing",model_incomplete:"error.modelIncomplete",model_missing:"error.modelMissing",model_request_failed:"error.modelRequestFailed",model_required:"error.modelRequired",model_switch_uncertain:"error.modelSwitchUncertain",name_taken:"error.nameTaken",provider_name_taken:"error.providerNameTaken",question_closed:"error.questionClosed",question_expired:"error.questionExpired",runtime_failed:"error.runtimeFailed",session_corrupt:"error.sessionCorrupt",session_mismatch:"error.sessionMismatch",session_missing:"error.sessionMissing",session_path:"error.sessionPath",stopping:"error.stopping",thinking_format:"error.thinkingFormat",tools_missing:"error.toolsMissing",unsafe_replay:"error.unsafeReplay"},Xk=(e,i)=>{const a=e?$8[e]:void 0;return a?j(a,i):null};function Pt(e,i="common.failed"){return e instanceof es?Xk(e.code,e.params)??(e.status<500?e.message:j(i)):e instanceof Error&&e.message?e.message:j(i)}const Y8=e=>Xk(e.errorCode,e.errorParams)??e.error??"";function G8({botId:e,selected:i,onSelect:a,onOpenChat:l}){const[s,c]=k.useState(null),[d,f]=k.useState(!0),[m,v]=k.useState(""),[y,g]=k.useState(0);if(k.useEffect(()=>{let w=!0;return f(!0),v(""),c(null),(i.kind==="history"?s3.read(e,i.id).then(C=>({kind:"history",data:C})):rw.message(e,i.id).then(C=>({kind:"chat",data:C}))).then(C=>{w&&c(C)}).catch(C=>{w&&v(Pt(C,"activity.detailFailed"))}).finally(()=>{w&&f(!1)}),()=>{w=!1}},[e,i.kind,i.id,y]),d)return u.jsx("p",{className:"jv-activity-state",role:"status",children:j("activity.detailLoading")});if(m)return u.jsxs("div",{className:"jv-activity-state",children:[u.jsx("p",{role:"alert",children:m}),u.jsx(Ve,{variant:"outline",size:"sm",onClick:()=>g(w=>w+1),children:j("common.retry")})]});if(!s)return null;if(s.kind==="history")return u.jsx(a3,{detail:s.data,onSelect:w=>a({kind:"history",id:w})},s.data.record.id);const{chat:b,message:x}=s.data;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"jv-activity-message-head",children:[u.jsxs("div",{children:[u.jsx("h3",{children:b.title}),u.jsx("p",{children:Vg(x.createdAt)})]}),u.jsxs(Ve,{variant:"ghost",size:"sm",onClick:()=>l(b.id),children:[j("activity.openChat"),u.jsx(Cp,{})]})]}),u.jsxs("div",{className:"jv-activity-message-body",children:[x.content&&u.jsx(Dc,{text:x.content}),x.attachments.length>0&&u.jsx("div",{className:"jv-activity-message-files",children:x.attachments.map(w=>u.jsxs("a",{href:`/api/attachments/${w.id}`,download:w.name,children:[u.jsx(fg,{}),w.name]},w.id))}),x.source&&u.jsxs(Ve,{className:"jv-activity-message-source",variant:"outline",size:"sm",onClick:()=>a({kind:"history",id:x.source.historyId}),children:[j("activity.sentBy",{id:x.source.historyId}),u.jsx(Cp,{})]})]})]})}const Qk=lO;function Kk({className:e,children:i,showCloseButton:a=!0,...l}){return u.jsxs(sO,{children:[u.jsx(cO,{"data-slot":"dialog-overlay",className:"fixed inset-0 z-[80] bg-black/50"}),u.jsxs(fO,{"data-slot":"dialog-content",className:nn("fixed top-1/2 left-1/2 z-[81] flex max-h-[calc(100dvh-24px)] w-[min(720px,calc(100vw-24px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border bg-background text-foreground shadow-lg outline-none",e),...l,children:[i,a&&u.jsx(yO,{className:"absolute top-4 right-4 rounded-sm p-1 text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring","aria-label":j("common.close"),children:u.jsx(Cc,{className:"size-4"})})]})]})}function uv({className:e,...i}){return u.jsx("div",{"data-slot":"dialog-header",className:nn("flex flex-col gap-2",e),...i})}function cf({className:e,...i}){return u.jsx(gO,{"data-slot":"dialog-title",className:nn("text-lg font-semibold",e),...i})}function X8({botId:e,botName:i,onBack:a,onOpenChat:l}){const[s,c]=k.useState([void 0]),d=s.at(-1),[f,m]=k.useState({items:[],nextBefore:null}),[v,y]=k.useState(!0),[g,b]=k.useState(""),[x,w]=k.useState(0),[S,C]=k.useState(null),N=k.useRef(null),M=k.useRef(0),T=k.useRef(null);k.useEffect(()=>{let D=!0;return y(!0),b(""),m({items:[],nextBefore:null}),N.current&&(N.current.scrollTop=0),rw.list(e,d).then(B=>{D&&m(B)}).catch(B=>{D&&b(Pt(B,"activity.loadFailed"))}).finally(()=>{D&&y(!1)}),()=>{D=!1}},[e,d,x]);const A=D=>{var B;S||(M.current=((B=N.current)==null?void 0:B.scrollTop)??0,T.current=document.activeElement),C(D)},I=()=>{if(!S){a();return}C(null),requestAnimationFrame(()=>{var D;N.current&&(N.current.scrollTop=M.current),(D=T.current)==null||D.focus({preventScroll:!0})})};return u.jsxs(u.Fragment,{children:[u.jsxs(uv,{className:"jv-bot-info-navigation",children:[u.jsx(Ve,{type:"button",variant:"ghost",size:"icon-sm","aria-label":j(S?"activity.backToTimeline":"usage.back"),onClick:I,children:u.jsx(Fd,{})}),u.jsx(cf,{children:S?S.kind==="history"?"History":j("activity.chatRecord"):j("bot.activity")}),u.jsx("span",{className:"jv-bot-page-name",children:i})]}),u.jsxs("div",{className:"jv-activity",children:[u.jsxs("div",{className:"jv-activity-list",hidden:S!==null,children:[u.jsxs("div",{className:"jv-activity-toolbar",children:[u.jsx("span",{children:j("activity.newestFirst")}),u.jsxs(Ve,{type:"button",variant:"ghost",size:"sm",disabled:v,onClick:()=>{c([void 0]),w(D=>D+1)},"aria-label":j("activity.refresh"),children:[u.jsx(hg,{}),j(v?"activity.reading":"usage.refresh")]})]}),u.jsxs("div",{className:"jv-activity-columns","aria-hidden":"true",children:[u.jsx("span",{children:j("activity.columnChat")}),u.jsx("span",{children:j("activity.columnTime")}),u.jsx("span",{children:"History"})]}),u.jsx("div",{className:"jv-activity-scroll",ref:N,children:v?u.jsx("p",{className:"jv-activity-state",role:"status",children:j("activity.loading")}):g?u.jsxs("div",{className:"jv-activity-state",children:[u.jsx("p",{role:"alert",children:g}),u.jsx(Ve,{variant:"outline",size:"sm",onClick:()=>w(D=>D+1),children:j("common.retry")})]}):f.items.length?u.jsx(o3,{items:f.items,onSelect:A}):u.jsxs("div",{className:"jv-activity-state jv-activity-empty",children:[u.jsx("p",{children:j("activity.empty")}),u.jsx("span",{children:j("activity.emptyHint")})]})}),u.jsxs("div",{className:"jv-activity-pagination",children:[u.jsxs(Ve,{type:"button",variant:"ghost",size:"sm",disabled:v||s.length===1,onClick:()=>c(D=>D.slice(0,-1)),children:[u.jsx(Z2,{}),j("activity.newer")]}),u.jsx("span",{children:j("activity.page",{page:s.length})}),u.jsxs(Ve,{type:"button",variant:"ghost",size:"sm",disabled:v||f.nextBefore===null,onClick:()=>c(D=>[...D,f.nextBefore]),children:[j("activity.older"),u.jsx(Kr,{})]})]})]}),S&&u.jsx("section",{className:"jv-activity-detail","aria-label":j(S.kind==="history"?"activity.historyDetail":"activity.chatDetail"),children:u.jsx(G8,{botId:e,selected:S,onSelect:A,onOpenChat:l})})]})]})}const Q8={list:(e,i)=>Re(`/bots/${e}/usage?since=${i}`)},K8=["today","7d","30d"],Z8=e=>e==="today"?j("usage.today"):j("usage.days",{count:e==="7d"?7:30}),hd=[["calls","usage.calls"],["input","usage.input"],["output","usage.output"],["cacheRead","usage.cacheRead"],["cacheWrite","usage.cacheWrite"]];function J8(e){const i=new Date;return i.setHours(0,0,0,0),i.setDate(i.getDate()-(e==="7d"?6:e==="30d"?29:0)),i.getTime()}const F1=e=>za(e,e<1e4?void 0:{notation:"compact",maximumFractionDigits:1}),V1=e=>e>0&&e<.01?"< $0.01":`$${e.toFixed(2)}`;function W8({botId:e,botName:i,onBack:a}){const[l,s]=k.useState("today"),[c,d]=k.useState(null),[f,m]=k.useState(""),[v,y]=k.useState(0);k.useEffect(()=>{let w=!0;return d(null),m(""),Q8.list(e,J8(l)).then(S=>{w&&d(S.models)}).catch(S=>{w&&m(Pt(S,"usage.loadFailed"))}),()=>{w=!1}},[e,l,v]);const g=(c==null?void 0:c.filter(w=>w.cost!==null))??[],b=c&&Object.fromEntries(hd.map(([w])=>[w,c.reduce((S,C)=>S+C[w],0)])),x=g.length?V1(g.reduce((w,S)=>w+S.cost,0)):j("usage.unpriced");return u.jsxs(u.Fragment,{children:[u.jsxs(uv,{className:"jv-bot-info-navigation",children:[u.jsx(Ve,{type:"button",variant:"ghost",size:"icon-sm","aria-label":j("usage.back"),onClick:a,children:u.jsx(Fd,{})}),u.jsx(cf,{children:j("usage.title")}),u.jsx("span",{className:"jv-bot-page-name",children:i})]}),u.jsxs("div",{className:"jv-usage",children:[u.jsxs("div",{className:"jv-usage-toolbar",children:[u.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":j("usage.range"),children:K8.map(w=>u.jsx("button",{type:"button",role:"tab","aria-selected":l===w,onClick:()=>s(w),children:Z8(w)},w))}),u.jsxs(Ve,{type:"button",variant:"ghost",size:"sm",disabled:!c&&!f,onClick:()=>y(w=>w+1),"aria-label":j("usage.refreshLabel"),children:[u.jsx(hg,{}),j("usage.refresh")]})]}),u.jsx("div",{className:"jv-usage-scroll",children:f?u.jsxs("div",{className:"jv-usage-state",children:[u.jsx("p",{role:"alert",children:f}),u.jsx(Ve,{variant:"outline",size:"sm",onClick:()=>y(w=>w+1),children:j("usage.retry")})]}):c?c.length?u.jsxs(u.Fragment,{children:[u.jsxs("table",{className:"jv-usage-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{scope:"col",children:j("usage.model")}),hd.map(([w,S])=>u.jsx("th",{scope:"col",children:j(S)},w)),u.jsx("th",{scope:"col",children:j("usage.cost")})]})}),u.jsx("tbody",{children:c.map(w=>u.jsxs("tr",{children:[u.jsx("th",{scope:"row",children:u.jsxs("span",{className:"jv-usage-model",children:[u.jsx("strong",{children:w.model}),u.jsx("span",{children:w.provider})]})}),hd.map(([S,C])=>u.jsx("td",{"data-label":j(C),title:za(w[S]),children:F1(w[S])},S)),u.jsx("td",{"data-label":j("usage.cost"),className:w.cost===null?"jv-usage-unpriced":void 0,title:w.cost===null?void 0:`$${w.cost.toFixed(4)}`,children:w.cost===null?j("usage.unpriced"):V1(w.cost)})]},`${w.provider}/${w.model}`))}),c.length>1&&b&&u.jsx("tfoot",{children:u.jsxs("tr",{children:[u.jsx("th",{scope:"row",children:u.jsx("strong",{children:j("usage.total")})}),hd.map(([w,S])=>u.jsx("td",{"data-label":j(S),title:za(b[w]),children:F1(b[w])},w)),u.jsx("td",{"data-label":j("usage.cost"),className:g.length?void 0:"jv-usage-unpriced",children:x})]})})]}),u.jsx("p",{className:"jv-usage-note",children:j(g.length>0&&g.length<c.length?"usage.notePartial":"usage.note")})]}):u.jsx("div",{className:"jv-usage-state jv-usage-empty",children:u.jsx("p",{children:j("usage.empty")})}):u.jsx("p",{className:"jv-usage-state",role:"status",children:j("usage.loading")})})]})]})}const Vi={gray:{hex:14079179,label:"color.gray"},blue:{hex:10470376,label:"color.blue"},green:{hex:11064750,label:"color.green"},amber:{hex:15778426,label:"color.amber"},rose:{hex:15642820,label:"color.rose"},violet:{hex:12759274,label:"color.violet"}},eI=["normal","happy","sad","angry","dizzy"],Zk=e=>{var i;return`#${(((i=Vi[e])==null?void 0:i.hex)??Vi.gray.hex).toString(16).padStart(6,"0")}`},tI="modulepreload",nI=function(e){return"/"+e},$1={},Pd=function(i,a,l){let s=Promise.resolve();if(a&&a.length>0){let d=function(v){return Promise.all(v.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));s=d(a.map(v=>{if(v=nI(v),v in $1)return;$1[v]=!0;const y=v.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":tI,y||(b.as="script"),b.crossOrigin="",b.href=v,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((x,w)=>{b.addEventListener("load",x),b.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return s.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return i().catch(c)})};let Y1;const up=new Map;let G1=Promise.resolve();function iI(){return Y1??(Y1=Promise.all([Pd(()=>import("./three.module-BdMZo7zQ.js"),[]),Pd(()=>import("./figure-DQGUDG-4.js"),[])]).then(([e,i])=>{const a=new e.WebGLRenderer({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});i.configureRenderer(e,a);const{scene:l,camera:s,ground:c}=i.createStage(e),d=new i.CatFigure(e,Vi.gray.hex);return l.add(d.root),i.frameCamera(s,1,3.3),{render(f,m,v,y,g){var b;return a.setSize(v,v,!1),d.setColor(((b=Vi[f])==null?void 0:b.hex)??Vi.gray.hex),d.setCrown(g),d.pose(m),c.visible=y,a.render(l,s),a.domElement.toDataURL("image/png")}}})),Y1}function aI(e,i,a,l=!1){const s=Math.round(a*Math.min(3,Math.max(1,window.devicePixelRatio||1))),c=`${e}:${i}:${s}:${l}`;let d=up.get(c);return d||(d=G1.then(()=>iI()).then(f=>f.render(e,i,s,a>=40,l)),G1=d.catch(()=>{}),up.set(c,d),d.catch(()=>up.delete(c))),d}function zc({color:e,mood:i="normal",size:a=36,badge:l,crown:s=!1}){const[c,d]=k.useState();return k.useEffect(()=>{let f=!0;return d(void 0),aI(e,i,a,s).then(m=>{f&&d(m)}).catch(()=>{}),()=>{f=!1}},[e,i,a,s]),u.jsxs("span",{className:"jv-bot-avatar",style:{"--jv-avatar-size":`${a}px`,"--jv-avatar-color":Zk(e)},"aria-hidden":"true",children:[c?u.jsx("img",{src:c,alt:""}):u.jsx("span",{className:"jv-bot-avatar-tile"}),l==="working"&&u.jsxs("span",{className:"jv-typing",title:j("avatar.working"),children:[u.jsx("i",{}),u.jsx("i",{}),u.jsx("i",{})]}),l==="asking"&&u.jsx("span",{className:"jv-typing jv-asking",title:j("activity.asking"),children:"?"})]})}const Zl=O_,Jl=z_;function Wl({className:e,children:i,...a}){return u.jsxs(__,{"data-slot":"select-trigger",className:nn("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50",e),...a,children:[i,u.jsx(L_,{asChild:!0,children:u.jsx(ts,{className:"size-4 opacity-50"})})]})}function eo({className:e,children:i,container:a,...l}){return u.jsx(H_,{container:a??void 0,children:u.jsx(U_,{"data-slot":"select-content",position:"popper",sideOffset:5,className:nn("z-[100] max-h-[min(300px,70dvh)] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md border bg-popover bg-background p-1 text-foreground shadow-md",e),...l,children:u.jsx(X_,{children:i})})})}function Fi({className:e,children:i,...a}){return u.jsxs(Z_,{"data-slot":"select-item",className:nn("relative flex cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50",e),...a,children:[u.jsx(J_,{children:i}),u.jsx(e3,{"data-slot":"select-indicator",className:"absolute right-2",children:u.jsx(ur,{className:"size-4"})})]})}const X1={auto:"botModel.auto",off:"botModel.off",minimal:"botModel.minimal",low:"botModel.low",medium:"botModel.medium",high:"botModel.high",xhigh:"botModel.xhigh",max:"botModel.max"},rI=(e,i)=>JSON.stringify([e,i]);function Jk({bot:e,connections:i,onSaved:a,onManage:l}){const[s,c]=k.useState([]),[d,f]=k.useState(!0),[m,v]=k.useState(""),[y,g]=k.useState(0),[b,x]=k.useState(!1),[w,S]=k.useState(""),[C,N]=k.useState(!1),[M,T]=k.useState(""),[A,I]=k.useState(-1),D=k.useRef(null),B=k.useRef(null),P=k.useId();k.useEffect(()=>{let J=!0;return f(!0),v(""),je.modelOptions().then(ee=>{J&&c(ee.connections)}).catch(ee=>{J&&v(Pt(ee,"botModel.loadFailed"))}).finally(()=>{J&&f(!1)}),()=>{J=!1}},[i,y]);const V=s.flatMap(J=>J.models.map(ee=>({...ee,connectionId:J.id,connectionName:J.name,key:rI(J.id,ee.id)}))).sort((J,ee)=>J.name.localeCompare(ee.name,void 0,{numeric:!0})),z=V.find(J=>J.connectionId===e.connectionId&&J.id===e.modelId),Y=i.find(J=>J.id===e.connectionId),q=Y==null?void 0:Y.models.find(J=>J.id===e.modelId),W=V.filter(J=>`${J.name} ${J.id} ${J.connectionName}`.toLocaleLowerCase().includes(M.trim().toLocaleLowerCase())),Q=s.map(J=>({...J,models:W.filter(ee=>ee.connectionId===J.id)})).filter(J=>J.models.length),U=Q.flatMap(J=>J.models),X=V.length>8,O=e.thinkingLevel==="auto"?`auto${e.effectiveThinkingLevel?` · ${e.effectiveThinkingLevel}`:""}`:e.effectiveThinkingLevel??e.thinkingLevel;function F(J){N(J),T(""),I(-1)}async function ne(J,ee,H){F(!1),x(!0),S("");try{a(await je.selectBotModel(e.id,J,ee,H,qd()))}catch($){S(Pt($,"botModel.switchFailed"))}finally{x(!1)}}function _(J){var ee;if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault();const H=J.key==="ArrowDown"?Math.min(A+1,U.length-1):Math.max(A-1,0);I(H),(ee=document.getElementById(`${P}-${H}`))==null||ee.scrollIntoView({block:"nearest"})}else if(J.key==="Enter"&&U[A]){J.preventDefault();const H=U[A];ne(H.connectionId,H.id,e.thinkingLevel)}}return u.jsxs("div",{className:"jv-bot-model jv-ui","aria-busy":b||d,children:[u.jsxs("div",{className:"jv-bot-model-fields",children:[u.jsxs("div",{className:"jv-bot-model-field",children:[u.jsx("span",{className:"jv-field-label",children:j("usage.model")}),u.jsxs(e_,{open:C,onOpenChange:F,children:[u.jsxs(t_,{className:"jv-model-trigger","aria-label":j("botModel.pick"),"aria-haspopup":"listbox",disabled:b||d||!!m,children:[u.jsx("span",{children:(z==null?void 0:z.name)??(q==null?void 0:q.name)??j(e.connectionId?"botModel.broken":"botModel.choose")}),b?u.jsx(jj,{className:"animate-spin"}):u.jsx(ts,{})]}),u.jsx(n_,{children:u.jsxs(i_,{className:"jv-model-menu jv-ui",align:"start",sideOffset:6,collisionPadding:12,onOpenAutoFocus:J=>{var ee;J.preventDefault(),(ee=X?D.current:B.current)==null||ee.focus()},onKeyDown:_,children:[X&&u.jsxs("div",{className:"jv-model-search",children:[u.jsx(kc,{}),u.jsx("input",{ref:D,role:"combobox","aria-label":j("botModel.filter"),"aria-expanded":"true","aria-controls":P,"aria-activedescendant":A>=0?`${P}-${A}`:void 0,placeholder:j("botModel.filterPlaceholder"),value:M,onChange:J=>{T(J.target.value),I(-1)},autoComplete:"off",spellCheck:!1})]}),u.jsxs("div",{ref:B,id:P,role:"listbox","aria-label":j("botModel.list"),tabIndex:-1,"aria-activedescendant":A>=0?`${P}-${A}`:void 0,className:"jv-model-options",children:[Q.map(J=>u.jsxs("div",{role:"group","aria-label":J.name,children:[u.jsx("div",{className:"jv-model-group-label",children:J.name}),J.models.map(ee=>{const H=U.indexOf(ee),$=ee.connectionId===e.connectionId&&ee.id===e.modelId;return u.jsxs("button",{type:"button",role:"option",tabIndex:-1,id:`${P}-${H}`,"aria-selected":$,"data-active":H===A||void 0,title:ee.id,onClick:()=>void ne(ee.connectionId,ee.id,e.thinkingLevel),children:[u.jsx("span",{className:"jv-option-check",children:$&&u.jsx(ur,{})}),u.jsx("span",{children:ee.name})]},ee.key)})]},J.id)),!U.length&&u.jsx("p",{className:"jv-menu-empty",children:j(V.length?"botModel.noMatch":"botModel.none")})]}),u.jsx("button",{type:"button",className:"jv-menu-manage",onClick:()=>{F(!1),l()},children:j("botModel.manage")})]})})]}),(z||Y)&&u.jsx("span",{className:"jv-field-note",children:(z==null?void 0:z.connectionName)??(Y==null?void 0:Y.displayName)})]}),u.jsxs("div",{className:"jv-bot-model-field",children:[u.jsx("span",{className:"jv-field-label",children:j("botModel.thinking")}),u.jsxs(Zl,{value:e.thinkingLevel==="auto"?"auto":e.effectiveThinkingLevel??e.thinkingLevel,disabled:b||d||!z||!!m,onValueChange:J=>{e.connectionId&&ne(e.connectionId,e.modelId,J)},children:[u.jsx(Wl,{className:"jv-thinking-trigger","aria-label":j("botModel.pickThinking"),children:u.jsx(Jl,{children:O})}),u.jsx(eo,{className:"jv-select-menu jv-thinking-menu",align:"end",children:["auto",...(z==null?void 0:z.thinking.levels)??[]].map(J=>{const ee=z==null?void 0:z.thinkingLevelMap[J],H=ee&&ee!==J?ee:J;return u.jsx(Fi,{value:J,children:u.jsxs("span",{className:"jv-thinking-option",children:[u.jsxs("span",{children:[H,ee&&ee!==J&&u.jsxs("small",{children:[" (",J,")"]})]}),u.jsx("small",{children:X1[J]&&j(X1[J])})]})},J)})})]})]})]}),d&&u.jsx("p",{className:"jv-field-note",role:"status",children:j("botModel.loading")}),b&&u.jsx("p",{className:"jv-field-note",role:"status",children:j("botModel.switching")}),m&&u.jsxs("p",{className:"jv-model-error",role:"alert",children:[m," ",u.jsx("button",{type:"button",onClick:()=>g(J=>J+1),children:j("common.retry")})]}),w&&u.jsx("p",{className:"jv-model-error",role:"alert",children:w})]})}function In({className:e,type:i,...a}){return u.jsx("input",{type:i,"data-slot":"input",className:nn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...a})}function ig({className:e,...i}){return u.jsx("textarea",{"data-slot":"textarea",className:nn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...i})}const lI={running:"activity.running",idle:"activity.idle",stop:"activity.stopped"};function oI({bot:e,status:i,connections:a,chats:l,onSaved:s,onManageModels:c,onClose:d,onOpenChat:f,onOpenSubscription:m}){const[v,y]=k.useState("info"),[g,b]=k.useState(e.name),[x,w]=k.useState(e.description),[S,C]=k.useState(e.systemPrompt),[N,M]=k.useState(!1),[T,A]=k.useState(null),[I,D]=k.useState(null),[B,P]=k.useState(null),[V,z]=k.useState(""),[Y,q]=k.useState(!1),[W,Q]=k.useState(null);k.useEffect(()=>{let ee=!0;return je.botSubscriptions(e.id).then(H=>{ee&&Q(H.chats)}).catch(()=>{}),()=>{ee=!1}},[e.id]),k.useEffect(()=>{if(!Y)return;const ee=setTimeout(()=>q(!1),1500);return()=>clearTimeout(ee)},[Y]);const U=g!==e.name||x!==e.description||S!==e.systemPrompt,X=(i==null?void 0:i.status)??"stop",O=i==null?void 0:i.context;async function F(ee){P(ee),z("");try{await je.controlBot(e.id,ee)}catch(H){z(Pt(H,"common.failed"))}finally{P(null)}}async function ne(ee){ee.preventDefault(),M(!0),A(null);try{s(await je.saveBot(e.id,{name:g,description:x,systemPrompt:S})),A({kind:"ok",text:j("bot.saved")})}catch(H){A({kind:"error",text:Pt(H,"common.saveFailed")})}finally{M(!1)}}async function _(ee){if(ee!==e.color){M(!0),D(null);try{s(await je.setBotColor(e.id,ee))}catch(H){D({kind:"error",text:Pt(H,"bot.changeFailed")})}finally{M(!1)}}}const J=ee=>ee&&u.jsx("p",{className:ee.kind==="error"?"jv-note-error":"jv-note-ok",role:ee.kind==="error"?"alert":"status",children:ee.text});return u.jsx(Qk,{open:!0,onOpenChange:ee=>{ee||d()},children:u.jsx(Kk,{className:`jv-bot-info jv-ui ${v==="activity"?"jv-bot-activity-shell":""}`,"aria-describedby":void 0,children:v==="activity"?u.jsx(X8,{botId:e.id,botName:e.name,onBack:()=>y("info"),onOpenChat:f}):v==="usage"?u.jsx(W8,{botId:e.id,botName:e.name,onBack:()=>y("info")}):u.jsxs(u.Fragment,{children:[u.jsx(uv,{className:"jv-dialog-header",children:u.jsx(cf,{children:j("entry.botInfo")})}),u.jsxs("div",{className:"jv-bot-scroll",children:[u.jsxs("section",{className:"jv-bot-hero",children:[u.jsx(zc,{color:e.color,mood:e.mood,size:72,crown:e.agent}),u.jsxs("div",{className:"jv-bot-identity",children:[u.jsx("strong",{children:e.name}),u.jsx("span",{children:e.description||j("bot.noDescription")}),u.jsx("div",{className:"jv-bot-colors",role:"radiogroup","aria-label":j("bot.color"),children:Object.keys(Vi).map(ee=>u.jsx("button",{type:"button",role:"radio","aria-checked":e.color===ee,"aria-label":j(Vi[ee].label),title:j(Vi[ee].label),disabled:N,style:{background:Zk(ee)},onClick:()=>void _(ee)},ee))}),J(I)]})]}),e.agent&&u.jsxs("section",{className:"jv-section","aria-label":j("agent.title"),children:[u.jsx("h3",{className:"jv-section-title",children:j("agent.title")}),u.jsxs("div",{className:"jv-panel jv-agent-about",children:[u.jsx("p",{children:j("agent.intro",{name:e.name})}),u.jsx("ul",{children:["agent.create","agent.model","agent.run","agent.delete"].map(ee=>u.jsx("li",{children:j(ee)},ee))}),u.jsx("p",{className:"jv-hint",children:j("agent.note")})]})]}),u.jsxs("section",{className:"jv-section","aria-label":j("usage.model"),children:[u.jsx("h3",{className:"jv-section-title",children:j("usage.model")}),u.jsxs("div",{className:"jv-panel",children:[u.jsx(Jk,{bot:e,connections:a,onSaved:s,onManage:c}),O&&u.jsxs("div",{className:"jv-context",title:j("bot.contextHint"),children:[u.jsxs("div",{className:"jv-context-label",children:[u.jsx("span",{children:j("bot.context")}),u.jsx("span",{children:O.tokens===null?j("bot.unknown"):j("bot.tokens",{used:za(O.tokens),window:za(O.contextWindow)})})]}),O.tokens!==null&&u.jsx("div",{className:"jv-context-bar",children:u.jsx("span",{style:{width:`${Math.min(100,Math.max(1,O.tokens/O.contextWindow*100))}%`}})})]})]})]}),u.jsxs("section",{className:"jv-section","aria-label":j("bot.profile"),children:[u.jsx("h3",{className:"jv-section-title",children:j("bot.profile")}),u.jsxs("form",{className:"jv-panel",onSubmit:ee=>void ne(ee),children:[u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:j("info.name")}),u.jsx(In,{id:"jarvy-bot-name",required:!0,maxLength:80,value:g,onChange:ee=>b(ee.target.value)})]}),u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:j("bot.description")}),u.jsx(ig,{id:"jarvy-bot-description",maxLength:1e3,rows:2,value:x,onChange:ee=>w(ee.target.value),placeholder:j("bot.descriptionPlaceholder")})]}),u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:"Persona"}),u.jsx(ig,{id:"jarvy-bot-persona",maxLength:16e3,rows:7,value:S,onChange:ee=>C(ee.target.value),placeholder:j("bot.personaPlaceholder")}),u.jsx("small",{className:"jv-hint",children:j("bot.personaHint")})]}),u.jsxs("div",{className:"jv-form-footer",children:[J((T==null?void 0:T.kind)==="error"||!U?T:null)??(U?u.jsx("p",{className:"jv-hint",children:j("bot.unsaved")}):u.jsx("span",{})),u.jsx(Ve,{type:"submit",className:"jv-primary",disabled:N||!U,children:j(N?"bot.saving":"common.save")})]})]})]}),u.jsxs("section",{className:"jv-section","aria-label":j("bot.runtime"),children:[u.jsx("h3",{className:"jv-section-title",children:j("bot.runtime")}),u.jsxs("div",{className:"jv-list",children:[u.jsxs("div",{className:"jv-list-row jv-static-row",children:[u.jsxs("span",{className:"jv-row-text",children:[u.jsx("strong",{children:j("bot.status")}),u.jsx("span",{children:j("bot.statusHint")})]}),u.jsx("span",{className:"jv-status","data-ok":X!=="stop"||void 0,"data-busy":X==="running"||void 0,children:j(lI[X])}),X==="running"&&u.jsx(Ve,{type:"button",variant:"ghost",size:"sm",disabled:!!B,onClick:()=>void F("abort"),children:j(B==="abort"?"bot.aborting":"bot.abort")}),u.jsx(Ve,{type:"button",variant:"outline",size:"sm",disabled:!!B||!e.connectionId,onClick:()=>void F(X==="stop"?"start":"stop"),children:j(B==="start"?"bot.starting":B==="stop"?"bot.stopping":X==="stop"?"bot.start":"bot.stop")})]}),u.jsxs("div",{className:"jv-list-row jv-static-row",children:[u.jsxs("span",{className:"jv-row-text",children:[u.jsx("strong",{children:j("bot.workspace")}),u.jsx("code",{title:e.workspacePath,children:e.workspacePath})]}),u.jsx(Ve,{type:"button",variant:"ghost",size:"icon-sm","aria-label":j(Y?"ui.copied":"bot.copyWorkspace"),onClick:()=>void cv(e.workspacePath).then(ee=>q(ee)),children:Y?u.jsx(ur,{}):u.jsx(tj,{})})]}),u.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>y("activity"),children:[u.jsx("span",{className:"jv-row-icon",children:u.jsx(FA,{})}),u.jsxs("span",{className:"jv-row-text",children:[u.jsx("strong",{children:j("bot.activity")}),u.jsx("span",{children:j("bot.activityHint")})]}),u.jsx(Kr,{className:"jv-row-chevron"})]}),u.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>y("usage"),children:[u.jsx("span",{className:"jv-row-icon",children:u.jsx(hA,{})}),u.jsxs("span",{className:"jv-row-text",children:[u.jsx("strong",{children:j("usage.title")}),u.jsx("span",{children:j("bot.usageHint")})]}),u.jsx(Kr,{className:"jv-row-chevron"})]})]}),V&&u.jsx("p",{className:"jv-note-error",role:"alert",children:V})]}),W&&u.jsxs("section",{className:"jv-section","aria-label":j("bot.subscriptions"),children:[u.jsx("h3",{className:"jv-section-title",children:j("bot.subscriptions")}),u.jsx("div",{className:"jv-list",children:W.length===0?u.jsx("div",{className:"jv-list-row jv-static-row",children:u.jsx("span",{className:"jv-row-text",children:u.jsx("span",{children:j("bot.noSubscriptions")})})}):W.map(ee=>{var H;return u.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>m(ee),children:[u.jsx("span",{className:"jv-row-icon",children:ee.type==="thread"?u.jsx(Aj,{}):u.jsx(EA,{})}),u.jsxs("span",{className:"jv-row-text",children:[u.jsx("strong",{children:ee.title}),u.jsx("span",{children:ee.type==="thread"?j("bot.threadIn",{channel:((H=l.find($=>$.id===ee.parentId))==null?void 0:H.title)??""}):j("info.menu")})]}),u.jsx(Kr,{className:"jv-row-chevron"})]},ee.id)})})]})]})]})})})}function Wk({id:e,value:i,sections:a,onChange:l}){const[s,c]=k.useState(null);return u.jsxs(Zl,{value:i??"none",onValueChange:d=>l(d==="none"?null:d),children:[u.jsx(Wl,{id:e,ref:d=>c((d==null?void 0:d.closest("dialog"))??null),className:"jv-select jv-section-select",children:u.jsx(Jl,{})}),u.jsxs(eo,{className:"jv-select-menu",position:"popper",sideOffset:4,container:s,children:[u.jsx(Fi,{value:"none",children:j("info.noSection")}),a.map(d=>u.jsx(Fi,{value:d.id,children:d.name},d.id))]})]})}const sI=1024*1024,cI=["txt","json","jsonl","yaml","yml","ts","tsx","js","jsx","mjs","cjs","css","log","csv","py","sh","sql","toml","xml","ini","env","diff","patch"],Fl=e=>`/api/attachments/${e.id}`,eC=e=>e.name.includes(".")?e.name.split(".").pop().toLowerCase():"";function uf(e){const i=eC(e),a=e.mimeType.toLowerCase();return i==="svg"||a==="image/svg+xml"?"svg":a.startsWith("image/")||["png","jpg","jpeg","gif","webp","avif","bmp"].includes(i)?"image":a.startsWith("video/")?"video":a.startsWith("audio/")?"audio":["webm","mp4","mov"].includes(i)?"video":["mp3","wav","ogg"].includes(i)?"audio":["html","htm"].includes(i)||a==="text/html"?"html":["md","markdown"].includes(i)?"markdown":a.startsWith("text/")||cI.includes(i)?"text":"download"}const hc=e=>e==="image"||e==="svg",tC=e=>e==="video"||e==="audio",nC={image:"files.kindImage",svg:"files.kindSvg",video:"files.kindVideo",audio:"files.kindAudio",html:"files.kindHtml",markdown:"files.kindMarkdown",text:"files.kindText",download:"files.kindFile"};function iC(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}async function aC(e,i){const a=await fetch(Fl(e),{signal:i,credentials:"same-origin"});if(!a.ok)throw new Error(a.status===404?j("files.gone"):j("files.readFailed",{status:a.status}));return a.text()}async function rC(e,i){return uf(e)==="svg"?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await aC(e,i))}`:Fl(e)}const Q1=e=>`/api/attachments/${e.id}/run`;function uI(e){const i=new DOMParser().parseFromString(e,"text/html");let a=i.querySelectorAll("script").length;const l=new Set;return i.querySelectorAll("*").forEach(s=>{for(const c of[...s.attributes])if(c.name.startsWith("on"))a++;else if(/^\s*javascript:/i.test(c.value)&&["href","src","action","formaction","xlink:href"].includes(c.name))a++;else if(["src","href"].includes(c.name)&&s.tagName!=="A")try{const d=new URL(c.value);(d.protocol==="http:"||d.protocol==="https:")&&l.add(d.host)}catch{}}),a?{count:a,hosts:[...l]}:null}function dI(e){const i=new DOMParser().parseFromString(e,"text/html");return i.querySelectorAll("script,iframe,frame,object,embed,link,meta,base,audio,video,source,track").forEach(a=>a.remove()),i.querySelectorAll("*").forEach(a=>{for(const l of[...a.attributes])(l.name.startsWith("on")||["href","xlink:href","srcset","action","formaction","target","autofocus","contenteditable"].includes(l.name)||l.name==="src"&&!l.value.startsWith("data:image/"))&&a.removeAttribute(l.name);["BUTTON","INPUT","SELECT","TEXTAREA"].includes(a.tagName)&&a.setAttribute("disabled","")}),`<!doctype html><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:; form-action 'none'; base-uri 'none'"><meta charset="utf-8">${i.documentElement.outerHTML}`}function fI({file:e,onSize:i}){const[a,l]=k.useState(),[s,c]=k.useState(!1);return k.useEffect(()=>{const d=new AbortController;return c(!1),rC(e,d.signal).then(l).catch(()=>{d.signal.aborted||c(!0)}),()=>d.abort()},[e.id]),s?u.jsx("span",{className:"ui-broken-image",children:u.jsx(De,{name:"image"})}):a?u.jsx("img",{src:a,alt:e.name,loading:"lazy",onError:()=>c(!0),onLoad:d=>{const{naturalWidth:f,naturalHeight:m}=d.currentTarget;f&&m&&i({width:f,height:m})}}):u.jsx(De,{name:"image"})}function hI({file:e,onOpen:i}){const[a,l]=k.useState(),s=uf(e),c=hc(s),d=tC(s),f=eC(e).toUpperCase(),m=c&&a?{"--image-w":`${a.width}px`,"--image-ratio":`${a.width/a.height}`}:void 0;return u.jsxs("div",{className:`ui-message-file ${c?"ui-message-image":""}`,"data-sized":m?"":void 0,style:m,children:[u.jsxs("button",{type:"button",className:"ui-message-open",onClick:i,"aria-label":j("files.preview",{name:e.name}),children:[c?u.jsx("span",{className:"ui-image-frame",children:u.jsx(fI,{file:e,onSize:l})}):u.jsx("span",{className:"ui-file-icon","data-kind":d?s:void 0,children:u.jsx(De,{name:d?`file-${s}`:"file"})}),u.jsxs("span",{className:"ui-file-copy",children:[u.jsx("strong",{title:e.name,children:e.name}),u.jsxs("small",{children:[d?`${j(nC[s])} · `:"",f?`${f} · `:"",iC(e.size)]})]})]}),u.jsx("a",{className:"ui-iconbtn",href:Fl(e),download:e.name,"aria-label":j("files.download",{name:e.name}),title:j("files.download",{name:e.name}),children:u.jsx(De,{name:"cloud-download"})})]})}function lC({files:e,onOpen:i}){const a=e.some(l=>hc(uf(l)));return u.jsx("div",{className:`ui-message-files ${a?"ui-has-images":""}`,children:e.map((l,s)=>u.jsx(hI,{file:l,onOpen:()=>i(s)},l.id))})}const K1=e=>String.fromCharCode(65+e),Z1=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable;function oC({message:e,keyboard:i,onSettled:a}){var M,T;const l=e.question,s=l.state==="pending",c=k.useId(),[d,f]=k.useState([]),[m,v]=k.useState(""),[y,g]=k.useState(!1),[b,x]=k.useState("");async function w(A){if(!(y||!s)){g(!0),x("");try{a(await je.answerQuestion(e.chatId,e.id,A))}catch(I){x(Pt(I,"question.failed"))}finally{g(!1)}}}const S=A=>{if(!l.multiple){w({action:"answer",selected:[A]});return}f(I=>I.includes(A)?I.filter(D=>D!==A):[...I,A])},C=()=>void w({action:"answer",selected:d,...m.trim()?{custom:m.trim()}:{}}),N=()=>{m.trim()&&(l.multiple?C():w({action:"answer",selected:[],custom:m.trim()}))};if(k.useEffect(()=>{if(!i||!s)return;const A=I=>{if(I.defaultPrevented||I.metaKey||I.ctrlKey||I.altKey||I.key.length!==1||Z1(I.target)||Z1(document.activeElement)||document.querySelector("dialog[open], [role=dialog]"))return;const D=I.key.toUpperCase().charCodeAt(0)-65;D<0||D>=l.options.length||(I.preventDefault(),S(D))};return document.addEventListener("keydown",A,!0),()=>document.removeEventListener("keydown",A,!0)}),!s){const A=l.state==="answered"?[...(((M=l.answer)==null?void 0:M.selected)??[]).map(I=>{var D;return((D=l.options[I])==null?void 0:D.label)??""}),...(T=l.answer)!=null&&T.custom?[l.answer.custom]:[]].filter(Boolean).join(j("common.listSeparator")):null;return u.jsxs("p",{className:"jv-question-done","data-state":l.state,title:`${l.question}
513
- ${A===null?j("question.dismissed"):j("question.chose",{answer:A})}`,children:[A===null?u.jsx(LA,{"aria-hidden":"true"}):u.jsx(ur,{"aria-hidden":"true"}),u.jsx("span",{className:"jv-question-answer",children:A===null?j("question.dismissed"):L2("question.chose",{answer:u.jsx("strong",{children:A})})}),u.jsx("span",{className:"jv-question-asked",children:l.question})]})}return u.jsxs("div",{className:"jv-question",role:"group","aria-labelledby":c,"aria-busy":y||void 0,children:[u.jsxs("div",{className:"jv-question-head",children:[u.jsxs("div",{className:"jv-question-heading",children:[u.jsx("p",{id:c,className:"jv-question-title",children:l.question}),l.detail&&u.jsx("p",{className:"jv-question-detail",children:l.detail})]}),u.jsx("button",{type:"button",className:"jv-question-dismiss","aria-label":j("question.dismissLabel"),title:j("question.dismiss"),disabled:y,onClick:()=>void w({action:"dismiss"}),children:u.jsx(Cc,{"aria-hidden":"true"})})]}),u.jsx("div",{className:"jv-question-options",role:l.multiple?"group":void 0,"aria-label":l.multiple?j("question.multiple"):void 0,children:l.options.map((A,I)=>{const D=d.includes(I);return u.jsxs("button",{type:"button",className:"jv-question-option","data-style":A.style,"data-on":D||void 0,"aria-pressed":l.multiple?D:void 0,"aria-keyshortcuts":i?K1(I).toLowerCase():void 0,disabled:y,onClick:()=>S(I),children:[u.jsx("span",{className:"jv-question-key","aria-hidden":"true",children:D?u.jsx(ur,{}):K1(I)}),u.jsxs("span",{className:"jv-question-copy",children:[u.jsx("strong",{children:A.label}),A.description&&u.jsx("small",{children:A.description})]})]},A.label)})}),(l.allowCustom||l.multiple)&&u.jsxs("div",{className:"jv-question-foot",children:[l.allowCustom&&u.jsx("input",{className:"jv-question-custom",value:m,maxLength:2e3,placeholder:j(l.multiple?"question.note":"question.own"),"aria-label":j("question.ownLabel"),disabled:y,onChange:A=>v(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!A.nativeEvent.isComposing&&(A.preventDefault(),N())}}),l.multiple?u.jsx("button",{type:"button",className:"ui-button jv-question-submit",disabled:y||!d.length&&!m.trim(),onClick:C,children:d.length?j("question.confirmCount",{count:d.length}):j("question.confirm")}):u.jsx("button",{type:"button",className:"ui-button jv-question-submit",disabled:y||!m.trim(),onClick:N,children:j("question.send")})]}),b&&u.jsx("p",{className:"jv-question-error",role:"alert",children:b})]})}function Pa(e){return e?e.deleted?j("member.deleted",{name:e.name}):e.name:j("member.unknown")}const mI={reasoning:"activity.reasoning",texting:"activity.texting",tool_calling:"activity.toolCalling",asking:"activity.asking"},sC=e=>j(mI[e??""]??"activity.running"),ra=e=>e.filter(i=>!i.deleted);function pI(e){const i=new Set(e.map(l=>l.toLowerCase()));let a=j("bot.newName");for(let l=2;i.has(a.toLowerCase());l++)a=j("bot.newNameN",{n:l});return a}const dp=/[\p{Script=Latin}\p{Nd}_]/u;function dv(e,i){const a=e.replace(/```[\s\S]*?```|`[^`\n]*`/g,d=>" ".repeat(d.length)),l=a.toLowerCase(),s=[...i].sort((d,f)=>f.name.length-d.name.length),c=[];for(let d=l.indexOf("@");d>=0;d=l.indexOf("@",d+1)){if(d>0&&dp.test(a[d-1]))continue;const f=s.find(m=>{const v=m.name.toLowerCase();if(!v||!l.startsWith(v,d+1))return!1;const y=a[d+1+v.length];return!(y&&dp.test(y)&&dp.test(v.at(-1)))});f&&(c.push({member:f,at:d,length:f.name.length+1}),d+=f.name.length)}return c}function gI(e,i,a){let l="",s=0;for(const c of dv(e,i))l+=e.slice(s,c.at)+`[${e.slice(c.at,c.at+c.length)}](${c.member.id===a?"#mention-me":"#mention"})`,s=c.at+c.length;return l+e.slice(s)}const cC=/\[\[q(\d+)\]\]/g,ag=(e,i=40)=>{const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}…`:a};function fv(e){return e.content.replace(cC,(i,a)=>{const l=e.quotes[Number(a)-1];return l?j("quote.inline",{text:l.text}):i})}function Lc(e){return fv(e).replace(/[*`~#>]/g,"").replace(/\s+/g," ").trim()||j("common.attachment")}function uC({message:e,members:i,me:a,onJump:l}){const s=gI(e.content,i.filter(d=>e.mentions.includes(d.id)),a).replace(cC,(d,f)=>e.quotes[Number(f)-1]?`[q${f}](#quote-${f})`:d),c=d=>{const f=e.quotes[d-1];if(!f)return null;const m=Pa(i.find(v=>v.id===f.senderId));return u.jsxs("button",{type:"button",className:"jv-quote-tag",title:j("sidebar.said",{name:m,text:f.text}),"data-gone":f.messageId?void 0:"",onClick:()=>l==null?void 0:l(f.messageId,f.text),children:[u.jsx(De,{name:"quote"}),u.jsx("span",{className:"jv-quote-name",children:j("quote.by",{name:m})}),u.jsx("span",{className:"jv-quote-text",children:ag(f.text,80)})]})};return u.jsx(Dc,{text:s,renderQuote:c})}function dC(e,i){var g;const a=i.replace(/\s+/g,"");if(!a||typeof CSS>"u"||!("highlights"in CSS))return!1;const l=e.querySelector(".ui-bubble")??e,s=document.createTreeWalker(l,NodeFilter.SHOW_TEXT),c=[];for(let b=s.nextNode();b;b=s.nextNode())if(!((g=b.parentElement)!=null&&g.closest(".jv-quote-tag, button")))for(let x=0;x<b.data.length;x++)/\s/.test(b.data[x])||c.push({node:b,offset:x});const d=c.map(b=>b.node.data[b.offset]).join(""),f=d.indexOf(a);if(f<0)return!1;const m=c[f],v=c[f+a.length-1],y=new Range;return y.setStart(m.node,m.offset),y.setEnd(v.node,v.offset+1),CSS.highlights.set("jv-passage",new Highlight(y)),setTimeout(()=>CSS.highlights.delete("jv-passage"),2400),!0}function fC(e,i){e.scrollIntoView({block:"center",behavior:"smooth"}),!(i&&dC(e,i))&&(e.classList.add("jv-jump"),setTimeout(()=>e.classList.remove("jv-jump"),1200))}function vI({quotes:e,onRemove:i}){return e.length?u.jsx("div",{className:"jv-compose-quotes",children:e.map((a,l)=>u.jsxs("span",{className:"jv-quote-tag",title:j("sidebar.said",{name:a.name,text:a.text}),children:[u.jsx(De,{name:"quote"}),u.jsx("span",{className:"jv-quote-name",children:j("quote.by",{name:a.name})}),u.jsx("span",{className:"jv-quote-text",children:ag(a.text)}),u.jsx("button",{type:"button","aria-label":j("quote.remove",{text:ag(a.text,20)}),onClick:()=>i(l),children:"×"})]},l))}):null}function hC({container:e,drafts:i,chatId:a,source:l,members:s,onNotice:c}){const d=(y,g)=>{const b=l(y);b&&!yI(i,a,b,s,g)&&c(j("quote.tooMany",{count:10}))},[f,m]=k.useState(null);if(k.useEffect(()=>{const y=e.current;if(!y||!matchMedia("(hover: hover) and (pointer: fine)").matches)return;const g=N=>{var M;return(M=N instanceof Element?N:N==null?void 0:N.parentElement)==null?void 0:M.closest(".ui-bubble")},b=()=>{var D,B;const N=getSelection(),M=(N==null?void 0:N.toString())??"";if(!N||N.isCollapsed||!M.trim()){m(null);return}const T=g(N.anchorNode),A=T==null?void 0:T.closest("[data-message]");if(!T||!A||!y.contains(T)||g(N.focusNode)!==T||(B=(D=N.anchorNode)==null?void 0:D.parentElement)!=null&&B.closest(".jv-quote-tag, button")){m(null);return}const I=N.getRangeAt(0).getBoundingClientRect();m({x:Math.min(Math.max(I.left+I.width/2,90),innerWidth-90),y:Math.max(I.top-8,48),messageId:A.getAttribute("data-message"),text:M.trim()})},x=()=>requestAnimationFrame(b),w=()=>m(null),S=N=>{N.key==="Escape"&&w()},C=()=>{var N;(N=getSelection())!=null&&N.isCollapsed&&w()};return y.addEventListener("mouseup",x),y.addEventListener("scroll",w,!0),document.addEventListener("keydown",S),document.addEventListener("selectionchange",C),()=>{y.removeEventListener("mouseup",x),y.removeEventListener("scroll",w,!0),document.removeEventListener("keydown",S),document.removeEventListener("selectionchange",C)}},[e]),!f)return null;const v=()=>{var y;m(null),(y=getSelection())==null||y.removeAllRanges()};return u.jsxs("div",{className:"ui-popover jv-selection-menu",role:"menu","aria-label":j("quote.selection"),style:{left:f.x,top:f.y},onMouseDown:y=>y.preventDefault(),children:[u.jsxs("button",{type:"button",role:"menuitem",className:"ui-menu-item",onClick:()=>{cv(f.text),v()},children:[u.jsx(De,{name:"copy"}),u.jsx("span",{className:"ui-menu-copy",children:j("quote.copy")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:"ui-menu-item",onClick:()=>{d(f.messageId,f.text),v()},children:[u.jsx(De,{name:"quote"}),u.jsx("span",{className:"ui-menu-copy",children:j("quote.quote")})]})]})}function yI(e,i,a,l,s){if(e.get(i).passages.length>=10)return!1;const c={messageId:a.id,name:Pa(l.find(d=>d.id===a.senderId)),text:s};return e.update(i,d=>({passages:[...d.passages,c]})),!0}const bI=["👍","👎","✅","❌","😄","😂","😵‍💫","🤔"],J1=["👍","👎","✅","❌","🙏","👏","🎉","🔥","💯","❤️","💔","⭐","😄","😂","🤣","😊","🙂","😉","😅","😴","🤔","🤨","😮","😱","😢","😭","😤","😡","🤯","🥳","😵‍💫","🫠","👀","🙈","🤝","💪","🚀","🐛","✅","⚠️","❓","❗","📌","🧠","☕","🍰","🌙","☀️"];function mC({message:e,members:i,onJump:a}){if(!e.replyTo)return null;const l=i.find(s=>s.id===e.replyTo.senderId);return u.jsxs("button",{type:"button",className:"jv-reply-quote",onClick:()=>a(e.replyTo.id),children:[u.jsx("span",{className:"jv-reply-author",children:Pa(l)}),u.jsx("span",{className:"jv-reply-text",children:Lc(e.replyTo)})]})}function pC({message:e,me:i,members:a,onReact:l,onError:s}){return e.reactions.length?u.jsx("div",{className:"jv-reactions",children:e.reactions.map(c=>{const d=c.memberIds.includes(i);return u.jsxs("button",{type:"button",className:"jv-reaction","data-mine":d||void 0,title:c.memberIds.map(f=>Pa(a.find(m=>m.id===f))).join(j("common.listSeparator")),onClick:()=>{try{l(e,c.emoji,!d)}catch(f){s(f)}},children:[u.jsx("span",{className:"jv-reaction-emoji",children:c.emoji}),u.jsx("span",{className:"jv-reaction-count",children:c.memberIds.length})]},c.emoji)})}):null}function gC({message:e,me:i,onReply:a,onReact:l,onError:s}){const[c,d]=k.useState(!1),[f,m]=k.useState(!1),v=k.useRef(null);k.useEffect(()=>{if(!c)return;const b=x=>{var w;(w=v.current)!=null&&w.contains(x.target)||d(!1)};return document.addEventListener("pointerdown",b),()=>document.removeEventListener("pointerdown",b)},[c]);const y=b=>{var w;const x=!((w=e.reactions.find(S=>S.emoji===b))!=null&&w.memberIds.includes(i));try{l(e,b,x)}catch(S){s(S)}d(!1)},g=()=>{var w,S,C;const b=(w=v.current)==null?void 0:w.getBoundingClientRect(),x=(C=(S=v.current)==null?void 0:S.closest(".ui-transcript, .ui-pane-body"))==null?void 0:C.getBoundingClientRect();m(!!b&&((x==null?void 0:x.bottom)??window.innerHeight)-b.bottom<240),d(!c)};return u.jsxs("div",{className:"jv-message-actions",ref:v,children:[a&&u.jsx(ct,{icon:"arrow-u-up-right",label:j("actions.reply"),onClick:()=>a(e)}),u.jsx(ct,{icon:"smiley-plus",label:j("actions.react"),"aria-expanded":c,onClick:g}),c&&u.jsxs("div",{className:"jv-emoji-menu",role:"menu","aria-label":j("actions.pickEmoji"),"data-up":f||void 0,children:[u.jsx("div",{className:"jv-emoji-quick",children:bI.map(b=>u.jsx("button",{type:"button",role:"menuitem",onClick:()=>y(b),children:b},b))}),u.jsxs("details",{className:"jv-emoji-more",children:[u.jsx("summary",{children:j("actions.more")}),u.jsx("div",{className:"jv-emoji-grid",children:J1.filter((b,x)=>J1.indexOf(b)===x).map(b=>u.jsx("button",{type:"button",onClick:()=>y(b),children:b},b))})]})]})]})}const vC="jarvy-notice-closed",xI=()=>{try{return JSON.parse(localStorage.getItem(vC)??"[]")}catch{return[]}};function vr({member:e,bots:i,size:a,working:l=!1}){const s=(e==null?void 0:e.kind)==="bot"?i.find(c=>c.id===e.id):void 0;return s?u.jsx(zc,{color:s.color,mood:s.mood,size:a,badge:l?"working":void 0,crown:s.agent}):u.jsx("span",{className:"ui-user-avatar jv-user-avatar",style:{width:a,height:a,fontSize:Math.round(a*.38)},children:((e==null?void 0:e.name)??"?").slice(0,2).toUpperCase()})}function jI({chat:e,members:i,bots:a,infoOpen:l,membersOpen:s,threadsOpen:c,searchOpen:d,onNav:f,onInfo:m,onMembers:v,onThreads:y,onSearch:g}){const b=i.filter(x=>e.memberIds.includes(x.id));return u.jsxs("header",{className:"ui-chat-header jv-channel-header",children:[u.jsxs("div",{className:"ui-header-left",children:[u.jsx(ct,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:j("common.openNav"),onClick:f}),u.jsxs("button",{type:"button",className:"jv-channel-title","aria-label":j("channel.infoFor",{name:e.title}),"aria-pressed":l,onClick:m,children:[u.jsx("span",{className:"jv-hash",children:"#"}),e.title,u.jsx(De,{name:"chevron-down"})]}),e.topic&&u.jsx("span",{className:"jv-channel-topic",children:e.topic})]}),u.jsxs("div",{className:"ui-header-actions",children:[u.jsxs("button",{type:"button",className:"jv-members-button","aria-label":j("channel.membersCount",{count:b.length}),"aria-pressed":s,title:j("channel.members"),onClick:v,children:[u.jsx("span",{className:"jv-stack",children:b.slice(0,3).map(x=>u.jsx("span",{className:"jv-stack-item",children:u.jsx(vr,{member:x,bots:a,size:22})},x.id))}),u.jsx("span",{className:"jv-members-count",children:b.length})]}),u.jsx(ct,{icon:"search",label:j("channel.search"),"aria-pressed":d,className:"jv-threads-button",onClick:g}),u.jsx(ct,{icon:"chat-bubble",label:j("channel.threads"),"aria-pressed":c,className:"jv-threads-button",onClick:y})]})]})}function wI({chat:e,onSave:i}){var x;const[a,l]=k.useState(xI),[s,c]=k.useState(null),[d,f]=k.useState(!1);k.useEffect(()=>c(null),[e.id]);const m=!a.includes(e.id),v=e.note,y=()=>l(w=>{const S=m?[...w,e.id]:w.filter(C=>C!==e.id);return localStorage.setItem(vC,JSON.stringify(S)),S}),g=async()=>{if(s!=null&&s.trim()){f(!0);try{await i(s.trim()),c(null)}finally{f(!1)}}};if(s!==null)return u.jsxs("div",{className:"jv-notice","data-editing":!0,children:[u.jsxs("div",{className:"jv-notice-head",children:[u.jsx(De,{name:"megaphone"}),u.jsx("strong",{children:j("notice.edit")})]}),u.jsx("textarea",{className:"jv-notice-input",value:s,autoFocus:!0,"aria-label":j("notice.content"),onChange:w=>c(w.target.value)}),u.jsxs("div",{className:"jv-notice-actions",children:[u.jsx("button",{type:"button",className:"ui-button",onClick:()=>c(null),children:j("common.cancel")}),u.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:d||!s.trim(),onClick:()=>void g(),children:j("common.save")})]})]});if(!v)return u.jsxs("div",{className:"jv-notice","data-empty":!0,children:[u.jsx(De,{name:"megaphone"}),u.jsx("span",{className:"jv-muted",children:j("notice.none")}),u.jsx(ct,{icon:"pencil",label:j("notice.edit"),onClick:()=>c("")})]});const b=((x=v.text.split(`
514
- `).find(w=>w.trim()&&!w.startsWith("#")))==null?void 0:x.replace(/[*`|>-]/g,"").trim())??"";return u.jsxs("div",{className:"jv-notice","data-open":m||void 0,children:[u.jsxs("div",{className:"jv-notice-head",children:[u.jsxs("button",{type:"button",className:"jv-notice-toggle","aria-expanded":m,onClick:y,children:[u.jsx(De,{name:"megaphone"}),u.jsx("strong",{children:j("notice.title")}),!m&&u.jsx("span",{className:"jv-notice-first",children:b}),u.jsx(De,{name:m?"chevron-down":"chevron-right"})]}),u.jsxs("span",{className:"jv-muted jv-notice-meta",children:[v.updatedBy.name," · ",Ha(v.updatedAt,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})," · ",j("notice.version",{version:v.version})]}),u.jsx(ct,{icon:"pencil",label:j("notice.edit"),onClick:()=>c(v.text)})]}),m&&u.jsx("div",{className:"jv-notice-body ui-bubble jv-flat",children:u.jsx(Dc,{text:v.text})})]})}function Hd({messages:e,members:i,bots:a,me:l,divider:s,activeQuestion:c,onSettled:d,onPreview:f,onReply:m,onOpenThread:v,onQuote:y,onReact:g,onJump:b,onError:x}){var S;const w=(S=e.find(C=>C.sequence>s&&C.senderId!==l))==null?void 0:S.id;return u.jsx(u.Fragment,{children:e.map((C,N)=>{const M=e[N-1],T=i.find(I=>I.id===C.senderId),A=!!M&&M.senderId===C.senderId&&C.createdAt-M.createdAt<5*6e4&&C.id!==w;return u.jsxs("div",{children:[C.id===w&&u.jsx("div",{className:"jv-divider",role:"separator",children:u.jsx("span",{children:j("chat.newBelow")})}),u.jsxs("div",{className:"jv-row",tabIndex:-1,"data-message":C.id,"data-folded":A||void 0,"data-mention":C.mentions.includes(l)||void 0,children:[u.jsx("div",{className:"jv-row-gutter",children:A?u.jsx("time",{className:"jv-row-time",children:cc(C.createdAt)}):u.jsx(vr,{member:T,bots:a,size:32})}),u.jsxs("div",{className:"jv-row-body",children:[!A&&u.jsxs("div",{className:"jv-row-head",children:[u.jsx("strong",{children:Pa(T)}),(T==null?void 0:T.kind)==="bot"&&u.jsx("span",{className:"jv-role",children:"Bot"}),u.jsx("time",{children:cc(C.createdAt)})]}),C.echoOf&&u.jsx("button",{type:"button",className:"jv-echo",onClick:()=>v==null?void 0:v(C.echoOf.id),children:j("channel.echo",{title:C.echoOf.title})}),C.replyTo&&u.jsx(mC,{message:C,members:i,onJump:I=>b==null?void 0:b(I)}),C.question?u.jsx(oC,{message:{...C,question:C.question},keyboard:C.id===c,onSettled:d}):u.jsxs("div",{className:"ui-bubble jv-flat",children:[C.content&&u.jsx(uC,{message:C,members:i,me:l,onJump:b}),C.attachments.length>0&&u.jsx(lC,{files:C.attachments,onOpen:I=>f(C.attachments,I)})]}),g&&u.jsx(pC,{message:C,me:l,members:i,onReact:g,onError:x??(()=>{})}),C.thread&&C.thread.replies>0&&u.jsxs("button",{type:"button",className:"jv-thread-link","data-done":C.thread.status==="done"||void 0,onClick:()=>v==null?void 0:v(C.thread.id),children:[j("channel.replies",{count:C.thread.replies}),C.thread.status==="done"&&` · ${j("channel.threadDone")}`,C.thread.lastReplyAt&&u.jsx("span",{className:"jv-muted",children:j("channel.lastReply",{time:cc(C.thread.lastReplyAt)})})]})]}),u.jsxs("div",{className:"jv-row-actions",children:[m&&!C.echoOf&&u.jsx(ct,{icon:"chat-bubble",label:j("channel.replyInThread"),onClick:()=>m(C)}),g&&u.jsx(gC,{message:C,me:l,onReply:y,onReact:g,onError:x??(()=>{})})]})]})]},C.id)})})}function yC({candidates:e,bots:i,busy:a,onCancel:l,onConfirm:s}){const[c,d]=k.useState(""),[f,m]=k.useState([]),v=e.filter(g=>g.name.toLowerCase().includes(c.trim().toLowerCase())),y=g=>m(b=>b.includes(g)?b.filter(x=>x!==g):[...b,g]);return u.jsxs("div",{className:"jv-picker",children:[u.jsx("div",{className:"ui-field",children:u.jsx("input",{type:"search",value:c,autoFocus:!0,placeholder:j("common.searchMembers"),"aria-label":j("common.searchMembers"),onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),v.length===1&&y(v[0].id))}})}),u.jsxs("div",{className:"jv-picker-list",role:"listbox","aria-multiselectable":"true","aria-label":j("dialogs.candidates"),children:[v.map(g=>u.jsxs("button",{type:"button",role:"option","aria-selected":f.includes(g.id),className:"jv-member-option",onClick:()=>y(g.id),children:[u.jsx(vr,{member:g,bots:i,size:24}),u.jsx("span",{className:"jv-member-name",children:g.name}),u.jsx("span",{className:"jv-muted",children:g.kind==="bot"?"Bot":j("common.member")}),u.jsx("span",{className:"jv-check",children:f.includes(g.id)&&u.jsx(De,{name:"check"})})]},g.id)),v.length===0&&u.jsx("p",{className:"jv-picker-empty",children:j(e.length?"common.noMatch":"dialogs.allInside")})]}),u.jsxs("div",{className:"ui-dialog-actions",children:[u.jsx("span",{className:"jv-spacer"}),u.jsx("button",{type:"button",className:"ui-button",onClick:l,children:j("common.cancel")}),u.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:a||f.length===0,onClick:()=>s(f),children:f.length?j("dialogs.addCount",{count:f.length}):j("common.add")})]})]})}function SI({chat:e,members:i,bots:a,onClose:l,onChanged:s}){const[c,d]=k.useState(!1),[f,m]=k.useState("");async function v(y){d(!0),m("");try{let g=e;for(const b of y)g=await je.addMember(e.id,b);s(g),l()}catch(g){m(Pt(g,"dialogs.addFailed"))}finally{d(!1)}}return u.jsxs(as,{title:j("info.addMembers"),onClose:l,className:"jv-channel-dialog",children:[u.jsx(yC,{candidates:i.filter(y=>!e.memberIds.includes(y.id)),bots:a,busy:c,onCancel:l,onConfirm:y=>void v(y)}),f&&u.jsx("p",{className:"jv-form-error",role:"alert",children:f})]})}function kI({sections:e,members:i,bots:a,me:l,onClose:s,onSaved:c}){const d=k.useId(),[f,m]=k.useState(""),[v,y]=k.useState(""),[g,b]=k.useState(null),[x,w]=k.useState([l]),[S,C]=k.useState(!1),[N,M]=k.useState(!1),[T,A]=k.useState("");async function I(B){if(B.preventDefault(),!(!f.trim()||N)){M(!0),A("");try{c(await je.createChannel({name:f.trim(),topic:v.trim(),sectionId:g,memberIds:x.filter(P=>P!==l)}))}catch(P){A(Pt(P,"common.saveFailed"))}finally{M(!1)}}}const D=i.filter(B=>x.includes(B.id));return S?u.jsx(as,{title:j("info.addMembers"),onClose:s,className:"jv-channel-dialog",children:u.jsx(yC,{candidates:i.filter(B=>!x.includes(B.id)),bots:a,busy:!1,onCancel:()=>C(!1),onConfirm:B=>{w(P=>[...P,...B]),C(!1)}})}):u.jsx(as,{title:j("sidebar.newChannel"),onClose:s,className:"jv-channel-dialog",children:u.jsxs("form",{onSubmit:B=>void I(B),children:[u.jsxs("div",{className:"ui-field",children:[u.jsx("label",{htmlFor:`${d}-name`,children:j("info.name")}),u.jsx("input",{id:`${d}-name`,value:f,maxLength:80,autoFocus:!0,placeholder:j("info.newChannel"),onChange:B=>m(B.target.value)})]}),u.jsxs("div",{className:"ui-field",children:[u.jsx("label",{htmlFor:`${d}-topic`,children:j("info.topic")}),u.jsx("input",{id:`${d}-topic`,value:v,maxLength:200,placeholder:j("dialogs.optional"),onChange:B=>y(B.target.value)})]}),u.jsxs("div",{className:"ui-field",children:[u.jsx("label",{htmlFor:`${d}-section`,children:j("info.section")}),u.jsx(Wk,{id:`${d}-section`,value:g,sections:e,onChange:b})]}),u.jsxs("div",{className:"jv-members",children:[u.jsxs("div",{className:"jv-members-head",children:[u.jsxs("span",{children:[j("channel.members")," · ",D.length]}),u.jsxs("button",{type:"button",className:"ui-button",onClick:()=>C(!0),children:[u.jsx(De,{name:"person-add"}),j("info.addMembers")]})]}),D.map(B=>u.jsxs("div",{className:"jv-member-option",children:[u.jsx(vr,{member:B,bots:a,size:24}),u.jsx("span",{className:"jv-member-name",children:B.name}),u.jsx("span",{className:"jv-muted",children:B.id===l?j("common.you"):B.kind==="bot"?"Bot":j("common.member")}),B.id!==l&&u.jsx(ct,{icon:"close",label:j("members.remove",{name:B.name}),className:"jv-member-remove",onClick:()=>w(P=>P.filter(V=>V!==B.id))})]},B.id))]}),T&&u.jsx("p",{className:"jv-form-error",role:"alert",children:T}),u.jsxs("div",{className:"ui-dialog-actions",children:[u.jsx("span",{className:"jv-spacer"}),u.jsx("button",{type:"button",className:"ui-button",onClick:s,children:j("common.cancel")}),u.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:N||!f.trim(),children:j("common.create")})]})]})})}function CI({section:e,onClose:i,onSaved:a,onDeleted:l}){const s=k.useId(),[c,d]=k.useState((e==null?void 0:e.name)??""),[f,m]=k.useState(!1),[v,y]=k.useState("");async function g(x){if(x.preventDefault(),!(!c.trim()||f)){m(!0),y("");try{a(e?await je.updateSection(e.id,{name:c.trim()}):await je.createSection({name:c.trim()}))}catch(w){y(Pt(w,"common.saveFailed")),m(!1)}}}async function b(){if(!(!e||!confirm(j("dialogs.deleteSection",{name:e.name})))){m(!0);try{await je.deleteSection(e.id),l==null||l(e.id)}catch(x){y(Pt(x,"dialogs.deleteFailed")),m(!1)}}}return u.jsx(as,{title:j(e?"dialogs.editSection":"sidebar.newSection"),onClose:i,children:u.jsxs("form",{onSubmit:x=>void g(x),children:[u.jsxs("div",{className:"ui-field",children:[u.jsx("label",{htmlFor:`${s}-name`,children:j("dialogs.sectionName")}),u.jsx("input",{id:`${s}-name`,value:c,maxLength:80,autoFocus:!0,placeholder:j("dialogs.newSection"),onChange:x=>d(x.target.value)})]}),v&&u.jsx("p",{className:"jv-form-error",role:"alert",children:v}),u.jsxs("div",{className:"ui-dialog-actions",children:[e&&u.jsx("button",{type:"button",className:"ui-button jv-danger",disabled:f,onClick:()=>void b(),children:j("common.delete")}),u.jsx("span",{className:"jv-spacer"}),u.jsx("button",{type:"button",className:"ui-button",onClick:i,children:j("common.cancel")}),u.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:f||!c.trim(),children:j(e?"common.save":"common.create")})]})]})})}function EI({bot:e,chats:i,onClose:a,onConfirm:l}){const[s,c]=k.useState(!1),[d,f]=k.useState(!1);return u.jsx(as,{title:j("deleteBot.title",{name:e.name}),onClose:a,className:"jv-dialog",children:u.jsxs("div",{className:"jv-dialog-body",children:[u.jsx("p",{children:j("deleteBot.after")}),u.jsxs("ul",{className:"jv-dialog-list",children:[u.jsx("li",{children:j("deleteBot.chats",{count:i})}),u.jsx("li",{children:j("deleteBot.messages",{name:j("member.deleted",{name:e.name})})}),u.jsx("li",{children:j("deleteBot.history")})]}),u.jsxs("label",{className:"jv-checkline",children:[u.jsx("input",{type:"checkbox",checked:s,onChange:m=>c(m.target.checked)}),u.jsx("span",{children:j("deleteBot.files")})]}),u.jsx("p",{className:"jv-hint",children:j("deleteBot.filesHint")}),u.jsxs("div",{className:"jv-dialog-actions",children:[u.jsx(Ve,{type:"button",variant:"ghost",onClick:a,children:j("common.cancel")}),u.jsx(Ve,{type:"button",className:"jv-primary",disabled:d,onClick:()=>{f(!0),l(s).finally(()=>f(!1))},children:j(d?"deleteBot.deleting":"common.delete")})]})]})})}function bC({title:e,body:i,confirm:a,onClose:l,onConfirm:s}){const[c,d]=k.useState(!1);return u.jsx(as,{title:e,onClose:l,className:"jv-dialog",children:u.jsxs("div",{className:"jv-dialog-body",children:[u.jsx("p",{children:i}),u.jsxs("div",{className:"jv-dialog-actions",children:[u.jsx(Ve,{type:"button",variant:"ghost",onClick:l,children:j("common.cancel")}),u.jsx(Ve,{type:"button",className:"jv-primary",disabled:c,onClick:()=>{d(!0),s().finally(()=>d(!1))},children:c?j("deleteBot.working"):a})]})]})})}function NI({target:e,x:i,y:a,onClose:l,onOpenBot:s,onSettings:c,onPin:d,onMute:f,onDeleteChat:m,onDeleteBot:v}){const y=k.useRef(null);k.useEffect(()=>{const x=S=>{var C;(C=y.current)!=null&&C.contains(S.target)||l()},w=S=>{S.key==="Escape"&&l()};return document.addEventListener("pointerdown",x),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",w)}},[l]);const g=e.chat,b={left:Math.max(8,Math.min(i,window.innerWidth-200)),top:Math.max(8,Math.min(a,window.innerHeight-210))};return u.jsxs("div",{ref:y,className:"ui-popover jv-entry-menu",role:"menu","aria-label":j("entry.menu"),style:b,children:[g&&u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{d(g,!g.pinned),l()},children:[u.jsx(De,{name:"pin"}),u.jsx("span",{className:"ui-menu-copy",children:j(g.pinned?"entry.unpin":"entry.pin")})]}),g&&u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{f(g,!g.muted),l()},children:[u.jsx(De,{name:g.muted?"bell":"bell-slash"}),u.jsx("span",{className:"ui-menu-copy",children:j(g.muted?"entry.unmute":"entry.mute")})]}),e.kind==="dm"?u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{s(e.bot),l()},children:[u.jsx(De,{name:"gear"}),u.jsx("span",{className:"ui-menu-copy",children:j("entry.botInfo")})]}):u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{c(e.chat),l()},children:[u.jsx(De,{name:"info"}),u.jsx("span",{className:"ui-menu-copy",children:j("entry.channelInfo")})]}),!(e.kind==="dm"&&e.bot.agent)&&u.jsx("hr",{className:"ui-menu-divider"}),e.kind==="dm"?!e.bot.agent&&u.jsxs("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{v(e.bot),l()},children:[u.jsx(De,{name:"close"}),u.jsx("span",{className:"ui-menu-copy",children:j("entry.deleteBot")})]}):u.jsxs("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{m(e.chat),l()},children:[u.jsx(De,{name:"close"}),u.jsx("span",{className:"ui-menu-copy",children:j("entry.deleteChannel")})]})]})}function TI({files:e,initialIndex:i=0,onClose:a}){const[l,s]=k.useState(i),[c,d]=k.useState("preview"),[f,m]=k.useState(!1),[v,y]=k.useState(""),[g,b]=k.useState(""),[x,w]=k.useState(""),[S,C]=k.useState(!0),[N,M]=k.useState(0),[T,A]=k.useState(!1),[I,D]=k.useState(!1),B=k.useRef(null),P=k.useRef(null),V=k.useRef(new Map),z=e[l],Y=uf(z),q=tC(Y),W=!q&&z.size>sI,Q=!q&&!W&&Y!=="download";k.useEffect(()=>{const J=B.current,ee=document.activeElement;return J.showModal(),()=>{J.close(),ee!=null&&ee.isConnected&&ee.focus({preventScroll:!0})}},[]),k.useEffect(()=>{const J=new AbortController;return y(""),b(""),w(""),d("preview"),A(!1),D(!1),C(Q),Q&&(hc(Y)?rC(z,J.signal).then(b):aC(z,J.signal).then(y)).then(()=>C(!1)).catch(ee=>{J.signal.aborted||(w(Pt(ee,"files.readError")),C(!1))}),()=>J.abort()},[z.id,N]),k.useEffect(()=>{P.current&&(P.current.scrollTop=V.current.get(`${l}:${c}`)??0)},[l,c,S]);const U=()=>{var J;return V.current.set(`${l}:${c}`,((J=P.current)==null?void 0:J.scrollTop)??0)},X=J=>{U(),s(Math.max(0,Math.min(e.length-1,J)))},O=k.useMemo(()=>Y==="html"&&v?uI(v):null,[Y,v]),F=Q&&["markdown","html"].includes(Y)&&!S&&!x,ne=hc(Y)||q&&!I?"ui-image-view":Y==="html"&&c==="preview"?"ui-html-view":Y==="markdown"&&c==="preview"?"ui-document":"",_=u.jsxs("a",{className:"ui-button",href:Fl(z),download:z.name,children:[u.jsx(De,{name:"cloud-download"}),j("files.downloadFile")]});return to.createPortal(u.jsxs("dialog",{ref:B,className:"ui-viewer","aria-labelledby":"jvPreviewTitle","data-wide":f||void 0,onCancel:J=>{J.preventDefault(),a()},onKeyDown:J=>{!["ArrowLeft","ArrowRight"].includes(J.key)||["SELECT","INPUT","TEXTAREA"].includes(J.target.tagName)||(J.preventDefault(),X(l+(J.key==="ArrowLeft"?-1:1)))},children:[u.jsxs("header",{className:"ui-preview-header",children:[u.jsxs("div",{className:"ui-preview-heading",children:[u.jsx("h1",{id:"jvPreviewTitle",children:z.name}),u.jsxs("small",{children:[j(nC[Y])," · ",iC(z.size)]})]}),u.jsxs("div",{className:"ui-preview-actions",children:[F&&u.jsx("button",{type:"button",className:"ui-button",onClick:()=>{U(),d(c==="source"?"preview":"source")},children:j(c==="source"?"files.showPreview":Y==="html"?"files.showSource":"files.showText")}),T&&u.jsx(ct,{icon:"window",label:j("files.openTab"),onClick:()=>window.open(Q1(z),"_blank","noopener,noreferrer")}),u.jsx("a",{className:"ui-iconbtn",href:Fl(z),download:z.name,"aria-label":j("files.download",{name:z.name}),title:j("files.download",{name:z.name}),children:u.jsx(De,{name:"cloud-download"})}),u.jsx(ct,{icon:f?"arrows-contract":"arrows-expand",label:j(f?"files.narrow":"files.widen"),"data-action":"ui-wide",onClick:()=>m(!f)}),u.jsx(ct,{icon:"close",label:j("files.closePreview"),"data-action":"ui-close",onClick:a})]})]}),O&&c==="preview"&&!S&&!x&&u.jsxs("div",{className:"jv-run-tip",role:"status",children:[u.jsx("p",{children:T?j("files.running"):j("files.scripts",{count:O.count,hosts:O.hosts.length?j("files.scriptHosts",{hosts:O.hosts.slice(0,3).join(j("common.listSeparator"))+(O.hosts.length>3?j("files.andMore"):"")}):""})}),u.jsx("button",{type:"button",className:"ui-button",onClick:()=>A(!T),children:j(T?"files.stop":"files.run")})]}),u.jsx("div",{className:`ui-preview-body ${ne}`,ref:P,tabIndex:-1,children:q?I?u.jsxs("div",{className:"ui-fallback",children:[u.jsx(De,{name:`file-${Y}`}),u.jsx("strong",{children:j("files.cantPlay")}),u.jsx("p",{children:j("files.cantPlayHint")}),_]}):Y==="video"?u.jsx("video",{className:"ui-preview-video",src:Fl(z),controls:!0,preload:"metadata",playsInline:!0,onError:()=>D(!0)},z.id):u.jsx("audio",{className:"ui-preview-audio",src:Fl(z),controls:!0,preload:"metadata",onError:()=>D(!0)},z.id):Q?S?u.jsx("p",{className:"ui-unloaded",children:j("files.reading")}):x?u.jsxs("div",{className:"ui-error",role:"alert",children:[u.jsx("p",{children:x}),u.jsx("button",{type:"button",className:"ui-button",onClick:()=>M(J=>J+1),children:j("common.retry")})]}):hc(Y)?u.jsx("img",{className:"ui-preview-image",src:g,alt:z.name}):c==="source"||Y==="text"?u.jsx("pre",{className:"ui-source",tabIndex:0,children:v}):Y==="html"?T?u.jsx("iframe",{title:j("files.runningTitle",{name:z.name}),sandbox:"allow-scripts",src:Q1(z),referrerPolicy:"no-referrer",className:"ui-html-frame"},"run"):u.jsx("iframe",{title:z.name,sandbox:"",srcDoc:dI(v),referrerPolicy:"no-referrer",className:"ui-html-frame"},"static"):u.jsx("article",{className:"ui-prose",children:u.jsx(Dc,{text:v})}):u.jsxs("div",{className:"ui-fallback",children:[u.jsx(De,{name:"file"}),u.jsx("strong",{children:j("files.downloadToView")}),u.jsx("p",{children:j(W?"files.tooLarge":"files.unsupported")}),_]})}),e.length>1&&u.jsxs("footer",{className:"ui-preview-nav",children:[u.jsx(ct,{icon:"chevron-left",label:j("files.previous"),disabled:l===0,onClick:()=>X(l-1)}),u.jsx("select",{id:"ui-preview-select","aria-label":j("files.choose"),value:l,onChange:J=>X(Number(J.target.value)),children:e.map((J,ee)=>u.jsx("option",{value:ee,children:J.name},J.id))}),u.jsxs("span",{children:[l+1," / ",e.length]}),u.jsx(ct,{icon:"chevron-right",label:j("files.next"),disabled:l===e.length-1,onClick:()=>X(l+1)})]})]}),document.body)}function AI({dialog:e,entryMenu:i,confirm:a,preview:l,infoBot:s,bots:c,statuses:d,chats:f,sections:m,members:v,connections:y,meId:g,onDialog:b,onEntryMenu:x,onConfirm:w,onPreview:S,onInfoBot:C,onSettings:N,onChannelInfo:M,onOpenChatId:T,chatSaved:A,openChat:I,onSectionSaved:D,onSectionDeleted:B,updateBot:P,openAnywhere:V,removeChannel:z,deleteBot:Y,pinChat:q,muteChat:W}){return u.jsxs(u.Fragment,{children:[(e==null?void 0:e.kind)==="channel"&&u.jsx(kI,{sections:m,members:ra(v),bots:c,me:g,onClose:()=>b(null),onSaved:Q=>{A(Q),b(null),I(Q)}}),(e==null?void 0:e.kind)==="members"&&u.jsx(SI,{chat:f.find(Q=>Q.id===e.chat.id)??e.chat,members:ra(v),bots:c,onClose:()=>b(null),onChanged:A}),(e==null?void 0:e.kind)==="section"&&u.jsx(CI,{section:e.section,onClose:()=>b(null),onSaved:D,onDeleted:B}),i&&u.jsx(NI,{target:i.target,x:i.at.x,y:i.at.y,onClose:()=>x(null),onOpenBot:Q=>C(Q.id),onSettings:Q=>{Q.type==="channel"&&M(Q)},onPin:(Q,U)=>void q(Q,U),onMute:(Q,U)=>void W(Q,U),onDeleteChat:Q=>w({kind:"chat",chat:Q}),onDeleteBot:Q=>w({kind:"bot",bot:Q})}),(a==null?void 0:a.kind)==="chat"&&u.jsx(bC,{title:j("app.deleteChannelTitle",{name:a.chat.title}),confirm:j("common.delete"),onClose:()=>w(null),body:j("app.deleteChannelBody"),onConfirm:async()=>{await z(a.chat),w(null)}}),(a==null?void 0:a.kind)==="bot"&&u.jsx(EI,{bot:a.bot,chats:f.filter(Q=>Q.type==="dm"&&Q.botId===a.bot.id).length,onClose:()=>w(null),onConfirm:async Q=>{await Y(a.bot,Q),w(null)}}),s&&u.jsx(oI,{bot:s,status:d[s.id],connections:y,chats:f,onSaved:P,onOpenChat:Q=>{C(null),T(Q)},onOpenSubscription:V,onManageModels:()=>{C(null),N()},onClose:()=>C(null)},s.id),l&&u.jsx(TI,{files:l.files,initialIndex:l.index,onClose:()=>S(null)})]})}function xC(e,i,a){const[l,s]=k.useState(null),[c,d]=k.useState(!1);return k.useEffect(()=>{const f=e.trim();if(!f){s(null),d(!1);return}let m=!0;d(!0);const v=setTimeout(()=>void je.search(f,i).then(y=>{m&&s(y)}).catch(y=>{m&&a(y)}).finally(()=>{m&&d(!1)}),250);return()=>{m=!1,clearTimeout(v)}},[e,i]),{result:l,loading:c}}function jC(e,i,a){var l;return e.type==="thread"?`#${((l=i.find(s=>s.id===e.parentId))==null?void 0:l.title)??j("search.channel")} › ${e.title}`:e.type==="channel"?`#${e.title}`:Pa(a.find(s=>s.id===e.botId))}function wC({text:e,query:i,room:a=24}){const l=e.replace(/[*`~#>|]/g,"").replace(/\s+/g," ").trim(),s=l.toLocaleLowerCase().indexOf(i.trim().toLocaleLowerCase());if(s<0||!i.trim())return u.jsx(u.Fragment,{children:l.slice(0,120)});const c=Math.max(0,s-a),d=s+i.trim().length;return u.jsxs(u.Fragment,{children:[c>0&&"…",l.slice(c,s),u.jsx("mark",{className:"jv-hit",children:l.slice(s,d)}),l.slice(d,d+120)]})}const MI=e=>new Date(e).toDateString()===new Date().toDateString()?cc(e):GT(e);function SC({message:e,chat:i,chats:a,members:l,query:s,showPlace:c=!0,onOpen:d}){return u.jsxs("button",{type:"button",className:"jv-hit-row",onClick:()=>d(i,e.id),children:[u.jsxs("span",{className:"jv-hit-head",children:[u.jsx("strong",{children:Pa(l.find(f=>f.id===e.senderId))}),c&&u.jsx("span",{className:"jv-hit-place",children:jC(i,a,l)}),u.jsx("time",{dateTime:new Date(e.createdAt).toISOString(),children:MI(e.createdAt)})]}),u.jsx("span",{className:"jv-hit-text",children:u.jsx(wC,{text:fv(e),query:s})})]})}const W1=5;function Cd({label:e,items:i,empty:a}){const[l,s]=k.useState(!1);return!i.length&&!a?null:u.jsxs("section",{className:"jv-result-group","aria-label":e,children:[u.jsxs("h3",{className:"jv-result-head",children:[e,u.jsx("span",{children:i.length})]}),i.length?l?i:i.slice(0,W1):u.jsx("p",{className:"jv-result-empty",children:a}),!l&&i.length>W1&&u.jsxs("button",{type:"button",className:"jv-result-more",onClick:()=>s(!0),children:[j("search.showAll",{count:i.length}),u.jsx(De,{name:"chevron-down"})]})]})}function OI({query:e,shown:i,chats:a,members:l,onOpenChat:s,onOpenMessage:c,onError:d}){const{result:f,loading:m}=xC(e,void 0,d),v=((f==null?void 0:f.chats)??[]).filter(g=>!i.has(g.id)),y=g=>{var b,x;return u.jsxs("button",{type:"button",className:"jv-hit-row",onClick:()=>s(g),children:[u.jsxs("span",{className:"jv-hit-head",children:[u.jsx("strong",{children:g.type==="thread"?g.title:`#${g.title}`}),g.type==="thread"&&u.jsx("span",{className:"jv-hit-place",children:jC(g,a,l).split(" › ")[0]})]}),(((b=g.note)==null?void 0:b.text)||g.topic)&&u.jsx("span",{className:"jv-hit-text",children:u.jsx(wC,{text:((x=g.note)==null?void 0:x.text)||g.topic,query:e})})]},g.id)};return u.jsxs("div",{className:"jv-results","aria-live":"polite",children:[u.jsx(Cd,{label:j("search.threads"),items:v.filter(g=>g.type==="thread").map(y)}),u.jsx(Cd,{label:j("search.channels"),items:v.filter(g=>g.type==="channel").map(y)}),f?u.jsx(Cd,{label:j("search.messages"),empty:j("search.noMessages"),items:f.messages.map(({message:g,chat:b})=>u.jsx(SC,{message:g,chat:b,chats:a,members:l,query:e,onOpen:c},g.id))}):m&&u.jsx("p",{className:"jv-result-empty",children:j("search.searching")})]})}function RI({className:e,...i}){return u.jsx("div",{"data-slot":"input-group",role:"group",className:nn("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...i})}const _I=mg("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}});function DI({className:e,align:i="inline-start",...a}){return u.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:nn(_I({align:i}),e),onClick:l=>{var s,c;l.target.closest("button")||(c=(s=l.currentTarget.parentElement)==null?void 0:s.querySelector("input"))==null||c.focus()},...a})}function zI({className:e,...i}){return u.jsx(In,{"data-slot":"input-group-control",className:nn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",e),...i})}function LI({className:e,children:i,...a}){return u.jsxs(j_,{"data-slot":"scroll-area",className:nn("relative",e),...a,children:[u.jsx(w_,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:i}),u.jsx(II,{}),u.jsx(S_,{})]})}function II({className:e,orientation:i="vertical",...a}){return u.jsx(u_,{"data-slot":"scroll-area-scrollbar",orientation:i,className:nn("flex touch-none p-px transition-colors select-none",i==="vertical"&&"h-full w-2.5 border-l border-l-transparent",i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:u.jsx(g_,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}const kC="jarvy-collapsed-sections",BI=()=>{try{return JSON.parse(localStorage.getItem(kC)??"[]")}catch{return[]}};function e2({chat:e}){return e.alerts>0?u.jsx("span",{className:"jv-badge","aria-label":j("sidebar.alerts",{count:e.alerts}),children:e.alerts}):e.unread>0?u.jsx("span",{className:"jv-count","aria-label":j("sidebar.unread",{count:e.unread}),children:e.unread}):null}function CC(e){const i=e.hint;if(!i||i.createdAt<e.updatedAt-1e3)return null;const a=i.chatType==="thread"&&i.chatId!==e.id,l={actor:i.actor,emoji:i.detail,title:i.title.length>16?`${i.title.slice(0,16)}…`:i.title};return i.kind==="reaction"?j(a?"hint.reactionInThread":"hint.reaction",l):j(a?"hint.threadSummary":i.chatType==="thread"?"hint.summary":"hint.notice",l)}function PI(e){var i;return e.type==="channel"&&CC(e)&&((i=e.hint)==null?void 0:i.chatType)==="thread"&&e.hint.chatId!==e.id?e.hint.chatId:null}function t2({chat:e,channel:i}){const a=CC(e),l=e.lastMessage&&Lc(e.lastMessage),s=a??(l?i&&e.lastSender?j("sidebar.said",{name:e.lastSender,text:l}):l:i?e.topic:"");return u.jsxs("span",{className:"jv-digest",children:[e.atMe&&u.jsx("span",{className:"jv-at-me",children:j("sidebar.atMe")}),u.jsx("span",{className:a?"jv-hint-line":void 0,children:s})]})}const n2=e=>{const i=e.getBoundingClientRect();return{x:i.right-168,y:i.bottom+4}};function HI({chats:e,sections:i,bots:a,members:l,onOpenMessage:s,onOpenFound:c,onError:d,working:f,asking:m,selected:v,filter:y,followed:g,followedOpen:b,onFilterChange:x,onSelect:w,onOpenBot:S,onOpenFollowed:C,onMenu:N,onEditSection:M}){const[T,A]=k.useState(BI),I=O=>A(F=>{const ne=F.includes(O)?F.filter(_=>_!==O):[...F,O];return localStorage.setItem(kC,JSON.stringify(ne)),ne}),D=y.toLocaleLowerCase(),B=e.filter(O=>{var F;return O.type!=="thread"&&`${O.title} ${O.topic} ${((F=a.find(ne=>ne.id===O.botId))==null?void 0:F.name)??""}`.toLocaleLowerCase().includes(D)}),P=g.reduce((O,F)=>O+F.unread,0),V=g.reduce((O,F)=>O+F.mentions,0),z=B.filter(O=>O.type==="channel").sort((O,F)=>Number(F.pinned)-Number(O.pinned)||O.title.localeCompare(F.title,"zh-CN")),Y=a.map(O=>({bot:O,chat:e.find(F=>F.type==="dm"&&F.botId===O.id)})).filter(({bot:O})=>O.name.toLocaleLowerCase().includes(D)).sort((O,F)=>{var ne,_,J,ee;return Number(F.bot.agent)-Number(O.bot.agent)||+!!((ne=F.chat)!=null&&ne.pinned)-+!!((_=O.chat)!=null&&_.pinned)||(((J=F.chat)==null?void 0:J.updatedAt)??0)-(((ee=O.chat)==null?void 0:ee.updatedAt)??0)}),q=O=>u.jsxs("div",{className:"jv-side-wrap",onContextMenu:F=>{F.preventDefault(),N({kind:"channel",chat:O},{x:F.clientX,y:F.clientY})},children:[u.jsxs("button",{type:"button",className:"jv-side-row","data-active":v===O.id||void 0,"data-unread":O.unread>0||void 0,"aria-current":v===O.id?"page":void 0,onClick:()=>w(O),children:[O.pinned?u.jsx(Ep,{className:"jv-side-pin","aria-label":j("sidebar.pinned")}):u.jsx("span",{className:"jv-hash","aria-hidden":"true",children:"#"}),u.jsxs("span",{className:"jv-side-text",children:[u.jsxs("span",{className:"jv-side-line",children:[u.jsx("span",{className:"jv-side-label",title:O.title,children:O.title}),O.muted&&u.jsx("span",{className:"jv-side-muted","aria-label":j("sidebar.muted"),children:u.jsx(De,{name:"bell-slash"})})]}),u.jsxs("span",{className:"jv-side-line",children:[u.jsx(t2,{chat:O,channel:!0}),u.jsx(e2,{chat:O})]})]})]}),u.jsx("button",{type:"button",className:"jv-side-more","aria-label":j("sidebar.more",{name:O.title}),onClick:F=>N({kind:"channel",chat:O},n2(F.currentTarget)),children:u.jsx(wx,{"aria-hidden":"true"})})]},O.id),W=({bot:O,chat:F})=>{const ne=m.has(O.id)?"asking":f.has(O.id)?"working":void 0,_=!!F&&v===F.id;return u.jsxs("div",{className:"shadcn-chat-row relative",onContextMenu:J=>{J.preventDefault(),N({kind:"dm",bot:O,chat:F},{x:J.clientX,y:J.clientY})},children:[u.jsxs(Ve,{type:"button",variant:"ghost","data-active":_,"aria-current":_?"page":void 0,className:"h-15 w-full justify-start gap-2.5 rounded-md px-2 text-left hover:bg-accent/70 data-[active=true]:bg-accent data-[active=true]:text-accent-foreground",onClick:()=>F?w(F):S(O),children:[u.jsx(zc,{color:O.color,mood:O.mood,size:36,badge:ne,crown:O.agent}),ne&&u.jsx("span",{className:"sr-only",children:j(ne==="asking"?"sidebar.asking":"sidebar.working")}),u.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${F!=null&&F.unread?"font-semibold":"font-medium"}`,title:O.name,children:O.name}),(F==null?void 0:F.muted)&&u.jsx("span",{className:"jv-side-muted","aria-label":j("sidebar.muted"),children:u.jsx(De,{name:"bell-slash"})}),(F==null?void 0:F.pinned)&&u.jsx(Ep,{className:"jv-dm-pin shrink-0","aria-label":j("sidebar.pinned")}),F&&u.jsx("time",{className:"shadcn-chat-time shrink-0 text-[11px] font-normal text-muted-foreground",dateTime:new Date(F.updatedAt).toISOString(),children:cc(F.updatedAt)})]}),u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-normal text-muted-foreground",children:F?u.jsx(t2,{chat:F,channel:!1}):""}),F&&u.jsx(e2,{chat:F})]})]})]}),u.jsx(Ve,{type:"button",variant:"ghost",size:"icon-xs","aria-label":j("sidebar.more",{name:O.name}),className:"shadcn-chat-more absolute top-4 right-2 opacity-0",onClick:J=>N({kind:"dm",bot:O,chat:F},n2(J.currentTarget)),children:u.jsx(wx,{"aria-hidden":"true"})})]},O.id)},Q=(O,F,ne,_,J)=>u.jsxs("div",{className:"jv-side-section-head",children:[u.jsxs("button",{type:"button",className:"jv-side-section-toggle","aria-expanded":!ne,onClick:()=>I(O),children:[u.jsx("span",{className:"jv-side-chevron",children:u.jsx(De,{name:ne?"chevron-right":"chevron-down"})}),u.jsxs("span",{className:"jv-side-section-name",children:[F,ne&&_&&u.jsx("span",{className:"jv-dot","aria-label":j("sidebar.hasUnread")})]})]}),J&&u.jsx("button",{type:"button",className:"jv-side-section-edit","aria-label":j("sidebar.editSection",{name:F}),onClick:()=>M(J),children:u.jsx(De,{name:"pencil"})})]}),U=O=>!D&&T.includes(O),X=(O,F,ne,_)=>u.jsxs("div",{className:"jv-side-section",children:[Q(O,F,U(O),ne.some(J=>J.unread>0),_),!U(O)&&ne.map(q)]},O);return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mx-3 mt-1 mb-2 shrink-0",role:"search",children:u.jsxs(RI,{className:"h-9 bg-background",children:[u.jsx(zI,{id:"jarvy-search",type:"search",value:y,onChange:O=>x(O.target.value),placeholder:j("sidebar.search"),"aria-label":j("sidebar.search"),onKeyDown:O=>{O.key==="Escape"&&y&&(O.preventDefault(),x(""))},className:"text-sm"}),u.jsx(DI,{align:"inline-start",children:u.jsx(kc,{"aria-hidden":"true"})})]})}),u.jsx(LI,{className:"min-h-0 flex-1",type:"auto",children:D?u.jsxs("nav",{className:"jv-side-nav jv-side-search px-3 pb-6","aria-label":j("sidebar.results"),children:[u.jsx(Cd,{label:j("sidebar.chats"),items:[...z.map(q),...Y.map(W)]}),u.jsx(OI,{query:y,shown:new Set(z.map(O=>O.id)),chats:e,members:l,onOpenChat:c,onOpenMessage:s,onError:d})]}):u.jsxs("nav",{className:"jv-side-nav px-3 pb-6","aria-label":j("sidebar.nav"),children:[g.length>0&&u.jsxs("button",{type:"button",className:"jv-side-row jv-side-top","data-active":b||void 0,"data-unread":P>0||void 0,"aria-current":b?"page":void 0,onClick:C,children:[u.jsx(De,{name:"chat-bubble"}),u.jsx("span",{className:"jv-side-label",children:j("sidebar.followed")}),V>0?u.jsx("span",{className:"jv-badge",children:V}):P>0&&u.jsx("span",{className:"jv-count",children:P})]}),i.map(O=>X(`s:${O.id}`,O.name,z.filter(F=>F.sectionId===O.id),O)),z.some(O=>!O.sectionId||!i.some(F=>F.id===O.sectionId))&&X("channels",j("sidebar.channels"),z.filter(O=>!O.sectionId||!i.some(F=>F.id===O.sectionId))),u.jsxs("div",{className:"jv-side-section",children:[Q("dms",j("sidebar.dms"),U("dms"),Y.some(({chat:O})=>!!(O!=null&&O.unread))),!U("dms")&&u.jsx("div",{className:"space-y-1",children:Y.map(W)}),!U("dms")&&Y.length===0&&u.jsx("p",{className:"jv-side-empty",children:j("sidebar.noDms")})]})]})})]})}function UI({username:e,chats:i,sections:a,bots:l,members:s,followed:c,followedOpen:d,working:f,asking:m,selected:v,filter:y,creating:g,createMenu:b,accountMenu:x,onFilterChange:w,onOpenFollowed:S,onOpenChat:C,onOpenBot:N,onOpenMenu:M,onEditSection:T,onCreate:A,onFind:I,onOpenFound:D,onError:B,onToggleCreate:P,onToggleAccount:V,onSettings:z,onToggleTheme:Y,onLogOut:q}){const W=k.useRef(null),Q=k.useRef(null);return k.useEffect(()=>{if(!x&&!b)return;const U=X=>{var O,F;x&&!((O=Q.current)!=null&&O.contains(X.target))&&V(!1),b&&!((F=W.current)!=null&&F.contains(X.target))&&P(!1)};return document.addEventListener("pointerdown",U),()=>document.removeEventListener("pointerdown",U)},[x,b]),u.jsxs(u.Fragment,{children:[u.jsxs("aside",{className:"ui-sidebar","aria-label":j("sidebar.label"),children:[u.jsx("header",{className:"ui-sidebar-header",children:u.jsxs("div",{className:"jarvy-sidebar-create",ref:W,children:[u.jsx(ct,{icon:"add",label:j("sidebar.create"),"aria-expanded":b,"aria-haspopup":"menu",disabled:g,onClick:()=>P(!b)}),b&&u.jsxs("div",{className:"ui-popover jarvy-create-menu",role:"menu","aria-label":j("sidebar.createMenu"),children:[u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>A("channel"),children:[u.jsx(De,{name:"list-bullets"}),u.jsx("span",{className:"ui-menu-copy",children:j("sidebar.newChannel")})]}),u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>A("section"),children:[u.jsx(De,{name:"folder"}),u.jsx("span",{className:"ui-menu-copy",children:j("sidebar.newSection")})]}),u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>A("bot"),children:[u.jsx(De,{name:"person-add"}),u.jsx("span",{className:"ui-menu-copy",children:j("sidebar.newBot")})]})]})]})}),u.jsx(HI,{chats:i,sections:a,bots:l,members:s,onOpenMessage:I,onOpenFound:D,onError:B,working:f,asking:m,selected:v,filter:y,onFilterChange:w,followed:c,followedOpen:d,onOpenFollowed:S,onSelect:C,onOpenBot:N,onMenu:M,onEditSection:T}),u.jsx("footer",{className:"ui-sidebar-footer",children:u.jsxs("button",{type:"button",className:"ui-footer-entry","aria-label":j("account.menuFor",{name:e}),"aria-expanded":x,onClick:()=>V(!x),children:[u.jsx("span",{className:"ui-user-avatar",children:e.slice(0,2).toUpperCase()}),u.jsx("span",{children:e}),u.jsx(De,{name:"chevron-down"})]})})]}),x&&u.jsxs("div",{ref:Q,className:"ui-popover jarvy-account-menu",role:"menu","aria-label":j("account.menu"),children:[u.jsx("div",{className:"ui-menu-note ui-small",children:e}),u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:z,children:[u.jsx(De,{name:"gear"}),u.jsx("span",{className:"ui-menu-copy",children:j("settings.title")})]}),u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:Y,children:[u.jsx(De,{name:"moon"}),u.jsx("span",{className:"ui-menu-copy",children:j("account.toggleTheme")})]}),u.jsx("hr",{className:"ui-menu-divider"}),u.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:q,children:[u.jsx(De,{name:"arrow-bracket-to-left"}),u.jsx("span",{className:"ui-menu-copy",children:j("account.signOut")})]})]})]})}function qI({textarea:e,value:i,setValue:a,inside:l,outside:s,bots:c,onInvite:d}){const[f,m]=k.useState(null),[v,y]=k.useState(0),[g,b]=k.useState(null),x=k.useRef(null),w=k.useRef(null),S=k.useRef(null);k.useLayoutEffect(()=>{S.current===null||!e.current||(e.current.focus(),e.current.setSelectionRange(S.current,S.current),S.current=null)},[i,e]);const C=(U,X)=>U.name.toLowerCase().includes(X.toLowerCase()),N=f===null?[]:l.filter(U=>C(U,f)),M=f===null?[]:s.filter(U=>C(U,f)),T=g?s.filter(U=>C(U,g.search)):[],A=N.length+(M.length?1:0),I=()=>{m(null),b(null)};function D(U=i){const X=e.current,O=X?/(?:^|[^\p{Script=Latin}\p{Nd}_])@([^\s@]*)$/u.exec(U.slice(0,X.selectionStart)):null;m(O?O[1]:null),y(0),b(null)}function B(U){const X=e.current;if(!X)return;l.some(ne=>ne.id===U.id)||d(U);const O=i.slice(0,X.selectionStart).replace(/@([^\s@]*)$/u,`@${U.name} `),F=O+i.slice(X.selectionStart);S.current=O.length,a(F),I()}function P(U){g||b({search:f??"",active:0}),U&&requestAnimationFrame(()=>{var X;return(X=w.current)==null?void 0:X.focus()})}function V(){var U;b(null),(U=e.current)==null||U.focus()}function z(U){if(!A||U.nativeEvent.isComposing)return!1;const X=v===N.length;return U.key==="ArrowDown"||U.key==="ArrowUp"?(U.preventDefault(),y((v+(U.key==="ArrowDown"?1:-1)+A)%A),b(null),!0):(U.key==="Enter"||U.key==="Tab")&&!X?(U.preventDefault(),B(N[v]),!0):(U.key==="Enter"||U.key==="Tab"||U.key==="ArrowRight")&&X?(U.preventDefault(),P(!0),!0):U.key==="Escape"?(U.preventDefault(),I(),!0):!1}function Y(U){!g||U.nativeEvent.isComposing||((U.key==="ArrowDown"||U.key==="ArrowUp")&&T.length?(U.preventDefault(),b({...g,active:(g.active+(U.key==="ArrowDown"?1:-1)+T.length)%T.length})):U.key==="Enter"?(U.preventDefault(),T[g.active]&&B(T[g.active])):(U.key==="Escape"||U.key==="ArrowLeft"&&!g.search)&&(U.preventDefault(),V()))}const q=U=>{var O;const X=U.relatedTarget;(!X||!((O=x.current)!=null&&O.contains(X))&&X!==e.current)&&I()},W=(U,X)=>u.jsxs("button",{type:"button",role:"option","aria-selected":X,className:"ui-menu-item","data-active":X||void 0,onMouseDown:O=>{O.preventDefault(),B(U)},children:[u.jsx(vr,{member:U,bots:c,size:20}),u.jsx("span",{className:"ui-menu-copy",children:U.name}),u.jsx("span",{className:"jv-muted",children:U.kind==="bot"?"Bot":j("common.member")})]},U.id);return{menu:A>0?u.jsxs("div",{ref:x,className:"jv-mention-box","data-side":g?"":void 0,onBlur:q,children:[u.jsxs("div",{className:"ui-popover jv-mention-menu",role:"listbox","aria-label":j("mention.menu"),children:[N.map((U,X)=>W(U,X===v)),M.length>0&&u.jsxs("button",{type:"button",className:"ui-menu-item jv-mention-more","aria-haspopup":"listbox","aria-expanded":!!g,"data-active":v===N.length||void 0,onMouseEnter:()=>{y(N.length),P(!1)},onMouseDown:U=>{U.preventDefault(),y(N.length),P(!0)},children:[u.jsx("span",{className:"ui-menu-copy",children:j("mention.outside")}),u.jsx("span",{className:"jv-muted",children:M.length}),u.jsx(De,{name:"chevron-right"})]})]}),g&&u.jsxs("div",{className:"ui-popover jv-mention-side",role:"listbox","aria-label":j("mention.outsideList"),children:[u.jsxs("div",{className:"jv-mention-side-head",children:[u.jsx("button",{type:"button",className:"jv-mention-back","aria-label":j("common.back"),onMouseDown:U=>{U.preventDefault(),V()},children:u.jsx(De,{name:"chevron-left"})}),u.jsx("input",{ref:w,type:"search",value:g.search,placeholder:j("common.searchMembers"),"aria-label":j("mention.searchOutside"),onChange:U=>b({search:U.target.value,active:0}),onKeyDown:Y})]}),u.jsx("div",{className:"jv-mention-side-list",children:T.length?T.map((U,X)=>W(U,X===g.active)):u.jsx("p",{className:"jv-mention-empty",children:j("common.noMatch")})}),u.jsx("p",{className:"ui-menu-note ui-small",children:j("mention.invites")})]})]}):null,track:D,onKeyDown:z,close:I,leaves:q}}const i2={text:null,files:[],quote:null,passages:[],key:null,signature:null,sending:!1};class FI{constructor(i){nc(this,"drafts",new Map);nc(this,"listeners",new Set);nc(this,"timer",null);nc(this,"subscribe",i=>(this.listeners.add(i),()=>{this.listeners.delete(i)}));this.storageKey=i;try{const a=JSON.parse(localStorage.getItem(i)??"{}");for(const[l,s]of Object.entries(a))this.drafts.set(l,{...i2,...s,sending:!1})}catch{localStorage.removeItem(i)}}get(i){return this.drafts.get(i)??i2}update(i,a){const l=this.get(i),s=typeof a=="function"?a(l):a;this.drafts.set(i,{...l,...s}),this.listeners.forEach(d=>d());const c=Object.keys(s).every(d=>d==="text"||d==="sending");this.timer&&clearTimeout(this.timer),c?this.timer=setTimeout(()=>this.save(),300):this.save()}save(){var a;this.timer&&(clearTimeout(this.timer),this.timer=null);const i={};for(const[l,{sending:s,...c}]of this.drafts)((a=c.text)!=null&&a.trim()||c.files.length||c.quote||c.passages.length)&&(i[l]=c);Object.keys(i).length?localStorage.setItem(this.storageKey,JSON.stringify(i)):localStorage.removeItem(this.storageKey)}async clear(i){this.timer&&(clearTimeout(this.timer),this.timer=null);const a=[...this.drafts.values()].flatMap(l=>l.files);await Promise.all(a.map(l=>i(l.id).catch(s=>console.warn(`Pending attachment ${l.id} was not deleted on log-out`,s)))),this.drafts.clear(),localStorage.removeItem(this.storageKey),this.listeners.forEach(l=>l())}}const VI=e=>`jarvy-drafts:${e}`;function EC(e,i,a){e.update(i.chatId,{quote:{id:i.id,name:Pa(a.find(l=>l.id===i.senderId)),text:fv(i).replace(/\s+/g," ").slice(0,160)}})}function $I(e,i){return k.useSyncExternalStore(e.subscribe,()=>e.get(i))}const a2=()=>Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");function NC({chatId:e,id:i,drafts:a,placeholder:l,disabled:s=!1,mention:c,initialText:d,formRef:f,scrollRef:m,onSend:v,onError:y,onNotice:g}){const b=$I(a,e),x=b.sending,[w,S]=k.useState([]),[C,N]=k.useState(!1),M=w.filter(O=>O.chatId===e),T=M.length>0,A=k.useRef(null),I=b.text??d??"",D=b.files,B=b.quote,P=O=>a.update(e,{text:O}),V=qI({textarea:A,value:I,setValue:P,inside:(c==null?void 0:c.inside)??[],outside:(c==null?void 0:c.outside)??[],bots:(c==null?void 0:c.bots)??[],onInvite:O=>c==null?void 0:c.onInvite(O)});async function z(O){const F=e;if(!O.length)return;if(T){g(j("composer.busy"));return}if(D.length+O.length>5){g(j("composer.tooMany",{count:5}));return}if(O.some(ee=>ee.size===0||ee.size>10*1024*1024)){g(j("composer.size"));return}const ne=O.map(ee=>({key:a2(),chatId:F,name:ee.name,done:0})),_=ne.map(ee=>ee.key),J=(ee,H)=>S($=>$.map(fe=>fe.key===ee?{...fe,done:H}:fe));S(ee=>[...ee,...ne]);try{for(const[ee,H]of O.entries()){const $=_[ee],fe=await je.uploadAttachment(F,H,ye=>J($,ye));a.update(F,ye=>({files:[...ye.files,fe]})),S(ye=>ye.filter(xe=>xe.key!==$))}}catch(ee){y(ee)}finally{S(ee=>ee.filter(H=>!_.includes(H.key)))}}async function Y(O){const F=e;try{await je.removeAttachment(O),a.update(F,ne=>({files:ne.files.filter(_=>_.id!==O)}))}catch(ne){y(ne)}}function q(O){const F=[...O.clipboardData.files];if(!F.length)return;O.preventDefault();const ne=new Date().toISOString().replace(/\D/g,"").slice(0,14);z(F.map((_,J)=>_.type.startsWith("image/")&&/^image\.\w+$/.test(_.name)?new File([_],`${j("composer.pasted")}-${ne}${F.length>1?`-${J+1}`:""}.${_.name.split(".").pop()}`,{type:_.type}):_))}const W=O=>O.dataTransfer.types.includes("Files");function Q(O){!W(O)||s||(O.preventDefault(),O.dataTransfer.dropEffect="copy",N(!0))}function U(O){W(O)&&(O.preventDefault(),N(!1),s||z([...O.dataTransfer.files]))}async function X(O){O==null||O.preventDefault();const F=e,ne=a.get(F),_=(ne.text??d??"").trim(),J=ne.files,ee=ne.quote,H=ne.passages,fe=[H.map((re,be)=>`[[q${be+1}]]`).join(`
515
- `),_].filter(Boolean).join(`
516
-
517
- `);if(!fe&&!J.length||ne.sending||T||s)return;const ye=JSON.stringify([fe,J.map(re=>re.id),(ee==null?void 0:ee.id)??null,H]),xe=ne.signature===ye&&ne.key?ne.key:a2();a.update(F,{key:xe,signature:ye,sending:!0});try{await v(fe,J.map(re=>re.id),xe,ee==null?void 0:ee.id,H.map(({messageId:re,text:be})=>({messageId:re,text:be}))),a.update(F,re=>{var be;return{text:(re.text??d??"").trim()===_?"":re.text,passages:re.passages.filter(oe=>!H.includes(oe)),files:re.files.filter(oe=>!J.some(ce=>ce.id===oe.id)),quote:((be=re.quote)==null?void 0:be.id)===(ee==null?void 0:ee.id)?null:re.quote,key:null,signature:null}})}catch(re){y(re)}finally{a.update(F,{sending:!1})}}return k.useLayoutEffect(()=>{const O=()=>{const F=A.current,ne=m==null?void 0:m.current;if(!F)return;const _=ne==null?void 0:ne.scrollTop;F.style.height="auto",F.style.height=`${F.scrollHeight}px`,ne&&_!==void 0&&ne.scrollTop!==_&&ne.scrollTo({top:_,behavior:"instant"})};return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[I,e,m]),u.jsxs("form",{ref:f,className:`ui-compose-wrap${C?" jarvy-dropping":""}`,onSubmit:O=>void X(O),onDragEnter:Q,onDragOver:Q,onDragLeave:O=>{O.currentTarget.contains(O.relatedTarget)||N(!1)},onDrop:U,children:[D.length+M.length>0&&u.jsxs("div",{className:"jarvy-pending-files",children:[D.map(O=>u.jsxs("span",{className:"jarvy-file-chip",children:[u.jsx(De,{name:"paperclip"}),u.jsx("span",{title:O.name,children:O.name}),u.jsx("button",{type:"button","aria-label":j("composer.removeFile",{name:O.name}),onClick:()=>void Y(O.id),children:"×"})]},O.id)),M.map(O=>u.jsxs("span",{className:"jarvy-file-chip","data-uploading":!0,children:[u.jsx(De,{name:"paperclip"}),u.jsx("span",{title:O.name,children:O.name}),u.jsx("span",{className:"jarvy-file-progress",role:"progressbar","aria-label":j("composer.uploading",{name:O.name}),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(O.done*100),children:u.jsx("span",{style:{width:`${O.done*100}%`}})})]},O.key))]}),B&&u.jsxs("div",{className:"jv-compose-quote",children:[u.jsx("span",{className:"jv-compose-quote-label",children:j("composer.replying")}),u.jsx("span",{className:"jv-reply-author",children:B.name}),u.jsx("span",{className:"jv-reply-text",children:B.text||j("common.attachment")}),u.jsx("button",{type:"button","aria-label":j("composer.cancelReply"),onClick:()=>a.update(e,{quote:null}),children:"×"})]}),u.jsx(vI,{quotes:b.passages,onRemove:O=>a.update(e,F=>({passages:F.passages.filter((ne,_)=>_!==O)}))}),u.jsxs("div",{className:"ui-composer jv-composer",children:[c&&V.menu,C&&u.jsx("span",{className:"jarvy-drop-hint",role:"status",children:j("composer.drop")}),u.jsxs("label",{className:"jarvy-attach-trigger",title:j("composer.attach"),children:[u.jsx(De,{name:"add"}),u.jsx("input",{type:"file",multiple:!0,"aria-label":j("composer.attach"),disabled:x||T||s||D.length>=5,onChange:O=>{const F=[...O.target.files??[]];O.target.value="",z(F)}})]}),u.jsx("textarea",{ref:A,id:i,rows:1,maxLength:32e3,value:I,onPaste:q,placeholder:l,disabled:s,"aria-label":j("composer.input"),onChange:O=>{P(O.target.value),c&&V.track(O.target.value)},onKeyDown:O=>{c&&V.onKeyDown(O)||O.key==="Enter"&&!O.shiftKey&&!O.nativeEvent.isComposing&&(O.preventDefault(),X())},onClick:()=>{c&&V.track()},onBlur:c?V.leaves:void 0}),u.jsx("button",{type:"submit",className:"ui-round ui-send","aria-label":j("composer.send"),disabled:x||T||s||!I.trim()&&!D.length&&!b.passages.length,children:u.jsx(De,{name:"arrow-up"})})]})]})}function YI({messages:e,members:i,me:a,activeQuestion:l,onSettled:s,onPreview:c,onQuote:d,onReact:f,onJump:m,onError:v,bot:y}){return u.jsx(u.Fragment,{children:e.map((g,b)=>{const x=e[b+1],w=g.role==="assistant"&&!!(x!=null&&x.question)&&x.senderId===g.senderId;return u.jsxs("div",{className:`ui-message-row ${g.role==="user"?"ui-user":""}`,"data-message":g.id,"data-asks":w||void 0,tabIndex:-1,children:[g.role==="assistant"&&u.jsx("span",{className:"jarvy-bubble-avatar",children:u.jsx(zc,{color:(y==null?void 0:y.color)??"gray",mood:y==null?void 0:y.mood,size:22,crown:y==null?void 0:y.agent})}),u.jsxs("div",{className:"jv-dm-stack",children:[g.replyTo&&u.jsx(mC,{message:g,members:i,onJump:m}),g.question?u.jsx(oC,{message:{...g,question:g.question},keyboard:g.id===l,onSettled:s}):u.jsxs("div",{className:"ui-bubble",children:[g.content&&u.jsx(uC,{message:g,members:i,me:a,onJump:m}),g.attachments.length>0&&u.jsx(lC,{files:g.attachments,onOpen:S=>c(g.attachments,S)})]}),u.jsx(pC,{message:g,me:a,members:i,onReact:f,onError:v})]}),u.jsx("div",{className:"jv-row-actions",children:u.jsx(gC,{message:g,me:a,onReply:d,onReact:f,onError:v})})]},g.id)})})}function GI(e,i,a,l,s,c=0){const v=i.offsetWidth,y=i.offsetLeft,g=i.offsetTop,b=Math.max(300,Math.round(a*.4));e.style.maxHeight="";const x=e.hasAttribute("data-fit"),w=e.offsetHeight,S=O=>O==="left"||O==="right",C=O=>O==="left"?y-10-8:O==="right"?a-y-v-10-8:O==="below"?l-g-v-10-8:g-10-8,N=y+v/2>a/2,M=O=>x?S(O)?Math.min(b,Math.max(160,C(O))):Math.min(b,N?y+v-8:a-y-8):e.offsetWidth,T=O=>S(O)?M(O)<=C(O):Math.min(120,w)<=C(O),A=c>.05?"right":c<-.05?"left":null,D=(A==="left"||A===null&&C("left")>=C("right")?["left","right"]:["right","left"]).find(T)??(C("below")>=C("above")?"below":"above"),B=e.dataset.side,V=B!==void 0&&B!==D&&S(B)===S(D)&&T(B)&&C(B)+40>=C(D)?B:D,z=x&&(V==="left"||!S(V)&&N),Y=V==="left"?y-10:V==="right"?y+v+10:N?y+v:y;e.style.width="",e.style.maxWidth=x?`${M(V)}px`:"",z?(e.style.left="",e.style.right=`${a-Y}px`):(e.style.right="",x&&(e.style.left=`${Y}px`));const q=e.offsetWidth,W=x?z?Y-q:Y:V==="left"?y-10-q:V==="right"?y+v+10:Math.min(Math.max(8,y+v-q),Math.max(8,a-q-8)),Q=s&&W<s.right&&W+q>s.left?s.bottom+6:0,U=Math.min(Math.max(8,Q),Math.max(8,l-140));let X;V==="below"?(X=Math.max(8,Math.min(g+v+10,l-8-Math.min(w,120))),e.style.maxHeight=`${Math.max(40,l-X-8)}px`):V==="above"?(e.style.maxHeight=`${Math.max(40,g-10-U)}px`,X=Math.max(U,g-10-e.offsetHeight)):(e.style.maxHeight=`${Math.max(120,l-U-8)}px`,X=Math.min(Math.max(U,g+6),Math.max(U,l-e.offsetHeight-8))),x||(e.style.left=`${W}px`),e.style.top=`${X}px`,e.dataset.side=V,e.style.setProperty("--npc-tail",S(V)?`${Math.min(e.offsetHeight-18,Math.max(18,g+v/2-X))}px`:`${Math.min(q-18,Math.max(18,y+v/2-W))}px`)}function XI(e){const i=e.split(new RegExp("(?<=[。!?.!?…])\\s*")).filter(Boolean);return{index:Math.max(0,i.length-1),sentence:i.at(-1)??""}}const r2=.06,QI=matchMedia("(prefers-reduced-motion: reduce)");function md({text:e,limit:i,streaming:a=!1}){const[,l]=k.useState(0),s=k.useRef({text:"",count:0,rate:r2,at:performance.now()}),c=performance.now(),d=s.current;d.count=Math.min(d.text.length,d.count+d.rate*(c-d.at)),d.at=c,e!==d.text&&(d.text=e,d.count=Math.min(d.count,e.length),d.rate=Math.max(r2,(e.length-d.count)/i));const f=!QI.matches&&d.count<e.length;k.useEffect(()=>{if(!f)return;const v=requestAnimationFrame(()=>l(y=>y+1));return()=>cancelAnimationFrame(v)});const m=f?e.slice(0,Math.floor(d.count)).replace(/[\uD800-\uDBFF]$/,""):e;return u.jsxs(u.Fragment,{children:[m,(f||a)&&u.jsx("i",{className:"jv-npc-caret"})]})}const TC={think:fA,mutter:QA,read:SA,write:PA,run:KA,script:mA,compact:oA,retry:hg,ask:OA,say:_A,chat:Aj,tool:e4},rg=e=>j("npc.duration",{value:za(Math.max(0,e)/1e3,{maximumFractionDigits:1,minimumFractionDigits:1})}),KI={completed:"npc.done",interrupted:"npc.done.interrupted",failed:"npc.done.failed"};function ZI({view:e,name:i,cat:a,area:l,avoid:s,layout:c,facing:d,toolbar:f}){var A,I,D;const m=k.useRef(null),v=k.useRef(null),[y,g]=k.useState(!1),[,b]=k.useState(0);k.useLayoutEffect(()=>{c.current=()=>{var Y;if(!m.current||!a.current||!l.current)return;const P=l.current.getBoundingClientRect(),V=s.current?s.current.getBoundingClientRect().top-P.top:P.height,z=(Y=v.current)==null?void 0:Y.getBoundingClientRect();y?m.current.removeAttribute("data-fit"):m.current.setAttribute("data-fit",""),GI(m.current,a.current,P.width,V,z?{left:z.left-P.left,right:z.right-P.left,bottom:z.bottom-P.top}:null,d())},c.current();const B=new ResizeObserver(()=>{var P;return(P=c.current)==null?void 0:P.call(c)});for(const P of[m.current,v.current])P&&B.observe(P);return()=>{B.disconnect(),c.current=null}},[y]);const x=e.steps.some(B=>B.state==="running");k.useEffect(()=>{if(!y||!x)return;const B=setInterval(()=>b(P=>P+1),200);return()=>clearInterval(B)},[y,x]),k.useEffect(()=>{if(!y)return;const B=P=>{P.key==="Escape"&&g(!1)};return addEventListener("keydown",B),()=>removeEventListener("keydown",B)},[y]);const w=(A=e.steps[0])==null?void 0:A.id;k.useEffect(()=>{g(!1)},[w]);const S=e.shown,C=S?S.look:e.done?"action":null;let N=null;if((S==null?void 0:S.look)==="thought"||(S==null?void 0:S.look)==="mutter"){const{index:B,sentence:P}=XI(S.line??""),V=u.jsx(md,{text:P,limit:300,streaming:S.look==="thought"&&S.state==="running"},`${S.id}:${B}`),[z,Y]=j("npc.mutter",{text:""}).split("");N=S.look==="thought"?u.jsx("span",{className:"jv-npc-thought",children:V},B):u.jsxs("span",{className:"jv-npc-murmur",children:[z,V,Y]},B)}else if((S==null?void 0:S.look)==="speech")N=u.jsx("span",{className:"jv-npc-speech",children:u.jsx(md,{text:S.line??"",limit:1500,streaming:S.state==="running"&&S.icon==="say"},S.id)});else if(S){const B=TC[S.icon];N=u.jsxs("span",{className:"jv-npc-action","data-state":S.state,children:[u.jsx(B,{}),u.jsx(md,{text:S.title,limit:300},S.id),S.state==="running"&&u.jsx("i",{className:"jv-npc-dots"})]})}else e.done&&(N=u.jsxs("span",{className:"jv-npc-action","data-state":e.done.outcome==="completed"?"ok":"failed",children:[e.done.outcome==="completed"?u.jsx(ur,{}):u.jsx(Cc,{}),u.jsx(md,{text:j(KI[e.done.outcome],{duration:rg(e.done.ms)}),limit:300},`done:${e.done.ms}`)]}));const M=e.steps.length>0,T=(S==null?void 0:S.icon)==="ask"&&S.state==="running";return u.jsxs(u.Fragment,{children:[f==null?void 0:f(v,()=>g(!1)),u.jsx("div",{ref:m,className:"jv-npc","data-open":y||void 0,"data-look":y?void 0:C??void 0,"data-kind":S==null?void 0:S.icon,"data-fading":!y&&!S&&((I=e.done)==null?void 0:I.fading)||void 0,hidden:!y&&!N,children:y?u.jsxs("section",{className:"jv-npc-panel","aria-label":j("npc.panel"),children:[u.jsxs("header",{children:[u.jsx("strong",{children:j("npc.panel")}),e.startedAt>0&&u.jsx("span",{children:rg((e.endedAt??Date.now()+e.skew)-e.startedAt)}),u.jsx("button",{type:"button",onClick:()=>g(!1),"aria-label":j("npc.collapse"),title:j("npc.collapse"),children:u.jsx(zA,{})})]}),u.jsx("ol",{children:e.steps.map(B=>u.jsx(JI,{step:B,skew:e.skew},B.id))})]}):u.jsxs(u.Fragment,{children:[C==="speech"&&u.jsxs("span",{className:"jv-npc-name",children:[i,(S==null?void 0:S.to)&&u.jsx("em",{children:j("npc.to",{chat:S.to})})]}),M?u.jsx("button",{type:"button",className:"jv-npc-line",onClick:()=>g(!0),title:j("npc.expand"),children:N}):u.jsx("div",{className:"jv-npc-line",children:N}),T&&e.answer&&((D=S.options)==null?void 0:D.some(B=>B.value))&&u.jsx("div",{className:"jv-npc-options",children:S.options.map(B=>u.jsx("button",{type:"button",onClick:()=>e.answer(B.value),children:B.label},B.label))}),T&&!e.answer&&S.hint&&u.jsx("p",{className:"jv-npc-hint",children:S.hint})]})})]})}function JI({step:e,skew:i}){const[a,l]=k.useState(!1),s=TC[e.icon],c=e.detail;return u.jsxs("li",{"data-state":e.state,style:e.depth?{paddingLeft:`${e.depth*16}px`}:void 0,children:[u.jsxs("button",{type:"button","aria-expanded":c?a:void 0,disabled:!c,onClick:()=>l(d=>!d),children:[u.jsx(s,{className:"jv-npc-kind"}),u.jsx("span",{className:"jv-npc-title",children:e.title}),u.jsxs("span",{className:"jv-npc-state",children:[e.state==="running"?u.jsx(jj,{}):e.state==="ok"?u.jsx(ur,{}):u.jsx(Cc,{}),j(`npc.state.${e.state}`)]}),u.jsx("span",{className:"jv-npc-time",children:rg((e.endedAt??Date.now()+i)-e.startedAt)}),c&&u.jsx(Kr,{className:"jv-npc-chevron"})]}),a&&c&&u.jsx("pre",{"data-kind":e.icon,children:c})]})}const Ed="src/web/thread/ThreadPane.tsx",Ud="npm run build",WI=["export function ThreadPane({ thread, replies }: Props) {"," const scroll = useRef<HTMLDivElement>(null);"," useLayoutEffect(() => {"," scroll.current!.scrollTop = scroll.current!.scrollHeight;"," }, [thread.id]);"," …"].join(`
518
- `),e9=["> tsc -p tsconfig.web.json","src/web/thread/ThreadPane.tsx:58:41 - error TS2345: Argument of type","'HTMLDivElement | null' is not assignable to parameter of type 'HTMLDivElement'.","","Found 1 error."].join(`
519
- `),AC={question:"npc.demo.question",options:[{value:"yes",label:"npc.demo.yes"},{value:"no",label:"npc.demo.no"}]},t9=[{kind:"think",text:"npc.demo.think1",ms:4200},{kind:"read",target:Ed,ms:2600,output:WI},{kind:"think",text:"npc.demo.think2",ms:3800},{kind:"write",target:Ed,ms:2600,output:["- useLayoutEffect(() => scrollToEnd(), [thread.id]);","+ useLayoutEffect(() => {","+ requestAnimationFrame(() => scrollToEnd(scroll.current));","+ }, [thread.id, replies.length]);"].join(`
520
- `)},{kind:"mutter",text:"npc.demo.mutter1"},{kind:"run",target:Ud,ms:3200,failed:!0,output:e9},{kind:"mutter",text:"npc.demo.mutter2"},{kind:"compact",ms:3400,output:"context: 412,380 → 38,210 tokens"},{kind:"write",target:Ed,ms:2e3,output:"+ const el = scroll.current; if (el) scrollToEnd(el);"},{kind:"run",target:Ud,ms:3e3,output:["> vite build","✓ 2331 modules transformed.","✓ built in 4.9s"].join(`
521
- `)},{kind:"say",text:"npc.demo.post",to:"npc.demo.channel"},{kind:"ask",...AC},{kind:"say",replies:{yes:"npc.demo.replyYes",no:"npc.demo.replyNo"}}],lg=[{key:"sleep",label:"npc.pose.sleep",motion:"sleep"},{key:"idle",label:"npc.pose.idle",motion:"idle"},{key:"think",label:"npc.pose.think",motion:"think",step:{kind:"think",text:"npc.demo.think1"}},{key:"mutter",label:"npc.pose.mutter",motion:"work",step:{kind:"mutter",text:"npc.demo.mutter2"}},{key:"say",label:"npc.pose.say",motion:"turn",step:{kind:"say",text:"npc.demo.replyNo"}},{key:"ask",label:"npc.pose.ask",motion:"ask",step:{kind:"ask",...AC}},{key:"read",label:"npc.pose.read",motion:"read",step:{kind:"read",target:Ed}},{key:"work",label:"npc.pose.work",motion:"work",fast:!0,step:{kind:"run",target:Ud}},{key:"compact",label:"npc.pose.compact",motion:"yawn",step:{kind:"compact"}},{key:"busy",label:"npc.pose.busy",motion:"busy"},{key:"failed",label:"npc.pose.failed",motion:"idle",mood:"dizzy",shake:!0,step:{kind:"run",target:Ud,failed:!0}},{key:"done",label:"npc.pose.done",motion:"stretch",mood:"happy",done:!0},{key:"groom",label:"npc.pose.groom",motion:"groom"}];function n9({controls:e,onReplay:i,toolbar:a}){const[l,s]=k.useState(!1);return u.jsxs("div",{ref:a,className:"jv-npc-toolbar",role:"toolbar","aria-label":j("npc.toolbar"),children:[u.jsxs("div",{className:"jv-npc-toolbar-row",children:[u.jsx("span",{children:j("npc.toolbar")}),u.jsx("button",{type:"button",className:"jv-npc-icon",onClick:i,"aria-label":j("npc.replay"),title:j("npc.replay"),children:u.jsx(VA,{})}),u.jsxs(Zl,{value:e.baseMood,onValueChange:c=>e.setBaseMood(c),children:[u.jsx(Wl,{className:"jv-npc-mood","aria-label":j("npc.mood"),title:j("npc.mood"),children:u.jsx(Jl,{})}),u.jsx(eo,{className:"jv-select-menu",position:"popper",sideOffset:4,children:eI.map(c=>u.jsx(Fi,{value:c,children:j(`npc.mood.${c}`)},c))})]}),u.jsxs("button",{type:"button",className:"jv-npc-toggle","aria-expanded":l,onClick:()=>s(c=>!c),children:[u.jsx(YA,{}),j("npc.poses")]})]}),l&&u.jsx("div",{className:"jv-npc-poses",role:"group","aria-label":j("npc.poses"),children:lg.map(c=>{var d;return u.jsx("button",{type:"button","aria-pressed":((d=e.pose)==null?void 0:d.key)===c.key,onClick:()=>e.hold(c.key),children:j(c.label)},c.key)})})]})}const i9={think:"think",mutter:"mutter",read:"read",write:"write",run:"run",compact:"compact",ask:"ask",say:"say"},l2=e=>e.text?[...j(e.text)].slice(0,e.typed).join(""):"";function a9(e){var l;if(e.kind==="think"||e.kind==="mutter")return j(`npc.step.${e.kind}`);if(e.kind==="ask"&&e.answer)return j("npc.step.ask.ok",{answer:j(e.answer.label)});const i=e.state==="failed"&&e.kind==="run"?"failed":e.state==="running"?"running":"ok",a=e.kind==="say"&&e.to?"post":e.kind;return j(`npc.step.${a}.${i}`,{target:((l=e.target)==null?void 0:l.split("/").pop())??"",chat:e.to?`#${j(e.to)}`:""})}function o2(e){var l;const i=e.kind==="think"?"thought":e.kind==="mutter"?"mutter":e.kind==="say"||e.kind==="ask"?"speech":"action",a=e.kind==="ask"?j(e.question):l2(e);return{id:String(e.id),look:i,icon:i9[e.kind],state:e.state,startedAt:e.startedAt,endedAt:e.endedAt,depth:0,title:a9(e),line:i==="action"?void 0:a,to:e.to?`#${j(e.to)}`:void 0,options:e.kind==="ask"&&e.state==="running"?(l=e.options)==null?void 0:l.map(s=>({label:j(s.label),value:s.value})):void 0,detail:e.kind==="ask"?j(e.question):e.text?l2(e):e.output}}const fp={steps:[],phase:"before",startedAt:0,endedAt:null,flash:null,shake:0,recapUntil:0},r9=40,s2=6e3,c2=500,l9={think:"think",mutter:"work",read:"read",write:"work",run:"work",compact:"yawn",ask:"ask",say:"turn"};class hp extends Error{}const o9=e=>({...e,id:-1,state:e.failed?"failed":"running",startedAt:Date.now(),endedAt:null,typed:e.text?[...j(e.text)].length:0});function s9(e,i){const[a,l]=k.useState(fp),[s,c]=k.useState(i),[d,f]=k.useState(0),[m,v]=k.useState(null),[,y]=k.useState(0),g=k.useRef(null);k.useEffect(()=>{if(!e||m)return;let A=!0;const I=new Set,D=z=>new Promise((Y,q)=>{const W=setTimeout(()=>{I.delete(W),A?Y():q(new hp)},z);I.add(W)}),B=(z,Y)=>l(q=>({...q,steps:q.steps.map(W=>W.id===z?{...W,...Y}:W)})),P=(z,Y)=>l(q=>({...q,flash:{mood:z,until:Date.now()+Y}})),V=async(z,Y,q)=>{const W=[...j(Y)].length,Q=q?Math.max(16,q/W):r9;for(let U=1;U<=W;U++)B(z,{typed:U}),await D(Q)};return(async()=>{l({...fp}),await D(700);const z=Date.now();let Y="";l(W=>({...W,phase:"turn",startedAt:z}));for(const[W,Q]of t9.entries()){const{ms:U,failed:X,replies:O,...F}=Q,ne=O?O[Y]:Q.text;if(l(_=>({..._,steps:[..._.steps,{...F,text:ne,id:W,state:"running",startedAt:Date.now(),endedAt:null,typed:0}]})),Q.kind==="ask"){if(Y=await new Promise(_=>{g.current=_}),g.current=null,!A)throw new hp;B(W,{state:"ok",endedAt:Date.now(),answer:Q.options.find(_=>_.value===Y)});continue}ne?await V(W,ne,Q.kind==="think"?U??null:null):await D(U??1e3),(Q.kind==="mutter"||Q.kind==="say")&&await D(1100),B(W,{state:X?"failed":"ok",endedAt:Date.now()}),X&&(l(_=>({..._,shake:_.shake+1})),P("dizzy",2600),await D(900))}const q=Date.now();for(l(W=>({...W,phase:"stretch",endedAt:q,recapUntil:q+s2})),q-z>2e4&&P("happy",3200),await D(2200);;)l(W=>({...W,phase:"idle"})),await D(9e3),l(W=>({...W,phase:"groom"})),await D(2800)})().catch(z=>{if(!(z instanceof hp))throw z}),()=>{var z;A=!1;for(const Y of I)clearTimeout(Y);(z=g.current)==null||z.call(g,"")}},[e,d,m]),k.useEffect(()=>{var B;const A=Date.now(),I=[((B=a.flash)==null?void 0:B.until)??0,a.recapUntil-c2,a.recapUntil].filter(P=>P>A);if(!I.length)return;const D=setTimeout(()=>y(P=>P+1),Math.min(...I)-A+20);return()=>clearTimeout(D)});const b=lg.find(A=>A.key===m)??null,x=Date.now(),w=b?null:a.phase==="turn"?[...a.steps].reverse().find(A=>A.state==="running")??null:null,S=b?b.motion:w?l9[w.kind]:a.phase==="stretch"?"stretch":a.phase==="groom"?"groom":a.phase==="turn"?"think":"idle",C=a.flash&&a.flash.until>x?a.flash.mood:null,N=a.endedAt!==null&&x<a.recapUntil,M=b?b.step?o9(b.step):null:w??(a.phase==="turn"?a.steps.at(-1)??null:null);return{...{view:{steps:a.steps.map(o2),shown:M?o2(M):null,startedAt:a.startedAt,endedAt:a.endedAt,skew:0,answer:A=>{var I;return(I=g.current)==null?void 0:I.call(g,A)},done:b!=null&&b.done?{ms:31400,outcome:"completed",fading:!1}:!b&&N?{ms:a.endedAt-a.startedAt,outcome:"completed",fading:x>=a.recapUntil-c2}:null},motion:S,fast:b?!!b.fast:(w==null?void 0:w.kind)==="write"||(w==null?void 0:w.kind)==="run",mood:(b==null?void 0:b.mood)??C??s,shake:a.shake,canRecap:!b&&a.endedAt!==null&&!N,showRecap:()=>l(A=>({...A,recapUntil:Date.now()+s2}))},controls:{pose:b,baseMood:s,setBaseMood:c,replay:()=>{v(null),f(A=>A+1)},hold:A=>{v(A),l(I=>{var D;return{...fp,shake:I.shake+((D=lg.find(B=>B.key===A))!=null&&D.shake?1:0)}})}}}}const c9=4e3,u2={turn:null,last:null,skew:0};function u9(e,i){const a=[...e.steps];let l=e.dropped;for(const s of i)if(s.op==="step"){const c=a.findIndex(d=>d.id===s.step.id);c>=0?a[c]=s.step:a.push(s.step)}else if(s.op==="text"){const c=a.findIndex(v=>v.id===s.id),d=a[c];if(!d)continue;const f=(d.text??"")+s.append,m=Math.max(0,f.length-c9);a[c]={...d,text:f.slice(m),omitted:(d.omitted??0)+m}}else{const c=a.findIndex(d=>d.id===s.id);c>=0&&(a.splice(c,1),l++)}return{...e,steps:a,dropped:l}}function d9(e){const[i,a]=k.useState(u2);return k.useEffect(()=>{if(a(u2),!e)return;const l=new EventSource(`/api/bots/${encodeURIComponent(e)}/live`),s=c=>JSON.parse(c.data);return l.addEventListener("snapshot",c=>{const d=s(c);a(f=>({...f,turn:d.turn,skew:d.now-Date.now()}))}),l.addEventListener("start",c=>{const{turn:d}=s(c);a(f=>({...f,turn:d}))}),l.addEventListener("patch",c=>{const{patches:d}=s(c);a(f=>f.turn?{...f,turn:u9(f.turn,d)}:f)}),l.addEventListener("end",c=>{const{outcome:d,endedAt:f}=s(c);a(m=>m.turn?{...m,turn:null,last:{...m.turn,outcome:d,endedAt:f}}:m)}),()=>l.close()},[e]),i}const mp=new Set(["messages.read","messages.search","chats.list","chats.info","threads.list","members.list","bots.list","sections.list","history.read","list","describe"]),lr=e=>e.state==="running"?"running":e.state==="failed"?"failed":"ok",pp=e=>(e==null?void 0:e.split("/").filter(Boolean).pop())??"",f9=e=>{const i=(e??"").split(`
522
- `)[0].trim();return i.length>40?`${i.slice(0,39)}…`:i},d2=e=>e.type==="channel"?`#${e.title}`:e.title;function gp(e){return e?e.omitted?`${e.head}
523
- ${j("npc.live.omitted",{count:za(e.omitted)})}
524
- ${e.tail}`:e.head+e.tail:""}const f2=e=>e.omitted?`${j("npc.live.omitted",{count:za(e.omitted)})}
525
- `:"";function vp(e){switch(e.icon){case"think":return{motion:"think",fast:!1};case"mutter":return{motion:"work",fast:!1};case"read":case"chat":return{motion:"read",fast:!1};case"say":return{motion:"turn",fast:!1};case"ask":return{motion:"ask",fast:!1};case"compact":return{motion:"yawn",fast:!1};case"retry":return{motion:"busy",fast:!1};default:return{motion:"work",fast:!0}}}function h9(e,i,a){const l={id:e.id,state:e.state,startedAt:e.startedAt,endedAt:e.endedAt,depth:i},s=(m,v,y)=>({...l,look:"action",icon:m,title:v,detail:y});switch(e.kind){case"thinking":return{...l,look:"thought",icon:"think",title:j("npc.step.think"),line:e.text??"",detail:f2(e)+(e.text??"")};case"text":return{...l,look:"mutter",icon:"mutter",title:j("npc.step.mutter"),line:e.text??"",detail:f2(e)+(e.text??"")};case"compaction":return s("compact",j(`npc.live.compact.${lr(e)}`),e.tokensBefore!=null&&e.tokensAfter!=null?j("npc.live.tokens",{before:za(e.tokensBefore),after:za(e.tokensAfter)}):gp(e.output));case"retry":return s("retry",e.state==="running"?j("npc.live.retry.running",{attempt:e.attempt??1,max:e.maxAttempts??1}):j(`npc.live.retry.${lr(e)}`),gp(e.output))}const c=e.input??{},d=gp(e.output),f=[c.path??c.command??c.args,d].filter(Boolean).join(`
526
-
527
- `);switch(e.tool){case"read":return s("read",j(`npc.live.read.${lr(e)}`,{target:pp(c.path)}),f);case"edit":return s("write",j(`npc.live.edit.${lr(e)}`,{target:pp(c.path)}),f);case"write":return s("write",j(`npc.live.write.${lr(e)}`,{target:pp(c.path)}),f);case"bash":return s("run",j(`npc.live.run.${lr(e)}`,{target:f9(c.command)}),f);case"codemode":return s("script",j(`npc.live.script.${lr(e)}`),f);case"chat":return m9(e,l,a,d);default:return s("tool",j(`npc.live.tool.${lr(e)}`,{tool:e.tool??""}),f)}}function m9(e,i,a,l){const s=e.input??{},c=s.action??"",d=s.chat,f=d&&(d.id===null?d.type!=="dm":d.id!==a)?d2(d):void 0;if(c==="messages.send")return{...i,look:"speech",icon:"say",to:f,line:s.text??"",detail:[s.text,e.state==="failed"?l:""].filter(Boolean).join(`
528
-
529
- `),title:e.state==="failed"?j("npc.live.sendFailed"):f?j(`npc.step.post.${e.state==="running"?"running":"ok"}`,{chat:f}):j(`npc.step.say.${e.state==="running"?"running":"ok"}`)};if(c==="messages.ask"){const y=p9(e);return{...i,look:"speech",icon:"ask",to:f,line:s.text??"",options:(s.options??[]).map(g=>({label:g})),hint:f?j("npc.live.answerIn",{chat:f}):j("npc.live.answerBelow"),detail:[s.text,...(s.options??[]).map(g=>`· ${g}`),l].filter(Boolean).join(`
530
- `),title:e.state==="running"?j("npc.step.ask.running"):y?j("npc.step.ask.ok",{answer:y}):j(e.state==="failed"?"npc.live.askFailed":"npc.live.askClosed")}}const m=d?d2(d):"",v=mp.has(c)?m?j(`npc.live.browse.${e.state==="running"?"running":"ok"}`,{chat:m}):j(`npc.live.browseAll.${e.state==="running"?"running":"ok"}`):j(`npc.live.tool.${lr(e)}`,{tool:c||"chat"});return{...i,look:"action",icon:mp.has(c)?"chat":"tool",title:e.state==="failed"&&mp.has(c)?j("npc.live.tool.failed",{tool:c}):v,detail:l}}function p9(e){try{const i=JSON.parse(e.output?e.output.head+e.output.tail:"");return i.status!=="answered"?null:[...(i.selected??[]).map(a=>a.label??""),i.custom??""].filter(Boolean).join(j("common.listSeparator"))}catch{return null}}function h2(e,i){const a=new Map(e.steps.map(s=>[s.id,s.parentId])),l=s=>{let c=0,d=s.parentId;for(;d&&c<4;)c++,d=a.get(d)??null;return c};return e.steps.map(s=>h9(s,l(s),i))}function pd(e){var a;const i=((a=e.line)==null?void 0:a.length)??0;if(e.look==="speech"){const l=Math.min(7e3,Math.max(2500,1500+50*i))+Math.min(1500,i/.06);return{firm:l,light:l}}return e.look==="mutter"?{firm:1500,light:Math.min(3500,Math.max(1500,800+30*i))}:e.state==="failed"?{firm:2e3,light:2e3}:{firm:0,light:e.look==="action"?900:0}}const g9=4e3,m2=1500;function p2(e,i,a,l){var x;const s=w=>w-a;let c=null;for(const w of e)w.state==="running"&&(!c||w.startedAt>=c.startedAt)&&(c=w);const d=[];for(const w of e.filter(S=>S.state!=="running"&&S.endedAt!==null&&pd(S).firm).sort((S,C)=>S.endedAt-C.endedAt)){const S=s(w.endedAt),C=d.at(-1);C&&w.look==="speech"&&(C.end=Math.min(C.end,Math.max(C.start+m2,S)));const N=Math.max(S,(C==null?void 0:C.end)??0);N-S>g9||d.push({step:w,start:N,end:N+pd(w).firm})}const f=(c==null?void 0:c.look)==="speech"?c:null;if(f){const w=s(f.startedAt);for(let S=d.length-1;S>=0;S--){const C=d[S];C.start>=w&&C.start>i?d.splice(S,1):C.end>w&&(C.end=Math.max(C.start+m2,w))}}let m=null;for(const w of e){if(w.state==="running"||w.endedAt===null||!pd(w).light)continue;const S=s(w.endedAt)+pd(w).light;S>i&&(!m||w.endedAt>=m.step.endedAt)&&(m={step:w,end:S})}const v=d.find(w=>w.start<=i&&i<w.end),y=(v==null?void 0:v.step)??(f||c&&c.look!=="thought"||m==null?void 0:m.step),g=y??f??c??(l?e.at(-1)??null:null),b=[...d.flatMap(w=>[w.start,w.end]),(m==null?void 0:m.end)??0].filter(w=>w>i);return{shown:g,lingering:!!y,next:b.length?Math.min(...b):0,wordsEnd:((x=d.at(-1))==null?void 0:x.end)??0}}const g2=6e3,v2=500,y2=2200,v9=2e4,y9=10*6e4,b2=3e4,b9=2e4,x9=2800;function j9(e,i,a,l,s){var Y;const{turn:c,last:d,skew:f}=d9(e),[m,v]=k.useState(null),[y,g]=k.useState(0),[b,x]=k.useState(0),[,w]=k.useState(0),S=k.useRef(new Set),C=k.useRef(Date.now()),N=k.useMemo(()=>c?h2(c,i):d?h2(d,i):[],[c,d,i]);k.useEffect(()=>{for(const q of(c==null?void 0:c.steps)??[])q.state==="failed"&&!S.current.has(q.id)&&(S.current.add(q.id),g(W=>W+1),v({mood:"dizzy",until:Date.now()+2600}))},[c]),k.useEffect(()=>{d&&(S.current.clear(),C.current=Date.now(),x(Math.max(Date.now(),p2(N,Date.now(),f,!1).wordsEnd)+g2),d.outcome==="completed"&&d.endedAt-d.startedAt>v9&&v({mood:"happy",until:Date.now()+3200}))},[d]),k.useEffect(()=>{c&&(C.current=Date.now())},[c!==null]);const M=Date.now(),T=p2(N,M,f,c!==null),A=T.shown,I=N.filter(q=>q.state==="running").sort((q,W)=>W.startedAt-q.startedAt)[0],D=!c&&(d==null?void 0:d.outcome)==="completed"&&M+f-d.endedAt<y2,B=M-C.current,P=!c&&(a==null?void 0:a.status)==="idle"&&B>b2&&(B-b2)%b9<x9,V=I&&I.look!=="thought"?vp(I):T.lingering&&A?vp(A):I?vp(I):c?{motion:"think",fast:!1}:D?{motion:"stretch",fast:!1}:P?{motion:"groom",fast:!1}:s,z=!c&&!A&&d!==null&&M<b;return k.useEffect(()=>{const q=[(m==null?void 0:m.until)??0,b-v2,b,((d==null?void 0:d.endedAt)??0)-f+y2,T.next].filter(Q=>Q>Date.now()),W=setTimeout(()=>w(Q=>Q+1),q.length?Math.min(...q)-Date.now()+20:1e3);return()=>clearTimeout(W)}),{view:{steps:N,shown:A,skew:f,startedAt:((Y=c??d)==null?void 0:Y.startedAt)??0,endedAt:c?null:(d==null?void 0:d.endedAt)??null,done:z?{ms:d.endedAt-d.startedAt,outcome:d.outcome,fading:M>=b-v2}:null},motion:V.motion,fast:V.fast,mood:m&&m.until>M?m.mood:l,shake:y,canRecap:!c&&d!==null&&!z&&M+f-d.endedAt<y9,showRecap:()=>x(Date.now()+g2)}}const MC="jarvy-floating-bot",Qo=10,w9=4,gd=new URLSearchParams(location.search).get("npc")==="demo";function S9(e){return!e||e.status==="stop"?{motion:"sleep",fast:!1}:e.status!=="running"||e.activity==="asking"?{motion:"idle",fast:!1}:["compacting","retrying","aborting"].includes(e.phase)?{motion:"busy",fast:!1}:e.activity==="tool_calling"||e.phase==="tool"?{motion:"work",fast:!0}:e.activity==="texting"||e.phase==="texting"?{motion:"work",fast:!1}:{motion:"think",fast:!1}}function k9(){try{const e=JSON.parse(localStorage.getItem(MC)??"");if(e.x>=0&&e.x<=1&&e.y>=0&&e.y<=1)return e}catch{}return{x:1,y:0}}function C9({bot:e,chatId:i,status:a,area:l,avoid:s,onOpen:c}){const d=k.useRef(null),f=k.useRef(null),m=k.useRef(k9()),v=k.useRef(null),y=k.useRef(!1),g=k.useRef(null),b=k.useRef({motion:"sleep",mood:"normal",lookX:0,lookY:0}),x=k.useRef(null),[w,S]=k.useState(!1),C=k.useRef(null),N=s9(gd,e.mood),M=j9(gd?null:e.id,i,a,e.mood,S9(a)),T=gd?N:M;b.current.motion=T.motion,b.current.fast=T.fast,b.current.mood=T.mood;function A(){const P=l.current.getBoundingClientRect(),V=d.current.offsetWidth,z=s.current?s.current.getBoundingClientRect().top-P.top:P.height,Y=Math.max(Qo,P.width-V-Qo),q=Math.max(Qo,z-V-Qo);return{minX:Qo,minY:Qo,maxX:Y,maxY:q}}function I(){var Y;const P=(Y=l.current)==null?void 0:Y.getBoundingClientRect(),V=d.current;if(!P||!V)return 0;const z=P.width/2-V.offsetWidth/2;return z>0?Math.max(-1,Math.min(1,(z-V.offsetLeft)/z)):0}function D(){var z;if(!d.current||!l.current)return;const P=A(),V=d.current;V.style.left=`${P.minX+m.current.x*(P.maxX-P.minX)}px`,V.style.top=`${P.minY+m.current.y*(P.maxY-P.minY)}px`,(z=C.current)==null||z.call(C)}k.useLayoutEffect(()=>{D();const P=new ResizeObserver(D);for(const V of[l.current,s.current,d.current])V&&P.observe(V);return()=>P.disconnect()},[]),k.useEffect(()=>{var P;(P=x.current)==null||P.setColor((Vi[e.color]??Vi.gray).hex)},[e.color]),k.useEffect(()=>{var P;(P=x.current)==null||P.setCrown(e.agent)},[e.agent]);const B=a!=null&&a.error?`${a.runId??""}:${a.error}`:null;return k.useEffect(()=>{var P;B&&((P=x.current)==null||P.shake(performance.now()))},[B]),k.useEffect(()=>{var P;T.shake&&((P=x.current)==null||P.shake(performance.now()))},[T.shake]),k.useEffect(()=>{const P=Y=>{(Y.pointerType==="mouse"||Y.type==="pointerdown")&&(g.current={x:Y.clientX,y:Y.clientY})},V=Y=>{Y.relatedTarget||(g.current=null)},z=Y=>{const q=Y.target;if(q.id!=="jarvy-composer")return;const W=q.getBoundingClientRect();g.current={x:W.left+W.width/2,y:W.top+W.height/2}};return window.addEventListener("pointermove",P),window.addEventListener("pointerdown",P),document.addEventListener("pointerout",V),document.addEventListener("input",z),document.addEventListener("focusin",z),()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerdown",P),document.removeEventListener("pointerout",V),document.removeEventListener("input",z),document.removeEventListener("focusin",z)}},[]),k.useEffect(()=>{let P=!0,V=0,z=()=>{};const Y=matchMedia("(prefers-reduced-motion: reduce)");return Promise.all([Pd(()=>import("./three.module-BdMZo7zQ.js"),[]),Pd(()=>import("./figure-DQGUDG-4.js"),[])]).then(([q,W])=>{if(!P||!f.current)return;const Q=new q.WebGLRenderer({canvas:f.current,antialias:!0,alpha:!0});W.configureRenderer(q,Q);const{scene:U,camera:X}=W.createStage(q),O=new W.CatFigure(q,(Vi[e.color]??Vi.gray).hex);O.setCrown(e.agent),O.pose(b.current.mood),U.add(O.root),W.frameCamera(X,1,3.3),x.current=O;let F=0;const ne=J=>{var H;const ee=d.current;if(ee){const $=Math.round(ee.offsetWidth*Math.min(2,devicePixelRatio||1));$!==F&&(F=$,Q.setSize($,$,!1));const fe=ee.getBoundingClientRect(),ye=g.current;b.current.lookX=ye?Math.max(-1,Math.min(1,(ye.x-fe.left-fe.width/2)/320)):0,b.current.lookY=ye?Math.max(-1,Math.min(1,(ye.y-fe.top-fe.height/2)/320)):0,b.current.reduced=Y.matches;const xe=b.current.motion,re=!!((H=v.current)!=null&&H.moved)&&(xe==="idle"||xe==="groom"||xe==="stretch");(b.current.faceX===void 0||!(re||xe==="sleep"))&&(b.current.faceX=I()),O.frame(J,b.current),Q.render(U,X)}V=requestAnimationFrame(ne)},_=()=>{cancelAnimationFrame(V),document.hidden||(V=requestAnimationFrame(ne))};document.addEventListener("visibilitychange",_),_(),S(!0),z=()=>{document.removeEventListener("visibilitychange",_),cancelAnimationFrame(V),O.dispose(),Q.dispose(),Q.forceContextLoss(),x.current=null}}).catch(()=>{}),()=>{P=!1,z()}},[]),u.jsxs(u.Fragment,{children:[u.jsxs("button",{ref:d,type:"button",className:"jv-floating-bot","data-live":w||void 0,"data-motion":T.motion,title:e.name,"aria-label":j("avatar.openInfo",{name:e.name}),onPointerDown:P=>{if(P.button!==0)return;const V=P.currentTarget;V.setPointerCapture(P.pointerId),v.current={id:P.pointerId,x:P.clientX,y:P.clientY,left:V.offsetLeft,top:V.offsetTop,moved:!1}},onPointerMove:P=>{const V=v.current;if(!V||V.id!==P.pointerId)return;const z=P.clientX-V.x,Y=P.clientY-V.y;if(!V.moved&&Math.hypot(z,Y)<w9)return;V.moved=!0;const q=A(),W=Math.min(q.maxX,Math.max(q.minX,V.left+z)),Q=Math.min(q.maxY,Math.max(q.minY,V.top+Y));m.current={x:q.maxX>q.minX?(W-q.minX)/(q.maxX-q.minX):0,y:q.maxY>q.minY?(Q-q.minY)/(q.maxY-q.minY):0},D()},onPointerUp:P=>{const V=v.current;!V||V.id!==P.pointerId||(v.current=null,y.current=V.moved,V.moved&&localStorage.setItem(MC,JSON.stringify(m.current)))},onPointerCancel:()=>{v.current=null},onClick:()=>{if(y.current){y.current=!1;return}T.canRecap?T.showRecap():c()},style:{"--jv-avatar-size":"100%"},children:[u.jsx("canvas",{ref:f,"aria-hidden":"true"}),!w&&u.jsx(zc,{color:e.color,mood:e.mood,size:88,crown:e.agent})]}),u.jsx(ZI,{view:T.view,name:e.name,cat:d,area:l,avoid:s,layout:C,facing:I,toolbar:gd?(P,V)=>u.jsx(n9,{controls:N.controls,toolbar:P,onReplay:()=>{V(),N.controls.replay()}}):void 0})]})}function E9({className:e,...i}){return u.jsx("div",{"data-slot":"card",className:nn("flex flex-col gap-4 rounded-xl border bg-card py-5 text-card-foreground shadow-sm",e),...i})}function N9({className:e,...i}){return u.jsx("div",{"data-slot":"card-header",className:nn("grid gap-1 px-5",e),...i})}function T9({className:e,...i}){return u.jsx("div",{"data-slot":"card-title",className:nn("font-semibold leading-none",e),...i})}function A9({className:e,...i}){return u.jsx("div",{"data-slot":"card-content",className:nn("px-5",e),...i})}function M9({bot:e,connections:i,onSaved:a,onManage:l}){return u.jsxs(E9,{className:"jarvy-model-picker jv-ui",children:[u.jsx(N9,{children:u.jsx(T9,{children:j("botModel.pickFor",{name:e.name})})}),u.jsx(A9,{children:u.jsx(Jk,{bot:e,connections:i,onSaved:a,onManage:l})})]})}function O9({chat:e,inChannel:i,bots:a,members:l,meId:s,drafts:c,composeReady:d,botName:f,activeBot:m,status:v,connections:y,activity:g,history:b,divider:x,activeQuestion:w,pane:S,onPane:C,onToggleInfo:N,find:M,onNav:T,onBot:A,hasBotDirects:I,onInvite:D,onQuote:B,onReply:P,onReact:V,onJump:z,onSettled:Y,onSend:q,onPreview:W,onSaveNote:Q,notice:U,createBot:X,creating:O,updateBot:F,onManageModels:ne,error:_,chatArea:J,transcript:ee,composeWrap:H,hidden:$,onOpenThread:fe}){const{messages:ye,loading:xe,hasOlder:re,loadingOlder:be,top:oe,away:ce,unseen:me,toLatest:Ee}=b;return u.jsxs("main",{className:"ui-chat","aria-label":j("chat.area"),ref:J,hidden:$,children:[!i&&u.jsx(ct,{icon:"layout-sidebar-left",className:"ui-mobile-only jv-floating-nav",label:j("common.openNav"),onClick:T}),!i&&I&&u.jsx(ct,{icon:"people",className:"jv-floating-dms",label:j("chat.botDms",{name:f}),"aria-pressed":(S==null?void 0:S.kind)==="botdms",onClick:()=>C((S==null?void 0:S.kind)==="botdms"?null:{kind:"botdms"})}),u.jsx("span",{className:"sr-only",role:"status","aria-label":j("chat.botStatus"),children:i?"":g}),e?u.jsxs(u.Fragment,{children:[i?u.jsx(jI,{chat:e,members:ra(l),bots:a,onNav:T,infoOpen:(S==null?void 0:S.kind)==="info"&&S.page==="main",onInfo:()=>N("main"),membersOpen:(S==null?void 0:S.kind)==="info"&&S.page==="members",onMembers:()=>N("members"),threadsOpen:(S==null?void 0:S.kind)==="threads",onThreads:()=>C((S==null?void 0:S.kind)==="threads"?null:{kind:"threads"}),searchOpen:(S==null?void 0:S.kind)==="search",onSearch:()=>(S==null?void 0:S.kind)==="search"?C(null):M.search(e)}):m&&u.jsx(C9,{bot:m,chatId:e.id,status:v,area:J,avoid:H,onOpen:()=>A(m.id)}),i&&u.jsx(wI,{chat:e,onSave:Q}),u.jsxs("div",{className:`ui-transcript jarvy-transcript${i?" jv-channel-transcript":""}`,ref:ee,"aria-label":j("chat.transcript"),role:"log",children:[!i&&!(m!=null&&m.connectionId)&&m&&u.jsx("div",{className:"jarvy-model-onboarding",children:u.jsx(M9,{bot:m,connections:y,onSaved:F,onManage:ne})}),xe?u.jsx("p",{className:"jarvy-empty-text",children:j("chat.loading")}):ye.length===0?i?u.jsx("div",{className:"jarvy-empty-chat",children:u.jsx("p",{children:j("chat.empty")})}):m!=null&&m.connectionId?u.jsx("div",{className:"jarvy-empty-chat",children:u.jsx("h2",{children:j("chat.start",{name:f})})}):null:u.jsxs(u.Fragment,{children:[re&&u.jsx("div",{ref:oe,className:"jv-history-more","aria-live":"polite",children:be?j("chat.loadingOlder"):""}),u.jsx("p",{className:"jarvy-date-stamp",children:Ha(ye[0].createdAt,{year:"numeric",month:"long",day:"numeric"})}),i?u.jsx(Hd,{messages:ye,members:l,bots:a,me:s,divider:x,activeQuestion:w,onSettled:Y,onPreview:W,onReply:P,onOpenThread:fe,onQuote:B,onReact:V,onJump:z,onError:_}):u.jsx(YI,{messages:ye,members:l,me:s,activeQuestion:w,bot:m,onSettled:Y,onPreview:W,onQuote:B,onReact:V,onJump:z,onError:_})]}),ce&&ye.length>0&&u.jsx("div",{className:"jv-to-latest",children:u.jsxs("button",{type:"button",onClick:Ee,"aria-label":j("chat.toLatest"),children:[me>0&&u.jsx("span",{children:j("chat.unseen",{count:me})}),u.jsx(De,{name:"chevron-down"})]})})]}),u.jsx(NC,{chatId:e.id,id:"jarvy-composer",drafts:c,formRef:H,scrollRef:ee,disabled:!d,placeholder:i?j("chat.toChannel",{name:e.title}):m!=null&&m.connectionId?j("chat.toBot",{name:f}):j("chat.pickModel"),mention:i?{bots:a,inside:ra(l).filter(ze=>ze.id!==s&&e.memberIds.includes(ze.id)),outside:ra(l).filter(ze=>!e.memberIds.includes(ze.id)),onInvite:ze=>D(e.id,ze)}:void 0,onSend:q,onError:_,onNotice:U})]}):u.jsx("div",{className:"jarvy-empty-chat jarvy-first-chat",children:a.length?u.jsx("p",{children:j("chat.pick")}):u.jsxs("button",{className:"ui-button ui-primary",onClick:X,disabled:O,children:[u.jsx(De,{name:"person-add"}),j("sidebar.newBot")]})}),e&&u.jsx(hC,{container:ee,drafts:c,chatId:e.id,source:ze=>ye.find(Fe=>Fe.id===ze),members:l,onNotice:U})]})}const R9=e=>Ha(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function _9(e,i){const[a,l]=k.useState([]);return k.useEffect(()=>{if(l([]),!e)return;let s=!0;return je.botDirects(e).then(c=>{s&&l(c.chats)}).catch(()=>{}),()=>{s=!1}},[e,i]),a}function D9({bot:e,chats:i,members:a,bots:l,me:s,tick:c,onClose:d,onPreview:f,onError:m}){const[v,y]=k.useState(null),[g,b]=k.useState(null);k.useEffect(()=>{if(b(null),!v)return;let S=!0;return je.messages(v).then(C=>{S&&b(C.messages)}).catch(C=>{S&&m(C)}),()=>{S=!1}},[v,c]);const x=S=>a.find(C=>C.id!==e.id&&S.memberIds.includes(C.id)),w=i.find(S=>S.id===v);return u.jsxs("aside",{className:"ui-pane jv-pane","aria-label":j("chat.botDms",{name:e.name}),children:[u.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[w&&u.jsx(ct,{icon:"chevron-left",label:j("directs.back"),onClick:()=>y(null)}),u.jsx("strong",{children:w?j("directs.between",{name:e.name,other:Pa(x(w))}):j("chat.botDms",{name:e.name})}),u.jsx("span",{className:"jv-spacer"}),u.jsx(ct,{icon:"close",label:j("common.close"),onClick:d})]}),w?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ui-pane-body jv-pane-body",children:g===null?u.jsx("p",{className:"jv-picker-empty",children:j("threads.loading")}):g.length===0?u.jsx("p",{className:"jv-picker-empty",children:j("chat.empty")}):u.jsx(Hd,{messages:g,members:a,bots:l,me:s,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:f})}),u.jsx("p",{className:"jv-readonly",children:j("directs.readOnly")})]}):u.jsx("div",{className:"ui-pane-body jv-pane-body",children:i.length===0?u.jsx("p",{className:"jv-picker-empty",children:j("sidebar.noDms")}):i.map(S=>{const C=x(S);return u.jsxs("button",{type:"button",className:"jv-thread-item",onClick:()=>y(S.id),children:[u.jsxs("span",{className:"jv-thread-item-head",children:[u.jsx(vr,{member:C,bots:l,size:20}),u.jsx("strong",{children:Pa(C)}),u.jsx("span",{className:"jv-muted",children:R9(S.updatedAt)})]}),S.lastMessage&&u.jsx("span",{className:"jv-muted jv-thread-item-meta",children:Lc(S.lastMessage)})]},S.id)})})]})}function z9(e,i){return e!=null&&e.connectionId?i!=null&&i.error?{label:j("activity.error"),tone:"error"}:(i==null?void 0:i.status)==="running"?{label:sC(i.activity),tone:"busy"}:{label:j((i==null?void 0:i.status)==="idle"?"activity.idle":"activity.stopped")}:{label:j("activity.noModel")}}function L9({channel:e,members:i,bots:a,statuses:l,me:s,onAdd:c,onBot:d,onChanged:f,onError:m}){const[v,y]=k.useState(null),g=i.filter(S=>e.memberIds.includes(S.id)),b=g.filter(S=>S.kind!=="bot").sort((S,C)=>+(C.id===s)-+(S.id===s)),x=g.filter(S=>S.kind==="bot"),w=S=>{const C=S.kind==="bot"?a.find(A=>A.id===S.id):void 0,N=l[S.id],M=S.kind==="bot"?z9(C,N):void 0,T=u.jsxs(u.Fragment,{children:[u.jsx(vr,{member:S,bots:a,size:28,working:(N==null?void 0:N.status)==="running"&&N.activity!=="asking"}),u.jsxs("span",{className:"jv-member-name",children:[S.name,S.id===s&&u.jsx("span",{className:"jv-role",children:j("common.you")})]}),M&&u.jsx("span",{className:"jv-member-state","data-tone":M.tone,children:M.label})]});return u.jsxs("div",{className:"jv-member-row",children:[C?u.jsx("button",{type:"button",className:"jv-member-main","aria-label":j("members.view",{name:S.name}),onClick:()=>d(S.id),children:T}):u.jsx("div",{className:"jv-member-main",children:T}),S.id!==s&&u.jsx(ct,{icon:"close",label:j("members.remove",{name:S.name}),className:"jv-member-remove",onClick:()=>y(S)})]},S.id)};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"jv-member-bar",children:[u.jsx("span",{children:j("members.count",{count:g.length})}),u.jsxs("button",{type:"button",className:"ui-button ui-primary jv-member-pane-add",onClick:c,children:[u.jsx(De,{name:"person-add"}),j("common.add")]})]}),u.jsx("div",{className:"ui-pane-body jv-pane-body",children:[["people",j("members.people"),b],["bots","Bot",x]].map(([S,C,N])=>N.length>0&&u.jsxs("section",{className:"jv-member-group","aria-label":C,children:[u.jsxs("h3",{children:[C," · ",N.length]}),N.map(w)]},S))}),v&&u.jsx(bC,{title:j("members.removeTitle",{name:v.name,channel:e.title}),body:j("members.removeBody"),confirm:j("members.removeConfirm"),onClose:()=>y(null),onConfirm:async()=>{try{f(await je.removeMember(e.id,v.id)),y(null)}catch(S){m(S)}}})]})}function x2({label:e,value:i,empty:a,maxLength:l,required:s=!1,onSave:c}){const d=k.useId(),[f,m]=k.useState(null),[v,y]=k.useState(!1);k.useEffect(()=>m(null),[i]);const g=async()=>{if(!(f===null||v||s&&!f.trim())){if(f.trim()===i){m(null);return}y(!0);try{await c(f.trim()),m(null)}catch{}finally{y(!1)}}};return u.jsxs("div",{className:"jv-info-field",children:[u.jsxs("div",{className:"jv-info-label",children:[u.jsx("label",{htmlFor:d,children:e}),f===null&&u.jsx(ct,{icon:"pencil",label:j("info.edit",{name:e}),className:"jv-info-edit",onClick:()=>m(i)})]}),f===null?u.jsx("p",{className:"jv-info-value","data-empty":!i||void 0,children:i||a}):u.jsxs("div",{className:"jv-inline-edit",children:[u.jsx("input",{id:d,value:f,maxLength:l,autoFocus:!0,placeholder:a,onChange:b=>m(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),g()),b.key==="Escape"&&(b.stopPropagation(),m(null))}}),u.jsx("button",{type:"button",className:"ui-button",onClick:()=>m(null),children:j("common.cancel")}),u.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:v||s&&!f.trim(),onClick:()=>void g(),children:j("common.save")})]})]})}function I9({channel:e,page:i,sections:a,members:l,bots:s,statuses:c,me:d,onPage:f,onPin:m,onMute:v,onAdd:y,onBot:g,onDelete:b,onChanged:x,onClose:w,onError:S}){const C=k.useId(),N=async T=>{try{x(await je.updateChannel(e.id,T))}catch(A){throw S(A),A}},M=l.filter(T=>e.memberIds.includes(T.id)).length;return u.jsxs("aside",{className:"ui-pane jv-pane","aria-label":j(i==="members"?"info.memberList":"entry.channelInfo"),children:[u.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[i==="members"&&u.jsx(ct,{icon:"chevron-left",label:j("info.back"),className:"jv-pane-back",onClick:()=>f("main")}),u.jsx("strong",{children:j(i==="members"?"channel.members":"entry.channelInfo")}),u.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",e.title]}),u.jsx("span",{className:"jv-spacer"}),u.jsx(ct,{icon:"close",label:j("common.close"),onClick:w})]}),i==="members"?u.jsx(L9,{channel:e,members:l,bots:s,statuses:c,me:d,onAdd:y,onBot:g,onChanged:x,onError:S}):u.jsxs("div",{className:"ui-pane-body jv-pane-body jv-info",children:[u.jsxs("div",{className:"jv-info-actions",children:[u.jsxs("button",{type:"button","aria-pressed":e.pinned,onClick:m,children:[u.jsx(De,{name:"pin"}),j("entry.pin")]}),u.jsxs("button",{type:"button","aria-pressed":e.muted,onClick:v,children:[u.jsx(De,{name:e.muted?"bell-slash":"bell"}),j("entry.mute")]}),u.jsxs("button",{type:"button",onClick:y,children:[u.jsx(De,{name:"person-add"}),j("info.addMembers")]})]}),u.jsx(x2,{label:j("info.name"),value:e.title,empty:j("info.newChannel"),maxLength:80,required:!0,onSave:T=>N({name:T})}),u.jsx(x2,{label:j("info.topic"),value:e.topic,empty:j("info.noTopic"),maxLength:200,onSave:T=>N({topic:T})}),u.jsxs("div",{className:"jv-info-field",children:[u.jsx("div",{className:"jv-info-label",children:u.jsx("label",{htmlFor:C,children:j("info.section")})}),u.jsx(Wk,{id:C,value:e.sectionId,sections:a,onChange:T=>void N({sectionId:T}).catch(()=>{})})]}),u.jsxs("nav",{className:"jv-info-menu","aria-label":j("info.menu"),children:[u.jsxs("button",{type:"button",className:"ui-menu-item",onClick:()=>f("members"),children:[u.jsx(De,{name:"people"}),u.jsx("span",{className:"ui-menu-copy",children:j("channel.members")}),u.jsx("span",{className:"jv-muted",children:M}),u.jsx(De,{name:"chevron-right"})]}),u.jsxs("button",{type:"button",className:"ui-menu-item jv-menu-danger",onClick:b,children:[u.jsx(De,{name:"trash"}),u.jsx("span",{className:"ui-menu-copy",children:j("entry.deleteChannel")})]})]})]})]})}function B9({chat:e,chats:i,members:a,focusKey:l,onOpenMessage:s,onClose:c,onError:d}){const[f,m]=k.useState(""),v=k.useRef(null);k.useEffect(()=>{var x,w;(x=v.current)==null||x.focus(),(w=v.current)==null||w.select()},[l,e.id]);const{result:y,loading:g}=xC(f,e.id,d),b=e.type==="channel"?`#${e.title}`:j(e.type==="thread"?"search.inThread":"search.inDm");return u.jsxs("aside",{className:"ui-pane jv-pane jv-search-pane","aria-label":j("search.paneLabel"),children:[u.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[u.jsx("strong",{children:j("search.title")}),u.jsx("span",{className:"jv-muted jv-pane-sub",children:b}),u.jsx("span",{className:"jv-spacer"}),u.jsx(ct,{icon:"close",label:j("search.close"),onClick:c})]}),u.jsx("div",{className:"jv-pane-search",children:u.jsx("input",{ref:v,type:"search",value:f,placeholder:j(e.type==="channel"?"search.channelPlaceholder":"search.placeholder"),"aria-label":j("search.placeholder"),onChange:x=>m(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),f?m(""):c())}})}),u.jsx("div",{className:"ui-pane-body jv-pane-body jv-results","aria-live":"polite",children:f.trim()?y?y.messages.length?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"jv-result-count",children:j(y.messages.length>=60?"search.countLatest":"search.count",{count:y.messages.length})}),y.messages.map(({message:x,chat:w})=>u.jsx(SC,{message:x,chat:w,chats:i,members:a,query:f,showPlace:w.id!==e.id,onOpen:s},x.id))]}):u.jsx("p",{className:"jv-result-empty",children:j("search.noMessages")}):g&&u.jsx("p",{className:"jv-result-empty",children:j("search.searching")}):u.jsx("p",{className:"jv-result-empty",children:j("search.prompt")})})]})}const P9=e=>Ha(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function H9({chat:e,channelName:i,expanded:a=!1,onTitle:l,onStatus:s,onSummary:c,onConclude:d}){var T;const[f,m]=k.useState(null),[v,y]=k.useState(null),[g,b]=k.useState(!1),[x,w]=k.useState(a);k.useEffect(()=>{m(null),y(null),w(a)},[e.id,a]);const S=async(A,I)=>{b(!0);try{await A(),I()}catch{}finally{b(!1)}},C=e.status==="done",N=e.note,M=((T=N==null?void 0:N.text.split(`
531
- `).find(A=>A.trim()&&!A.startsWith("#")))==null?void 0:T.replace(/[*`|>-]/g,"").trim())??"";return u.jsxs("div",{className:"jv-thread-meta","data-open":x||void 0,children:[u.jsxs("div",{className:"jv-thread-title-row",children:[f===null?u.jsxs(u.Fragment,{children:[u.jsx("h2",{className:"jv-thread-title",title:e.title,children:e.title}),u.jsx(ct,{icon:"pencil",label:j("thread.rename"),onClick:()=>m(e.title)})]}):u.jsxs("form",{className:"jv-inline-edit",onSubmit:A=>{A.preventDefault(),f.trim()&&S(()=>l(f.trim()),()=>m(null))},children:[u.jsx("input",{value:f,autoFocus:!0,maxLength:80,"aria-label":j("thread.title"),onChange:A=>m(A.target.value),onKeyDown:A=>{A.key==="Escape"&&m(null)}}),u.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:g||!f.trim(),children:j("common.save")})]}),u.jsx("button",{type:"button",className:"jv-thread-status","data-done":C||void 0,disabled:g,title:j("thread.toggleStatus"),onClick:()=>void S(()=>s(C?"open":"done"),()=>{}),children:C?u.jsxs(u.Fragment,{children:[u.jsx(De,{name:"check"}),j("channel.threadDone")]}):j("threads.open")})]}),v!==null?u.jsxs("div",{className:"jv-summary","data-editing":!0,children:[u.jsx("textarea",{className:"jv-notice-input",value:v,autoFocus:!0,"aria-label":j("thread.summary"),onChange:A=>y(A.target.value)}),u.jsxs("div",{className:"jv-notice-actions",children:[u.jsx("button",{type:"button",className:"ui-button",onClick:()=>y(null),children:j("common.cancel")}),u.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:g||!v.trim(),onClick:()=>void S(()=>c(v.trim()),()=>y(null)),children:j("common.save")})]})]}):N?u.jsxs("div",{className:"jv-summary",children:[u.jsxs("div",{className:"jv-summary-head",children:[u.jsxs("button",{type:"button",className:"jv-summary-toggle","aria-expanded":x,onClick:()=>w(!x),children:[u.jsx("strong",{children:j("thread.summary")}),!x&&u.jsx("span",{className:"jv-summary-first",children:M}),u.jsx(De,{name:x?"chevron-down":"chevron-right"})]}),x&&u.jsxs("span",{className:"jv-muted jv-summary-meta",children:[N.updatedBy.name," · ",P9(N.updatedAt)," · ",j("notice.version",{version:N.version})]}),u.jsx(ct,{icon:"pencil",label:j("thread.editSummary"),onClick:()=>y(N.text)})]}),x&&u.jsx("div",{className:"jv-summary-body ui-bubble jv-flat",children:u.jsx(Dc,{text:N.text})}),x&&!C&&u.jsxs("button",{type:"button",className:"ui-button jv-conclude",disabled:g,onClick:()=>void S(d,()=>{}),children:[u.jsx(De,{name:"check"}),j("thread.conclude",{channel:i})]})]}):u.jsxs("button",{type:"button",className:"jv-summary-empty",onClick:()=>y(""),children:[u.jsx(De,{name:"add"}),j("thread.addSummary")]})]})}function j2({threadId:e,mode:i,showSummary:a=!1,focus:l,onSearch:s,channel:c,drafts:d,members:f,bots:m,me:v,tick:y,onClose:g,onToggleMode:b,onNav:x,onChanged:w,onInvite:S,onPreview:C,onError:N,onNotice:M}){const[T,A]=k.useState(null),[I,D]=k.useState(null),[B,P]=k.useState([]),[V,z]=k.useState(null),Y=k.useRef(B);Y.current=B;const q=k.useRef(null),W=k.useRef(null),Q=k.useRef(null),U=k.useRef(!1),X=k.useRef(!0),[O,F]=k.useState(!1),ne=k.useRef(0),_=k.useRef(0);k.useEffect(()=>{A(null),D(null),P([]),z(null),U.current=!1,X.current=!0,F(!1),ne.current=0,_.current=0},[e]),k.useEffect(()=>{let oe=!0;return Promise.all([je.chat(e),je.messages(e)]).then(async([ce,me])=>{if(oe&&(A(ce),P(me.messages),Q.current!==e&&(Q.current=e,z(ce.readSequence)),ce.rootMessageId)){const Ee=await je.message(ce.rootMessageId);oe&&D(Ee)}}).catch(ce=>{oe&&N(ce)}),()=>{oe=!1}},[e,y]),k.useLayoutEffect(()=>{const oe=q.current;if(!oe||!T)return;const ce=()=>oe.scrollTo({top:oe.scrollHeight,behavior:"instant"}),me=B.at(-1),Ee=(me==null?void 0:me.senderId)===v&&me.sequence>_.current;if(_.current=Math.max(_.current,(me==null?void 0:me.sequence)??0),U.current)(X.current||Ee)&&oe.scrollTo({top:oe.scrollHeight,behavior:"smooth"});else{if(!B.length&&!I)return;U.current=!0;const ze=l?oe.querySelector(`[data-message="${l.id}"]`):null;if(ze){if(X.current=!1,ze.scrollIntoView({block:"center"}),l!=null&&l.passage&&dC(ze,l.passage))return;ze.classList.add("jv-jump"),setTimeout(()=>ze.classList.remove("jv-jump"),1600);return}ce(),requestAnimationFrame(ce)}(X.current||Ee)&&(ne.current=(me==null?void 0:me.sequence)??0)},[B,I,T]),k.useEffect(()=>{U.current&&l&&H(l.id,l.passage)},[l]),k.useEffect(()=>{const oe=q.current,ce=W.current;if(!oe||!ce)return;const me=new ResizeObserver(()=>{!U.current||!X.current||oe.scrollHeight-oe.scrollTop-oe.clientHeight<8||oe.scrollTo({top:oe.scrollHeight,behavior:"instant"})});me.observe(ce);const Ee=()=>{var ze;X.current=oe.scrollHeight-oe.scrollTop-oe.clientHeight<120,X.current&&(ne.current=Math.max(ne.current,((ze=Y.current.at(-1))==null?void 0:ze.sequence)??0)),F(!X.current)};return Ee(),oe.addEventListener("scroll",Ee,{passive:!0}),()=>{me.disconnect(),oe.removeEventListener("scroll",Ee)}},[q.current,e,T]),k.useEffect(()=>{const oe=B.at(-1);if(!T||!oe||oe.chatId!==T.id)return;const ce=()=>{if(document.visibilityState!=="visible"||T.readSequence>=oe.sequence)return;const me={...T,readSequence:oe.sequence,unread:0,mentions:0,alerts:0,atMe:!1,hint:null};A(me),je.markRead(T.id,oe.sequence).then(()=>w(me)).catch(N)};return ce(),document.addEventListener("visibilitychange",ce),()=>document.removeEventListener("visibilitychange",ce)},[B,T]);const J=async oe=>{try{const ce=await oe();A(ce),w(ce)}catch(ce){throw N(ce),ce}},ee=async(oe,ce,me)=>{try{const Ee=await je.react(oe.id,ce,me),ze=Fe=>Fe.id===Ee.id?{...Fe,reactions:Ee.reactions}:Fe;P(Fe=>Fe.map(ze)),D(Fe=>Fe&&ze(Fe))}catch(Ee){N(Ee)}},H=(oe,ce)=>{var Ee;const me=oe&&((Ee=q.current)==null?void 0:Ee.querySelector(`[data-message="${oe}"]`));if(!me){M(j(oe?"thread.sourceElsewhere":"app.sourceGone"));return}fC(me,ce)},$={onQuote:oe=>EC(d,oe,f),onReact:ee,onJump:H,onError:N},fe=async(oe,ce,me,Ee,ze=[],Fe=!1)=>{await je.send(e,oe,ce,me,Fe,Ee,ze);const ht=c?[...new Set(dv(oe,ra(f)).filter(At=>!c.memberIds.includes(At.member.id)).map(At=>At.member.name))]:[];ht.length&&M(j("app.notInChannel",{names:ht.join(j("common.listSeparator")),count:ht.length}));const[ot,Je]=await Promise.all([je.chat(e),je.messages(e)]);A(ot),P(Je.messages),w(ot)},ye=(c==null?void 0:c.title)??j("search.channel"),xe=f.find(oe=>oe.id===(I==null?void 0:I.senderId)),re=O?B.filter(oe=>oe.sequence>ne.current&&oe.senderId!==v).length:0,be=i==="pane"?"aside":i==="embed"?"section":"main";return u.jsxs(be,{className:i==="pane"?"ui-pane jv-pane":i==="embed"?"ui-chat jv-thread-full jv-thread-embed":"ui-chat jv-thread-full","aria-label":j("thread.label"),onKeyDown:oe=>{T&&s&&(oe.ctrlKey||oe.metaKey)&&oe.key.toLowerCase()==="f"&&(oe.preventDefault(),s(T))},children:[u.jsxs("header",{className:i==="pane"?"ui-pane-header jv-pane-header":"ui-chat-header jv-pane-header",children:[i==="full"&&u.jsx(ct,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:j("common.openNav"),onClick:x}),i==="embed"&&u.jsx(ct,{icon:"chevron-left",className:"ui-mobile-only",label:j("thread.backToList"),onClick:g}),i==="full"?u.jsxs("button",{type:"button",className:"jv-crumb",onClick:g,children:[u.jsx(De,{name:"chevron-left"}),u.jsx("span",{className:"jv-hash",children:"#"}),ye]}):i==="embed"?u.jsxs("button",{type:"button",className:"jv-crumb",title:j("thread.inChannel"),onClick:b,children:[u.jsx("span",{className:"jv-hash",children:"#"}),ye]}):u.jsxs(u.Fragment,{children:[u.jsx("strong",{children:j("thread.label")}),u.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",ye]})]}),u.jsx("span",{className:"jv-spacer"}),T&&s&&u.jsx(ct,{icon:"search",label:j("thread.search"),onClick:()=>s(T)}),T&&u.jsxs("button",{type:"button",className:"ui-button jv-follow","data-on":T.following||void 0,title:j(T.following?"thread.followingHint":"thread.notFollowingHint"),onClick:()=>void J(()=>je.follow(e,!T.following)).catch(()=>{}),children:[u.jsx(De,{name:"bell"}),j(T.following?"threads.following":"thread.follow")]}),i!=="embed"&&u.jsx(ct,{icon:i==="pane"?"arrows-expand":"arrows-contract",className:"jv-desktop-only",label:j(i==="pane"?"thread.expand":"thread.collapse"),onClick:b}),i==="pane"&&u.jsx(ct,{icon:"close",label:j("thread.close"),onClick:g})]}),T&&u.jsx("div",{className:i==="pane"?"jv-thread-pin":"jv-thread-pin jv-thread-pin-wide",children:u.jsx(H9,{chat:T,channelName:ye,expanded:a,onTitle:oe=>J(()=>je.updateThread(e,{title:oe})),onStatus:oe=>J(()=>je.updateThread(e,{status:oe})),onSummary:oe=>J(()=>je.setNote(e,oe)),onConclude:async()=>{var oe;try{await fe(`${j("thread.conclusion")}
532
-
533
- ${((oe=T.note)==null?void 0:oe.text)??""}`,[],Array.from(crypto.getRandomValues(new Uint8Array(16)),ce=>ce.toString(16).padStart(2,"0")).join(""),void 0,[],!0),await J(()=>je.updateThread(e,{status:"done"})),M(j("thread.concluded",{channel:ye}))}catch(ce){throw N(ce),ce}}})}),u.jsxs("div",{ref:q,className:i==="pane"?"ui-pane-body jv-pane-body":"ui-transcript jv-thread-wide",children:[u.jsxs("div",{ref:W,children:[I&&u.jsx(Hd,{messages:[{...I,thread:null}],members:f,bots:m,me:v,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:C,onReact:ee,onJump:H,onError:N}),u.jsx("div",{className:"jv-divider","data-tone":"count",role:"separator",children:u.jsx("span",{children:B.length?j("channel.replies",{count:B.length}):j("thread.noReplies")})}),u.jsx(Hd,{messages:B,members:f,bots:m,me:v,divider:V??Number.MAX_SAFE_INTEGER,onSettled:oe=>P(ce=>ce.map(me=>me.id===oe.id?oe:me)),onPreview:C,...$})]}),O&&B.length>0&&u.jsx("div",{className:"jv-to-latest",children:u.jsxs("button",{type:"button","aria-label":j("thread.toLatest"),onClick:()=>{var oe;return(oe=q.current)==null?void 0:oe.scrollTo({top:q.current.scrollHeight,behavior:"smooth"})},children:[re>0&&u.jsx("span",{children:j("chat.unseen",{count:re})}),u.jsx(De,{name:"chevron-down"})]})})]}),u.jsx(NC,{chatId:e,id:"jarvy-thread-composer",drafts:d,placeholder:j("thread.reply"),scrollRef:q,disabled:!T,initialText:B.length===0&&I&&I.senderId!==v&&xe&&!xe.deleted?`@${xe.name} `:void 0,mention:{bots:m,inside:ra(f).filter(oe=>oe.id!==v&&!!(c!=null&&c.memberIds.includes(oe.id))),outside:ra(f).filter(oe=>!(c!=null&&c.memberIds.includes(oe.id))),onInvite:S},onSend:fe,onError:N,onNotice:M}),u.jsx(hC,{container:q,drafts:d,chatId:e,members:f,onNotice:M,source:oe=>oe===(I==null?void 0:I.id)?I:B.find(ce=>ce.id===oe)})]})}const yp={updated:"threadSort.updated",created:"threadSort.created",status:"threadSort.status"},vd=e=>e.lastReplyAt??e.createdAt;function OC(e,i){const a=i==="created"?(l,s)=>s.createdAt-l.createdAt:i==="status"?(l,s)=>+(l.status==="done")-+(s.status==="done")||vd(s)-vd(l):(l,s)=>vd(s)-vd(l);return[...e].sort(a)}function RC(e){const i=`jarvy-thread-sort-${e}`,[a,l]=k.useState(()=>{const s=localStorage.getItem(i);return s==="created"||s==="status"?s:"updated"});return[a,s=>{l(s),localStorage.setItem(i,s)}]}function _C({value:e,onChange:i}){return u.jsxs(Zl,{value:e,onValueChange:a=>i(a),children:[u.jsxs(Wl,{className:"jv-thread-sort","aria-label":j("threadSort.current",{order:j(yp[e])}),title:j("threadSort.title"),children:[u.jsx(sA,{}),u.jsx(Jl,{})]}),u.jsx(eo,{className:"jv-select-menu",position:"popper",sideOffset:4,align:"end",children:Object.keys(yp).map(a=>u.jsx(Fi,{value:a,children:j(yp[a])},a))})]})}const DC=e=>Ha(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function U9({channel:e,members:i,bots:a,tick:l,onOpen:s,onClose:c,onError:d}){const[f,m]=k.useState(null),[v,y]=k.useState("open"),[g,b]=RC("channel");k.useEffect(()=>{let S=!0;return je.channelThreads(e.id).then(C=>{S&&m(C.threads)}).catch(C=>{S&&d(C)}),()=>{S=!1}},[e.id,l]);const x=OC((f??[]).filter(S=>v==="all"||S.status===v),g),w=S=>(f??[]).filter(C=>C.status===S).length;return u.jsxs("aside",{className:"ui-pane jv-pane","aria-label":j("threads.list"),children:[u.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[u.jsx("strong",{children:j("channel.threads")}),u.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",e.title]}),u.jsx("span",{className:"jv-spacer"}),u.jsx(_C,{value:g,onChange:b}),u.jsx(ct,{icon:"close",label:j("threads.closeList"),onClick:c})]}),u.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":j("threads.byStatus"),children:[["open",j("threads.openCount",{count:w("open")})],["done",j("threads.doneCount",{count:w("done")})],["all",j("threads.all")]].map(([S,C])=>u.jsx("button",{type:"button",role:"tab","aria-selected":v===S,onClick:()=>y(S),children:C},S))}),u.jsx("div",{className:"ui-pane-body jv-pane-body",children:f===null?u.jsx("p",{className:"jv-picker-empty",children:j("threads.loading")}):x.length===0?u.jsx("p",{className:"jv-picker-empty",children:j("threads.none")}):x.map(S=>{const C=i.find(N=>{var M;return N.id===((M=S.root)==null?void 0:M.senderId)});return u.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":S.unread>0||void 0,onClick:()=>s(S.id),children:[u.jsxs("span",{className:"jv-thread-item-head",children:[u.jsx("strong",{children:S.title}),S.alerts>0?u.jsx("span",{className:"jv-badge",children:S.alerts}):S.unread>0&&u.jsx("span",{className:"jv-count",children:S.unread}),u.jsx("span",{className:"jv-thread-status","data-done":S.status==="done"||void 0,children:j(S.status==="done"?"channel.threadDone":"threads.open")})]}),S.root&&u.jsxs("span",{className:"jv-thread-item-root",children:[u.jsx(vr,{member:C,bots:a,size:16}),u.jsx("span",{children:Lc(S.root)})]}),u.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:[j("channel.replies",{count:S.replies}),S.lastReplyAt?` · ${DC(S.lastReplyAt)}`:"",S.following?` · ${j("threads.following")}`:""]})]},S.id)})})]})}function q9({threads:e,chats:i,members:a,bots:l,onNav:s,renderThread:c}){const[d,f]=k.useState(e),[m,v]=k.useState(null),[y,g]=k.useState("all"),[b,x]=RC("followed");k.useEffect(()=>f(M=>[...e,...M.filter(T=>!e.some(A=>A.id===T.id)).map(T=>({...T,following:!1,unread:0,alerts:0}))]),[e]);const w=OC(d,b).filter(M=>y==="all"||(y==="unread"?M.unread>0:M.status===y)),S=d.filter(M=>M.unread>0).length,C=d.find(M=>M.id===m),N=M=>d.filter(T=>T.status===M).length;return u.jsxs("main",{className:"ui-chat jv-followed-page","aria-label":j("sidebar.followed"),"data-open":C?"":void 0,children:[u.jsxs("section",{className:"jv-followed-list","aria-label":j("threads.list"),children:[u.jsxs("header",{className:"ui-chat-header jv-channel-header",children:[u.jsxs("div",{className:"ui-header-left",children:[u.jsx(ct,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:j("common.openNav"),onClick:s}),u.jsx("strong",{className:"jv-channel-title",children:j("sidebar.followed")})]}),u.jsx(_C,{value:b,onChange:x})]}),u.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":j("threads.filter"),children:[["all",j("threads.all")],["unread",S?j("threads.unreadCount",{count:S}):j("threads.unread")],["open",j("threads.openCount",{count:N("open")})],["done",j("threads.doneCount",{count:N("done")})]].map(([M,T])=>u.jsx("button",{type:"button",role:"tab","aria-selected":y===M,onClick:()=>g(M),children:T},M))}),u.jsx("div",{className:"jv-followed-items",children:w.length===0?u.jsx("p",{className:"jv-picker-empty",children:j({all:"threads.none",unread:"threads.noneUnread",open:"threads.noneOpen",done:"threads.noneDone"}[y])}):w.map(M=>{const T=a.find(I=>{var D;return I.id===((D=M.root)==null?void 0:D.senderId)}),A=i.find(I=>I.id===M.parentId);return u.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":M.unread>0||void 0,"aria-current":M.id===m||void 0,onClick:()=>v(M.id),children:[u.jsxs("span",{className:"jv-thread-item-head",children:[u.jsx("strong",{children:M.title}),M.alerts>0?u.jsx("span",{className:"jv-badge",children:M.alerts}):M.unread>0&&u.jsx("span",{className:"jv-count",children:M.unread}),u.jsx("span",{className:"jv-thread-status","data-done":M.status==="done"||void 0,children:j(M.status==="done"?"channel.threadDone":"threads.open")})]}),M.root&&u.jsxs("span",{className:"jv-thread-item-root",children:[u.jsx(vr,{member:T,bots:l,size:16}),u.jsx("span",{children:Lc(M.root)})]}),u.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:["#",(A==null?void 0:A.title)??""," · ",j("channel.replies",{count:M.replies}),M.lastReplyAt?` · ${DC(M.lastReplyAt)}`:"",M.following?"":` · ${j("threads.notFollowing")}`]})]},M.id)})})]}),C?c(C,()=>v(null)):u.jsx("div",{className:"jv-followed-empty",children:u.jsx("p",{children:j("threads.pick")})})]})}function F9({pane:e,followedView:i,followed:a,chats:l,sections:s,members:c,bots:d,statuses:f,meId:m,drafts:v,tick:y,paneChannel:g,activeBot:b,botDirects:x,find:w,onPane:S,onNav:C,onBackToChannel:N,onAddMembers:M,onOpenBot:T,onPin:A,onMute:I,onDeleteChannel:D,onChannelSaved:B,onThreadChanged:P,onInvite:V,onPreview:z,onNotice:Y,onError:q,paneWidth:W,onResize:Q}){var F,ne;const U=(e==null?void 0:e.kind)==="thread"?e:null,X=(U==null?void 0:U.mode)==="full",O=()=>S(null);return u.jsxs(u.Fragment,{children:[i&&!X&&u.jsx(q9,{threads:a,chats:l,members:c,bots:d,onNav:C,renderThread:(_,J)=>u.jsx(j2,{threadId:_.id,mode:"embed",channel:l.find(ee=>ee.id===_.parentId),drafts:v,members:c,bots:d,me:m,tick:y,onNav:C,onChanged:P,onClose:J,onToggleMode:()=>N({id:_.id,parentId:_.parentId},!0),onInvite:ee=>V(_.parentId,ee),onPreview:z,onError:q,onNotice:Y},_.id)}),U&&u.jsx(j2,{threadId:U.id,mode:U.mode,showSummary:U.summary,focus:U.focus,onSearch:w.search,channel:l.find(_=>_.id===U.parentId),drafts:v,members:c,bots:d,me:m,tick:y,onNav:C,onChanged:P,onClose:()=>X?N(U,!1):O(),onToggleMode:()=>X?N(U,!0):S({...U,mode:"full"}),onInvite:_=>V(U.parentId,_),onPreview:z,onError:q,onNotice:Y},`${U.id}:${((F=U.focus)==null?void 0:F.id)??""}:${((ne=U.focus)==null?void 0:ne.passage)??""}`),(e==null?void 0:e.kind)==="search"&&u.jsx(B9,{chat:e.chat,chats:l,members:c,focusKey:w.focusKey,onOpenMessage:w.openMessage,onClose:O,onError:q}),(e==null?void 0:e.kind)==="threads"&&g&&u.jsx(U9,{channel:g,members:c,bots:d,tick:y,onOpen:_=>S({kind:"thread",id:_,parentId:g.id,mode:"pane"}),onClose:O,onError:q}),(e==null?void 0:e.kind)==="info"&&g&&u.jsx(I9,{channel:g,page:e.page,sections:s,members:ra(c),bots:d,statuses:f,me:m,onPage:_=>S({kind:"info",page:_}),onPin:()=>A(g),onMute:()=>I(g),onAdd:()=>M(g),onBot:T,onDelete:()=>D(g),onChanged:B,onClose:O,onError:q}),(e==null?void 0:e.kind)==="botdms"&&b&&!g&&u.jsx(D9,{bot:b,chats:x,members:c,bots:d,me:m,tick:y,onClose:O,onPreview:z,onError:q}),e&&!X&&u.jsx("div",{className:"jv-resize",style:{right:W-4},onPointerDown:Q,role:"separator","aria-orientation":"vertical","aria-label":j("app.resizePane")})]})}const w2="@goodfish/jarvy",zC="0.5.0",V9={url:"git+https://github.com/AzzzGoodFish/Jarvy.git"},$9="Apache-2.0",og=V9.url.replace(/^git\+/,"").replace(/\.git$/,""),S2=`${og}/blob/v${zC}`,Y9=[{label:"about.source",detail:og.replace(/^https:\/\//,""),href:og},{label:"about.package",detail:w2,href:`https://www.npmjs.com/package/${w2}`},{label:"about.license",detail:$9,href:`${S2}/LICENSE`},{label:"about.notices",detail:"THIRD_PARTY_NOTICE.md",href:`${S2}/THIRD_PARTY_NOTICE.md`}];function G9(){return u.jsxs("div",{className:"jv-page",children:[u.jsx("header",{className:"jv-page-header",children:u.jsx("div",{children:u.jsx("h2",{children:j("settings.about")})})}),u.jsxs("div",{className:"jv-list",children:[u.jsxs("div",{className:"jv-list-row jv-static-row jv-about-intro",children:[u.jsxs("div",{className:"jv-row-text",children:[u.jsx("strong",{children:"Jarvy"}),u.jsx("span",{children:j("about.tagline")})]}),u.jsx("span",{className:"jv-row-meta",children:j("about.version",{version:zC})})]}),Y9.map(e=>u.jsxs("a",{className:"jv-list-row jv-link-row",href:e.href,target:"_blank",rel:"noreferrer",children:[u.jsxs("div",{className:"jv-row-text",children:[u.jsx("strong",{children:j(e.label)}),u.jsx("span",{children:e.detail})]}),u.jsx(vA,{"aria-hidden":"true"})]},e.label))]})]})}function X9(){const[e,i]=k.useState(document.documentElement.classList.contains("dark")),a=s=>{Bd(s?"dark":"light"),i(s)},l=(s,c,d,f,m)=>u.jsxs("button",{type:"button",role:"radio","aria-checked":d,lang:m,className:"jv-list-row jv-choice-row",onClick:f,children:[u.jsx("span",{className:"jv-row-text",children:u.jsx("strong",{children:c})}),d&&u.jsx(ur,{"aria-hidden":"true"})]},s);return u.jsxs("div",{className:"jv-page",children:[u.jsx("header",{className:"jv-page-header",children:u.jsx("div",{children:u.jsx("h2",{children:j("settings.general")})})}),u.jsxs("section",{className:"jv-section","aria-labelledby":"general-language",children:[u.jsx("h3",{id:"general-language",className:"jv-section-title",children:j("general.language")}),u.jsx("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-language",children:M2.map(s=>l(s,Sp(s,"name"),qd()===s,()=>_2(s),s))})]}),u.jsxs("section",{className:"jv-section","aria-labelledby":"general-theme",children:[u.jsx("h3",{id:"general-theme",className:"jv-section-title",children:j("general.theme")}),u.jsxs("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-theme",children:[l("light",j("general.light"),!e,()=>a(!1)),l("dark",j("general.dark"),e,()=>a(!0))]})]})]})}function hv({name:e}){var i;return u.jsx("span",{className:"jv-provider-mark","aria-hidden":"true",children:((i=[...e.trim()][0])==null?void 0:i.toUpperCase())??"?"})}function LC(e){const i=e.authType==="oauth";return e.configured?{ok:!0,label:j(i?"status.signedIn":"status.configured")}:{ok:!1,label:j(i?"status.signedOut":"status.notConfigured")}}const IC=[{id:"custom",label:"group.custom"},{id:"subscription",label:"group.subscription"},{id:"api_key",label:"group.apiKey"}],BC=e=>e.custom?"custom":e.authType==="oauth"?"subscription":"api_key",Q9={id:"custom",name:"OpenAI / Anthropic compatible",authType:"api_key",api:"openai-completions",modelCount:0};function K9({onBack:e,onSelect:i}){const[a,l]=k.useState([]),[s,c]=k.useState(""),[d,f]=k.useState(""),[m,v]=k.useState(!0),[y,g]=k.useState(0);k.useEffect(()=>{let w=!0;return v(!0),f(""),je.modelProviders().then(S=>{w&&l(S.providers)}).catch(S=>{w&&f(Pt(S,"picker.loadFailed"))}).finally(()=>{w&&v(!1)}),()=>{w=!1}},[y]);const b=[Q9,...a].filter(w=>`${w.name} ${w.id}`.toLowerCase().includes(s.toLowerCase())),x=w=>BC({authType:w.authType,custom:w.id==="custom"});return u.jsxs("div",{className:"jv-page",children:[u.jsxs("header",{className:"jv-page-header",children:[u.jsx(Ve,{variant:"ghost",size:"icon-sm",className:"jv-back",onClick:e,"aria-label":j("picker.back"),children:u.jsx(Fd,{})}),u.jsxs("div",{children:[u.jsx("h2",{children:j("models.add")}),u.jsx("p",{children:j("picker.intro")})]})]}),u.jsxs("label",{className:"jv-search",children:[u.jsx(kc,{}),u.jsx("input",{autoFocus:!0,"aria-label":j("picker.search"),placeholder:j("picker.searchPlaceholder"),value:s,onChange:w=>c(w.target.value)})]}),IC.filter(w=>b.some(S=>x(S)===w.id)).map(({id:w,label:S})=>u.jsxs("section",{className:"jv-section","aria-label":j(S),children:[u.jsx("h3",{className:"jv-section-title",children:j(S)}),u.jsx("div",{className:"jv-list",children:b.filter(C=>x(C)===w).map(C=>u.jsxs("button",{className:"jv-list-row",type:"button",onClick:()=>i(C),children:[u.jsx(hv,{name:C.id==="custom"?"+":C.name}),u.jsxs("span",{className:"jv-row-text",children:[u.jsx("strong",{children:C.name}),u.jsx("span",{children:C.id==="custom"?j("picker.customHint"):C.authType==="oauth"?j("picker.oauthHint"):j("picker.keyHint",{count:C.modelCount})})]}),u.jsx(Kr,{className:"jv-row-chevron"})]},`${C.id}:${C.authType}`))})]},w)),m&&u.jsx("p",{role:"status",className:"jv-hint",children:j("picker.loading")}),d&&u.jsxs("div",{className:"jv-empty",role:"alert",children:[u.jsx("strong",{children:d}),u.jsx(Ve,{variant:"outline",onClick:()=>g(w=>w+1),children:j("picker.retry")})]}),!m&&!d&&!b.length&&u.jsxs("div",{className:"jv-empty",children:[u.jsx("strong",{children:j("picker.noMatch")}),u.jsx("span",{children:j("picker.noMatchHint")})]})]})}const Z9=mg("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-foreground",destructive:"border-transparent bg-destructive text-white"}},defaultVariants:{variant:"default"}});function J9({className:e,variant:i,...a}){return u.jsx("span",{"data-slot":"badge",className:nn(Z9({variant:i}),e),...a})}function PC({className:e,...i}){return u.jsx(IR,{"data-slot":"label",className:nn("flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...i})}function W9({connection:e,providerName:i,authType:a,ensureConnection:l,onChanged:s}){var q,W;const[c,d]=k.useState({phase:"idle"}),[f,m]=k.useState(""),[v,y]=k.useState(!1),[g,b]=k.useState(""),[x,w]=k.useState(0),S=k.useRef(void 0),C=e==null?void 0:e.id,N=k.useRef(s);N.current=s;const M=k.useRef(c.phase);M.current=c.phase,k.useEffect(()=>{if(!C)return;const Q=C;let U=!0,X;async function O(){var F;try{let ne=await je.authStatus(Q);if(!U)return;if(S.current&&((F=ne.prompt)==null?void 0:F.type)==="select"){const J=S.current;if(S.current=void 0,ne=await je.authInput(Q,ne.prompt.id,J),!U)return}const _=M.current==="running"&&ne.phase!=="running";M.current=ne.phase,d(ne),_&&await N.current(),ne.phase==="running"&&U&&(X=setTimeout(()=>void O(),750))}catch(ne){U&&b(Pt(ne,"auth.statusFailed"))}}return O(),()=>{U=!1,clearTimeout(X)}},[C,c.phase,x]),k.useEffect(()=>m(""),[(q=c.prompt)==null?void 0:q.id]);async function T(Q){y(!0),b("");try{const U=await Q();d(U),U.phase!=="running"&&await s()}catch(U){b(Pt(U,"common.failed"))}finally{y(!1)}}function A(Q){S.current=Q,T(async()=>{const U=C??await l();return je.authStart(U)})}const I=i==="openai-codex"&&a==="oauth",D=i==="openai"&&a==="oauth",B=c.phase==="running",P=c.prompt,V=c.event,z=(V==null?void 0:V.type)==="auth_url"?V.url:(V==null?void 0:V.type)==="device_code"?V.verificationUri:null,Y=Q=>{P&&C&&T(()=>je.authInput(C,P.id,Q))};return u.jsxs("section",{className:"jv-auth","aria-label":j("auth.title"),children:[u.jsxs("div",{className:"jv-auth-header",children:[u.jsx("h3",{children:j("auth.title")}),u.jsx(J9,{variant:"outline","data-state":B?"running":e!=null&&e.configured?"connected":"disconnected",children:j(B?"auth.running":e!=null&&e.configured?a==="oauth"?"status.signedIn":"status.configured":a==="oauth"?"status.signedOut":"status.notConfigured")})]}),B?u.jsxs("div",{className:"jv-auth-flow",children:[z&&u.jsx(Ve,{asChild:!0,variant:"outline",children:u.jsx("a",{style:{color:"inherit",textDecoration:"none"},href:z,target:"_blank",rel:"noopener noreferrer",children:j("auth.openPage")})}),(V==null?void 0:V.type)==="device_code"&&u.jsx("p",{children:j("auth.code",{code:V.userCode})}),(P==null?void 0:P.type)==="select"&&u.jsx("div",{className:"flex flex-wrap gap-2",children:(W=P.options)==null?void 0:W.map(Q=>u.jsx(Ve,{type:"button",variant:"outline",disabled:v,onClick:()=>Y(Q.id),children:I&&Q.id==="browser"?j("auth.browser"):I&&Q.id==="device_code"?j("auth.deviceCode"):Q.label},Q.id))}),P&&P.type!=="select"&&u.jsxs("div",{className:"jv-auth-input",children:[u.jsx(PC,{htmlFor:`oauth-input-${C??i}`,children:P.type==="manual_code"?j(D?"auth.redirectFull":"auth.redirectOrCode"):P.message}),P.type==="manual_code"&&u.jsx("p",{className:"jv-auth-note",children:j("auth.manualNote")}),u.jsx(In,{id:`oauth-input-${C??i}`,type:P.type==="text"?"text":"password",autoComplete:"off",value:f,disabled:v,onChange:Q=>m(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),Y(f))}}),u.jsx(Ve,{type:"button",variant:"outline",disabled:v||!f.trim(),onClick:()=>Y(f),children:j("common.continue")})]}),!P&&u.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:j("auth.waiting")}),(V==null?void 0:V.type)==="info"&&u.jsx("p",{className:"text-sm",children:V.message}),u.jsx(Ve,{type:"button",variant:"ghost",disabled:v,onClick:()=>void T(()=>je.authCancel(C)),children:j("auth.cancel")})]}):u.jsxs("div",{className:"flex flex-wrap gap-2",children:[I?u.jsxs(u.Fragment,{children:[u.jsx(Ve,{type:"button",variant:"outline",disabled:v,onClick:()=>A("browser"),children:j("auth.browser")}),u.jsx(Ve,{type:"button",variant:"outline",disabled:v,onClick:()=>A("device_code"),children:j("auth.deviceCode")})]}):u.jsx(Ve,{type:"button",variant:"outline",disabled:v,onClick:()=>A(),children:j(a==="api_key"?"auth.configureCredential":e!=null&&e.configured?"auth.signInAgain":"auth.signIn")}),(e==null?void 0:e.configured)&&u.jsx(Ve,{type:"button",variant:"outline",disabled:v,onClick:()=>void T(async()=>(await je.authLogout(C),{phase:"idle"})),children:j(a==="api_key"?"auth.removeCredential":"auth.signOut")})]}),(g||c.phase==="error")&&u.jsx("p",{role:"alert",className:"jarvy-model-feedback",children:g||j("error.loginFailed")}),g&&u.jsx(Ve,{type:"button",variant:"link",disabled:v,onClick:()=>{b(""),w(Q=>Q+1)},children:j("auth.refresh")})]})}async function eB(e,i,a){try{return await je.autoconfigModel({modelId:e.id,api:e.api||i,...a?{choice:a}:{}})}catch(l){return{status:"error",message:Pt(l,"auto.failed")}}}function tB(e,i){if(i.status!=="matched")return{...e,auto:i};const{fields:a,...l}=i,s=e.model.name&&e.model.name!==e.model.id;return{...e,model:{...e.model,...a,name:s?e.model.name:i.source.name||e.model.id},auto:l}}const HC=e=>`${e.provider} / ${e.modelId}`;function k2({items:e,onPick:i}){return u.jsx("div",{className:"jv-auto-sources",children:e.map(a=>u.jsxs("button",{type:"button",onClick:()=>i(a),children:[u.jsx("span",{className:"jv-mono",children:HC(a)}),a.official&&u.jsx("em",{children:j("auto.official")}),u.jsx("small",{children:a.api})]},`${a.provider}/${a.modelId}`))})}function nB({state:e,modelId:i,onRun:a}){const l=c=>a({provider:c.provider,modelId:c.modelId}),s=(e==null?void 0:e.status)==="pending";return u.jsxs("div",{className:"jv-autoconfig","aria-live":"polite",children:[u.jsxs(Ve,{type:"button",variant:"outline",size:"sm",disabled:!i.trim()||s,onClick:()=>a(),children:[u.jsx(Kj,{}),j(s?"auto.pending":"auto.run")]}),e&&!s&&u.jsxs("div",{className:"jv-auto-result",children:[e.status==="matched"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:L2("auto.matched",{source:u.jsx("strong",{className:"jv-mono",children:HC(e.source)}),note:e.reseller?j("auto.reseller"):"",suffix:j("auto.applied")})}),e.apiMismatch&&u.jsx("p",{className:"jv-auto-warn",children:j("auto.apiMismatch",{api:e.source.api})}),e.alternatives.length>0&&u.jsxs("details",{children:[u.jsx("summary",{children:j("auto.changeSource")}),u.jsx(k2,{items:e.alternatives,onPick:l})]})]}),e.status==="choose"&&u.jsxs(u.Fragment,{children:[u.jsx("p",{children:e.reason==="multiple"?j("auto.multiple"):j("auto.similar",{modelId:i})}),u.jsx(k2,{items:e.options,onPick:l})]}),e.status==="none"&&u.jsx("p",{children:j("auto.notFound")}),e.status==="error"&&u.jsx("p",{role:"alert",children:e.message})]})]})}const bp=["openai","openrouter","deepseek","zai","qwen","together","baseten","chat-template","qwen-chat-template","string-thinking","ant-ling"],UC=[["off","thinking.level.off"],["minimal","thinking.level.minimal"],["low","thinking.level.low"],["medium","thinking.level.medium"],["high","thinking.level.high"],["xhigh","thinking.level.xhigh"],["max","thinking.level.max"]],qC=e=>e==="xhigh"||e==="max";function FC(e,i){const a=e[i];return a===null||a===void 0&&qC(i)?"unsupported":a===void 0?"default":"custom"}function iB(e){return e.reasoning?UC.filter(([i])=>FC(e.thinkingLevelMap,i)!=="unsupported").map(([,i])=>j(i)):[j("thinking.level.off")]}function aB({model:e,api:i,onChange:a}){const l=e.thinkingLevelMap,s=(f,m,v)=>{const y={...l};m==="default"?delete y[f]:m==="unsupported"?y[f]=null:y[f]=v??(typeof l[f]=="string"?l[f]:f),a({thinkingLevelMap:y})},c=i==="openai-completions",d=e.thinkingFormat&&!bp.includes(e.thinkingFormat)?[...bp,e.thinkingFormat]:bp;return u.jsxs("section",{className:"jv-thinking",children:[u.jsx("h4",{children:j("thinking.title")}),u.jsxs("div",{className:"jv-field",children:[u.jsx("span",{children:j("thinking.format")}),u.jsxs(Zl,{value:e.thinkingFormat||"default",disabled:!c&&!e.thinkingFormat,onValueChange:f=>a({thinkingFormat:f==="default"?"":f}),children:[u.jsx(Wl,{"aria-label":j("thinking.format"),children:u.jsx(Jl,{})}),u.jsxs(eo,{className:"jv-select-menu",children:[u.jsx(Fi,{value:"default",children:j("thinking.protocolDefault")}),d.map(f=>u.jsx(Fi,{value:f,children:f},f))]})]}),!c&&u.jsx("small",{className:"jv-field-hint",children:j("thinking.onlyCompletions")})]}),u.jsx("div",{className:"jv-thinking-levels",role:"group","aria-label":j("thinking.levels"),children:UC.map(([f,m])=>{const v=FC(l,f);return u.jsxs("div",{className:"jv-thinking-level",children:[u.jsxs("span",{children:[j(m),u.jsx("code",{children:f})]}),u.jsxs(Zl,{value:v,onValueChange:y=>s(f,y),children:[u.jsx(Wl,{"aria-label":j("thinking.levelName",{level:j(m)}),children:u.jsx(Jl,{})}),u.jsxs(eo,{className:"jv-select-menu",children:[!qC(f)&&u.jsx(Fi,{value:"default",children:j("thinking.supportedDefault")}),u.jsx(Fi,{value:"unsupported",children:j("thinking.unsupported")}),u.jsx(Fi,{value:"custom",children:j("thinking.supportedCustom")})]})]}),v==="custom"?u.jsx(In,{className:"jv-mono",required:!0,"aria-label":j("thinking.levelValue",{level:j(m)}),maxLength:80,value:l[f]??"",onChange:y=>s(f,"custom",y.target.value)}):u.jsx("span",{})]},f)})}),u.jsx("p",{className:"jv-field-hint",children:j("thinking.supported",{levels:iB(e).join(" · ")})})]})}const xp=[{id:"openai-completions",label:"OpenAI · Chat Completions"},{id:"openai-responses",label:"OpenAI · Responses"},{id:"anthropic-messages",label:"Anthropic · Messages"},{id:"google-generative-ai",label:"Google · Gemini"}],rB=()=>({id:"",name:"",reasoning:!1,input:["text"],contextWindow:null,maxTokens:null,thinkingFormat:"",thinkingLevelMap:{},compat:{},cost:null});function sg({value:e,onChange:i,allowDefault:a=!1}){const l=xp.some(s=>s.id===e)||!e?xp:[...xp,{id:e,label:e}];return u.jsxs(Zl,{value:e||"default",onValueChange:s=>i(s==="default"?"":s),children:[u.jsx(Wl,{"aria-label":j("editor.protocol"),children:u.jsx(Jl,{})}),u.jsxs(eo,{className:"jv-select-menu",children:[a&&u.jsx(Fi,{value:"default",children:j("card.defaultProtocol")}),l.map(s=>u.jsx(Fi,{value:s.id,children:s.label},s.id))]})]})}const lB=e=>e>=1e6?`${+(e/1e6).toFixed(2)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e),C2={pending:"auto.pending",choose:"auto.tagChoose",none:"auto.tagNone",error:"auto.failed"};function oB({value:e,onChange:i}){const a=m=>Object.keys(m).length?JSON.stringify(m,null,2):"",[l,s]=k.useState(()=>a(e)),[c,d]=k.useState(""),f=k.useRef(null);return k.useEffect(()=>{var m;try{if(JSON.stringify(JSON.parse(l||"{}"))===JSON.stringify(e))return}catch{}s(a(e)),d(""),(m=f.current)==null||m.setCustomValidity("")},[e]),u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:j("card.compat")}),u.jsx(ig,{ref:f,className:"jv-mono jv-compat",rows:Math.min(10,Math.max(2,l.split(`
534
- `).length)),placeholder:"{}",value:l,onChange:m=>{s(m.target.value);try{const v=JSON.parse(m.target.value||"{}");if(!v||typeof v!="object"||Array.isArray(v))throw new Error;i(v),d(""),m.currentTarget.setCustomValidity("")}catch{d(j("card.jsonObject")),m.currentTarget.setCustomValidity(j("card.jsonObject"))}}}),c&&u.jsx("small",{role:"alert",children:c})]})}function sB({draft:e,protocol:i,onChange:a,onRemove:l,onAutoconfig:s}){const{model:c}=e,[d,f]=k.useState(!c.id),[m,v]=k.useState(!1),[y,g]=k.useState(()=>(c.headerNames??[]).map(S=>({name:S,value:"",saved:!0}))),b=S=>a({...e,model:{...c,...S}}),x=(S,C)=>u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:S}),C]}),w=(S,C,N)=>{const M=y.map((A,I)=>I===S?{...A,[C]:N}:A);g(M);const T={...c.headerUpdates};!y[S].saved&&y[S].name&&y[S].name!==M[S].name&&(T[y[S].name]=null);for(const A of M)A.name&&(A.value||!A.saved)&&(T[A.name]=A.value);b({headerUpdates:T})};return u.jsxs("article",{className:`jv-model-card ${e.selected?"is-selected":""}`,children:[u.jsxs("div",{className:"jv-model-summary",children:[u.jsx("input",{type:"checkbox",checked:e.selected,"aria-label":j("card.use",{name:c.id||j("card.newModel")}),onChange:S=>a({...e,selected:S.target.checked})}),u.jsxs("button",{type:"button","aria-expanded":d,className:"jv-model-expand",onClick:()=>f(!d),children:[u.jsxs("span",{className:"jv-row-text",children:[u.jsx("strong",{children:c.name||c.id||j("card.newModel")}),u.jsx("span",{className:"jv-mono",children:c.id||j("card.enterId")})]}),u.jsxs("span",{className:"jv-chips",children:[c.contextWindow&&u.jsx("span",{className:"jv-chip",children:lB(c.contextWindow)}),c.input.includes("image")&&u.jsx("span",{className:"jv-chip",children:j("card.image")}),c.reasoning&&u.jsx("span",{className:"jv-chip",children:j("card.reasoning")}),e.auto&&C2[e.auto.status]&&u.jsx("span",{className:"jv-chip jv-chip-warn",children:j(C2[e.auto.status])})]}),u.jsx(ts,{className:"jv-expand-icon"})]}),u.jsx(Ve,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-model-remove","aria-label":j("card.remove",{name:c.id||j("card.newModel")}),onClick:l,children:u.jsx(Nd,{})})]}),d&&u.jsxs("div",{className:"jv-model-fields",children:[u.jsxs("div",{className:"jv-field-grid",children:[x(j("card.modelId"),u.jsx(In,{className:"jv-mono",required:!0,value:c.id,onChange:S=>b({id:S.target.value}),placeholder:"model-id"})),x(j("card.modelName"),u.jsx(In,{value:c.name,onChange:S=>b({name:S.target.value}),placeholder:j("card.optional")}))]}),u.jsx(nB,{state:e.auto,modelId:c.id,onRun:s}),u.jsxs("section",{children:[u.jsx("h4",{children:j("card.capabilities")}),u.jsxs("div",{className:"flex flex-wrap gap-5",children:[u.jsxs("label",{className:"jarvy-model-check",children:[u.jsx("input",{type:"checkbox",checked:c.reasoning,onChange:S=>b({reasoning:S.target.checked})}),j("card.reasoningThinking")]}),u.jsxs("label",{className:"jarvy-model-check",children:[u.jsx("input",{type:"checkbox",checked:c.input.includes("image"),onChange:S=>b({input:S.target.checked?["text","image"]:["text"]})}),j("card.imageInput")]})]})]}),c.reasoning&&u.jsx(aB,{model:c,api:c.api||i,onChange:b}),u.jsxs("section",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h4",{children:j("card.specs")}),u.jsx(Ve,{type:"button",variant:"link",size:"sm",onClick:()=>v(!m),children:j(m?"card.hidePrices":"card.editPrices")})]}),u.jsxs("div",{className:"jv-field-grid",children:[x(j("card.context"),u.jsx(In,{type:"number",min:1,value:c.contextWindow??"",placeholder:j("card.notProvided"),onChange:S=>b({contextWindow:S.target.value?Number(S.target.value):null})})),x(j("card.maxOutput"),u.jsx(In,{type:"number",min:1,value:c.maxTokens??"",placeholder:j("card.notProvided"),onChange:S=>b({maxTokens:S.target.value?Number(S.target.value):null})}))]}),u.jsx("h4",{className:"jv-cost-title",children:j("card.costTitle")}),u.jsx("div",{className:"jv-costs",children:[["input","card.costInput"],["output","card.costOutput"],["cacheRead","card.costCacheRead"],["cacheWrite","card.costCacheWrite"]].map(([S,C])=>{var N,M;return u.jsxs("div",{children:[u.jsx(PC,{children:j(C)}),m?u.jsx(In,{type:"number",step:"any",min:0,value:((N=c.cost)==null?void 0:N[S])??"",onChange:T=>b({cost:{input:0,output:0,cacheRead:0,cacheWrite:0,...c.cost,[S]:Number(T.target.value)}})}):u.jsx("span",{children:((M=c.cost)==null?void 0:M[S])??j("card.notProvided")})]},S)})})]}),u.jsxs("details",{className:"jv-advanced",children:[u.jsxs("summary",{children:[j("card.advanced"),u.jsx(ts,{className:"size-4"})]}),u.jsxs("div",{className:"jv-advanced-fields",children:[u.jsxs("div",{className:"jv-field",children:[u.jsx("span",{children:j("card.apiOverride")}),u.jsx(sg,{allowDefault:!0,value:c.api??"",onChange:S=>b({api:S})})]}),u.jsxs("div",{className:"jv-field",children:[u.jsx("span",{children:j("card.headers")}),y.map((S,C)=>u.jsxs("div",{className:"jv-header-row",children:[u.jsx(In,{className:"jv-mono","aria-label":"Header Name",placeholder:"Header-Name",readOnly:S.saved,value:S.name,onChange:N=>w(C,"name",N.target.value)}),u.jsx(In,{"aria-label":"Header Value",type:"password",autoComplete:"off",placeholder:S.saved?j("card.headerSaved"):"value",value:S.value,onChange:N=>w(C,"value",N.target.value)}),u.jsx(Ve,{type:"button",size:"icon-sm",variant:"ghost","aria-label":j("card.removeHeader"),onClick:()=>{g(y.filter((N,M)=>M!==C)),S.name&&b({headerUpdates:{...c.headerUpdates,[S.name]:null}})},children:u.jsx(Nd,{})})]},C)),u.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"self-start",onClick:()=>g([...y,{name:"",value:"",saved:!1}]),children:[u.jsx(Vd,{}),j("card.addHeader")]})]}),u.jsx(oB,{value:c.compat,onChange:S=>b({compat:S})})]})]})]})]})}let cB=0;const jp=(e,i,a=!1)=>({key:`draft-${++cB}`,model:e,selected:i,...a?{originalId:e.id}:{}});function uB({connection:e,preset:i,defaultName:a,saved:l=!1,onBack:s,onSaved:c,onConnected:d,onChanged:f}){const m=e?e.kind==="custom":(i==null?void 0:i.id)==="custom",v=(e==null?void 0:e.authType)??i.authType,[y,g]=k.useState(e?m?e.providerName:e.displayName:m?"":a),[b,x]=k.useState((e==null?void 0:e.baseUrl)??""),[w,S]=k.useState((e==null?void 0:e.api)??i.api),[C,N]=k.useState(""),[M,T]=k.useState(()=>((e==null?void 0:e.models)??[]).map(re=>jp(re,!0,!0))),[A,I]=k.useState([]),[D,B]=k.useState(""),[P,V]=k.useState(!1),[z,Y]=k.useState(!1),[q,W]=k.useState(""),[Q,U]=k.useState(l?j("editor.saved"):""),X=k.useRef(e==null?void 0:e.id);function O(re){T(be=>{const oe=new Set(be.map(ce=>ce.model.id));return[...be,...re.filter(ce=>!oe.has(ce.id)).map(ce=>jp(ce,!1))]})}k.useEffect(()=>{if(m)return;let re=!0;return Y(!0),(e?je.modelCatalog(e.id):je.providerModels(i.id)).then(oe=>{re&&O(oe.models)}).catch(oe=>{re&&W(Pt(oe,"editor.fetchFailed"))}).finally(()=>{re&&Y(!1)}),()=>{re=!1}},[e==null?void 0:e.id,i==null?void 0:i.id,m]);async function F(){Y(!0),W(""),U("");try{const re=await je.discoverModels({connectionId:X.current,baseUrl:b,api:w,...C.trim()?{apiKey:C}:{}});O(re.models),U(re.models.length?j("editor.fetched",{count:re.models.length}):j("editor.noneReturned"))}catch(re){W(Pt(re,"editor.fetchFailed"))}finally{Y(!1)}}async function ne(re,be){const oe=M.filter(me=>re.includes(me.key)&&me.model.id.trim());if(!oe.length)return;W(""),U(""),T(me=>me.map(Ee=>oe.some(ze=>ze.key===Ee.key)?{...Ee,auto:{status:"pending"}}:Ee));const ce={matched:0,choose:0,none:0,error:0};for(const me of oe){const Ee=await eB(me.model,w,be);ce[Ee.status]++,T(ze=>ze.map(Fe=>Fe.key===me.key?tB(Fe,Ee):Fe))}oe.length>1&&U(j("editor.autoSummary",{parts:[j("editor.autoMatched",{count:ce.matched}),ce.choose&&j("editor.autoChoose",{count:ce.choose}),ce.none&&j("editor.autoNone",{count:ce.none}),ce.error&&j("editor.autoFailed",{count:ce.error})].filter(Boolean).join(j("common.listSeparator"))}))}async function _(){if(!X.current){const re=await je.createModelConnection({providerName:i.id,displayName:y,kind:"builtin",authType:v,baseUrl:b,api:w});X.current=re.id}return await d(X.current),X.current}async function J(re){re.preventDefault(),V(!0),W(""),U("");try{let be;X.current?(be=await je.updateModelConnection(X.current,{displayName:y,...m?{providerName:y}:{},baseUrl:b,api:w}),m&&C.trim()&&await je.saveModelCredential(be.id,C)):(be=await je.createModelConnection({providerName:m?y:i.id,displayName:y,kind:m?"custom":"builtin",authType:v,baseUrl:b,api:w,...m&&C.trim()?{apiKey:C}:{}}),X.current=be.id);for(const oe of M)oe.selected&&await je.saveConnectionModel(be.id,oe.model,oe.originalId);for(const oe of new Set([...A,...M.filter(ce=>ce.originalId&&!ce.selected).map(ce=>ce.originalId)]))await je.deleteConnectionModel(be.id,oe);N(""),await c(be.id),U(j("editor.saved"))}catch(be){W(Pt(be,"editor.saveFailed"))}finally{V(!1)}}async function ee(){if(!(!e||!confirm(j("editor.confirmDelete",{name:e.displayName})))){V(!0),W("");try{await je.deleteModelConnection(e.id),await f(),s()}catch(re){W(Pt(re,"editor.deleteFailed"))}finally{V(!1)}}}const H=M.filter(re=>`${re.model.id} ${re.model.name}`.toLowerCase().includes(D.toLowerCase())),$=M.filter(re=>re.selected).length,fe=m?(e==null?void 0:e.displayName)??j("group.custom"):(e==null?void 0:e.displayName)??i.name,ye=e?LC(e):null,xe=M.some(re=>{var be;return((be=re.auto)==null?void 0:be.status)==="pending"});return u.jsxs("form",{className:"jv-editor",onChange:()=>U(""),onSubmit:re=>void J(re),children:[u.jsxs("header",{className:"jv-editor-header",children:[u.jsx(Ve,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-back",disabled:P,onClick:s,"aria-label":j("editor.back"),children:u.jsx(Fd,{})}),u.jsx(hv,{name:fe}),u.jsxs("div",{className:"jv-row-text",children:[u.jsx("strong",{children:fe}),u.jsx("span",{children:m?"OpenAI / Anthropic compatible":j(v==="oauth"?"group.subscription":"group.apiKey")})]}),ye&&u.jsx("span",{className:"jv-status","data-ok":ye.ok||void 0,children:ye.label}),e&&u.jsx(Ve,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-danger-icon",disabled:P,onClick:()=>void ee(),"aria-label":j("editor.delete"),children:u.jsx(Nd,{})})]}),u.jsxs("div",{className:"jv-editor-scroll",children:[u.jsxs("section",{className:"jv-section","aria-label":j("editor.connection"),children:[u.jsx("h3",{className:"jv-section-title",children:j("editor.connection")}),u.jsx("div",{className:"jv-panel",children:m?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"jv-field-grid",children:[u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:j("editor.providerName")}),u.jsx(In,{className:"jv-mono",required:!0,maxLength:80,"aria-label":j("editor.providerName"),placeholder:"my-provider",value:y,onChange:re=>g(re.target.value)})]}),u.jsxs("div",{className:"jv-field",children:[u.jsx("span",{children:j("editor.protocol")}),u.jsx(sg,{value:w,onChange:S})]})]}),u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:j("editor.url")}),u.jsx(In,{required:!0,type:"url","aria-label":j("editor.url"),value:b,placeholder:"https://api.example.com/v1",onChange:re=>x(re.target.value)})]}),u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:j("editor.key")}),u.jsx(In,{type:"password",autoComplete:"new-password","aria-label":j("editor.key"),placeholder:j(e!=null&&e.configured?"editor.keySaved":"editor.keyPlaceholder"),value:C,onChange:re=>N(re.target.value)})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:j("editor.name")}),u.jsx(In,{required:!0,maxLength:100,"aria-label":j("editor.name"),value:y,onChange:re=>g(re.target.value)})]}),u.jsx(W9,{connection:e,providerName:(e==null?void 0:e.providerName)??i.id,authType:v,ensureConnection:_,onChanged:f}),u.jsxs("details",{className:"jv-advanced",children:[u.jsxs("summary",{children:[u.jsx(ts,{}),j("editor.settings")]}),u.jsxs("div",{className:"jv-advanced-fields",children:[u.jsxs("label",{className:"jv-field",children:[u.jsx("span",{children:j("editor.url")}),u.jsx(In,{className:"jv-mono",value:b,placeholder:j("editor.defaultUrl"),onChange:re=>x(re.target.value)})]}),u.jsxs("div",{className:"jv-field",children:[u.jsx("span",{children:"API Protocol"}),u.jsx(sg,{value:w,onChange:S})]})]})]})]})})]}),u.jsxs("section",{className:"jv-section","aria-label":j("editor.models"),children:[u.jsxs("div",{className:"jv-section-head",children:[u.jsxs("h3",{className:"jv-section-title",children:[j("settings.models")," ",u.jsx("span",{children:j("editor.selected",{selected:$,total:M.length})})]}),u.jsxs("div",{className:"jv-section-actions",children:[m&&u.jsxs(Ve,{type:"button",variant:"ghost",size:"sm",disabled:P||z||!b.trim()||!(C.trim()||e!=null&&e.configured),onClick:()=>void F(),children:[u.jsx(aj,{}),j(z?"editor.fetching":"editor.fetch")]}),$>0&&u.jsxs(Ve,{type:"button",variant:"ghost",size:"sm",disabled:P||xe,onClick:()=>void ne(M.filter(re=>re.selected).map(re=>re.key)),children:[u.jsx(Kj,{}),j("editor.autoSelected")]}),u.jsxs(Ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>T([...M,jp(rB(),!0)]),children:[u.jsx(Vd,{}),j("editor.addManually")]})]})]}),M.length>6&&u.jsxs("div",{className:"jv-models-filter",children:[u.jsxs("label",{className:"jv-search",children:[u.jsx(kc,{}),u.jsx("input",{"aria-label":j("editor.filter"),placeholder:j("editor.filterPlaceholder"),value:D,onChange:re=>B(re.target.value)})]}),u.jsx(Ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(re=>re.map(be=>H.includes(be)?{...be,selected:!0}:be)),children:j("editor.selectVisible")})]}),z&&!m&&u.jsx("p",{role:"status",className:"jv-hint",children:j("editor.loadingCatalog")}),u.jsx("div",{className:"jv-model-cards",children:H.map(re=>u.jsx(sB,{draft:re,protocol:w,onAutoconfig:be=>void ne([re.key],be),onChange:be=>T(oe=>oe.map(ce=>ce.key===re.key?be:ce)),onRemove:()=>{re.originalId&&I(be=>[...be,re.originalId]),T(be=>be.filter(oe=>oe.key!==re.key))}},re.key))}),!z&&!M.length&&u.jsxs("div",{className:"jv-empty",children:[u.jsx("strong",{children:j("editor.empty")}),u.jsx("span",{children:j(m?"editor.emptyCustom":"editor.emptyBuiltin")})]})]})]}),u.jsxs("footer",{className:"jv-editor-footer",children:[u.jsx("div",{"aria-live":"polite",children:q?u.jsx("p",{role:"alert",children:q}):Q?u.jsx("p",{role:"status",children:Q}):u.jsx("p",{children:j("editor.footer")})}),u.jsx(Ve,{type:"submit",className:"jv-primary",disabled:P||z||xe,children:j(P?"editor.saving":"editor.save")})]})]})}function dB({connections:e,onChanged:i}){const[a,l]=k.useState("list"),[s,c]=k.useState(),[d,f]=k.useState(),[m,v]=k.useState(0),y=()=>{l("list"),f(void 0),c(void 0),v(0)},g=x=>BC({authType:x.authType,custom:x.kind==="custom"});let b=(s==null?void 0:s.name)??"";if(s){let x=2;for(;e.some(w=>w.displayName===b);)b=`${s.name} ${x++}`}return a==="choose"?u.jsx(K9,{onBack:y,onSelect:x=>{c(x),f(void 0),l("editor")}}):a==="editor"?u.jsx(uB,{connection:e.find(x=>x.id===d),preset:s,defaultName:b,saved:m>0,onBack:y,onChanged:i,onConnected:async x=>{await i(),f(x),c(void 0)},onSaved:async x=>{await i(),f(x),c(void 0),v(w=>w+1)}},m):u.jsxs("div",{className:"jv-page",children:[u.jsxs("header",{className:"jv-page-header",children:[u.jsxs("div",{children:[u.jsx("h2",{children:j("settings.models")}),u.jsx("p",{children:j("models.intro")})]}),u.jsxs(Ve,{className:"jv-primary",onClick:()=>l("choose"),children:[u.jsx(Vd,{}),j("models.add")]})]}),!e.length&&u.jsxs("div",{className:"jv-empty",children:[u.jsx("strong",{children:j("models.empty")}),u.jsx("span",{children:j("models.emptyHint")})]}),IC.filter(x=>e.some(w=>g(w)===x.id)).map(({id:x,label:w})=>u.jsxs("section",{className:"jv-section","aria-label":j(w),children:[u.jsx("h3",{className:"jv-section-title",children:j(w)}),u.jsx("div",{className:"jv-list",children:e.filter(S=>g(S)===x).map(S=>{const C=LC(S);return u.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>{f(S.id),c(void 0),l("editor")},children:[u.jsx(hv,{name:S.displayName}),u.jsxs("span",{className:"jv-row-text",children:[u.jsx("strong",{children:S.displayName}),u.jsx("span",{children:S.models.length?j("models.count",{count:S.models.length}):j("models.none")})]}),u.jsx("span",{className:"jv-status","data-ok":C.ok||void 0,children:C.label}),u.jsx(Kr,{className:"jv-row-chevron"})]},S.id)})})]},x))]})}const fB=[{id:"general",label:"settings.general",icon:XA},{id:"models",label:"settings.models",icon:pA},{id:"about",label:"settings.about",icon:dg}];function hB({connections:e,onChanged:i,onClose:a,initialTab:l="general"}){const[s,c]=k.useState(l);return u.jsx(Qk,{open:!0,onOpenChange:d=>{d||a()},children:u.jsxs(Kk,{className:"jv-settings-shell","aria-describedby":void 0,children:[u.jsxs("nav",{className:"jv-settings-nav","aria-label":j("settings.sections"),children:[u.jsx(cf,{className:"jv-settings-title",children:j("settings.title")}),fB.map(d=>u.jsxs("button",{type:"button",className:"jv-nav-item","aria-current":s===d.id?"page":void 0,onClick:()=>c(d.id),children:[u.jsx(d.icon,{}),j(d.label)]},d.id))]}),u.jsx("main",{className:"jv-settings-content",children:s==="general"?u.jsx(X9,{}):s==="models"?u.jsx(dB,{connections:e,onChanged:i}):u.jsx(G9,{})})]})})}const E2="Jarvy";let N2=null,Ra=null,Pl=null;function mB(){return document.querySelector('link[rel="icon"][type="image/png"]')}function pB(e){if(!(Ra!=null&&Ra.complete)||!Ra.naturalWidth)return null;const i=64,a=document.createElement("canvas");a.width=a.height=i;const l=a.getContext("2d");if(!l)return null;l.drawImage(Ra,0,0,i,i);const s=e>9?"9+":String(e),c=s.length>1?21:18;return l.fillStyle="#e5484d",l.beginPath(),l.arc(i-c,c,c,0,Math.PI*2),l.fill(),l.fillStyle="#fff",l.font=`bold ${s.length>1?26:30}px system-ui, sans-serif`,l.textAlign="center",l.textBaseline="middle",l.fillText(s,i-c,c+2),a.toDataURL("image/png")}function T2(e){document.title=e>0?`(${e>99?"99+":e}) ${E2}`:E2;const i=mB();if(!i)return;if(N2??(N2=i.href),Pl??(Pl=document.querySelector('link[rel="icon"][type="image/svg+xml"]')),e<=0){i.href=N2,Pl&&!Pl.isConnected&&document.head.prepend(Pl);return}const a=pB(e);a&&(i.href=a,Pl==null||Pl.remove())}function gB(e){k.useEffect(()=>{Ra||(Ra=new Image,Ra.src="/favicon.svg"),Ra.complete?T2(e):Ra.onload=()=>T2(e)},[e])}const yd=50;function vB({chatId:e,ready:i,scroller:a,me:l,onError:s}){const[c,d]=k.useState([]),[f,m]=k.useState(!1),[v,y]=k.useState(!1),[g,b]=k.useState(!1),x=k.useRef(c),w=k.useRef(e),S=k.useRef(0),C=k.useRef(!1),N=k.useRef(!1);x.current=c,w.current=e,N.current=v;const M=k.useRef(null),T=k.useRef(!1),A=k.useRef(void 0),I=k.useRef(!0),D=k.useRef(!1),B=k.useRef(null),[P,V]=k.useState(!1),z=k.useRef(0);k.useEffect(()=>{if(d([]),y(!1),D.current=!1,I.current=!0,!i||!e)return;let O=!0;const F=++S.current;return m(!0),V(!1),z.current=0,je.latestMessages(e,yd).then(ne=>{!O||F!==S.current||(T.current=!0,d(ne.messages),y(ne.hasOlder),m(!1))}).catch(ne=>{O&&(m(!1),s(ne))}),()=>{O=!1}},[e,i]);async function Y(O){const F=x.current[0],ne=++S.current;if(!F||F.chatId!==O){const ee=await je.latestMessages(O,yd);w.current===O&&ne===S.current&&(d(ee.messages),y(ee.hasOlder),m(!1));return}const _=F.sequence-1,J=await je.messages(O,_);w.current!==O||ne!==S.current||(d(ee=>[...ee.filter(H=>H.chatId===O&&H.sequence<=_),...J.messages]),m(!1))}async function q(){const O=x.current[0],F=a.current;if(!(!O||!N.current||C.current)){C.current=!0,b(!0);try{const ne=await je.olderMessages(O.chatId,O.sequence,yd);if(w.current!==O.chatId)return;M.current=F?F.scrollHeight-F.scrollTop:null,d(_=>{var J;return((J=_[0])==null?void 0:J.id)===O.id?[...ne.messages,..._]:_}),y(ne.hasOlder)}catch(ne){s(ne)}finally{C.current=!1,b(!1)}}}k.useEffect(()=>{const O=a.current;if(!O)return;const F=new ResizeObserver(()=>{!D.current||!I.current||O.scrollHeight-O.scrollTop-O.clientHeight<8||O.scrollTo({top:O.scrollHeight,behavior:"instant"})}),ne=O.firstElementChild;ne&&F.observe(ne);const _=()=>{var J;if(!D.current){I.current=!0,V(!1);return}I.current=O.scrollHeight-O.scrollTop-O.clientHeight<160,V(!I.current),I.current&&(z.current=((J=x.current.at(-1))==null?void 0:J.sequence)??0)};return _(),O.addEventListener("scroll",_,{passive:!0}),()=>{F.disconnect(),O.removeEventListener("scroll",_)}},[a.current,e]),k.useLayoutEffect(()=>{const O=a.current,F=c.at(-1);if(O){if(M.current!==null)O.scrollTo({top:O.scrollHeight-M.current,behavior:"instant"}),M.current=null;else if(T.current&&c.length){const ne=()=>O.scrollTo({top:O.scrollHeight,behavior:"instant"});ne(),requestAnimationFrame(ne),T.current=!1,D.current=!0,I.current=!0}else F&&F.id!==A.current&&(I.current||F.senderId===l)&&O.scrollTo({top:O.scrollHeight,behavior:"smooth"});A.current=F==null?void 0:F.id,I.current&&(z.current=(F==null?void 0:F.sequence)??0)}},[c]),k.useEffect(()=>{const O=a.current,F=B.current;if(!O||!F||!v||!D.current)return;const ne=new IntersectionObserver(_=>{var J;(J=_[0])!=null&&J.isIntersecting&&D.current&&q()},{root:O,rootMargin:"400px 0px 0px 0px"});return ne.observe(F),()=>ne.disconnect()},[v,c,e,f]);async function W(O,F){if(x.current.some(H=>H.id===O)){Q(O,F);return}const _=w.current,J=await je.message(O);if(J.chatId!==_)return J.chatId;const ee=await je.olderMessages(J.chatId,J.sequence+1,yd);w.current===J.chatId&&(T.current=!0,d([...ee.messages,J]),y(ee.hasOlder),requestAnimationFrame(()=>Q(O,F)))}function Q(O,F){var _;const ne=(_=a.current)==null?void 0:_.querySelector(`[data-message="${O}"]`);ne&&fC(ne,F)}const U=P?c.filter(O=>O.sequence>z.current&&O.senderId!==l).length:0;return{messages:c,setMessages:d,loading:f,hasOlder:v,loadingOlder:g,refresh:Y,top:B,away:P,unseen:U,toLatest:()=>{const O=a.current;O==null||O.scrollTo({top:O.scrollHeight,behavior:"smooth"})},toMessage:W,cancel:()=>{S.current++}}}function yB({ready:e,selected:i,messages:a,chats:l,chatList:s,setChats:c,onError:d}){const f=l.find(m=>m.id===i);k.useEffect(()=>{const m=i,v=a.at(-1);if(!e||!m||!v||v.chatId!==m)return;const y=()=>{const g=s.current.find(b=>b.id===m);document.visibilityState!=="visible"||((g==null?void 0:g.readSequence)??0)>=v.sequence&&!(g!=null&&g.hint)&&!(g!=null&&g.alerts)||(c(b=>b.map(x=>x.id===m?{...x,readSequence:Math.max(x.readSequence,v.sequence),unread:0,mentions:0,alerts:0,atMe:!1,hint:null}:x)),je.markRead(m,v.sequence).catch(d))};return y(),document.addEventListener("visibilitychange",y),()=>document.removeEventListener("visibilitychange",y)},[a,i,e,f==null?void 0:f.readSequence,f==null?void 0:f.alerts,f==null?void 0:f.hint])}function bB({onLogin:e}){const[i,a]=k.useState(""),[l,s]=k.useState(""),[c,d]=k.useState(!1),[f,m]=k.useState(!1),[v,y]=k.useState(null),[g,b]=k.useState(document.documentElement.classList.contains("dark"));async function x(w){if(w.preventDefault(),!f){m(!0),y(null);try{const S=await je.login(i.trim(),l);s(""),e(S.username)}catch(S){y(S instanceof es&&S.status===401?"login.wrong":S instanceof es&&S.status===429?"login.tooMany":"login.offline")}finally{m(!1)}}}return u.jsxs("div",{className:"jv-login",children:[u.jsxs("div",{className:"jv-login-corner",children:[u.jsx("div",{className:"jv-login-locales",role:"group","aria-label":j("general.language"),children:M2.map(w=>u.jsx("button",{type:"button",lang:w,"aria-pressed":qd()===w,title:Sp(w,"name"),onClick:()=>_2(w),children:Sp(w,"short")},w))}),u.jsx("button",{className:"jv-login-theme",type:"button",onClick:()=>{Bd(g?"light":"dark"),b(!g)},"aria-label":j(g?"login.themeLight":"login.themeDark"),children:u.jsx(De,{name:g?"sun":"moon"})})]}),u.jsx("main",{className:"jv-login-stage",children:u.jsxs("div",{className:"jv-login-wrap",children:[u.jsxs("header",{className:"jv-login-brand",children:[u.jsx("img",{className:"jv-login-logo",src:"/icon.svg",alt:"",width:64,height:64}),u.jsx("h1",{children:"Jarvy"}),u.jsx("p",{children:j("login.subtitle")})]}),u.jsxs("form",{className:"jv-login-form",onSubmit:w=>void x(w),"aria-label":j("login.form"),"aria-busy":f,children:[u.jsxs("div",{className:"jv-login-field",children:[u.jsx("label",{htmlFor:"login-username",children:j("login.username")}),u.jsx("input",{id:"login-username",autoComplete:"username",autoFocus:!0,required:!0,disabled:f,value:i,onChange:w=>a(w.target.value)})]}),u.jsxs("div",{className:"jv-login-field",children:[u.jsx("label",{htmlFor:"login-password",children:j("login.password")}),u.jsxs("div",{className:"jv-login-password",children:[u.jsx("input",{id:"login-password",type:c?"text":"password",autoComplete:"current-password",required:!0,disabled:f,value:l,onChange:w=>s(w.target.value)}),u.jsx("button",{type:"button",className:"jv-login-visibility","aria-label":j(c?"login.hidePassword":"login.showPassword"),onClick:()=>d(!c),children:u.jsx(De,{name:c?"eye-slash":"eye"})})]})]}),v&&u.jsx("p",{className:"jv-login-error",role:"alert",children:j(v)}),u.jsx("button",{className:"jv-login-submit",type:"submit",disabled:f,children:j(f?"login.submitting":"login.submit")})]})]})})]})}function xB({selected:e,chats:i,transcript:a,openChat:l,setPane:s,paneRef:c,blocked:d}){const[f,m]=k.useState(null),[v,y]=k.useState(0);k.useEffect(()=>{var x;!f||e!==f.chatId||a.loading||((x=a.messages[0])==null?void 0:x.chatId)!==f.chatId||(a.toMessage(f.id,f.passage),m(null))},[f,e,a.loading,a.messages]);function g(x,w,S){var N;if(x.type==="thread"){const M=i.find(T=>T.id===x.parentId);M&&l(M),s({kind:"thread",id:x.id,parentId:x.parentId,mode:"pane",focus:{id:w,passage:S}});return}((N=c.current)==null?void 0:N.kind)==="search"&&window.matchMedia("(max-width: 760px)").matches&&s(null);const C=x.id===e;l(x),C?a.toMessage(w,S):m({chatId:x.id,id:w,passage:S})}function b(x){s({kind:"search",chat:x}),y(w=>w+1)}return k.useEffect(()=>{const x=w=>{var C,N;if(d||w.defaultPrevented||!(w.ctrlKey||w.metaKey)||w.key.toLowerCase()!=="f")return;const S=i.find(M=>M.id===e);S&&(((C=c.current)==null?void 0:C.kind)==="search"&&((N=document.activeElement)!=null&&N.closest(".jv-search-pane"))||(w.preventDefault(),b(S)))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[d,i,e]),{openMessage:g,search:b,focusKey:v}}const jB=null;function wB(){var ga,Va,$a,ti,va,ue;const[e,i]=k.useState("loading"),[a,l]=k.useState(""),[s,c]=k.useState([]),[d,f]=k.useState({}),m=k.useRef(new Map),[v,y]=k.useState([]),[g,b]=k.useState([]),[x,w]=k.useState([]),[S,C]=k.useState(null),[N,M]=k.useState({}),[T,A]=k.useState(null),[I,D]=k.useState(null),[B,P]=k.useState(null),[V,z]=k.useState([]),[Y,q]=k.useState(null),[W,Q]=k.useState(!1),[U,X]=k.useState(!1),[O,F]=k.useState(!1),[ne,_]=k.useState(""),[J,ee]=k.useState(!1),[H,$]=k.useState(null),[fe,ye]=k.useState(!1),[xe,re]=k.useState(420),[be,oe]=k.useState(0),[ce,me]=k.useState([]),[Ee,ze]=k.useState(""),Fe=k.useRef(null),ht=k.useRef(null),ot=k.useRef(null),[Je,At]=k.useState(null),[gn,vn]=k.useState(null),[Hn,di]=k.useState(null),an=k.useRef(T);an.current=T;const Yi=k.useRef(0),pe=k.useRef(v);pe.current=v;const ke=k.useRef(H);ke.current=H;const Be=k.useMemo(()=>new FI(VI(a)),[a]);k.useEffect(()=>{const L=()=>Be.save();return window.addEventListener("pagehide",L),()=>window.removeEventListener("pagehide",L)},[Be]);const Ue=((ga=x.find(L=>L.kind==="user"&&L.name===a))==null?void 0:ga.id)??"",We=vB({chatId:T,ready:e==="ready",scroller:Fe,me:Ue,onError:Xe}),{messages:Ht,setMessages:yn}=We,Ut=xB({selected:T,chats:v,transcript:We,openChat:fi,setPane:$,paneRef:ke,blocked:!!B||!!Y}),On=((Va=v.find(L=>L.id===T))==null?void 0:Va.botId)??I??(($a=s[0])==null?void 0:$a.id);async function Un(L){const K=(m.current.get(L)??0)+1;m.current.set(L,K);const he=await je.botStatus(L);m.current.get(L)===K&&f(Ne=>({...Ne,[L]:he}))}k.useEffect(()=>{e==="ready"&&On&&Un(On).catch(Xe)},[e,On]);const Rt=((ti=v.find(L=>L.id===T&&L.type==="channel"))==null?void 0:ti.memberIds.filter(L=>s.some(K=>K.id===L)).join(","))??"";k.useEffect(()=>{if(e==="ready"&&Rt)for(const L of Rt.split(","))Un(L).catch(Xe)},[e,Rt]);async function Rn(L){var Me,$e;const[K,he,Ne,Se,Te,Le]=await Promise.all([je.bots(),je.chats(),je.modelConnections(),je.sections(),je.members(),je.followedThreads()]);l(L),c(K.bots),y(he.chats),z(Ne.connections),b(Se.sections),w(Te.members),me(Le.threads);const Qe=he.chats.find(st=>st.type!=="thread");A((Qe==null?void 0:Qe.id)??null),Qe&&M({[Qe.id]:Qe.readSequence}),D(((Me=he.chats[0])==null?void 0:Me.botId)??(($e=K.bots[0])==null?void 0:$e.id)??null),i("ready")}k.useEffect(()=>{Bd(localStorage.getItem("jarvy-theme")==="dark"?"dark":"light"),je.me().then(L=>Rn(L.username)).catch(()=>i("login"))},[]),k.useEffect(()=>{if(e!=="ready")return;let L=!0;const K=new EventSource("/api/events"),he=async Se=>{je.followedThreads().then(Le=>{L&&me(Le.threads)}).catch(()=>{}),oe(Le=>Le+1),await Gt();const Te=an.current;L&&Te&&(!Se||Se===Te)&&await ll(Te)},Ne=()=>void je.sections().then(Se=>{L&&b(Se.sections)}).catch(Se=>{L&&Xe(Se)});return K.addEventListener("ready",()=>{var Te;he().catch(Le=>{L&&Xe(Le)}),Ne();const Se=(Te=pe.current.find(Le=>Le.id===an.current))==null?void 0:Te.botId;Se&&Un(Se).catch(Le=>{L&&Xe(Le)}),je.bots().then(Le=>{L&&c(Le.bots)}).catch(Le=>{L&&Xe(Le)})}),K.addEventListener("sections",Ne),K.addEventListener("bots",()=>{je.bots().then(Se=>{L&&c(Se.bots)}).catch(Se=>{L&&Xe(Se)}),he().catch(Se=>{L&&Xe(Se)})}),K.addEventListener("inbox",()=>void he().catch(Se=>{L&&Xe(Se)})),K.addEventListener("chat",Se=>{const Te=JSON.parse(Se.data);typeof Te.chatId=="string"&&he(Te.chatId).catch(Le=>{L&&Xe(Le)})}),K.addEventListener("bot",Se=>{var Qe;const Te=JSON.parse(Se.data),Le=Te.status;m.current.set(Te.botId,(m.current.get(Te.botId)??0)+1),f(Me=>({...Me,[Te.botId]:Le})),Le.error&&((Qe=pe.current.find(Me=>Me.id===an.current))==null?void 0:Qe.botId)===Le.botId&&ze(Y8(Le)),(Le.status==="idle"||Le.status==="stop")&&je.bots().then(Me=>{L&&c(Me.bots)}).catch(Me=>{L&&Xe(Me)})}),K.onerror=()=>{je.me().catch(Se=>{L&&Se instanceof es&&Se.status===401&&i("login")})},()=>{L=!1,K.close(),We.cancel(),Yi.current++}},[e]),yB({ready:e==="ready",selected:T,messages:Ht,chats:v,chatList:pe,setChats:y,onError:Xe}),gB(e==="ready"?v.reduce((L,K)=>L+K.alerts,0):0),k.useEffect(()=>{if(!Ee)return;const L=setTimeout(()=>ze(""),4800);return()=>clearTimeout(L)},[Ee]),k.useEffect(()=>{const L=K=>{K.defaultPrevented||B||Y||(K.key==="Escape"&&(Q(!1),X(!1),F(!1)),(K.ctrlKey||K.metaKey)&&K.key.toLowerCase()==="k"&&(K.preventDefault(),F(window.matchMedia("(max-width: 620px)").matches),requestAnimationFrame(()=>{var he;return(he=document.querySelector("#jarvy-search"))==null?void 0:he.focus()})))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[B,Y]),k.useEffect(()=>{const L=window.matchMedia("(max-width: 620px)"),K=()=>{L.matches||F(!1)};return L.addEventListener("change",K),()=>L.removeEventListener("change",K)},[]);function Xe(L){if(L instanceof es&&L.status===401){i("login");return}ze(Pt(L,"common.failed"))}async function Gt(){const L=++Yi.current,K=await je.chats();return L===Yi.current&&y(K.chats),K.chats}async function ll(L){await We.refresh(L)}async function sa(){const[L,K]=await Promise.all([je.modelConnections(),je.bots()]);z(L.connections),c(K.bots)}const ca=()=>void je.members().then(L=>w(L.members)).catch(Xe);function bn(L){c(K=>K.map(he=>he.id===L.id?L:he)),ca()}function fi(L){var he;const K=PI(L);K?$({kind:"thread",id:K,parentId:L.id,mode:"pane",summary:((he=L.hint)==null?void 0:he.kind)==="note"}):L.id!==an.current&&$(null),ye(!1),M(Ne=>({...Ne,[L.id]:L.readSequence})),A(L.id),L.botId&&D(L.botId),F(!1),Q(!1),X(!1)}const ol=L=>$((H==null?void 0:H.kind)==="info"&&H.page===L?null:{kind:"info",page:L});function hi(L){y(K=>K.some(he=>he.id===L.id)?K.map(he=>he.id===L.id?L:he):[L,...K])}async function ao(L){if(!J){ee(!0);try{const K=await je.createChat(L);hi(K),fi(K),requestAnimationFrame(()=>{var he;return(he=document.querySelector("#jarvy-composer"))==null?void 0:he.focus()})}catch(K){Xe(K)}finally{ee(!1)}}}async function Gi(){if(!J){ee(!0);try{const L=await je.createBot(pI(ra(x).map(he=>he.name))),K=await je.createChat(L.id);c(he=>[...he,L]),hi(K),ca(),fi(K)}catch(L){Xe(L)}finally{ee(!1)}}}async function sn(L){try{await je.deleteChat(L.id),await Gt(),an.current===L.id&&A(null),ze(j("app.channelDeleted"))}catch(K){Xe(K)}}async function zt(L,K){try{hi(await je.pin(L.id,K))}catch(he){Xe(he)}}async function Vt(L,K){try{hi(await je.mute(L.id,K))}catch(he){Xe(he)}}async function ua(L,K){try{await je.deleteBot(L.id,K);const he=new Set(v.filter(Ne=>Ne.type==="dm"&&Ne.botId===L.id).map(Ne=>Ne.id));y(Ne=>Ne.filter(Se=>!he.has(Se.id)).map(Se=>Se.memberIds.includes(L.id)?{...Se,memberIds:Se.memberIds.filter(Te=>Te!==L.id)}:Se)),c(Ne=>Ne.filter(Se=>Se.id!==L.id)),ca(),an.current&&he.has(an.current)&&A(null),B===L.id&&P(null),ze(j("app.botDeleted",{name:L.name}))}catch(he){Xe(he)}}async function da(L,K,he,Ne,Se){const Te=T;await je.send(Te,L,K,he,!1,Ne,Se);const Le=pe.current.find(Me=>Me.id===Te),Qe=(Le==null?void 0:Le.type)==="channel"?[...new Set(dv(L,ra(x)).filter(Me=>!Le.memberIds.includes(Me.member.id)).map(Me=>Me.member.name))]:[];Qe.length&&ze(j("app.notInChannel",{names:Qe.join(j("common.listSeparator")),count:Qe.length})),await Promise.all([ll(Te),Gt()])}function Xi(L,K){je.addMember(L,K.id).then(he=>{hi(he),ze(j("app.memberAdded",{name:K.name,channel:he.title}))}).catch(Xe)}async function Qi(L){try{const K=await je.openThread(L.id);$({kind:"thread",id:K.id,parentId:L.chatId,mode:"pane"})}catch(K){Xe(K)}}function Oi(L,K){const he=v.find(Ne=>Ne.id===L.parentId);he&&fi(he),$(K?{kind:"thread",id:L.id,parentId:L.parentId,mode:"pane"}:null)}function Kn(L){P(null);const K=v.find(he=>he.id===(L.type==="thread"?L.parentId:L.id));K&&fi(K),L.type==="thread"&&$({kind:"thread",id:L.id,parentId:L.parentId,mode:"pane"})}async function Ki(L,K,he){try{const Ne=await je.react(L.id,K,he);yn(Se=>Se.map(Te=>Te.id===Ne.id?{...Te,reactions:Ne.reactions}:Te))}catch(Ne){Xe(Ne)}}function mi(L){EC(Be,L,x)}const pi=(L,K)=>L?void We.toMessage(L,K).then(async he=>{he&&Ut.openMessage(await je.chat(he),L,K)}).catch(()=>ze(j("app.sourceGone"))):ze(j("app.sourceGone"));function fa(L){me(K=>K.map(he=>he.id===L.id?{...he,...L}:he)),je.followedThreads().then(K=>me(K.threads)).catch(()=>{})}function sl(L){L.preventDefault();const K=Ne=>re(Math.min(Math.max(340,window.innerWidth-Ne.clientX),Math.round(window.innerWidth*.6))),he=()=>{window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",he),document.body.style.cursor=""};window.addEventListener("pointermove",K),window.addEventListener("pointerup",he),document.body.style.cursor="col-resize"}async function gi(){try{await Be.clear(L=>je.removeAttachment(L)),await je.logout(),i("login"),Q(!1),q(null),m.current.clear(),f({}),$(null),me([]),l(""),A(null),y([]),c([]),z([]),yn([])}catch(L){Xe(L)}}const yr=e==="ready"&&v.some(L=>L.id===T);k.useEffect(()=>{const L=Fe.current;if(!L)return;let K=0,he=L.clientHeight;const Ne=()=>{K=L.scrollHeight-L.scrollTop-L.clientHeight},Se=new ResizeObserver(()=>{L.clientHeight!==he&&(he=L.clientHeight,L.scrollTo({top:L.scrollHeight-L.clientHeight-K,behavior:"instant"}))}),Te=new MutationObserver(Ne);return Ne(),L.addEventListener("scroll",Ne,{passive:!0}),Se.observe(L),Te.observe(L,{childList:!0,subtree:!0,characterData:!0}),()=>{Se.disconnect(),Te.disconnect(),L.removeEventListener("scroll",Ne)}},[yr]);const Zn=v.find(L=>L.id===T),ha=(Zn==null?void 0:Zn.type)==="channel",Jn=_9(e==="ready"?(va=v.find(L=>L.id===T&&L.type==="dm"))==null?void 0:va.botId:void 0,be);if(e==="loading")return u.jsx("div",{className:"jarvy-loading",children:j("app.connecting")});if(e==="login")return u.jsx(bB,{onLogin:L=>void Rn(L).catch(Xe)});const rn=v.find(L=>L.id===T),cn=s.find(L=>L.id===((rn==null?void 0:rn.botId)??I))??s[0],ma=!!(cn!=null&&cn.connectionId),Wn=ha||ma,ei=(cn==null?void 0:cn.name)??"Jarvy",_n=cn?d[cn.id]:void 0,Lt=_n!=null&&_n.error?j("activity.error"):(_n==null?void 0:_n.status)==="running"?sC(_n.activity):"",Mt=(ue=[...Ht].reverse().find(L=>{var K;return((K=L.question)==null?void 0:K.state)==="pending"}))==null?void 0:ue.id,$t=(H==null?void 0:H.kind)==="thread"?H:null,xn=($t==null?void 0:$t.mode)==="full",cl=ha?Zn:void 0,br=s.find(L=>L.id===B),xr=new Set(Object.values(d).filter(L=>L.status==="running"&&L.activity!=="asking").map(L=>L.botId)),pa=new Set(Object.values(d).filter(L=>L.activity==="asking").map(L=>L.botId));return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"ui-app","data-nav":O?"":void 0,"data-pane":H&&!xn?"":void 0,style:{"--ui-pane":`${xe}px`},children:[u.jsx(UI,{username:a,chats:v,sections:g,bots:s,members:x,followed:ce,followedOpen:fe&&!xn,working:xr,asking:pa,selected:fe?null:T,filter:ne,creating:J,createMenu:U,accountMenu:W,onFilterChange:_,onOpenFollowed:()=>{ye(!0),$(null),F(!1)},onOpenChat:fi,onOpenBot:L=>void ao(L.id),onOpenMenu:(L,K)=>vn({target:L,at:K}),onEditSection:L=>C({kind:"section",section:L}),onCreate:L=>{if(L==="bot")return void Gi();C({kind:L}),X(!1)},onFind:Ut.openMessage,onOpenFound:Kn,onError:Xe,onToggleCreate:L=>{X(L),Q(!1)},onToggleAccount:L=>{Q(L),X(!1)},onSettings:()=>{Q(!1),q("general")},onToggleTheme:()=>{Bd(document.documentElement.classList.contains("dark")?"light":"dark"),Q(!1)},onLogOut:()=>void gi()}),u.jsx(O9,{chat:rn,inChannel:ha,bots:s,members:x,meId:Ue,drafts:Be,composeReady:Wn,botName:ei,activeBot:cn,status:_n,connections:V,activity:Lt,history:We,divider:N[(rn==null?void 0:rn.id)??""]??(rn==null?void 0:rn.readSequence)??0,activeQuestion:Mt,pane:H,onPane:$,onToggleInfo:ol,find:Ut,onNav:()=>F(!0),onBot:L=>P(L),hasBotDirects:Jn.length>0,onInvite:Xi,onQuote:mi,onReply:L=>void Qi(L),onReact:(L,K,he)=>void Ki(L,K,he),onJump:pi,onSettled:L=>yn(K=>K.map(he=>he.id===L.id?L:he)),onPreview:(L,K)=>At({files:L,index:K}),onSend:da,notice:ze,onSaveNote:async L=>{try{hi(await je.setNote(rn.id,L))}catch(K){throw Xe(K),K}},createBot:()=>void Gi(),creating:J,updateBot:bn,onManageModels:()=>q("models"),error:Xe,chatArea:ht,transcript:Fe,composeWrap:ot,hidden:xn||fe,onOpenThread:L=>$({kind:"thread",id:L,parentId:rn.id,mode:"pane"})}),u.jsx(F9,{pane:H,followedView:fe,followed:ce,chats:v,sections:g,members:x,bots:s,statuses:d,meId:Ue,drafts:Be,tick:be,paneChannel:cl,activeBot:cn,botDirects:Jn,find:Ut,onPane:$,onNav:()=>F(!0),onBackToChannel:Oi,onAddMembers:L=>C({kind:"members",chat:L}),onOpenBot:P,onPin:L=>void zt(L,!L.pinned),onMute:L=>void Vt(L,!L.muted),onDeleteChannel:L=>di({kind:"chat",chat:L}),onChannelSaved:hi,onThreadChanged:fa,onInvite:Xi,onPreview:(L,K)=>At({files:L,index:K}),onNotice:ze,onError:Xe,paneWidth:xe,onResize:sl})]}),O&&u.jsx("div",{className:"ui-nav-scrim",onClick:()=>F(!1),role:"presentation"}),Y&&u.jsx(hB,{connections:V,initialTab:Y,onChanged:sa,onClose:()=>q(null)}),u.jsx(AI,{dialog:S,entryMenu:gn,confirm:Hn,preview:Je,infoBot:br,bots:s,statuses:d,chats:v,sections:g,members:x,connections:V,meId:Ue,onDialog:C,onEntryMenu:vn,onConfirm:di,onPreview:At,onInfoBot:P,onSettings:()=>q("models"),onChannelInfo:L=>{fi(L),$({kind:"info",page:"main"})},onOpenChatId:L=>{A(L),F(!1)},chatSaved:hi,openChat:fi,onSectionSaved:L=>{b(K=>K.some(he=>he.id===L.id)?K.map(he=>he.id===L.id?L:he):[...K,L]),C(null)},onSectionDeleted:L=>{C(null),b(K=>K.filter(he=>he.id!==L)),Gt().catch(Xe)},updateBot:bn,openAnywhere:Kn,removeChannel:sn,deleteBot:ua,pinChat:zt,muteChat:Vt}),Ee&&u.jsx("div",{className:"ui-toast",role:"status",children:Ee}),jB]})}function SB(){return D2(),u.jsx(wB,{})}OT.createRoot(document.getElementById("root")).render(u.jsx(k.StrictMode,{children:u.jsx(SB,{})}));