kaizenai 0.2.2 → 0.4.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.
- package/bin/kaizen +16 -5
- package/dist/client/app-icon-180.png +0 -0
- package/dist/client/app-icon-192.png +0 -0
- package/dist/client/app-icon-512.png +0 -0
- package/dist/client/app-icon-96.png +0 -0
- package/dist/client/apple-touch-icon.png +0 -0
- package/dist/client/assets/index-BR0jGwm_.css +32 -0
- package/dist/client/assets/index-CYqy6l6r.js +628 -0
- package/dist/client/favicon.png +0 -0
- package/dist/client/index.html +17 -10
- package/dist/client/manifest-dark.webmanifest +3 -3
- package/dist/client/manifest.webmanifest +3 -3
- package/dist/client/pwa-192.png +0 -0
- package/dist/client/pwa-512.png +0 -0
- package/dist/server/cli-supervisor.js +307 -0
- package/dist/server/cli.js +12371 -0
- package/package.json +7 -9
- package/dist/client/assets/index-Cojjg8ln.js +0 -598
- package/dist/client/assets/index-lSe049cB.css +0 -32
- package/src/server/acp-shared.ts +0 -315
- package/src/server/agent.ts +0 -1121
- package/src/server/attachments.ts +0 -133
- package/src/server/backgrounds.ts +0 -74
- package/src/server/cli-runtime.ts +0 -375
- package/src/server/cli-supervisor.ts +0 -97
- package/src/server/cli.ts +0 -68
- package/src/server/codex-app-server-protocol.ts +0 -453
- package/src/server/codex-app-server.ts +0 -1350
- package/src/server/cursor-acp.ts +0 -819
- package/src/server/discovery.ts +0 -322
- package/src/server/event-store.ts +0 -1369
- package/src/server/events.ts +0 -244
- package/src/server/external-open.ts +0 -272
- package/src/server/gemini-acp.ts +0 -844
- package/src/server/gemini-cli.ts +0 -525
- package/src/server/generate-title.ts +0 -36
- package/src/server/git-manager.ts +0 -79
- package/src/server/git-repository.ts +0 -101
- package/src/server/harness-types.ts +0 -20
- package/src/server/keybindings.ts +0 -177
- package/src/server/machine-name.ts +0 -22
- package/src/server/paths.ts +0 -112
- package/src/server/process-utils.ts +0 -22
- package/src/server/project-icon.ts +0 -352
- package/src/server/project-metadata.ts +0 -10
- package/src/server/provider-catalog.ts +0 -85
- package/src/server/provider-settings.ts +0 -155
- package/src/server/quick-response.ts +0 -153
- package/src/server/read-models.ts +0 -275
- package/src/server/recovery.ts +0 -507
- package/src/server/restart.ts +0 -56
- package/src/server/server.ts +0 -244
- package/src/server/terminal-manager.ts +0 -350
- package/src/server/theme-settings.ts +0 -179
- package/src/server/update-manager.ts +0 -230
- package/src/server/usage/base-provider-usage.ts +0 -57
- package/src/server/usage/claude-usage.ts +0 -558
- package/src/server/usage/codex-usage.ts +0 -144
- package/src/server/usage/cursor-browser.ts +0 -120
- package/src/server/usage/cursor-cookies.ts +0 -390
- package/src/server/usage/cursor-usage.ts +0 -490
- package/src/server/usage/gemini-usage.ts +0 -24
- package/src/server/usage/provider-usage.ts +0 -61
- package/src/server/usage/test-helpers.ts +0 -9
- package/src/server/usage/types.ts +0 -54
- package/src/server/usage/utils.ts +0 -325
- package/src/server/ws-router.ts +0 -709
- package/src/shared/branding.ts +0 -83
- package/src/shared/dev-ports.ts +0 -43
- package/src/shared/ports.ts +0 -2
- package/src/shared/protocol.ts +0 -152
- package/src/shared/tools.ts +0 -251
- package/src/shared/types.ts +0 -1028
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
var k4=Object.defineProperty;var WC=e=>{throw TypeError(e)};var E4=(e,t,n)=>t in e?k4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Vn=(e,t,n)=>E4(e,typeof t!="symbol"?t+"":t,n),VC=(e,t,n)=>t.has(e)||WC("Cannot "+n);var Au=(e,t,n)=>(VC(e,t,"read from private field"),n?n.call(e):t.get(e)),qC=(e,t,n)=>t.has(e)?WC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),KC=(e,t,n,r)=>(VC(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function R4(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function cp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cb={exports:{}},Du={};/**
|
|
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 GC;function T4(){if(GC)return Du;GC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,o){var l=null;if(o!==void 0&&(l=""+o),s.key!==void 0&&(l=""+s.key),"key"in s){o={};for(var u in s)u!=="key"&&(o[u]=s[u])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:o}}return Du.Fragment=t,Du.jsx=n,Du.jsxs=n,Du}var YC;function N4(){return YC||(YC=1,cb.exports=T4()),cb.exports}var f=N4(),ub={exports:{}},at={};/**
|
|
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 XC;function M4(){if(XC)return at;XC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),v=Symbol.iterator;function y(P){return P===null||typeof P!="object"?null:(P=v&&P[v]||P["@@iterator"],typeof P=="function"?P:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(P,Z,A){this.props=P,this.context=Z,this.refs=C,this.updater=A||w}k.prototype.isReactComponent={},k.prototype.setState=function(P,Z){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,Z,"setState")},k.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function R(){}R.prototype=k.prototype;function E(P,Z,A){this.props=P,this.context=Z,this.refs=C,this.updater=A||w}var N=E.prototype=new R;N.constructor=E,S(N,k.prototype),N.isPureReactComponent=!0;var L=Array.isArray;function D(){}var j={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function G(P,Z,A){var ie=A.ref;return{$$typeof:e,type:P,key:Z,ref:ie!==void 0?ie:null,props:A}}function B(P,Z){return G(P.type,Z,P.props)}function q(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function I(P){var Z={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(A){return Z[A]})}var V=/\/+/g;function F(P,Z){return typeof P=="object"&&P!==null&&P.key!=null?I(""+P.key):Z.toString(36)}function W(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(D,D):(P.status="pending",P.then(function(Z){P.status==="pending"&&(P.status="fulfilled",P.value=Z)},function(Z){P.status==="pending"&&(P.status="rejected",P.reason=Z)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function O(P,Z,A,ie,J){var ee=typeof P;(ee==="undefined"||ee==="boolean")&&(P=null);var re=!1;if(P===null)re=!0;else switch(ee){case"bigint":case"string":case"number":re=!0;break;case"object":switch(P.$$typeof){case e:case t:re=!0;break;case g:return re=P._init,O(re(P._payload),Z,A,ie,J)}}if(re)return J=J(P),re=ie===""?"."+F(P,0):ie,L(J)?(A="",re!=null&&(A=re.replace(V,"$&/")+"/"),O(J,Z,A,"",function(pe){return pe})):J!=null&&(q(J)&&(J=B(J,A+(J.key==null||P&&P.key===J.key?"":(""+J.key).replace(V,"$&/")+"/")+re)),Z.push(J)),1;re=0;var ce=ie===""?".":ie+":";if(L(P))for(var he=0;he<P.length;he++)ie=P[he],ee=ce+F(ie,he),re+=O(ie,Z,A,ee,J);else if(he=y(P),typeof he=="function")for(P=he.call(P),he=0;!(ie=P.next()).done;)ie=ie.value,ee=ce+F(ie,he++),re+=O(ie,Z,A,ee,J);else if(ee==="object"){if(typeof P.then=="function")return O(W(P),Z,A,ie,J);throw Z=String(P),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return re}function $(P,Z,A){if(P==null)return P;var ie=[],J=0;return O(P,ie,"","",function(ee){return Z.call(A,ee,J++)}),ie}function U(P){if(P._status===-1){var Z=P._result;Z=Z(),Z.then(function(A){(P._status===0||P._status===-1)&&(P._status=1,P._result=A)},function(A){(P._status===0||P._status===-1)&&(P._status=2,P._result=A)}),P._status===-1&&(P._status=0,P._result=Z)}if(P._status===1)return P._result.default;throw P._result}var X=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},M={map:$,forEach:function(P,Z,A){$(P,function(){Z.apply(this,arguments)},A)},count:function(P){var Z=0;return $(P,function(){Z++}),Z},toArray:function(P){return $(P,function(Z){return Z})||[]},only:function(P){if(!q(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return at.Activity=p,at.Children=M,at.Component=k,at.Fragment=n,at.Profiler=s,at.PureComponent=E,at.StrictMode=r,at.Suspense=h,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,at.__COMPILER_RUNTIME={__proto__:null,c:function(P){return j.H.useMemoCache(P)}},at.cache=function(P){return function(){return P.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(P,Z,A){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var ie=S({},P.props),J=P.key;if(Z!=null)for(ee in Z.key!==void 0&&(J=""+Z.key),Z)!H.call(Z,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&Z.ref===void 0||(ie[ee]=Z[ee]);var ee=arguments.length-2;if(ee===1)ie.children=A;else if(1<ee){for(var re=Array(ee),ce=0;ce<ee;ce++)re[ce]=arguments[ce+2];ie.children=re}return G(P.type,J,ie)},at.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},at.createElement=function(P,Z,A){var ie,J={},ee=null;if(Z!=null)for(ie in Z.key!==void 0&&(ee=""+Z.key),Z)H.call(Z,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(J[ie]=Z[ie]);var re=arguments.length-2;if(re===1)J.children=A;else if(1<re){for(var ce=Array(re),he=0;he<re;he++)ce[he]=arguments[he+2];J.children=ce}if(P&&P.defaultProps)for(ie in re=P.defaultProps,re)J[ie]===void 0&&(J[ie]=re[ie]);return G(P,ee,J)},at.createRef=function(){return{current:null}},at.forwardRef=function(P){return{$$typeof:u,render:P}},at.isValidElement=q,at.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:U}},at.memo=function(P,Z){return{$$typeof:d,type:P,compare:Z===void 0?null:Z}},at.startTransition=function(P){var Z=j.T,A={};j.T=A;try{var ie=P(),J=j.S;J!==null&&J(A,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(D,X)}catch(ee){X(ee)}finally{Z!==null&&A.types!==null&&(Z.types=A.types),j.T=Z}},at.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},at.use=function(P){return j.H.use(P)},at.useActionState=function(P,Z,A){return j.H.useActionState(P,Z,A)},at.useCallback=function(P,Z){return j.H.useCallback(P,Z)},at.useContext=function(P){return j.H.useContext(P)},at.useDebugValue=function(){},at.useDeferredValue=function(P,Z){return j.H.useDeferredValue(P,Z)},at.useEffect=function(P,Z){return j.H.useEffect(P,Z)},at.useEffectEvent=function(P){return j.H.useEffectEvent(P)},at.useId=function(){return j.H.useId()},at.useImperativeHandle=function(P,Z,A){return j.H.useImperativeHandle(P,Z,A)},at.useInsertionEffect=function(P,Z){return j.H.useInsertionEffect(P,Z)},at.useLayoutEffect=function(P,Z){return j.H.useLayoutEffect(P,Z)},at.useMemo=function(P,Z){return j.H.useMemo(P,Z)},at.useOptimistic=function(P,Z){return j.H.useOptimistic(P,Z)},at.useReducer=function(P,Z,A){return j.H.useReducer(P,Z,A)},at.useRef=function(P){return j.H.useRef(P)},at.useState=function(P){return j.H.useState(P)},at.useSyncExternalStore=function(P,Z,A){return j.H.useSyncExternalStore(P,Z,A)},at.useTransition=function(){return j.H.useTransition()},at.version="19.2.1",at}var ZC;function _x(){return ZC||(ZC=1,ub.exports=M4()),ub.exports}var b=_x();const xe=cp(b),uT=R4({__proto__:null,default:xe},[b]);var db={exports:{}},ju={},hb={exports:{}},fb={};/**
|
|
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 QC;function A4(){return QC||(QC=1,function(e){function t(O,$){var U=O.length;O.push($);e:for(;0<U;){var X=U-1>>>1,M=O[X];if(0<s(M,$))O[X]=$,O[U]=M,U=X;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var $=O[0],U=O.pop();if(U!==$){O[0]=U;e:for(var X=0,M=O.length,P=M>>>1;X<P;){var Z=2*(X+1)-1,A=O[Z],ie=Z+1,J=O[ie];if(0>s(A,U))ie<M&&0>s(J,A)?(O[X]=J,O[ie]=U,X=ie):(O[X]=A,O[Z]=U,X=Z);else if(ie<M&&0>s(J,U))O[X]=J,O[ie]=U,X=ie;else break e}}return $}function s(O,$){var U=O.sortIndex-$.sortIndex;return U!==0?U:O.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var h=[],d=[],g=1,p=null,v=3,y=!1,w=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function N(O){for(var $=n(d);$!==null;){if($.callback===null)r(d);else if($.startTime<=O)r(d),$.sortIndex=$.expirationTime,t(h,$);else break;$=n(d)}}function L(O){if(S=!1,N(O),!w)if(n(h)!==null)w=!0,D||(D=!0,I());else{var $=n(d);$!==null&&W(L,$.startTime-O)}}var D=!1,j=-1,H=5,G=-1;function B(){return C?!0:!(e.unstable_now()-G<H)}function q(){if(C=!1,D){var O=e.unstable_now();G=O;var $=!0;try{e:{w=!1,S&&(S=!1,R(j),j=-1),y=!0;var U=v;try{t:{for(N(O),p=n(h);p!==null&&!(p.expirationTime>O&&B());){var X=p.callback;if(typeof X=="function"){p.callback=null,v=p.priorityLevel;var M=X(p.expirationTime<=O);if(O=e.unstable_now(),typeof M=="function"){p.callback=M,N(O),$=!0;break t}p===n(h)&&r(h),N(O)}else r(h);p=n(h)}if(p!==null)$=!0;else{var P=n(d);P!==null&&W(L,P.startTime-O),$=!1}}break e}finally{p=null,v=U,y=!1}$=void 0}}finally{$?I():D=!1}}}var I;if(typeof E=="function")I=function(){E(q)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,F=V.port2;V.port1.onmessage=q,I=function(){F.postMessage(null)}}else I=function(){k(q,0)};function W(O,$){j=k(function(){O(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(O){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var U=v;v=$;try{return O()}finally{v=U}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,$){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var U=v;v=O;try{return $()}finally{v=U}},e.unstable_scheduleCallback=function(O,$,U){var X=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?X+U:X):U=X,O){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=U+M,O={id:g++,callback:$,priorityLevel:O,startTime:U,expirationTime:M,sortIndex:-1},U>X?(O.sortIndex=U,t(d,O),n(h)===null&&O===n(d)&&(S?(R(j),j=-1):S=!0,W(L,U-X))):(O.sortIndex=M,t(h,O),w||y||(w=!0,D||(D=!0,I()))),O},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(O){var $=v;return function(){var U=v;v=$;try{return O.apply(this,arguments)}finally{v=U}}}}(fb)),fb}var JC;function D4(){return JC||(JC=1,hb.exports=A4()),hb.exports}var mb={exports:{}},xr={};/**
|
|
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 ek;function j4(){if(ek)return xr;ek=1;var e=_x();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,d,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:h,containerInfo:d,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return xr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,xr.createPortal=function(h,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(h,d,null,g)},xr.flushSync=function(h){var d=l.T,g=r.p;try{if(l.T=null,r.p=2,h)return h()}finally{l.T=d,r.p=g,r.d.f()}},xr.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(h,d))},xr.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},xr.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,p=u(g,d.crossOrigin),v=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:v,fetchPriority:y}):g==="script"&&r.d.X(h,{crossOrigin:p,integrity:v,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},xr.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=u(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(h)},xr.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,p=u(g,d.crossOrigin);r.d.L(h,g,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},xr.preloadModule=function(h,d){if(typeof h=="string")if(d){var g=u(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},xr.requestFormReset=function(h){r.d.r(h)},xr.unstable_batchedUpdates=function(h,d){return h(d)},xr.useFormState=function(h,d,g){return l.H.useFormState(h,d,g)},xr.useFormStatus=function(){return l.H.useHostTransitionStatus()},xr.version="19.2.1",xr}var tk;function dT(){if(tk)return mb.exports;tk=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(t){console.error(t)}}return e(),mb.exports=j4(),mb.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 nk;function O4(){if(nk)return ju;nk=1;var e=D4(),t=_x(),n=dT();function r(i){var a="https://react.dev/errors/"+i;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var a=i,c=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(c=a.return),i=a.return;while(i)}return a.tag===3?c:null}function l(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function u(i){if(i.tag===31){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function h(i){if(o(i)!==i)throw Error(r(188))}function d(i){var a=i.alternate;if(!a){if(a=o(i),a===null)throw Error(r(188));return a!==i?null:i}for(var c=i,m=a;;){var _=c.return;if(_===null)break;var x=_.alternate;if(x===null){if(m=_.return,m!==null){c=m;continue}break}if(_.child===x.child){for(x=_.child;x;){if(x===c)return h(_),i;if(x===m)return h(_),a;x=x.sibling}throw Error(r(188))}if(c.return!==m.return)c=_,m=x;else{for(var T=!1,z=_.child;z;){if(z===c){T=!0,c=_,m=x;break}if(z===m){T=!0,m=_,c=x;break}z=z.sibling}if(!T){for(z=x.child;z;){if(z===c){T=!0,c=x,m=_;break}if(z===m){T=!0,m=x,c=_;break}z=z.sibling}if(!T)throw Error(r(189))}}if(c.alternate!==m)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:a}function g(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i;for(i=i.child;i!==null;){if(a=g(i),a!==null)return a;i=i.sibling}return null}var p=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),E=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function I(i){return i===null||typeof i!="object"?null:(i=q&&i[q]||i["@@iterator"],typeof i=="function"?i:null)}var V=Symbol.for("react.client.reference");function F(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===V?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case D:return"SuspenseList";case G:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case E:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case N:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case j:return a=i.displayName||null,a!==null?a:F(i.type)||"Memo";case H:a=i._payload,i=i._init;try{return F(i(a))}catch{}}return null}var W=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},X=[],M=-1;function P(i){return{current:i}}function Z(i){0>M||(i.current=X[M],X[M]=null,M--)}function A(i,a){M++,X[M]=i.current,i.current=a}var ie=P(null),J=P(null),ee=P(null),re=P(null);function ce(i,a){switch(A(ee,a),A(J,i),A(ie,null),a.nodeType){case 9:case 11:i=(i=a.documentElement)&&(i=i.namespaceURI)?fC(i):0;break;default:if(i=a.tagName,a=a.namespaceURI)a=fC(a),i=mC(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Z(ie),A(ie,i)}function he(){Z(ie),Z(J),Z(ee)}function pe(i){i.memoizedState!==null&&A(re,i);var a=ie.current,c=mC(a,i.type);a!==c&&(A(J,i),A(ie,c))}function Se(i){J.current===i&&(Z(ie),Z(J)),re.current===i&&(Z(re),Ru._currentValue=U)}var Re,Ae;function Ke(i){if(Re===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);Re=a&&a[1]||"",Ae=-1<c.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Re+i+Ae}var yt=!1;function xt(i,a){if(!i||yt)return"";yt=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(a){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(de){var ue=de}Reflect.construct(i,[],_e)}else{try{_e.call()}catch(de){ue=de}i.call(_e.prototype)}}else{try{throw Error()}catch(de){ue=de}(_e=i())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(de){if(de&&ue&&typeof de.stack=="string")return[de.stack,ue.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=m.DetermineComponentFrameRoot(),T=x[0],z=x[1];if(T&&z){var Q=T.split(`
|
|
44
|
+
`),le=z.split(`
|
|
45
|
+
`);for(_=m=0;m<Q.length&&!Q[m].includes("DetermineComponentFrameRoot");)m++;for(;_<le.length&&!le[_].includes("DetermineComponentFrameRoot");)_++;if(m===Q.length||_===le.length)for(m=Q.length-1,_=le.length-1;1<=m&&0<=_&&Q[m]!==le[_];)_--;for(;1<=m&&0<=_;m--,_--)if(Q[m]!==le[_]){if(m!==1||_!==1)do if(m--,_--,0>_||Q[m]!==le[_]){var ge=`
|
|
46
|
+
`+Q[m].replace(" at new "," at ");return i.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",i.displayName)),ge}while(1<=m&&0<=_);break}}}finally{yt=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Ke(c):""}function fe(i,a){switch(i.tag){case 26:case 27:case 5:return Ke(i.type);case 16:return Ke("Lazy");case 13:return i.child!==a&&a!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return xt(i.type,!1);case 11:return xt(i.type.render,!1);case 1:return xt(i.type,!0);case 31:return Ke("Activity");default:return""}}function Ie(i){try{var a="",c=null;do a+=fe(i,c),c=i,i=i.return;while(i);return a}catch(m){return`
|
|
47
|
+
Error generating stack: `+m.message+`
|
|
48
|
+
`+m.stack}}var De=Object.prototype.hasOwnProperty,lt=e.unstable_scheduleCallback,st=e.unstable_cancelCallback,nt=e.unstable_shouldYield,rn=e.unstable_requestPaint,Ce=e.unstable_now,Ze=e.unstable_getCurrentPriorityLevel,oe=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,Me=e.unstable_LowPriority,Ge=e.unstable_IdlePriority,Ct=e.log,Je=e.unstable_setDisableYieldValue,je=null,We=null;function ut(i){if(typeof Ct=="function"&&Je(i),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(je,i)}catch{}}var Ue=Math.clz32?Math.clz32:Ye,sn=Math.log,Yt=Math.LN2;function Ye(i){return i>>>=0,i===0?32:31-(sn(i)/Yt|0)|0}var qt=256,jn=262144,Wt=4194304;function Bt(i){var a=i&42;if(a!==0)return a;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Pe(i,a,c){var m=i.pendingLanes;if(m===0)return 0;var _=0,x=i.suspendedLanes,T=i.pingedLanes;i=i.warmLanes;var z=m&134217727;return z!==0?(m=z&~x,m!==0?_=Bt(m):(T&=z,T!==0?_=Bt(T):c||(c=z&~i,c!==0&&(_=Bt(c))))):(z=m&~x,z!==0?_=Bt(z):T!==0?_=Bt(T):c||(c=m&~i,c!==0&&(_=Bt(c)))),_===0?0:a!==0&&a!==_&&(a&x)===0&&(x=_&-_,c=a&-a,x>=c||x===32&&(c&4194048)!==0)?a:_}function dt(i,a){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&a)===0}function gt(i,a){switch(i){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 wt(){var i=Wt;return Wt<<=1,(Wt&62914560)===0&&(Wt=4194304),i}function Vt(i){for(var a=[],c=0;31>c;c++)a.push(i);return a}function ht(i,a){i.pendingLanes|=a,a!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ft(i,a,c,m,_,x){var T=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var z=i.entanglements,Q=i.expirationTimes,le=i.hiddenUpdates;for(c=T&~c;0<c;){var ge=31-Ue(c),_e=1<<ge;z[ge]=0,Q[ge]=-1;var ue=le[ge];if(ue!==null)for(le[ge]=null,ge=0;ge<ue.length;ge++){var de=ue[ge];de!==null&&(de.lane&=-536870913)}c&=~_e}m!==0&&pn(i,m,0),x!==0&&_===0&&i.tag!==0&&(i.suspendedLanes|=x&~(T&~a))}function pn(i,a,c){i.pendingLanes|=a,i.suspendedLanes&=~a;var m=31-Ue(a);i.entangledLanes|=a,i.entanglements[m]=i.entanglements[m]|1073741824|c&261930}function ke(i,a){var c=i.entangledLanes|=a;for(i=i.entanglements;c;){var m=31-Ue(c),_=1<<m;_&a|i[m]&a&&(i[m]|=a),c&=~_}}function Oe(i,a){var c=a&-a;return c=(c&42)!==0?1:St(c),(c&(i.suspendedLanes|a))!==0?0:c}function St(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function ot(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function on(){var i=$.p;return i!==0?i:(i=window.event,i===void 0?32:PC(i.type))}function dn(i,a){var c=$.p;try{return $.p=i,a()}finally{$.p=c}}var Xt=Math.random().toString(36).slice(2),It="__reactFiber$"+Xt,Ft="__reactProps$"+Xt,yr="__reactContainer$"+Xt,ts="__reactEvents$"+Xt,dl="__reactListeners$"+Xt,K="__reactHandles$"+Xt,rt="__reactResources$"+Xt,On="__reactMarker$"+Xt;function ns(i){delete i[It],delete i[Ft],delete i[ts],delete i[dl],delete i[K]}function mi(i){var a=i[It];if(a)return a;for(var c=i.parentNode;c;){if(a=c[yr]||c[It]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(i=xC(i);i!==null;){if(c=i[It])return c;i=xC(i)}return a}i=c,c=i.parentNode}return null}function Ot(i){if(i=i[It]||i[yr]){var a=i.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return i}return null}function Tn(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i.stateNode;throw Error(r(33))}function rs(i){var a=i[rt];return a||(a=i[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Ln(i){i[On]=!0}var lh=new Set,ch={};function Ns(i,a){vo(i,a),vo(i+"Capture",a)}function vo(i,a){for(ch[i]=a,i=0;i<a.length;i++)lh.add(a[i])}var ng=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]*$"),uh={},dh={};function rg(i){return De.call(dh,i)?!0:De.call(uh,i)?!1:ng.test(i)?dh[i]=!0:(uh[i]=!0,!1)}function hl(i,a,c){if(rg(a))if(c===null)i.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(a);return;case"boolean":var m=a.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){i.removeAttribute(a);return}}i.setAttribute(a,""+c)}}function fl(i,a,c){if(c===null)i.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttribute(a,""+c)}}function Ii(i,a,c,m){if(m===null)i.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(a,c,""+m)}}function ur(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function hh(i){var a=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ig(i,a,c){var m=Object.getOwnPropertyDescriptor(i.constructor.prototype,a);if(!i.hasOwnProperty(a)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var _=m.get,x=m.set;return Object.defineProperty(i,a,{configurable:!0,get:function(){return _.call(this)},set:function(T){c=""+T,x.call(this,T)}}),Object.defineProperty(i,a,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(T){c=""+T},stopTracking:function(){i._valueTracker=null,delete i[a]}}}}function Hc(i){if(!i._valueTracker){var a=hh(i)?"checked":"value";i._valueTracker=ig(i,a,""+i[a])}}function Uc(i){if(!i)return!1;var a=i._valueTracker;if(!a)return!0;var c=a.getValue(),m="";return i&&(m=hh(i)?i.checked?"true":"false":i.value),i=m,i!==c?(a.setValue(i),!0):!1}function da(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var fh=/[\n"\\]/g;function Y(i){return i.replace(fh,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ne(i,a,c,m,_,x,T,z){i.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?i.type=T:i.removeAttribute("type"),a!=null?T==="number"?(a===0&&i.value===""||i.value!=a)&&(i.value=""+ur(a)):i.value!==""+ur(a)&&(i.value=""+ur(a)):T!=="submit"&&T!=="reset"||i.removeAttribute("value"),a!=null?Fe(i,T,ur(a)):c!=null?Fe(i,T,ur(c)):m!=null&&i.removeAttribute("value"),_==null&&x!=null&&(i.defaultChecked=!!x),_!=null&&(i.checked=_&&typeof _!="function"&&typeof _!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?i.name=""+ur(z):i.removeAttribute("name")}function we(i,a,c,m,_,x,T,z){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),a!=null||c!=null){if(!(x!=="submit"&&x!=="reset"||a!=null)){Hc(i);return}c=c!=null?""+ur(c):"",a=a!=null?""+ur(a):c,z||a===i.value||(i.value=a),i.defaultValue=a}m=m??_,m=typeof m!="function"&&typeof m!="symbol"&&!!m,i.checked=z?i.checked:!!m,i.defaultChecked=!!m,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(i.name=T),Hc(i)}function Fe(i,a,c){a==="number"&&da(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function Dt(i,a,c,m){if(i=i.options,a){a={};for(var _=0;_<c.length;_++)a["$"+c[_]]=!0;for(c=0;c<i.length;c++)_=a.hasOwnProperty("$"+i[c].value),i[c].selected!==_&&(i[c].selected=_),_&&m&&(i[c].defaultSelected=!0)}else{for(c=""+ur(c),a=null,_=0;_<i.length;_++){if(i[_].value===c){i[_].selected=!0,m&&(i[_].defaultSelected=!0);return}a!==null||i[_].disabled||(a=i[_])}a!==null&&(a.selected=!0)}}function gn(i,a,c){if(a!=null&&(a=""+ur(a),a!==i.value&&(i.value=a),c==null)){i.defaultValue!==a&&(i.defaultValue=a);return}i.defaultValue=c!=null?""+ur(c):""}function dr(i,a,c,m){if(a==null){if(m!=null){if(c!=null)throw Error(r(92));if(W(m)){if(1<m.length)throw Error(r(93));m=m[0]}c=m}c==null&&(c=""),a=c}c=ur(a),i.defaultValue=c,m=i.textContent,m===c&&m!==""&&m!==null&&(i.value=m),Hc(i)}function Br(i,a){if(a){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=a;return}}i.textContent=a}var mh=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 $c(i,a,c){var m=a.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?i.setProperty(a,""):a==="float"?i.cssFloat="":i[a]="":m?i.setProperty(a,c):typeof c!="number"||c===0||mh.has(a)?a==="float"?i.cssFloat=c:i[a]=(""+c).trim():i[a]=c+"px"}function d1(i,a,c){if(a!=null&&typeof a!="object")throw Error(r(62));if(i=i.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||a!=null&&a.hasOwnProperty(m)||(m.indexOf("--")===0?i.setProperty(m,""):m==="float"?i.cssFloat="":i[m]="");for(var _ in a)m=a[_],a.hasOwnProperty(_)&&c[_]!==m&&$c(i,_,m)}else for(var x in a)a.hasOwnProperty(x)&&$c(i,x,a[x])}function sg(i){if(i.indexOf("-")===-1)return!1;switch(i){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 x3=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),w3=/^[\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 ph(i){return w3.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ms(){}var og=null;function ag(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ml=null,pl=null;function h1(i){var a=Ot(i);if(a&&(i=a.stateNode)){var c=i[Ft]||null;e:switch(i=a.stateNode,a.type){case"input":if(ne(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),a=c.name,c.type==="radio"&&a!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Y(""+a)+'"][type="radio"]'),a=0;a<c.length;a++){var m=c[a];if(m!==i&&m.form===i.form){var _=m[Ft]||null;if(!_)throw Error(r(90));ne(m,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(a=0;a<c.length;a++)m=c[a],m.form===i.form&&Uc(m)}break e;case"textarea":gn(i,c.value,c.defaultValue);break e;case"select":a=c.value,a!=null&&Dt(i,!!c.multiple,a,!1)}}}var lg=!1;function f1(i,a,c){if(lg)return i(a,c);lg=!0;try{var m=i(a);return m}finally{if(lg=!1,(ml!==null||pl!==null)&&(nf(),ml&&(a=ml,i=pl,pl=ml=null,h1(a),i)))for(a=0;a<i.length;a++)h1(i[a])}}function Wc(i,a){var c=i.stateNode;if(c===null)return null;var m=c[Ft]||null;if(m===null)return null;c=m[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(i=i.type,m=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!m;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,a,typeof c));return c}var As=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cg=!1;if(As)try{var Vc={};Object.defineProperty(Vc,"passive",{get:function(){cg=!0}}),window.addEventListener("test",Vc,Vc),window.removeEventListener("test",Vc,Vc)}catch{cg=!1}var bo=null,ug=null,gh=null;function m1(){if(gh)return gh;var i,a=ug,c=a.length,m,_="value"in bo?bo.value:bo.textContent,x=_.length;for(i=0;i<c&&a[i]===_[i];i++);var T=c-i;for(m=1;m<=T&&a[c-m]===_[x-m];m++);return gh=_.slice(i,1<m?1-m:void 0)}function vh(i){var a=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&a===13&&(i=13)):i=a,i===10&&(i=13),32<=i||i===13?i:0}function bh(){return!0}function p1(){return!1}function Ir(i){function a(c,m,_,x,T){this._reactName=c,this._targetInst=_,this.type=m,this.nativeEvent=x,this.target=T,this.currentTarget=null;for(var z in i)i.hasOwnProperty(z)&&(c=i[z],this[z]=c?c(x):x[z]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?bh:p1,this.isPropagationStopped=p1,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=bh)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=bh)},persist:function(){},isPersistent:bh}),a}var ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_h=Ir(ha),qc=p({},ha,{view:0,detail:0}),S3=Ir(qc),dg,hg,Kc,yh=p({},qc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mg,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Kc&&(Kc&&i.type==="mousemove"?(dg=i.screenX-Kc.screenX,hg=i.screenY-Kc.screenY):hg=dg=0,Kc=i),dg)},movementY:function(i){return"movementY"in i?i.movementY:hg}}),g1=Ir(yh),C3=p({},yh,{dataTransfer:0}),k3=Ir(C3),E3=p({},qc,{relatedTarget:0}),fg=Ir(E3),R3=p({},ha,{animationName:0,elapsedTime:0,pseudoElement:0}),T3=Ir(R3),N3=p({},ha,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),M3=Ir(N3),A3=p({},ha,{data:0}),v1=Ir(A3),D3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j3={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"},O3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L3(i){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(i):(i=O3[i])?!!a[i]:!1}function mg(){return L3}var z3=p({},qc,{key:function(i){if(i.key){var a=D3[i.key]||i.key;if(a!=="Unidentified")return a}return i.type==="keypress"?(i=vh(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?j3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mg,charCode:function(i){return i.type==="keypress"?vh(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?vh(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),P3=Ir(z3),B3=p({},yh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),b1=Ir(B3),I3=p({},qc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mg}),F3=Ir(I3),H3=p({},ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),U3=Ir(H3),$3=p({},yh,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),W3=Ir($3),V3=p({},ha,{newState:0,oldState:0}),q3=Ir(V3),K3=[9,13,27,32],pg=As&&"CompositionEvent"in window,Gc=null;As&&"documentMode"in document&&(Gc=document.documentMode);var G3=As&&"TextEvent"in window&&!Gc,_1=As&&(!pg||Gc&&8<Gc&&11>=Gc),y1=" ",x1=!1;function w1(i,a){switch(i){case"keyup":return K3.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function S1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var gl=!1;function Y3(i,a){switch(i){case"compositionend":return S1(a);case"keypress":return a.which!==32?null:(x1=!0,y1);case"textInput":return i=a.data,i===y1&&x1?null:i;default:return null}}function X3(i,a){if(gl)return i==="compositionend"||!pg&&w1(i,a)?(i=m1(),gh=ug=bo=null,gl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return _1&&a.locale!=="ko"?null:a.data;default:return null}}var Z3={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 C1(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a==="input"?!!Z3[i.type]:a==="textarea"}function k1(i,a,c,m){ml?pl?pl.push(m):pl=[m]:ml=m,a=uf(a,"onChange"),0<a.length&&(c=new _h("onChange","change",null,c,m),i.push({event:c,listeners:a}))}var Yc=null,Xc=null;function Q3(i){aC(i,0)}function xh(i){var a=Tn(i);if(Uc(a))return i}function E1(i,a){if(i==="change")return a}var R1=!1;if(As){var gg;if(As){var vg="oninput"in document;if(!vg){var T1=document.createElement("div");T1.setAttribute("oninput","return;"),vg=typeof T1.oninput=="function"}gg=vg}else gg=!1;R1=gg&&(!document.documentMode||9<document.documentMode)}function N1(){Yc&&(Yc.detachEvent("onpropertychange",M1),Xc=Yc=null)}function M1(i){if(i.propertyName==="value"&&xh(Xc)){var a=[];k1(a,Xc,i,ag(i)),f1(Q3,a)}}function J3(i,a,c){i==="focusin"?(N1(),Yc=a,Xc=c,Yc.attachEvent("onpropertychange",M1)):i==="focusout"&&N1()}function eO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return xh(Xc)}function tO(i,a){if(i==="click")return xh(a)}function nO(i,a){if(i==="input"||i==="change")return xh(a)}function rO(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var Qr=typeof Object.is=="function"?Object.is:rO;function Zc(i,a){if(Qr(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var c=Object.keys(i),m=Object.keys(a);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var _=c[m];if(!De.call(a,_)||!Qr(i[_],a[_]))return!1}return!0}function A1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function D1(i,a){var c=A1(i);i=0;for(var m;c;){if(c.nodeType===3){if(m=i+c.textContent.length,i<=a&&m>=a)return{node:c,offset:a-i};i=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=A1(c)}}function j1(i,a){return i&&a?i===a?!0:i&&i.nodeType===3?!1:a&&a.nodeType===3?j1(i,a.parentNode):"contains"in i?i.contains(a):i.compareDocumentPosition?!!(i.compareDocumentPosition(a)&16):!1:!1}function O1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var a=da(i.document);a instanceof i.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)i=a.contentWindow;else break;a=da(i.document)}return a}function bg(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a&&(a==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||a==="textarea"||i.contentEditable==="true")}var iO=As&&"documentMode"in document&&11>=document.documentMode,vl=null,_g=null,Qc=null,yg=!1;function L1(i,a,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;yg||vl==null||vl!==da(m)||(m=vl,"selectionStart"in m&&bg(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Qc&&Zc(Qc,m)||(Qc=m,m=uf(_g,"onSelect"),0<m.length&&(a=new _h("onSelect","select",null,a,c),i.push({event:a,listeners:m}),a.target=vl)))}function fa(i,a){var c={};return c[i.toLowerCase()]=a.toLowerCase(),c["Webkit"+i]="webkit"+a,c["Moz"+i]="moz"+a,c}var bl={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionrun:fa("Transition","TransitionRun"),transitionstart:fa("Transition","TransitionStart"),transitioncancel:fa("Transition","TransitionCancel"),transitionend:fa("Transition","TransitionEnd")},xg={},z1={};As&&(z1=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function ma(i){if(xg[i])return xg[i];if(!bl[i])return i;var a=bl[i],c;for(c in a)if(a.hasOwnProperty(c)&&c in z1)return xg[i]=a[c];return i}var P1=ma("animationend"),B1=ma("animationiteration"),I1=ma("animationstart"),sO=ma("transitionrun"),oO=ma("transitionstart"),aO=ma("transitioncancel"),F1=ma("transitionend"),H1=new Map,wg="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");wg.push("scrollEnd");function Fi(i,a){H1.set(i,a),Ns(a,[i])}var wh=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},pi=[],_l=0,Sg=0;function Sh(){for(var i=_l,a=Sg=_l=0;a<i;){var c=pi[a];pi[a++]=null;var m=pi[a];pi[a++]=null;var _=pi[a];pi[a++]=null;var x=pi[a];if(pi[a++]=null,m!==null&&_!==null){var T=m.pending;T===null?_.next=_:(_.next=T.next,T.next=_),m.pending=_}x!==0&&U1(c,_,x)}}function Ch(i,a,c,m){pi[_l++]=i,pi[_l++]=a,pi[_l++]=c,pi[_l++]=m,Sg|=m,i.lanes|=m,i=i.alternate,i!==null&&(i.lanes|=m)}function Cg(i,a,c,m){return Ch(i,a,c,m),kh(i)}function pa(i,a){return Ch(i,null,null,a),kh(i)}function U1(i,a,c){i.lanes|=c;var m=i.alternate;m!==null&&(m.lanes|=c);for(var _=!1,x=i.return;x!==null;)x.childLanes|=c,m=x.alternate,m!==null&&(m.childLanes|=c),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(_=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,_&&a!==null&&(_=31-Ue(c),i=x.hiddenUpdates,m=i[_],m===null?i[_]=[a]:m.push(a),a.lane=c|536870912),x):null}function kh(i){if(50<yu)throw yu=0,jv=null,Error(r(185));for(var a=i.return;a!==null;)i=a,a=i.return;return i.tag===3?i.stateNode:null}var yl={};function lO(i,a,c,m){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jr(i,a,c,m){return new lO(i,a,c,m)}function kg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ds(i,a){var c=i.alternate;return c===null?(c=Jr(i.tag,a,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=a,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,a=i.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function $1(i,a){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=a,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,a=c.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),i}function Eh(i,a,c,m,_,x){var T=0;if(m=i,typeof i=="function")kg(i)&&(T=1);else if(typeof i=="string")T=f4(i,c,ie.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case G:return i=Jr(31,c,a,_),i.elementType=G,i.lanes=x,i;case S:return ga(c.children,_,x,a);case C:T=8,_|=24;break;case k:return i=Jr(12,c,a,_|2),i.elementType=k,i.lanes=x,i;case L:return i=Jr(13,c,a,_),i.elementType=L,i.lanes=x,i;case D:return i=Jr(19,c,a,_),i.elementType=D,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case E:T=10;break e;case R:T=9;break e;case N:T=11;break e;case j:T=14;break e;case H:T=16,m=null;break e}T=29,c=Error(r(130,i===null?"null":typeof i,"")),m=null}return a=Jr(T,c,a,_),a.elementType=i,a.type=m,a.lanes=x,a}function ga(i,a,c,m){return i=Jr(7,i,m,a),i.lanes=c,i}function Eg(i,a,c){return i=Jr(6,i,null,a),i.lanes=c,i}function W1(i){var a=Jr(18,null,null,0);return a.stateNode=i,a}function Rg(i,a,c){return a=Jr(4,i.children!==null?i.children:[],i.key,a),a.lanes=c,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}var V1=new WeakMap;function gi(i,a){if(typeof i=="object"&&i!==null){var c=V1.get(i);return c!==void 0?c:(a={value:i,source:a,stack:Ie(a)},V1.set(i,a),a)}return{value:i,source:a,stack:Ie(a)}}var xl=[],wl=0,Rh=null,Jc=0,vi=[],bi=0,_o=null,is=1,ss="";function js(i,a){xl[wl++]=Jc,xl[wl++]=Rh,Rh=i,Jc=a}function q1(i,a,c){vi[bi++]=is,vi[bi++]=ss,vi[bi++]=_o,_o=i;var m=is;i=ss;var _=32-Ue(m)-1;m&=~(1<<_),c+=1;var x=32-Ue(a)+_;if(30<x){var T=_-_%5;x=(m&(1<<T)-1).toString(32),m>>=T,_-=T,is=1<<32-Ue(a)+_|c<<_|m,ss=x+i}else is=1<<x|c<<_|m,ss=i}function Tg(i){i.return!==null&&(js(i,1),q1(i,1,0))}function Ng(i){for(;i===Rh;)Rh=xl[--wl],xl[wl]=null,Jc=xl[--wl],xl[wl]=null;for(;i===_o;)_o=vi[--bi],vi[bi]=null,ss=vi[--bi],vi[bi]=null,is=vi[--bi],vi[bi]=null}function K1(i,a){vi[bi++]=is,vi[bi++]=ss,vi[bi++]=_o,is=a.id,ss=a.overflow,_o=i}var hr=null,hn=null,At=!1,yo=null,_i=!1,Mg=Error(r(519));function xo(i){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw eu(gi(a,i)),Mg}function G1(i){var a=i.stateNode,c=i.type,m=i.memoizedProps;switch(a[It]=i,a[Ft]=m,c){case"dialog":Et("cancel",a),Et("close",a);break;case"iframe":case"object":case"embed":Et("load",a);break;case"video":case"audio":for(c=0;c<wu.length;c++)Et(wu[c],a);break;case"source":Et("error",a);break;case"img":case"image":case"link":Et("error",a),Et("load",a);break;case"details":Et("toggle",a);break;case"input":Et("invalid",a),we(a,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Et("invalid",a);break;case"textarea":Et("invalid",a),dr(a,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||a.textContent===""+c||m.suppressHydrationWarning===!0||dC(a.textContent,c)?(m.popover!=null&&(Et("beforetoggle",a),Et("toggle",a)),m.onScroll!=null&&Et("scroll",a),m.onScrollEnd!=null&&Et("scrollend",a),m.onClick!=null&&(a.onclick=Ms),a=!0):a=!1,a||xo(i,!0)}function Y1(i){for(hr=i.return;hr;)switch(hr.tag){case 5:case 31:case 13:_i=!1;return;case 27:case 3:_i=!0;return;default:hr=hr.return}}function Sl(i){if(i!==hr)return!1;if(!At)return Y1(i),At=!0,!1;var a=i.tag,c;if((c=a!==3&&a!==27)&&((c=a===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||Gv(i.type,i.memoizedProps)),c=!c),c&&hn&&xo(i),Y1(i),a===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));hn=yC(i)}else if(a===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));hn=yC(i)}else a===27?(a=hn,Lo(i.type)?(i=Jv,Jv=null,hn=i):hn=a):hn=hr?xi(i.stateNode.nextSibling):null;return!0}function va(){hn=hr=null,At=!1}function Ag(){var i=yo;return i!==null&&($r===null?$r=i:$r.push.apply($r,i),yo=null),i}function eu(i){yo===null?yo=[i]:yo.push(i)}var Dg=P(null),ba=null,Os=null;function wo(i,a,c){A(Dg,a._currentValue),a._currentValue=c}function Ls(i){i._currentValue=Dg.current,Z(Dg)}function jg(i,a,c){for(;i!==null;){var m=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),i===c)break;i=i.return}}function Og(i,a,c,m){var _=i.child;for(_!==null&&(_.return=i);_!==null;){var x=_.dependencies;if(x!==null){var T=_.child;x=x.firstContext;e:for(;x!==null;){var z=x;x=_;for(var Q=0;Q<a.length;Q++)if(z.context===a[Q]){x.lanes|=c,z=x.alternate,z!==null&&(z.lanes|=c),jg(x.return,c,i),m||(T=null);break e}x=z.next}}else if(_.tag===18){if(T=_.return,T===null)throw Error(r(341));T.lanes|=c,x=T.alternate,x!==null&&(x.lanes|=c),jg(T,c,i),T=null}else T=_.child;if(T!==null)T.return=_;else for(T=_;T!==null;){if(T===i){T=null;break}if(_=T.sibling,_!==null){_.return=T.return,T=_;break}T=T.return}_=T}}function Cl(i,a,c,m){i=null;for(var _=a,x=!1;_!==null;){if(!x){if((_.flags&524288)!==0)x=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var T=_.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var z=_.type;Qr(_.pendingProps.value,T.value)||(i!==null?i.push(z):i=[z])}}else if(_===re.current){if(T=_.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(i!==null?i.push(Ru):i=[Ru])}_=_.return}i!==null&&Og(a,i,c,m),a.flags|=262144}function Th(i){for(i=i.firstContext;i!==null;){if(!Qr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function _a(i){ba=i,Os=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function fr(i){return X1(ba,i)}function Nh(i,a){return ba===null&&_a(i),X1(i,a)}function X1(i,a){var c=a._currentValue;if(a={context:a,memoizedValue:c,next:null},Os===null){if(i===null)throw Error(r(308));Os=a,i.dependencies={lanes:0,firstContext:a},i.flags|=524288}else Os=Os.next=a;return c}var cO=typeof AbortController<"u"?AbortController:function(){var i=[],a=this.signal={aborted:!1,addEventListener:function(c,m){i.push(m)}};this.abort=function(){a.aborted=!0,i.forEach(function(c){return c()})}},uO=e.unstable_scheduleCallback,dO=e.unstable_NormalPriority,zn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lg(){return{controller:new cO,data:new Map,refCount:0}}function tu(i){i.refCount--,i.refCount===0&&uO(dO,function(){i.controller.abort()})}var nu=null,zg=0,kl=0,El=null;function hO(i,a){if(nu===null){var c=nu=[];zg=0,kl=Iv(),El={status:"pending",value:void 0,then:function(m){c.push(m)}}}return zg++,a.then(Z1,Z1),a}function Z1(){if(--zg===0&&nu!==null){El!==null&&(El.status="fulfilled");var i=nu;nu=null,kl=0,El=null;for(var a=0;a<i.length;a++)(0,i[a])()}}function fO(i,a){var c=[],m={status:"pending",value:null,reason:null,then:function(_){c.push(_)}};return i.then(function(){m.status="fulfilled",m.value=a;for(var _=0;_<c.length;_++)(0,c[_])(a)},function(_){for(m.status="rejected",m.reason=_,_=0;_<c.length;_++)(0,c[_])(void 0)}),m}var Q1=O.S;O.S=function(i,a){LS=Ce(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&hO(i,a),Q1!==null&&Q1(i,a)};var ya=P(null);function Pg(){var i=ya.current;return i!==null?i:an.pooledCache}function Mh(i,a){a===null?A(ya,ya.current):A(ya,a.pool)}function J1(){var i=Pg();return i===null?null:{parent:zn._currentValue,pool:i}}var Rl=Error(r(460)),Bg=Error(r(474)),Ah=Error(r(542)),Dh={then:function(){}};function ew(i){return i=i.status,i==="fulfilled"||i==="rejected"}function tw(i,a,c){switch(c=i[c],c===void 0?i.push(a):c!==a&&(a.then(Ms,Ms),a=c),a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,rw(i),i;default:if(typeof a.status=="string")a.then(Ms,Ms);else{if(i=an,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=a,i.status="pending",i.then(function(m){if(a.status==="pending"){var _=a;_.status="fulfilled",_.value=m}},function(m){if(a.status==="pending"){var _=a;_.status="rejected",_.reason=m}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,rw(i),i}throw wa=a,Rl}}function xa(i){try{var a=i._init;return a(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(wa=c,Rl):c}}var wa=null;function nw(){if(wa===null)throw Error(r(459));var i=wa;return wa=null,i}function rw(i){if(i===Rl||i===Ah)throw Error(r(483))}var Tl=null,ru=0;function jh(i){var a=ru;return ru+=1,Tl===null&&(Tl=[]),tw(Tl,i,a)}function iu(i,a){a=a.props.ref,i.ref=a!==void 0?a:null}function Oh(i,a){throw a.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(a),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i)))}function iw(i){function a(se,te){if(i){var ae=se.deletions;ae===null?(se.deletions=[te],se.flags|=16):ae.push(te)}}function c(se,te){if(!i)return null;for(;te!==null;)a(se,te),te=te.sibling;return null}function m(se){for(var te=new Map;se!==null;)se.key!==null?te.set(se.key,se):te.set(se.index,se),se=se.sibling;return te}function _(se,te){return se=Ds(se,te),se.index=0,se.sibling=null,se}function x(se,te,ae){return se.index=ae,i?(ae=se.alternate,ae!==null?(ae=ae.index,ae<te?(se.flags|=67108866,te):ae):(se.flags|=67108866,te)):(se.flags|=1048576,te)}function T(se){return i&&se.alternate===null&&(se.flags|=67108866),se}function z(se,te,ae,be){return te===null||te.tag!==6?(te=Eg(ae,se.mode,be),te.return=se,te):(te=_(te,ae),te.return=se,te)}function Q(se,te,ae,be){var Qe=ae.type;return Qe===S?ge(se,te,ae.props.children,be,ae.key):te!==null&&(te.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===H&&xa(Qe)===te.type)?(te=_(te,ae.props),iu(te,ae),te.return=se,te):(te=Eh(ae.type,ae.key,ae.props,null,se.mode,be),iu(te,ae),te.return=se,te)}function le(se,te,ae,be){return te===null||te.tag!==4||te.stateNode.containerInfo!==ae.containerInfo||te.stateNode.implementation!==ae.implementation?(te=Rg(ae,se.mode,be),te.return=se,te):(te=_(te,ae.children||[]),te.return=se,te)}function ge(se,te,ae,be,Qe){return te===null||te.tag!==7?(te=ga(ae,se.mode,be,Qe),te.return=se,te):(te=_(te,ae),te.return=se,te)}function _e(se,te,ae){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Eg(""+te,se.mode,ae),te.return=se,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return ae=Eh(te.type,te.key,te.props,null,se.mode,ae),iu(ae,te),ae.return=se,ae;case w:return te=Rg(te,se.mode,ae),te.return=se,te;case H:return te=xa(te),_e(se,te,ae)}if(W(te)||I(te))return te=ga(te,se.mode,ae,null),te.return=se,te;if(typeof te.then=="function")return _e(se,jh(te),ae);if(te.$$typeof===E)return _e(se,Nh(se,te),ae);Oh(se,te)}return null}function ue(se,te,ae,be){var Qe=te!==null?te.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Qe!==null?null:z(se,te,""+ae,be);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case y:return ae.key===Qe?Q(se,te,ae,be):null;case w:return ae.key===Qe?le(se,te,ae,be):null;case H:return ae=xa(ae),ue(se,te,ae,be)}if(W(ae)||I(ae))return Qe!==null?null:ge(se,te,ae,be,null);if(typeof ae.then=="function")return ue(se,te,jh(ae),be);if(ae.$$typeof===E)return ue(se,te,Nh(se,ae),be);Oh(se,ae)}return null}function de(se,te,ae,be,Qe){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return se=se.get(ae)||null,z(te,se,""+be,Qe);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case y:return se=se.get(be.key===null?ae:be.key)||null,Q(te,se,be,Qe);case w:return se=se.get(be.key===null?ae:be.key)||null,le(te,se,be,Qe);case H:return be=xa(be),de(se,te,ae,be,Qe)}if(W(be)||I(be))return se=se.get(ae)||null,ge(te,se,be,Qe,null);if(typeof be.then=="function")return de(se,te,ae,jh(be),Qe);if(be.$$typeof===E)return de(se,te,ae,Nh(te,be),Qe);Oh(te,be)}return null}function He(se,te,ae,be){for(var Qe=null,zt=null,qe=te,mt=te=0,Mt=null;qe!==null&&mt<ae.length;mt++){qe.index>mt?(Mt=qe,qe=null):Mt=qe.sibling;var Pt=ue(se,qe,ae[mt],be);if(Pt===null){qe===null&&(qe=Mt);break}i&&qe&&Pt.alternate===null&&a(se,qe),te=x(Pt,te,mt),zt===null?Qe=Pt:zt.sibling=Pt,zt=Pt,qe=Mt}if(mt===ae.length)return c(se,qe),At&&js(se,mt),Qe;if(qe===null){for(;mt<ae.length;mt++)qe=_e(se,ae[mt],be),qe!==null&&(te=x(qe,te,mt),zt===null?Qe=qe:zt.sibling=qe,zt=qe);return At&&js(se,mt),Qe}for(qe=m(qe);mt<ae.length;mt++)Mt=de(qe,se,mt,ae[mt],be),Mt!==null&&(i&&Mt.alternate!==null&&qe.delete(Mt.key===null?mt:Mt.key),te=x(Mt,te,mt),zt===null?Qe=Mt:zt.sibling=Mt,zt=Mt);return i&&qe.forEach(function(Fo){return a(se,Fo)}),At&&js(se,mt),Qe}function tt(se,te,ae,be){if(ae==null)throw Error(r(151));for(var Qe=null,zt=null,qe=te,mt=te=0,Mt=null,Pt=ae.next();qe!==null&&!Pt.done;mt++,Pt=ae.next()){qe.index>mt?(Mt=qe,qe=null):Mt=qe.sibling;var Fo=ue(se,qe,Pt.value,be);if(Fo===null){qe===null&&(qe=Mt);break}i&&qe&&Fo.alternate===null&&a(se,qe),te=x(Fo,te,mt),zt===null?Qe=Fo:zt.sibling=Fo,zt=Fo,qe=Mt}if(Pt.done)return c(se,qe),At&&js(se,mt),Qe;if(qe===null){for(;!Pt.done;mt++,Pt=ae.next())Pt=_e(se,Pt.value,be),Pt!==null&&(te=x(Pt,te,mt),zt===null?Qe=Pt:zt.sibling=Pt,zt=Pt);return At&&js(se,mt),Qe}for(qe=m(qe);!Pt.done;mt++,Pt=ae.next())Pt=de(qe,se,mt,Pt.value,be),Pt!==null&&(i&&Pt.alternate!==null&&qe.delete(Pt.key===null?mt:Pt.key),te=x(Pt,te,mt),zt===null?Qe=Pt:zt.sibling=Pt,zt=Pt);return i&&qe.forEach(function(C4){return a(se,C4)}),At&&js(se,mt),Qe}function Jt(se,te,ae,be){if(typeof ae=="object"&&ae!==null&&ae.type===S&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case y:e:{for(var Qe=ae.key;te!==null;){if(te.key===Qe){if(Qe=ae.type,Qe===S){if(te.tag===7){c(se,te.sibling),be=_(te,ae.props.children),be.return=se,se=be;break e}}else if(te.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===H&&xa(Qe)===te.type){c(se,te.sibling),be=_(te,ae.props),iu(be,ae),be.return=se,se=be;break e}c(se,te);break}else a(se,te);te=te.sibling}ae.type===S?(be=ga(ae.props.children,se.mode,be,ae.key),be.return=se,se=be):(be=Eh(ae.type,ae.key,ae.props,null,se.mode,be),iu(be,ae),be.return=se,se=be)}return T(se);case w:e:{for(Qe=ae.key;te!==null;){if(te.key===Qe)if(te.tag===4&&te.stateNode.containerInfo===ae.containerInfo&&te.stateNode.implementation===ae.implementation){c(se,te.sibling),be=_(te,ae.children||[]),be.return=se,se=be;break e}else{c(se,te);break}else a(se,te);te=te.sibling}be=Rg(ae,se.mode,be),be.return=se,se=be}return T(se);case H:return ae=xa(ae),Jt(se,te,ae,be)}if(W(ae))return He(se,te,ae,be);if(I(ae)){if(Qe=I(ae),typeof Qe!="function")throw Error(r(150));return ae=Qe.call(ae),tt(se,te,ae,be)}if(typeof ae.then=="function")return Jt(se,te,jh(ae),be);if(ae.$$typeof===E)return Jt(se,te,Nh(se,ae),be);Oh(se,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,te!==null&&te.tag===6?(c(se,te.sibling),be=_(te,ae),be.return=se,se=be):(c(se,te),be=Eg(ae,se.mode,be),be.return=se,se=be),T(se)):c(se,te)}return function(se,te,ae,be){try{ru=0;var Qe=Jt(se,te,ae,be);return Tl=null,Qe}catch(qe){if(qe===Rl||qe===Ah)throw qe;var zt=Jr(29,qe,null,se.mode);return zt.lanes=be,zt.return=se,zt}finally{}}}var Sa=iw(!0),sw=iw(!1),So=!1;function Ig(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fg(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Co(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ko(i,a,c){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(Ht&2)!==0){var _=m.pending;return _===null?a.next=a:(a.next=_.next,_.next=a),m.pending=a,a=kh(i),U1(i,null,c),a}return Ch(i,m,a,c),kh(i)}function su(i,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194048)!==0)){var m=a.lanes;m&=i.pendingLanes,c|=m,a.lanes=c,ke(i,c)}}function Hg(i,a){var c=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var _=null,x=null;if(c=c.firstBaseUpdate,c!==null){do{var T={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};x===null?_=x=T:x=x.next=T,c=c.next}while(c!==null);x===null?_=x=a:x=x.next=a}else _=x=a;c={baseState:m.baseState,firstBaseUpdate:_,lastBaseUpdate:x,shared:m.shared,callbacks:m.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=a:i.next=a,c.lastBaseUpdate=a}var Ug=!1;function ou(){if(Ug){var i=El;if(i!==null)throw i}}function au(i,a,c,m){Ug=!1;var _=i.updateQueue;So=!1;var x=_.firstBaseUpdate,T=_.lastBaseUpdate,z=_.shared.pending;if(z!==null){_.shared.pending=null;var Q=z,le=Q.next;Q.next=null,T===null?x=le:T.next=le,T=Q;var ge=i.alternate;ge!==null&&(ge=ge.updateQueue,z=ge.lastBaseUpdate,z!==T&&(z===null?ge.firstBaseUpdate=le:z.next=le,ge.lastBaseUpdate=Q))}if(x!==null){var _e=_.baseState;T=0,ge=le=Q=null,z=x;do{var ue=z.lane&-536870913,de=ue!==z.lane;if(de?(Nt&ue)===ue:(m&ue)===ue){ue!==0&&ue===kl&&(Ug=!0),ge!==null&&(ge=ge.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var He=i,tt=z;ue=a;var Jt=c;switch(tt.tag){case 1:if(He=tt.payload,typeof He=="function"){_e=He.call(Jt,_e,ue);break e}_e=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=tt.payload,ue=typeof He=="function"?He.call(Jt,_e,ue):He,ue==null)break e;_e=p({},_e,ue);break e;case 2:So=!0}}ue=z.callback,ue!==null&&(i.flags|=64,de&&(i.flags|=8192),de=_.callbacks,de===null?_.callbacks=[ue]:de.push(ue))}else de={lane:ue,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ge===null?(le=ge=de,Q=_e):ge=ge.next=de,T|=ue;if(z=z.next,z===null){if(z=_.shared.pending,z===null)break;de=z,z=de.next,de.next=null,_.lastBaseUpdate=de,_.shared.pending=null}}while(!0);ge===null&&(Q=_e),_.baseState=Q,_.firstBaseUpdate=le,_.lastBaseUpdate=ge,x===null&&(_.shared.lanes=0),Mo|=T,i.lanes=T,i.memoizedState=_e}}function ow(i,a){if(typeof i!="function")throw Error(r(191,i));i.call(a)}function aw(i,a){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)ow(c[i],a)}var Nl=P(null),Lh=P(0);function lw(i,a){i=Ws,A(Lh,i),A(Nl,a),Ws=i|a.baseLanes}function $g(){A(Lh,Ws),A(Nl,Nl.current)}function Wg(){Ws=Lh.current,Z(Nl),Z(Lh)}var ei=P(null),yi=null;function Eo(i){var a=i.alternate;A(Nn,Nn.current&1),A(ei,i),yi===null&&(a===null||Nl.current!==null||a.memoizedState!==null)&&(yi=i)}function Vg(i){A(Nn,Nn.current),A(ei,i),yi===null&&(yi=i)}function cw(i){i.tag===22?(A(Nn,Nn.current),A(ei,i),yi===null&&(yi=i)):Ro()}function Ro(){A(Nn,Nn.current),A(ei,ei.current)}function ti(i){Z(ei),yi===i&&(yi=null),Z(Nn)}var Nn=P(0);function zh(i){for(var a=i;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Zv(c)||Qv(c)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var zs=0,ct=null,Zt=null,Pn=null,Ph=!1,Ml=!1,Ca=!1,Bh=0,lu=0,Al=null,mO=0;function Sn(){throw Error(r(321))}function qg(i,a){if(a===null)return!1;for(var c=0;c<a.length&&c<i.length;c++)if(!Qr(i[c],a[c]))return!1;return!0}function Kg(i,a,c,m,_,x){return zs=x,ct=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,O.H=i===null||i.memoizedState===null?qw:lv,Ca=!1,x=c(m,_),Ca=!1,Ml&&(x=dw(a,c,m,_)),uw(i),x}function uw(i){O.H=du;var a=Zt!==null&&Zt.next!==null;if(zs=0,Pn=Zt=ct=null,Ph=!1,lu=0,Al=null,a)throw Error(r(300));i===null||Bn||(i=i.dependencies,i!==null&&Th(i)&&(Bn=!0))}function dw(i,a,c,m){ct=i;var _=0;do{if(Ml&&(Al=null),lu=0,Ml=!1,25<=_)throw Error(r(301));if(_+=1,Pn=Zt=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}O.H=Kw,x=a(c,m)}while(Ml);return x}function pO(){var i=O.H,a=i.useState()[0];return a=typeof a.then=="function"?cu(a):a,i=i.useState()[0],(Zt!==null?Zt.memoizedState:null)!==i&&(ct.flags|=1024),a}function Gg(){var i=Bh!==0;return Bh=0,i}function Yg(i,a,c){a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~c}function Xg(i){if(Ph){for(i=i.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Ph=!1}zs=0,Pn=Zt=ct=null,Ml=!1,lu=Bh=0,Al=null}function Nr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pn===null?ct.memoizedState=Pn=i:Pn=Pn.next=i,Pn}function Mn(){if(Zt===null){var i=ct.alternate;i=i!==null?i.memoizedState:null}else i=Zt.next;var a=Pn===null?ct.memoizedState:Pn.next;if(a!==null)Pn=a,Zt=i;else{if(i===null)throw ct.alternate===null?Error(r(467)):Error(r(310));Zt=i,i={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},Pn===null?ct.memoizedState=Pn=i:Pn=Pn.next=i}return Pn}function Ih(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cu(i){var a=lu;return lu+=1,Al===null&&(Al=[]),i=tw(Al,i,a),a=ct,(Pn===null?a.memoizedState:Pn.next)===null&&(a=a.alternate,O.H=a===null||a.memoizedState===null?qw:lv),i}function Fh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return cu(i);if(i.$$typeof===E)return fr(i)}throw Error(r(438,String(i)))}function Zg(i){var a=null,c=ct.updateQueue;if(c!==null&&(a=c.memoCache),a==null){var m=ct.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(a={data:m.data.map(function(_){return _.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),c===null&&(c=Ih(),ct.updateQueue=c),c.memoCache=a,c=a.data[a.index],c===void 0)for(c=a.data[a.index]=Array(i),m=0;m<i;m++)c[m]=B;return a.index++,c}function Ps(i,a){return typeof a=="function"?a(i):a}function Hh(i){var a=Mn();return Qg(a,Zt,i)}function Qg(i,a,c){var m=i.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var _=i.baseQueue,x=m.pending;if(x!==null){if(_!==null){var T=_.next;_.next=x.next,x.next=T}a.baseQueue=_=x,m.pending=null}if(x=i.baseState,_===null)i.memoizedState=x;else{a=_.next;var z=T=null,Q=null,le=a,ge=!1;do{var _e=le.lane&-536870913;if(_e!==le.lane?(Nt&_e)===_e:(zs&_e)===_e){var ue=le.revertLane;if(ue===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),_e===kl&&(ge=!0);else if((zs&ue)===ue){le=le.next,ue===kl&&(ge=!0);continue}else _e={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Q===null?(z=Q=_e,T=x):Q=Q.next=_e,ct.lanes|=ue,Mo|=ue;_e=le.action,Ca&&c(x,_e),x=le.hasEagerState?le.eagerState:c(x,_e)}else ue={lane:_e,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Q===null?(z=Q=ue,T=x):Q=Q.next=ue,ct.lanes|=_e,Mo|=_e;le=le.next}while(le!==null&&le!==a);if(Q===null?T=x:Q.next=z,!Qr(x,i.memoizedState)&&(Bn=!0,ge&&(c=El,c!==null)))throw c;i.memoizedState=x,i.baseState=T,i.baseQueue=Q,m.lastRenderedState=x}return _===null&&(m.lanes=0),[i.memoizedState,m.dispatch]}function Jg(i){var a=Mn(),c=a.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var m=c.dispatch,_=c.pending,x=a.memoizedState;if(_!==null){c.pending=null;var T=_=_.next;do x=i(x,T.action),T=T.next;while(T!==_);Qr(x,a.memoizedState)||(Bn=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),c.lastRenderedState=x}return[x,m]}function hw(i,a,c){var m=ct,_=Mn(),x=At;if(x){if(c===void 0)throw Error(r(407));c=c()}else c=a();var T=!Qr((Zt||_).memoizedState,c);if(T&&(_.memoizedState=c,Bn=!0),_=_.queue,nv(pw.bind(null,m,_,i),[i]),_.getSnapshot!==a||T||Pn!==null&&Pn.memoizedState.tag&1){if(m.flags|=2048,Dl(9,{destroy:void 0},mw.bind(null,m,_,c,a),null),an===null)throw Error(r(349));x||(zs&127)!==0||fw(m,a,c)}return c}function fw(i,a,c){i.flags|=16384,i={getSnapshot:a,value:c},a=ct.updateQueue,a===null?(a=Ih(),ct.updateQueue=a,a.stores=[i]):(c=a.stores,c===null?a.stores=[i]:c.push(i))}function mw(i,a,c,m){a.value=c,a.getSnapshot=m,gw(a)&&vw(i)}function pw(i,a,c){return c(function(){gw(a)&&vw(i)})}function gw(i){var a=i.getSnapshot;i=i.value;try{var c=a();return!Qr(i,c)}catch{return!0}}function vw(i){var a=pa(i,2);a!==null&&Wr(a,i,2)}function ev(i){var a=Nr();if(typeof i=="function"){var c=i;if(i=c(),Ca){ut(!0);try{c()}finally{ut(!1)}}}return a.memoizedState=a.baseState=i,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:i},a}function bw(i,a,c,m){return i.baseState=c,Qg(i,Zt,typeof m=="function"?m:Ps)}function gO(i,a,c,m,_){if(Wh(i))throw Error(r(485));if(i=a.action,i!==null){var x={payload:_,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){x.listeners.push(T)}};O.T!==null?c(!0):x.isTransition=!1,m(x),c=a.pending,c===null?(x.next=a.pending=x,_w(a,x)):(x.next=c.next,a.pending=c.next=x)}}function _w(i,a){var c=a.action,m=a.payload,_=i.state;if(a.isTransition){var x=O.T,T={};O.T=T;try{var z=c(_,m),Q=O.S;Q!==null&&Q(T,z),yw(i,a,z)}catch(le){tv(i,a,le)}finally{x!==null&&T.types!==null&&(x.types=T.types),O.T=x}}else try{x=c(_,m),yw(i,a,x)}catch(le){tv(i,a,le)}}function yw(i,a,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){xw(i,a,m)},function(m){return tv(i,a,m)}):xw(i,a,c)}function xw(i,a,c){a.status="fulfilled",a.value=c,ww(a),i.state=c,a=i.pending,a!==null&&(c=a.next,c===a?i.pending=null:(c=c.next,a.next=c,_w(i,c)))}function tv(i,a,c){var m=i.pending;if(i.pending=null,m!==null){m=m.next;do a.status="rejected",a.reason=c,ww(a),a=a.next;while(a!==m)}i.action=null}function ww(i){i=i.listeners;for(var a=0;a<i.length;a++)(0,i[a])()}function Sw(i,a){return a}function Cw(i,a){if(At){var c=an.formState;if(c!==null){e:{var m=ct;if(At){if(hn){t:{for(var _=hn,x=_i;_.nodeType!==8;){if(!x){_=null;break t}if(_=xi(_.nextSibling),_===null){_=null;break t}}x=_.data,_=x==="F!"||x==="F"?_:null}if(_){hn=xi(_.nextSibling),m=_.data==="F!";break e}}xo(m)}m=!1}m&&(a=c[0])}}return c=Nr(),c.memoizedState=c.baseState=a,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sw,lastRenderedState:a},c.queue=m,c=$w.bind(null,ct,m),m.dispatch=c,m=ev(!1),x=av.bind(null,ct,!1,m.queue),m=Nr(),_={state:a,dispatch:null,action:i,pending:null},m.queue=_,c=gO.bind(null,ct,_,x,c),_.dispatch=c,m.memoizedState=i,[a,c,!1]}function kw(i){var a=Mn();return Ew(a,Zt,i)}function Ew(i,a,c){if(a=Qg(i,a,Sw)[0],i=Hh(Ps)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var m=cu(a)}catch(T){throw T===Rl?Ah:T}else m=a;a=Mn();var _=a.queue,x=_.dispatch;return c!==a.memoizedState&&(ct.flags|=2048,Dl(9,{destroy:void 0},vO.bind(null,_,c),null)),[m,x,i]}function vO(i,a){i.action=a}function Rw(i){var a=Mn(),c=Zt;if(c!==null)return Ew(a,c,i);Mn(),a=a.memoizedState,c=Mn();var m=c.queue.dispatch;return c.memoizedState=i,[a,m,!1]}function Dl(i,a,c,m){return i={tag:i,create:c,deps:m,inst:a,next:null},a=ct.updateQueue,a===null&&(a=Ih(),ct.updateQueue=a),c=a.lastEffect,c===null?a.lastEffect=i.next=i:(m=c.next,c.next=i,i.next=m,a.lastEffect=i),i}function Tw(){return Mn().memoizedState}function Uh(i,a,c,m){var _=Nr();ct.flags|=i,_.memoizedState=Dl(1|a,{destroy:void 0},c,m===void 0?null:m)}function $h(i,a,c,m){var _=Mn();m=m===void 0?null:m;var x=_.memoizedState.inst;Zt!==null&&m!==null&&qg(m,Zt.memoizedState.deps)?_.memoizedState=Dl(a,x,c,m):(ct.flags|=i,_.memoizedState=Dl(1|a,x,c,m))}function Nw(i,a){Uh(8390656,8,i,a)}function nv(i,a){$h(2048,8,i,a)}function bO(i){ct.flags|=4;var a=ct.updateQueue;if(a===null)a=Ih(),ct.updateQueue=a,a.events=[i];else{var c=a.events;c===null?a.events=[i]:c.push(i)}}function Mw(i){var a=Mn().memoizedState;return bO({ref:a,nextImpl:i}),function(){if((Ht&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Aw(i,a){return $h(4,2,i,a)}function Dw(i,a){return $h(4,4,i,a)}function jw(i,a){if(typeof a=="function"){i=i();var c=a(i);return function(){typeof c=="function"?c():a(null)}}if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function Ow(i,a,c){c=c!=null?c.concat([i]):null,$h(4,4,jw.bind(null,a,i),c)}function rv(){}function Lw(i,a){var c=Mn();a=a===void 0?null:a;var m=c.memoizedState;return a!==null&&qg(a,m[1])?m[0]:(c.memoizedState=[i,a],i)}function zw(i,a){var c=Mn();a=a===void 0?null:a;var m=c.memoizedState;if(a!==null&&qg(a,m[1]))return m[0];if(m=i(),Ca){ut(!0);try{i()}finally{ut(!1)}}return c.memoizedState=[m,a],m}function iv(i,a,c){return c===void 0||(zs&1073741824)!==0&&(Nt&261930)===0?i.memoizedState=a:(i.memoizedState=c,i=PS(),ct.lanes|=i,Mo|=i,c)}function Pw(i,a,c,m){return Qr(c,a)?c:Nl.current!==null?(i=iv(i,c,m),Qr(i,a)||(Bn=!0),i):(zs&42)===0||(zs&1073741824)!==0&&(Nt&261930)===0?(Bn=!0,i.memoizedState=c):(i=PS(),ct.lanes|=i,Mo|=i,a)}function Bw(i,a,c,m,_){var x=$.p;$.p=x!==0&&8>x?x:8;var T=O.T,z={};O.T=z,av(i,!1,a,c);try{var Q=_(),le=O.S;if(le!==null&&le(z,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var ge=fO(Q,m);uu(i,a,ge,ii(i))}else uu(i,a,m,ii(i))}catch(_e){uu(i,a,{then:function(){},status:"rejected",reason:_e},ii())}finally{$.p=x,T!==null&&z.types!==null&&(T.types=z.types),O.T=T}}function _O(){}function sv(i,a,c,m){if(i.tag!==5)throw Error(r(476));var _=Iw(i).queue;Bw(i,_,a,U,c===null?_O:function(){return Fw(i),c(m)})}function Iw(i){var a=i.memoizedState;if(a!==null)return a;a={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:U},next:null};var c={};return a.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:c},next:null},i.memoizedState=a,i=i.alternate,i!==null&&(i.memoizedState=a),a}function Fw(i){var a=Iw(i);a.next===null&&(a=i.alternate.memoizedState),uu(i,a.next.queue,{},ii())}function ov(){return fr(Ru)}function Hw(){return Mn().memoizedState}function Uw(){return Mn().memoizedState}function yO(i){for(var a=i.return;a!==null;){switch(a.tag){case 24:case 3:var c=ii();i=Co(c);var m=ko(a,i,c);m!==null&&(Wr(m,a,c),su(m,a,c)),a={cache:Lg()},i.payload=a;return}a=a.return}}function xO(i,a,c){var m=ii();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Wh(i)?Ww(a,c):(c=Cg(i,a,c,m),c!==null&&(Wr(c,i,m),Vw(c,a,m)))}function $w(i,a,c){var m=ii();uu(i,a,c,m)}function uu(i,a,c,m){var _={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Wh(i))Ww(a,_);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var T=a.lastRenderedState,z=x(T,c);if(_.hasEagerState=!0,_.eagerState=z,Qr(z,T))return Ch(i,a,_,0),an===null&&Sh(),!1}catch{}finally{}if(c=Cg(i,a,_,m),c!==null)return Wr(c,i,m),Vw(c,a,m),!0}return!1}function av(i,a,c,m){if(m={lane:2,revertLane:Iv(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Wh(i)){if(a)throw Error(r(479))}else a=Cg(i,c,m,2),a!==null&&Wr(a,i,2)}function Wh(i){var a=i.alternate;return i===ct||a!==null&&a===ct}function Ww(i,a){Ml=Ph=!0;var c=i.pending;c===null?a.next=a:(a.next=c.next,c.next=a),i.pending=a}function Vw(i,a,c){if((c&4194048)!==0){var m=a.lanes;m&=i.pendingLanes,c|=m,a.lanes=c,ke(i,c)}}var du={readContext:fr,use:Fh,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useLayoutEffect:Sn,useInsertionEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useSyncExternalStore:Sn,useId:Sn,useHostTransitionStatus:Sn,useFormState:Sn,useActionState:Sn,useOptimistic:Sn,useMemoCache:Sn,useCacheRefresh:Sn};du.useEffectEvent=Sn;var qw={readContext:fr,use:Fh,useCallback:function(i,a){return Nr().memoizedState=[i,a===void 0?null:a],i},useContext:fr,useEffect:Nw,useImperativeHandle:function(i,a,c){c=c!=null?c.concat([i]):null,Uh(4194308,4,jw.bind(null,a,i),c)},useLayoutEffect:function(i,a){return Uh(4194308,4,i,a)},useInsertionEffect:function(i,a){Uh(4,2,i,a)},useMemo:function(i,a){var c=Nr();a=a===void 0?null:a;var m=i();if(Ca){ut(!0);try{i()}finally{ut(!1)}}return c.memoizedState=[m,a],m},useReducer:function(i,a,c){var m=Nr();if(c!==void 0){var _=c(a);if(Ca){ut(!0);try{c(a)}finally{ut(!1)}}}else _=a;return m.memoizedState=m.baseState=_,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:_},m.queue=i,i=i.dispatch=xO.bind(null,ct,i),[m.memoizedState,i]},useRef:function(i){var a=Nr();return i={current:i},a.memoizedState=i},useState:function(i){i=ev(i);var a=i.queue,c=$w.bind(null,ct,a);return a.dispatch=c,[i.memoizedState,c]},useDebugValue:rv,useDeferredValue:function(i,a){var c=Nr();return iv(c,i,a)},useTransition:function(){var i=ev(!1);return i=Bw.bind(null,ct,i.queue,!0,!1),Nr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,a,c){var m=ct,_=Nr();if(At){if(c===void 0)throw Error(r(407));c=c()}else{if(c=a(),an===null)throw Error(r(349));(Nt&127)!==0||fw(m,a,c)}_.memoizedState=c;var x={value:c,getSnapshot:a};return _.queue=x,Nw(pw.bind(null,m,x,i),[i]),m.flags|=2048,Dl(9,{destroy:void 0},mw.bind(null,m,x,c,a),null),c},useId:function(){var i=Nr(),a=an.identifierPrefix;if(At){var c=ss,m=is;c=(m&~(1<<32-Ue(m)-1)).toString(32)+c,a="_"+a+"R_"+c,c=Bh++,0<c&&(a+="H"+c.toString(32)),a+="_"}else c=mO++,a="_"+a+"r_"+c.toString(32)+"_";return i.memoizedState=a},useHostTransitionStatus:ov,useFormState:Cw,useActionState:Cw,useOptimistic:function(i){var a=Nr();a.memoizedState=a.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=c,a=av.bind(null,ct,!0,c),c.dispatch=a,[i,a]},useMemoCache:Zg,useCacheRefresh:function(){return Nr().memoizedState=yO.bind(null,ct)},useEffectEvent:function(i){var a=Nr(),c={impl:i};return a.memoizedState=c,function(){if((Ht&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},lv={readContext:fr,use:Fh,useCallback:Lw,useContext:fr,useEffect:nv,useImperativeHandle:Ow,useInsertionEffect:Aw,useLayoutEffect:Dw,useMemo:zw,useReducer:Hh,useRef:Tw,useState:function(){return Hh(Ps)},useDebugValue:rv,useDeferredValue:function(i,a){var c=Mn();return Pw(c,Zt.memoizedState,i,a)},useTransition:function(){var i=Hh(Ps)[0],a=Mn().memoizedState;return[typeof i=="boolean"?i:cu(i),a]},useSyncExternalStore:hw,useId:Hw,useHostTransitionStatus:ov,useFormState:kw,useActionState:kw,useOptimistic:function(i,a){var c=Mn();return bw(c,Zt,i,a)},useMemoCache:Zg,useCacheRefresh:Uw};lv.useEffectEvent=Mw;var Kw={readContext:fr,use:Fh,useCallback:Lw,useContext:fr,useEffect:nv,useImperativeHandle:Ow,useInsertionEffect:Aw,useLayoutEffect:Dw,useMemo:zw,useReducer:Jg,useRef:Tw,useState:function(){return Jg(Ps)},useDebugValue:rv,useDeferredValue:function(i,a){var c=Mn();return Zt===null?iv(c,i,a):Pw(c,Zt.memoizedState,i,a)},useTransition:function(){var i=Jg(Ps)[0],a=Mn().memoizedState;return[typeof i=="boolean"?i:cu(i),a]},useSyncExternalStore:hw,useId:Hw,useHostTransitionStatus:ov,useFormState:Rw,useActionState:Rw,useOptimistic:function(i,a){var c=Mn();return Zt!==null?bw(c,Zt,i,a):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:Zg,useCacheRefresh:Uw};Kw.useEffectEvent=Mw;function cv(i,a,c,m){a=i.memoizedState,c=c(m,a),c=c==null?a:p({},a,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var uv={enqueueSetState:function(i,a,c){i=i._reactInternals;var m=ii(),_=Co(m);_.payload=a,c!=null&&(_.callback=c),a=ko(i,_,m),a!==null&&(Wr(a,i,m),su(a,i,m))},enqueueReplaceState:function(i,a,c){i=i._reactInternals;var m=ii(),_=Co(m);_.tag=1,_.payload=a,c!=null&&(_.callback=c),a=ko(i,_,m),a!==null&&(Wr(a,i,m),su(a,i,m))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var c=ii(),m=Co(c);m.tag=2,a!=null&&(m.callback=a),a=ko(i,m,c),a!==null&&(Wr(a,i,c),su(a,i,c))}};function Gw(i,a,c,m,_,x,T){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(m,x,T):a.prototype&&a.prototype.isPureReactComponent?!Zc(c,m)||!Zc(_,x):!0}function Yw(i,a,c,m){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,m),a.state!==i&&uv.enqueueReplaceState(a,a.state,null)}function ka(i,a){var c=a;if("ref"in a){c={};for(var m in a)m!=="ref"&&(c[m]=a[m])}if(i=i.defaultProps){c===a&&(c=p({},c));for(var _ in i)c[_]===void 0&&(c[_]=i[_])}return c}function Xw(i){wh(i)}function Zw(i){console.error(i)}function Qw(i){wh(i)}function Vh(i,a){try{var c=i.onUncaughtError;c(a.value,{componentStack:a.stack})}catch(m){setTimeout(function(){throw m})}}function Jw(i,a,c){try{var m=i.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function dv(i,a,c){return c=Co(c),c.tag=3,c.payload={element:null},c.callback=function(){Vh(i,a)},c}function eS(i){return i=Co(i),i.tag=3,i}function tS(i,a,c,m){var _=c.type.getDerivedStateFromError;if(typeof _=="function"){var x=m.value;i.payload=function(){return _(x)},i.callback=function(){Jw(a,c,m)}}var T=c.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(i.callback=function(){Jw(a,c,m),typeof _!="function"&&(Ao===null?Ao=new Set([this]):Ao.add(this));var z=m.stack;this.componentDidCatch(m.value,{componentStack:z!==null?z:""})})}function wO(i,a,c,m,_){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(a=c.alternate,a!==null&&Cl(a,c,_,!0),c=ei.current,c!==null){switch(c.tag){case 31:case 13:return yi===null?rf():c.alternate===null&&Cn===0&&(Cn=3),c.flags&=-257,c.flags|=65536,c.lanes=_,m===Dh?c.flags|=16384:(a=c.updateQueue,a===null?c.updateQueue=new Set([m]):a.add(m),zv(i,m,_)),!1;case 22:return c.flags|=65536,m===Dh?c.flags|=16384:(a=c.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=a):(c=a.retryQueue,c===null?a.retryQueue=new Set([m]):c.add(m)),zv(i,m,_)),!1}throw Error(r(435,c.tag))}return zv(i,m,_),rf(),!1}if(At)return a=ei.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=_,m!==Mg&&(i=Error(r(422),{cause:m}),eu(gi(i,c)))):(m!==Mg&&(a=Error(r(423),{cause:m}),eu(gi(a,c))),i=i.current.alternate,i.flags|=65536,_&=-_,i.lanes|=_,m=gi(m,c),_=dv(i.stateNode,m,_),Hg(i,_),Cn!==4&&(Cn=2)),!1;var x=Error(r(520),{cause:m});if(x=gi(x,c),_u===null?_u=[x]:_u.push(x),Cn!==4&&(Cn=2),a===null)return!0;m=gi(m,c),c=a;do{switch(c.tag){case 3:return c.flags|=65536,i=_&-_,c.lanes|=i,i=dv(c.stateNode,m,i),Hg(c,i),!1;case 1:if(a=c.type,x=c.stateNode,(c.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ao===null||!Ao.has(x))))return c.flags|=65536,_&=-_,c.lanes|=_,_=eS(_),tS(_,i,c,m),Hg(c,_),!1}c=c.return}while(c!==null);return!1}var hv=Error(r(461)),Bn=!1;function mr(i,a,c,m){a.child=i===null?sw(a,null,c,m):Sa(a,i.child,c,m)}function nS(i,a,c,m,_){c=c.render;var x=a.ref;if("ref"in m){var T={};for(var z in m)z!=="ref"&&(T[z]=m[z])}else T=m;return _a(a),m=Kg(i,a,c,T,x,_),z=Gg(),i!==null&&!Bn?(Yg(i,a,_),Bs(i,a,_)):(At&&z&&Tg(a),a.flags|=1,mr(i,a,m,_),a.child)}function rS(i,a,c,m,_){if(i===null){var x=c.type;return typeof x=="function"&&!kg(x)&&x.defaultProps===void 0&&c.compare===null?(a.tag=15,a.type=x,iS(i,a,x,m,_)):(i=Eh(c.type,null,m,a,a.mode,_),i.ref=a.ref,i.return=a,a.child=i)}if(x=i.child,!yv(i,_)){var T=x.memoizedProps;if(c=c.compare,c=c!==null?c:Zc,c(T,m)&&i.ref===a.ref)return Bs(i,a,_)}return a.flags|=1,i=Ds(x,m),i.ref=a.ref,i.return=a,a.child=i}function iS(i,a,c,m,_){if(i!==null){var x=i.memoizedProps;if(Zc(x,m)&&i.ref===a.ref)if(Bn=!1,a.pendingProps=m=x,yv(i,_))(i.flags&131072)!==0&&(Bn=!0);else return a.lanes=i.lanes,Bs(i,a,_)}return fv(i,a,c,m,_)}function sS(i,a,c,m){var _=m.children,x=i!==null?i.memoizedState:null;if(i===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((a.flags&128)!==0){if(x=x!==null?x.baseLanes|c:c,i!==null){for(m=a.child=i.child,_=0;m!==null;)_=_|m.lanes|m.childLanes,m=m.sibling;m=_&~x}else m=0,a.child=null;return oS(i,a,x,c,m)}if((c&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},i!==null&&Mh(a,x!==null?x.cachePool:null),x!==null?lw(a,x):$g(),cw(a);else return m=a.lanes=536870912,oS(i,a,x!==null?x.baseLanes|c:c,c,m)}else x!==null?(Mh(a,x.cachePool),lw(a,x),Ro(),a.memoizedState=null):(i!==null&&Mh(a,null),$g(),Ro());return mr(i,a,_,c),a.child}function hu(i,a){return i!==null&&i.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function oS(i,a,c,m,_){var x=Pg();return x=x===null?null:{parent:zn._currentValue,pool:x},a.memoizedState={baseLanes:c,cachePool:x},i!==null&&Mh(a,null),$g(),cw(a),i!==null&&Cl(i,a,m,!0),a.childLanes=_,null}function qh(i,a){return a=Gh({mode:a.mode,children:a.children},i.mode),a.ref=i.ref,i.child=a,a.return=i,a}function aS(i,a,c){return Sa(a,i.child,null,c),i=qh(a,a.pendingProps),i.flags|=2,ti(a),a.memoizedState=null,i}function SO(i,a,c){var m=a.pendingProps,_=(a.flags&128)!==0;if(a.flags&=-129,i===null){if(At){if(m.mode==="hidden")return i=qh(a,m),a.lanes=536870912,hu(null,i);if(Vg(a),(i=hn)?(i=_C(i,_i),i=i!==null&&i.data==="&"?i:null,i!==null&&(a.memoizedState={dehydrated:i,treeContext:_o!==null?{id:is,overflow:ss}:null,retryLane:536870912,hydrationErrors:null},c=W1(i),c.return=a,a.child=c,hr=a,hn=null)):i=null,i===null)throw xo(a);return a.lanes=536870912,null}return qh(a,m)}var x=i.memoizedState;if(x!==null){var T=x.dehydrated;if(Vg(a),_)if(a.flags&256)a.flags&=-257,a=aS(i,a,c);else if(a.memoizedState!==null)a.child=i.child,a.flags|=128,a=null;else throw Error(r(558));else if(Bn||Cl(i,a,c,!1),_=(c&i.childLanes)!==0,Bn||_){if(m=an,m!==null&&(T=Oe(m,c),T!==0&&T!==x.retryLane))throw x.retryLane=T,pa(i,T),Wr(m,i,T),hv;rf(),a=aS(i,a,c)}else i=x.treeContext,hn=xi(T.nextSibling),hr=a,At=!0,yo=null,_i=!1,i!==null&&K1(a,i),a=qh(a,m),a.flags|=4096;return a}return i=Ds(i.child,{mode:m.mode,children:m.children}),i.ref=a.ref,a.child=i,i.return=a,i}function Kh(i,a){var c=a.ref;if(c===null)i!==null&&i.ref!==null&&(a.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(a.flags|=4194816)}}function fv(i,a,c,m,_){return _a(a),c=Kg(i,a,c,m,void 0,_),m=Gg(),i!==null&&!Bn?(Yg(i,a,_),Bs(i,a,_)):(At&&m&&Tg(a),a.flags|=1,mr(i,a,c,_),a.child)}function lS(i,a,c,m,_,x){return _a(a),a.updateQueue=null,c=dw(a,m,c,_),uw(i),m=Gg(),i!==null&&!Bn?(Yg(i,a,x),Bs(i,a,x)):(At&&m&&Tg(a),a.flags|=1,mr(i,a,c,x),a.child)}function cS(i,a,c,m,_){if(_a(a),a.stateNode===null){var x=yl,T=c.contextType;typeof T=="object"&&T!==null&&(x=fr(T)),x=new c(m,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=uv,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=m,x.state=a.memoizedState,x.refs={},Ig(a),T=c.contextType,x.context=typeof T=="object"&&T!==null?fr(T):yl,x.state=a.memoizedState,T=c.getDerivedStateFromProps,typeof T=="function"&&(cv(a,c,T,m),x.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(T=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),T!==x.state&&uv.enqueueReplaceState(x,x.state,null),au(a,m,x,_),ou(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),m=!0}else if(i===null){x=a.stateNode;var z=a.memoizedProps,Q=ka(c,z);x.props=Q;var le=x.context,ge=c.contextType;T=yl,typeof ge=="object"&&ge!==null&&(T=fr(ge));var _e=c.getDerivedStateFromProps;ge=typeof _e=="function"||typeof x.getSnapshotBeforeUpdate=="function",z=a.pendingProps!==z,ge||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(z||le!==T)&&Yw(a,x,m,T),So=!1;var ue=a.memoizedState;x.state=ue,au(a,m,x,_),ou(),le=a.memoizedState,z||ue!==le||So?(typeof _e=="function"&&(cv(a,c,_e,m),le=a.memoizedState),(Q=So||Gw(a,c,Q,m,ue,le,T))?(ge||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(a.flags|=4194308)):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=le),x.props=m,x.state=le,x.context=T,m=Q):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{x=a.stateNode,Fg(i,a),T=a.memoizedProps,ge=ka(c,T),x.props=ge,_e=a.pendingProps,ue=x.context,le=c.contextType,Q=yl,typeof le=="object"&&le!==null&&(Q=fr(le)),z=c.getDerivedStateFromProps,(le=typeof z=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(T!==_e||ue!==Q)&&Yw(a,x,m,Q),So=!1,ue=a.memoizedState,x.state=ue,au(a,m,x,_),ou();var de=a.memoizedState;T!==_e||ue!==de||So||i!==null&&i.dependencies!==null&&Th(i.dependencies)?(typeof z=="function"&&(cv(a,c,z,m),de=a.memoizedState),(ge=So||Gw(a,c,ge,m,ue,de,Q)||i!==null&&i.dependencies!==null&&Th(i.dependencies))?(le||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(m,de,Q),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(m,de,Q)),typeof x.componentDidUpdate=="function"&&(a.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof x.componentDidUpdate!="function"||T===i.memoizedProps&&ue===i.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===i.memoizedProps&&ue===i.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=de),x.props=m,x.state=de,x.context=Q,m=ge):(typeof x.componentDidUpdate!="function"||T===i.memoizedProps&&ue===i.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||T===i.memoizedProps&&ue===i.memoizedState||(a.flags|=1024),m=!1)}return x=m,Kh(i,a),m=(a.flags&128)!==0,x||m?(x=a.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,i!==null&&m?(a.child=Sa(a,i.child,null,_),a.child=Sa(a,null,c,_)):mr(i,a,c,_),a.memoizedState=x.state,i=a.child):i=Bs(i,a,_),i}function uS(i,a,c,m){return va(),a.flags|=256,mr(i,a,c,m),a.child}var mv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pv(i){return{baseLanes:i,cachePool:J1()}}function gv(i,a,c){return i=i!==null?i.childLanes&~c:0,a&&(i|=ri),i}function dS(i,a,c){var m=a.pendingProps,_=!1,x=(a.flags&128)!==0,T;if((T=x)||(T=i!==null&&i.memoizedState===null?!1:(Nn.current&2)!==0),T&&(_=!0,a.flags&=-129),T=(a.flags&32)!==0,a.flags&=-33,i===null){if(At){if(_?Eo(a):Ro(),(i=hn)?(i=_C(i,_i),i=i!==null&&i.data!=="&"?i:null,i!==null&&(a.memoizedState={dehydrated:i,treeContext:_o!==null?{id:is,overflow:ss}:null,retryLane:536870912,hydrationErrors:null},c=W1(i),c.return=a,a.child=c,hr=a,hn=null)):i=null,i===null)throw xo(a);return Qv(i)?a.lanes=32:a.lanes=536870912,null}var z=m.children;return m=m.fallback,_?(Ro(),_=a.mode,z=Gh({mode:"hidden",children:z},_),m=ga(m,_,c,null),z.return=a,m.return=a,z.sibling=m,a.child=z,m=a.child,m.memoizedState=pv(c),m.childLanes=gv(i,T,c),a.memoizedState=mv,hu(null,m)):(Eo(a),vv(a,z))}var Q=i.memoizedState;if(Q!==null&&(z=Q.dehydrated,z!==null)){if(x)a.flags&256?(Eo(a),a.flags&=-257,a=bv(i,a,c)):a.memoizedState!==null?(Ro(),a.child=i.child,a.flags|=128,a=null):(Ro(),z=m.fallback,_=a.mode,m=Gh({mode:"visible",children:m.children},_),z=ga(z,_,c,null),z.flags|=2,m.return=a,z.return=a,m.sibling=z,a.child=m,Sa(a,i.child,null,c),m=a.child,m.memoizedState=pv(c),m.childLanes=gv(i,T,c),a.memoizedState=mv,a=hu(null,m));else if(Eo(a),Qv(z)){if(T=z.nextSibling&&z.nextSibling.dataset,T)var le=T.dgst;T=le,m=Error(r(419)),m.stack="",m.digest=T,eu({value:m,source:null,stack:null}),a=bv(i,a,c)}else if(Bn||Cl(i,a,c,!1),T=(c&i.childLanes)!==0,Bn||T){if(T=an,T!==null&&(m=Oe(T,c),m!==0&&m!==Q.retryLane))throw Q.retryLane=m,pa(i,m),Wr(T,i,m),hv;Zv(z)||rf(),a=bv(i,a,c)}else Zv(z)?(a.flags|=192,a.child=i.child,a=null):(i=Q.treeContext,hn=xi(z.nextSibling),hr=a,At=!0,yo=null,_i=!1,i!==null&&K1(a,i),a=vv(a,m.children),a.flags|=4096);return a}return _?(Ro(),z=m.fallback,_=a.mode,Q=i.child,le=Q.sibling,m=Ds(Q,{mode:"hidden",children:m.children}),m.subtreeFlags=Q.subtreeFlags&65011712,le!==null?z=Ds(le,z):(z=ga(z,_,c,null),z.flags|=2),z.return=a,m.return=a,m.sibling=z,a.child=m,hu(null,m),m=a.child,z=i.child.memoizedState,z===null?z=pv(c):(_=z.cachePool,_!==null?(Q=zn._currentValue,_=_.parent!==Q?{parent:Q,pool:Q}:_):_=J1(),z={baseLanes:z.baseLanes|c,cachePool:_}),m.memoizedState=z,m.childLanes=gv(i,T,c),a.memoizedState=mv,hu(i.child,m)):(Eo(a),c=i.child,i=c.sibling,c=Ds(c,{mode:"visible",children:m.children}),c.return=a,c.sibling=null,i!==null&&(T=a.deletions,T===null?(a.deletions=[i],a.flags|=16):T.push(i)),a.child=c,a.memoizedState=null,c)}function vv(i,a){return a=Gh({mode:"visible",children:a},i.mode),a.return=i,i.child=a}function Gh(i,a){return i=Jr(22,i,null,a),i.lanes=0,i}function bv(i,a,c){return Sa(a,i.child,null,c),i=vv(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function hS(i,a,c){i.lanes|=a;var m=i.alternate;m!==null&&(m.lanes|=a),jg(i.return,a,c)}function _v(i,a,c,m,_,x){var T=i.memoizedState;T===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:_,treeForkCount:x}:(T.isBackwards=a,T.rendering=null,T.renderingStartTime=0,T.last=m,T.tail=c,T.tailMode=_,T.treeForkCount=x)}function fS(i,a,c){var m=a.pendingProps,_=m.revealOrder,x=m.tail;m=m.children;var T=Nn.current,z=(T&2)!==0;if(z?(T=T&1|2,a.flags|=128):T&=1,A(Nn,T),mr(i,a,m,c),m=At?Jc:0,!z&&i!==null&&(i.flags&128)!==0)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&hS(i,c,a);else if(i.tag===19)hS(i,c,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(_){case"forwards":for(c=a.child,_=null;c!==null;)i=c.alternate,i!==null&&zh(i)===null&&(_=c),c=c.sibling;c=_,c===null?(_=a.child,a.child=null):(_=c.sibling,c.sibling=null),_v(a,!1,_,c,x,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,_=a.child,a.child=null;_!==null;){if(i=_.alternate,i!==null&&zh(i)===null){a.child=_;break}i=_.sibling,_.sibling=c,c=_,_=i}_v(a,!0,c,null,x,m);break;case"together":_v(a,!1,null,null,void 0,m);break;default:a.memoizedState=null}return a.child}function Bs(i,a,c){if(i!==null&&(a.dependencies=i.dependencies),Mo|=a.lanes,(c&a.childLanes)===0)if(i!==null){if(Cl(i,a,c,!1),(c&a.childLanes)===0)return null}else return null;if(i!==null&&a.child!==i.child)throw Error(r(153));if(a.child!==null){for(i=a.child,c=Ds(i,i.pendingProps),a.child=c,c.return=a;i.sibling!==null;)i=i.sibling,c=c.sibling=Ds(i,i.pendingProps),c.return=a;c.sibling=null}return a.child}function yv(i,a){return(i.lanes&a)!==0?!0:(i=i.dependencies,!!(i!==null&&Th(i)))}function CO(i,a,c){switch(a.tag){case 3:ce(a,a.stateNode.containerInfo),wo(a,zn,i.memoizedState.cache),va();break;case 27:case 5:pe(a);break;case 4:ce(a,a.stateNode.containerInfo);break;case 10:wo(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Vg(a),null;break;case 13:var m=a.memoizedState;if(m!==null)return m.dehydrated!==null?(Eo(a),a.flags|=128,null):(c&a.child.childLanes)!==0?dS(i,a,c):(Eo(a),i=Bs(i,a,c),i!==null?i.sibling:null);Eo(a);break;case 19:var _=(i.flags&128)!==0;if(m=(c&a.childLanes)!==0,m||(Cl(i,a,c,!1),m=(c&a.childLanes)!==0),_){if(m)return fS(i,a,c);a.flags|=128}if(_=a.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),A(Nn,Nn.current),m)break;return null;case 22:return a.lanes=0,sS(i,a,c,a.pendingProps);case 24:wo(a,zn,i.memoizedState.cache)}return Bs(i,a,c)}function mS(i,a,c){if(i!==null)if(i.memoizedProps!==a.pendingProps)Bn=!0;else{if(!yv(i,c)&&(a.flags&128)===0)return Bn=!1,CO(i,a,c);Bn=(i.flags&131072)!==0}else Bn=!1,At&&(a.flags&1048576)!==0&&q1(a,Jc,a.index);switch(a.lanes=0,a.tag){case 16:e:{var m=a.pendingProps;if(i=xa(a.elementType),a.type=i,typeof i=="function")kg(i)?(m=ka(i,m),a.tag=1,a=cS(null,a,i,m,c)):(a.tag=0,a=fv(null,a,i,m,c));else{if(i!=null){var _=i.$$typeof;if(_===N){a.tag=11,a=nS(null,a,i,m,c);break e}else if(_===j){a.tag=14,a=rS(null,a,i,m,c);break e}}throw a=F(i)||i,Error(r(306,a,""))}}return a;case 0:return fv(i,a,a.type,a.pendingProps,c);case 1:return m=a.type,_=ka(m,a.pendingProps),cS(i,a,m,_,c);case 3:e:{if(ce(a,a.stateNode.containerInfo),i===null)throw Error(r(387));m=a.pendingProps;var x=a.memoizedState;_=x.element,Fg(i,a),au(a,m,null,c);var T=a.memoizedState;if(m=T.cache,wo(a,zn,m),m!==x.cache&&Og(a,[zn],c,!0),ou(),m=T.element,x.isDehydrated)if(x={element:m,isDehydrated:!1,cache:T.cache},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){a=uS(i,a,m,c);break e}else if(m!==_){_=gi(Error(r(424)),a),eu(_),a=uS(i,a,m,c);break e}else{switch(i=a.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(hn=xi(i.firstChild),hr=a,At=!0,yo=null,_i=!0,c=sw(a,null,m,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(va(),m===_){a=Bs(i,a,c);break e}mr(i,a,m,c)}a=a.child}return a;case 26:return Kh(i,a),i===null?(c=kC(a.type,null,a.pendingProps,null))?a.memoizedState=c:At||(c=a.type,i=a.pendingProps,m=df(ee.current).createElement(c),m[It]=a,m[Ft]=i,pr(m,c,i),Ln(m),a.stateNode=m):a.memoizedState=kC(a.type,i.memoizedProps,a.pendingProps,i.memoizedState),null;case 27:return pe(a),i===null&&At&&(m=a.stateNode=wC(a.type,a.pendingProps,ee.current),hr=a,_i=!0,_=hn,Lo(a.type)?(Jv=_,hn=xi(m.firstChild)):hn=_),mr(i,a,a.pendingProps.children,c),Kh(i,a),i===null&&(a.flags|=4194304),a.child;case 5:return i===null&&At&&((_=m=hn)&&(m=e4(m,a.type,a.pendingProps,_i),m!==null?(a.stateNode=m,hr=a,hn=xi(m.firstChild),_i=!1,_=!0):_=!1),_||xo(a)),pe(a),_=a.type,x=a.pendingProps,T=i!==null?i.memoizedProps:null,m=x.children,Gv(_,x)?m=null:T!==null&&Gv(_,T)&&(a.flags|=32),a.memoizedState!==null&&(_=Kg(i,a,pO,null,null,c),Ru._currentValue=_),Kh(i,a),mr(i,a,m,c),a.child;case 6:return i===null&&At&&((i=c=hn)&&(c=t4(c,a.pendingProps,_i),c!==null?(a.stateNode=c,hr=a,hn=null,i=!0):i=!1),i||xo(a)),null;case 13:return dS(i,a,c);case 4:return ce(a,a.stateNode.containerInfo),m=a.pendingProps,i===null?a.child=Sa(a,null,m,c):mr(i,a,m,c),a.child;case 11:return nS(i,a,a.type,a.pendingProps,c);case 7:return mr(i,a,a.pendingProps,c),a.child;case 8:return mr(i,a,a.pendingProps.children,c),a.child;case 12:return mr(i,a,a.pendingProps.children,c),a.child;case 10:return m=a.pendingProps,wo(a,a.type,m.value),mr(i,a,m.children,c),a.child;case 9:return _=a.type._context,m=a.pendingProps.children,_a(a),_=fr(_),m=m(_),a.flags|=1,mr(i,a,m,c),a.child;case 14:return rS(i,a,a.type,a.pendingProps,c);case 15:return iS(i,a,a.type,a.pendingProps,c);case 19:return fS(i,a,c);case 31:return SO(i,a,c);case 22:return sS(i,a,c,a.pendingProps);case 24:return _a(a),m=fr(zn),i===null?(_=Pg(),_===null&&(_=an,x=Lg(),_.pooledCache=x,x.refCount++,x!==null&&(_.pooledCacheLanes|=c),_=x),a.memoizedState={parent:m,cache:_},Ig(a),wo(a,zn,_)):((i.lanes&c)!==0&&(Fg(i,a),au(a,null,null,c),ou()),_=i.memoizedState,x=a.memoizedState,_.parent!==m?(_={parent:m,cache:m},a.memoizedState=_,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=_),wo(a,zn,m)):(m=x.cache,wo(a,zn,m),m!==_.cache&&Og(a,[zn],c,!0))),mr(i,a,a.pendingProps.children,c),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Is(i){i.flags|=4}function xv(i,a,c,m,_){if((a=(i.mode&32)!==0)&&(a=!1),a){if(i.flags|=16777216,(_&335544128)===_)if(i.stateNode.complete)i.flags|=8192;else if(HS())i.flags|=8192;else throw wa=Dh,Bg}else i.flags&=-16777217}function pS(i,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!MC(a))if(HS())i.flags|=8192;else throw wa=Dh,Bg}function Yh(i,a){a!==null&&(i.flags|=4),i.flags&16384&&(a=i.tag!==22?wt():536870912,i.lanes|=a,zl|=a)}function fu(i,a){if(!At)switch(i.tailMode){case"hidden":a=i.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:m.sibling=null}}function fn(i){var a=i.alternate!==null&&i.alternate.child===i.child,c=0,m=0;if(a)for(var _=i.child;_!==null;)c|=_.lanes|_.childLanes,m|=_.subtreeFlags&65011712,m|=_.flags&65011712,_.return=i,_=_.sibling;else for(_=i.child;_!==null;)c|=_.lanes|_.childLanes,m|=_.subtreeFlags,m|=_.flags,_.return=i,_=_.sibling;return i.subtreeFlags|=m,i.childLanes=c,a}function kO(i,a,c){var m=a.pendingProps;switch(Ng(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fn(a),null;case 1:return fn(a),null;case 3:return c=a.stateNode,m=null,i!==null&&(m=i.memoizedState.cache),a.memoizedState.cache!==m&&(a.flags|=2048),Ls(zn),he(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(Sl(a)?Is(a):i===null||i.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Ag())),fn(a),null;case 26:var _=a.type,x=a.memoizedState;return i===null?(Is(a),x!==null?(fn(a),pS(a,x)):(fn(a),xv(a,_,null,m,c))):x?x!==i.memoizedState?(Is(a),fn(a),pS(a,x)):(fn(a),a.flags&=-16777217):(i=i.memoizedProps,i!==m&&Is(a),fn(a),xv(a,_,i,m,c)),null;case 27:if(Se(a),c=ee.current,_=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==m&&Is(a);else{if(!m){if(a.stateNode===null)throw Error(r(166));return fn(a),null}i=ie.current,Sl(a)?G1(a):(i=wC(_,m,c),a.stateNode=i,Is(a))}return fn(a),null;case 5:if(Se(a),_=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==m&&Is(a);else{if(!m){if(a.stateNode===null)throw Error(r(166));return fn(a),null}if(x=ie.current,Sl(a))G1(a);else{var T=df(ee.current);switch(x){case 1:x=T.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:x=T.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":x=T.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":x=T.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":x=T.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof m.is=="string"?T.createElement("select",{is:m.is}):T.createElement("select"),m.multiple?x.multiple=!0:m.size&&(x.size=m.size);break;default:x=typeof m.is=="string"?T.createElement(_,{is:m.is}):T.createElement(_)}}x[It]=a,x[Ft]=m;e:for(T=a.child;T!==null;){if(T.tag===5||T.tag===6)x.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===a)break e;for(;T.sibling===null;){if(T.return===null||T.return===a)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}a.stateNode=x;e:switch(pr(x,_,m),_){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Is(a)}}return fn(a),xv(a,a.type,i===null?null:i.memoizedProps,a.pendingProps,c),null;case 6:if(i&&a.stateNode!=null)i.memoizedProps!==m&&Is(a);else{if(typeof m!="string"&&a.stateNode===null)throw Error(r(166));if(i=ee.current,Sl(a)){if(i=a.stateNode,c=a.memoizedProps,m=null,_=hr,_!==null)switch(_.tag){case 27:case 5:m=_.memoizedProps}i[It]=a,i=!!(i.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||dC(i.nodeValue,c)),i||xo(a,!0)}else i=df(i).createTextNode(m),i[It]=a,a.stateNode=i}return fn(a),null;case 31:if(c=a.memoizedState,i===null||i.memoizedState!==null){if(m=Sl(a),c!==null){if(i===null){if(!m)throw Error(r(318));if(i=a.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[It]=a}else va(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;fn(a),i=!1}else c=Ag(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return a.flags&256?(ti(a),a):(ti(a),null);if((a.flags&128)!==0)throw Error(r(558))}return fn(a),null;case 13:if(m=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(_=Sl(a),m!==null&&m.dehydrated!==null){if(i===null){if(!_)throw Error(r(318));if(_=a.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[It]=a}else va(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;fn(a),_=!1}else _=Ag(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=_),_=!0;if(!_)return a.flags&256?(ti(a),a):(ti(a),null)}return ti(a),(a.flags&128)!==0?(a.lanes=c,a):(c=m!==null,i=i!==null&&i.memoizedState!==null,c&&(m=a.child,_=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(_=m.alternate.memoizedState.cachePool.pool),x=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(x=m.memoizedState.cachePool.pool),x!==_&&(m.flags|=2048)),c!==i&&c&&(a.child.flags|=8192),Yh(a,a.updateQueue),fn(a),null);case 4:return he(),i===null&&$v(a.stateNode.containerInfo),fn(a),null;case 10:return Ls(a.type),fn(a),null;case 19:if(Z(Nn),m=a.memoizedState,m===null)return fn(a),null;if(_=(a.flags&128)!==0,x=m.rendering,x===null)if(_)fu(m,!1);else{if(Cn!==0||i!==null&&(i.flags&128)!==0)for(i=a.child;i!==null;){if(x=zh(i),x!==null){for(a.flags|=128,fu(m,!1),i=x.updateQueue,a.updateQueue=i,Yh(a,i),a.subtreeFlags=0,i=c,c=a.child;c!==null;)$1(c,i),c=c.sibling;return A(Nn,Nn.current&1|2),At&&js(a,m.treeForkCount),a.child}i=i.sibling}m.tail!==null&&Ce()>ef&&(a.flags|=128,_=!0,fu(m,!1),a.lanes=4194304)}else{if(!_)if(i=zh(x),i!==null){if(a.flags|=128,_=!0,i=i.updateQueue,a.updateQueue=i,Yh(a,i),fu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!x.alternate&&!At)return fn(a),null}else 2*Ce()-m.renderingStartTime>ef&&c!==536870912&&(a.flags|=128,_=!0,fu(m,!1),a.lanes=4194304);m.isBackwards?(x.sibling=a.child,a.child=x):(i=m.last,i!==null?i.sibling=x:a.child=x,m.last=x)}return m.tail!==null?(i=m.tail,m.rendering=i,m.tail=i.sibling,m.renderingStartTime=Ce(),i.sibling=null,c=Nn.current,A(Nn,_?c&1|2:c&1),At&&js(a,m.treeForkCount),i):(fn(a),null);case 22:case 23:return ti(a),Wg(),m=a.memoizedState!==null,i!==null?i.memoizedState!==null!==m&&(a.flags|=8192):m&&(a.flags|=8192),m?(c&536870912)!==0&&(a.flags&128)===0&&(fn(a),a.subtreeFlags&6&&(a.flags|=8192)):fn(a),c=a.updateQueue,c!==null&&Yh(a,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),m=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(m=a.memoizedState.cachePool.pool),m!==c&&(a.flags|=2048),i!==null&&Z(ya),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Ls(zn),fn(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function EO(i,a){switch(Ng(a),a.tag){case 1:return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return Ls(zn),he(),i=a.flags,(i&65536)!==0&&(i&128)===0?(a.flags=i&-65537|128,a):null;case 26:case 27:case 5:return Se(a),null;case 31:if(a.memoizedState!==null){if(ti(a),a.alternate===null)throw Error(r(340));va()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 13:if(ti(a),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(r(340));va()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return Z(Nn),null;case 4:return he(),null;case 10:return Ls(a.type),null;case 22:case 23:return ti(a),Wg(),i!==null&&Z(ya),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 24:return Ls(zn),null;case 25:return null;default:return null}}function gS(i,a){switch(Ng(a),a.tag){case 3:Ls(zn),he();break;case 26:case 27:case 5:Se(a);break;case 4:he();break;case 31:a.memoizedState!==null&&ti(a);break;case 13:ti(a);break;case 19:Z(Nn);break;case 10:Ls(a.type);break;case 22:case 23:ti(a),Wg(),i!==null&&Z(ya);break;case 24:Ls(zn)}}function mu(i,a){try{var c=a.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var _=m.next;c=_;do{if((c.tag&i)===i){m=void 0;var x=c.create,T=c.inst;m=x(),T.destroy=m}c=c.next}while(c!==_)}}catch(z){Gt(a,a.return,z)}}function To(i,a,c){try{var m=a.updateQueue,_=m!==null?m.lastEffect:null;if(_!==null){var x=_.next;m=x;do{if((m.tag&i)===i){var T=m.inst,z=T.destroy;if(z!==void 0){T.destroy=void 0,_=a;var Q=c,le=z;try{le()}catch(ge){Gt(_,Q,ge)}}}m=m.next}while(m!==x)}}catch(ge){Gt(a,a.return,ge)}}function vS(i){var a=i.updateQueue;if(a!==null){var c=i.stateNode;try{aw(a,c)}catch(m){Gt(i,i.return,m)}}}function bS(i,a,c){c.props=ka(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(m){Gt(i,a,m)}}function pu(i,a){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var m=i.stateNode;break;case 30:m=i.stateNode;break;default:m=i.stateNode}typeof c=="function"?i.refCleanup=c(m):c.current=m}}catch(_){Gt(i,a,_)}}function os(i,a){var c=i.ref,m=i.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(_){Gt(i,a,_)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(_){Gt(i,a,_)}else c.current=null}function _S(i){var a=i.type,c=i.memoizedProps,m=i.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(_){Gt(i,i.return,_)}}function wv(i,a,c){try{var m=i.stateNode;GO(m,i.type,c,a),m[Ft]=a}catch(_){Gt(i,i.return,_)}}function yS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Lo(i.type)||i.tag===4}function Sv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||yS(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Lo(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Cv(i,a,c){var m=i.tag;if(m===5||m===6)i=i.stateNode,a?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,a):(a=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,a.appendChild(i),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=Ms));else if(m!==4&&(m===27&&Lo(i.type)&&(c=i.stateNode,a=null),i=i.child,i!==null))for(Cv(i,a,c),i=i.sibling;i!==null;)Cv(i,a,c),i=i.sibling}function Xh(i,a,c){var m=i.tag;if(m===5||m===6)i=i.stateNode,a?c.insertBefore(i,a):c.appendChild(i);else if(m!==4&&(m===27&&Lo(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(Xh(i,a,c),i=i.sibling;i!==null;)Xh(i,a,c),i=i.sibling}function xS(i){var a=i.stateNode,c=i.memoizedProps;try{for(var m=i.type,_=a.attributes;_.length;)a.removeAttributeNode(_[0]);pr(a,m,c),a[It]=i,a[Ft]=c}catch(x){Gt(i,i.return,x)}}var Fs=!1,In=!1,kv=!1,wS=typeof WeakSet=="function"?WeakSet:Set,Qn=null;function RO(i,a){if(i=i.containerInfo,qv=bf,i=O1(i),bg(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var _=m.anchorOffset,x=m.focusNode;m=m.focusOffset;try{c.nodeType,x.nodeType}catch{c=null;break e}var T=0,z=-1,Q=-1,le=0,ge=0,_e=i,ue=null;t:for(;;){for(var de;_e!==c||_!==0&&_e.nodeType!==3||(z=T+_),_e!==x||m!==0&&_e.nodeType!==3||(Q=T+m),_e.nodeType===3&&(T+=_e.nodeValue.length),(de=_e.firstChild)!==null;)ue=_e,_e=de;for(;;){if(_e===i)break t;if(ue===c&&++le===_&&(z=T),ue===x&&++ge===m&&(Q=T),(de=_e.nextSibling)!==null)break;_e=ue,ue=_e.parentNode}_e=de}c=z===-1||Q===-1?null:{start:z,end:Q}}else c=null}c=c||{start:0,end:0}}else c=null;for(Kv={focusedElem:i,selectionRange:c},bf=!1,Qn=a;Qn!==null;)if(a=Qn,i=a.child,(a.subtreeFlags&1028)!==0&&i!==null)i.return=a,Qn=i;else for(;Qn!==null;){switch(a=Qn,x=a.alternate,i=a.flags,a.tag){case 0:if((i&4)!==0&&(i=a.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)_=i[c],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,c=a,_=x.memoizedProps,x=x.memoizedState,m=c.stateNode;try{var He=ka(c.type,_);i=m.getSnapshotBeforeUpdate(He,x),m.__reactInternalSnapshotBeforeUpdate=i}catch(tt){Gt(c,c.return,tt)}}break;case 3:if((i&1024)!==0){if(i=a.stateNode.containerInfo,c=i.nodeType,c===9)Xv(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Xv(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=a.sibling,i!==null){i.return=a.return,Qn=i;break}Qn=a.return}}function SS(i,a,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:Us(i,c),m&4&&mu(5,c);break;case 1:if(Us(i,c),m&4)if(i=c.stateNode,a===null)try{i.componentDidMount()}catch(T){Gt(c,c.return,T)}else{var _=ka(c.type,a.memoizedProps);a=a.memoizedState;try{i.componentDidUpdate(_,a,i.__reactInternalSnapshotBeforeUpdate)}catch(T){Gt(c,c.return,T)}}m&64&&vS(c),m&512&&pu(c,c.return);break;case 3:if(Us(i,c),m&64&&(i=c.updateQueue,i!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{aw(i,a)}catch(T){Gt(c,c.return,T)}}break;case 27:a===null&&m&4&&xS(c);case 26:case 5:Us(i,c),a===null&&m&4&&_S(c),m&512&&pu(c,c.return);break;case 12:Us(i,c);break;case 31:Us(i,c),m&4&&ES(i,c);break;case 13:Us(i,c),m&4&&RS(i,c),m&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=zO.bind(null,c),n4(i,c))));break;case 22:if(m=c.memoizedState!==null||Fs,!m){a=a!==null&&a.memoizedState!==null||In,_=Fs;var x=In;Fs=m,(In=a)&&!x?$s(i,c,(c.subtreeFlags&8772)!==0):Us(i,c),Fs=_,In=x}break;case 30:break;default:Us(i,c)}}function CS(i){var a=i.alternate;a!==null&&(i.alternate=null,CS(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&ns(a)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var vn=null,Fr=!1;function Hs(i,a,c){for(c=c.child;c!==null;)kS(i,a,c),c=c.sibling}function kS(i,a,c){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(je,c)}catch{}switch(c.tag){case 26:In||os(c,a),Hs(i,a,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:In||os(c,a);var m=vn,_=Fr;Lo(c.type)&&(vn=c.stateNode,Fr=!1),Hs(i,a,c),Cu(c.stateNode),vn=m,Fr=_;break;case 5:In||os(c,a);case 6:if(m=vn,_=Fr,vn=null,Hs(i,a,c),vn=m,Fr=_,vn!==null)if(Fr)try{(vn.nodeType===9?vn.body:vn.nodeName==="HTML"?vn.ownerDocument.body:vn).removeChild(c.stateNode)}catch(x){Gt(c,a,x)}else try{vn.removeChild(c.stateNode)}catch(x){Gt(c,a,x)}break;case 18:vn!==null&&(Fr?(i=vn,vC(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),Wl(i)):vC(vn,c.stateNode));break;case 4:m=vn,_=Fr,vn=c.stateNode.containerInfo,Fr=!0,Hs(i,a,c),vn=m,Fr=_;break;case 0:case 11:case 14:case 15:To(2,c,a),In||To(4,c,a),Hs(i,a,c);break;case 1:In||(os(c,a),m=c.stateNode,typeof m.componentWillUnmount=="function"&&bS(c,a,m)),Hs(i,a,c);break;case 21:Hs(i,a,c);break;case 22:In=(m=In)||c.memoizedState!==null,Hs(i,a,c),In=m;break;default:Hs(i,a,c)}}function ES(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Wl(i)}catch(c){Gt(a,a.return,c)}}}function RS(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Wl(i)}catch(c){Gt(a,a.return,c)}}function TO(i){switch(i.tag){case 31:case 13:case 19:var a=i.stateNode;return a===null&&(a=i.stateNode=new wS),a;case 22:return i=i.stateNode,a=i._retryCache,a===null&&(a=i._retryCache=new wS),a;default:throw Error(r(435,i.tag))}}function Zh(i,a){var c=TO(i);a.forEach(function(m){if(!c.has(m)){c.add(m);var _=PO.bind(null,i,m);m.then(_,_)}})}function Hr(i,a){var c=a.deletions;if(c!==null)for(var m=0;m<c.length;m++){var _=c[m],x=i,T=a,z=T;e:for(;z!==null;){switch(z.tag){case 27:if(Lo(z.type)){vn=z.stateNode,Fr=!1;break e}break;case 5:vn=z.stateNode,Fr=!1;break e;case 3:case 4:vn=z.stateNode.containerInfo,Fr=!0;break e}z=z.return}if(vn===null)throw Error(r(160));kS(x,T,_),vn=null,Fr=!1,x=_.alternate,x!==null&&(x.return=null),_.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)TS(a,i),a=a.sibling}var Hi=null;function TS(i,a){var c=i.alternate,m=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Hr(a,i),Ur(i),m&4&&(To(3,i,i.return),mu(3,i),To(5,i,i.return));break;case 1:Hr(a,i),Ur(i),m&512&&(In||c===null||os(c,c.return)),m&64&&Fs&&(i=i.updateQueue,i!==null&&(m=i.callbacks,m!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var _=Hi;if(Hr(a,i),Ur(i),m&512&&(In||c===null||os(c,c.return)),m&4){var x=c!==null?c.memoizedState:null;if(m=i.memoizedState,c===null)if(m===null)if(i.stateNode===null){e:{m=i.type,c=i.memoizedProps,_=_.ownerDocument||_;t:switch(m){case"title":x=_.getElementsByTagName("title")[0],(!x||x[On]||x[It]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=_.createElement(m),_.head.insertBefore(x,_.querySelector("head > title"))),pr(x,m,c),x[It]=i,Ln(x),m=x;break e;case"link":var T=TC("link","href",_).get(m+(c.href||""));if(T){for(var z=0;z<T.length;z++)if(x=T[z],x.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&x.getAttribute("rel")===(c.rel==null?null:c.rel)&&x.getAttribute("title")===(c.title==null?null:c.title)&&x.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){T.splice(z,1);break t}}x=_.createElement(m),pr(x,m,c),_.head.appendChild(x);break;case"meta":if(T=TC("meta","content",_).get(m+(c.content||""))){for(z=0;z<T.length;z++)if(x=T[z],x.getAttribute("content")===(c.content==null?null:""+c.content)&&x.getAttribute("name")===(c.name==null?null:c.name)&&x.getAttribute("property")===(c.property==null?null:c.property)&&x.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&x.getAttribute("charset")===(c.charSet==null?null:c.charSet)){T.splice(z,1);break t}}x=_.createElement(m),pr(x,m,c),_.head.appendChild(x);break;default:throw Error(r(468,m))}x[It]=i,Ln(x),m=x}i.stateNode=m}else NC(_,i.type,i.stateNode);else i.stateNode=RC(_,m,i.memoizedProps);else x!==m?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,m===null?NC(_,i.type,i.stateNode):RC(_,m,i.memoizedProps)):m===null&&i.stateNode!==null&&wv(i,i.memoizedProps,c.memoizedProps)}break;case 27:Hr(a,i),Ur(i),m&512&&(In||c===null||os(c,c.return)),c!==null&&m&4&&wv(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Hr(a,i),Ur(i),m&512&&(In||c===null||os(c,c.return)),i.flags&32){_=i.stateNode;try{Br(_,"")}catch(He){Gt(i,i.return,He)}}m&4&&i.stateNode!=null&&(_=i.memoizedProps,wv(i,_,c!==null?c.memoizedProps:_)),m&1024&&(kv=!0);break;case 6:if(Hr(a,i),Ur(i),m&4){if(i.stateNode===null)throw Error(r(162));m=i.memoizedProps,c=i.stateNode;try{c.nodeValue=m}catch(He){Gt(i,i.return,He)}}break;case 3:if(mf=null,_=Hi,Hi=hf(a.containerInfo),Hr(a,i),Hi=_,Ur(i),m&4&&c!==null&&c.memoizedState.isDehydrated)try{Wl(a.containerInfo)}catch(He){Gt(i,i.return,He)}kv&&(kv=!1,NS(i));break;case 4:m=Hi,Hi=hf(i.stateNode.containerInfo),Hr(a,i),Ur(i),Hi=m;break;case 12:Hr(a,i),Ur(i);break;case 31:Hr(a,i),Ur(i),m&4&&(m=i.updateQueue,m!==null&&(i.updateQueue=null,Zh(i,m)));break;case 13:Hr(a,i),Ur(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Jh=Ce()),m&4&&(m=i.updateQueue,m!==null&&(i.updateQueue=null,Zh(i,m)));break;case 22:_=i.memoizedState!==null;var Q=c!==null&&c.memoizedState!==null,le=Fs,ge=In;if(Fs=le||_,In=ge||Q,Hr(a,i),In=ge,Fs=le,Ur(i),m&8192)e:for(a=i.stateNode,a._visibility=_?a._visibility&-2:a._visibility|1,_&&(c===null||Q||Fs||In||Ea(i)),c=null,a=i;;){if(a.tag===5||a.tag===26){if(c===null){Q=c=a;try{if(x=Q.stateNode,_)T=x.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{z=Q.stateNode;var _e=Q.memoizedProps.style,ue=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;z.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(He){Gt(Q,Q.return,He)}}}else if(a.tag===6){if(c===null){Q=a;try{Q.stateNode.nodeValue=_?"":Q.memoizedProps}catch(He){Gt(Q,Q.return,He)}}}else if(a.tag===18){if(c===null){Q=a;try{var de=Q.stateNode;_?bC(de,!0):bC(Q.stateNode,!1)}catch(He){Gt(Q,Q.return,He)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===i)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;c===a&&(c=null),a=a.return}c===a&&(c=null),a.sibling.return=a.return,a=a.sibling}m&4&&(m=i.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,Zh(i,c))));break;case 19:Hr(a,i),Ur(i),m&4&&(m=i.updateQueue,m!==null&&(i.updateQueue=null,Zh(i,m)));break;case 30:break;case 21:break;default:Hr(a,i),Ur(i)}}function Ur(i){var a=i.flags;if(a&2){try{for(var c,m=i.return;m!==null;){if(yS(m)){c=m;break}m=m.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var _=c.stateNode,x=Sv(i);Xh(i,x,_);break;case 5:var T=c.stateNode;c.flags&32&&(Br(T,""),c.flags&=-33);var z=Sv(i);Xh(i,z,T);break;case 3:case 4:var Q=c.stateNode.containerInfo,le=Sv(i);Cv(i,le,Q);break;default:throw Error(r(161))}}catch(ge){Gt(i,i.return,ge)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function NS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var a=i;NS(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),i=i.sibling}}function Us(i,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)SS(i,a.alternate,a),a=a.sibling}function Ea(i){for(i=i.child;i!==null;){var a=i;switch(a.tag){case 0:case 11:case 14:case 15:To(4,a,a.return),Ea(a);break;case 1:os(a,a.return);var c=a.stateNode;typeof c.componentWillUnmount=="function"&&bS(a,a.return,c),Ea(a);break;case 27:Cu(a.stateNode);case 26:case 5:os(a,a.return),Ea(a);break;case 22:a.memoizedState===null&&Ea(a);break;case 30:Ea(a);break;default:Ea(a)}i=i.sibling}}function $s(i,a,c){for(c=c&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var m=a.alternate,_=i,x=a,T=x.flags;switch(x.tag){case 0:case 11:case 15:$s(_,x,c),mu(4,x);break;case 1:if($s(_,x,c),m=x,_=m.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(le){Gt(m,m.return,le)}if(m=x,_=m.updateQueue,_!==null){var z=m.stateNode;try{var Q=_.shared.hiddenCallbacks;if(Q!==null)for(_.shared.hiddenCallbacks=null,_=0;_<Q.length;_++)ow(Q[_],z)}catch(le){Gt(m,m.return,le)}}c&&T&64&&vS(x),pu(x,x.return);break;case 27:xS(x);case 26:case 5:$s(_,x,c),c&&m===null&&T&4&&_S(x),pu(x,x.return);break;case 12:$s(_,x,c);break;case 31:$s(_,x,c),c&&T&4&&ES(_,x);break;case 13:$s(_,x,c),c&&T&4&&RS(_,x);break;case 22:x.memoizedState===null&&$s(_,x,c),pu(x,x.return);break;case 30:break;default:$s(_,x,c)}a=a.sibling}}function Ev(i,a){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&tu(c))}function Rv(i,a){i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&tu(i))}function Ui(i,a,c,m){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)MS(i,a,c,m),a=a.sibling}function MS(i,a,c,m){var _=a.flags;switch(a.tag){case 0:case 11:case 15:Ui(i,a,c,m),_&2048&&mu(9,a);break;case 1:Ui(i,a,c,m);break;case 3:Ui(i,a,c,m),_&2048&&(i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&tu(i)));break;case 12:if(_&2048){Ui(i,a,c,m),i=a.stateNode;try{var x=a.memoizedProps,T=x.id,z=x.onPostCommit;typeof z=="function"&&z(T,a.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(Q){Gt(a,a.return,Q)}}else Ui(i,a,c,m);break;case 31:Ui(i,a,c,m);break;case 13:Ui(i,a,c,m);break;case 23:break;case 22:x=a.stateNode,T=a.alternate,a.memoizedState!==null?x._visibility&2?Ui(i,a,c,m):gu(i,a):x._visibility&2?Ui(i,a,c,m):(x._visibility|=2,jl(i,a,c,m,(a.subtreeFlags&10256)!==0||!1)),_&2048&&Ev(T,a);break;case 24:Ui(i,a,c,m),_&2048&&Rv(a.alternate,a);break;default:Ui(i,a,c,m)}}function jl(i,a,c,m,_){for(_=_&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var x=i,T=a,z=c,Q=m,le=T.flags;switch(T.tag){case 0:case 11:case 15:jl(x,T,z,Q,_),mu(8,T);break;case 23:break;case 22:var ge=T.stateNode;T.memoizedState!==null?ge._visibility&2?jl(x,T,z,Q,_):gu(x,T):(ge._visibility|=2,jl(x,T,z,Q,_)),_&&le&2048&&Ev(T.alternate,T);break;case 24:jl(x,T,z,Q,_),_&&le&2048&&Rv(T.alternate,T);break;default:jl(x,T,z,Q,_)}a=a.sibling}}function gu(i,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var c=i,m=a,_=m.flags;switch(m.tag){case 22:gu(c,m),_&2048&&Ev(m.alternate,m);break;case 24:gu(c,m),_&2048&&Rv(m.alternate,m);break;default:gu(c,m)}a=a.sibling}}var vu=8192;function Ol(i,a,c){if(i.subtreeFlags&vu)for(i=i.child;i!==null;)AS(i,a,c),i=i.sibling}function AS(i,a,c){switch(i.tag){case 26:Ol(i,a,c),i.flags&vu&&i.memoizedState!==null&&m4(c,Hi,i.memoizedState,i.memoizedProps);break;case 5:Ol(i,a,c);break;case 3:case 4:var m=Hi;Hi=hf(i.stateNode.containerInfo),Ol(i,a,c),Hi=m;break;case 22:i.memoizedState===null&&(m=i.alternate,m!==null&&m.memoizedState!==null?(m=vu,vu=16777216,Ol(i,a,c),vu=m):Ol(i,a,c));break;default:Ol(i,a,c)}}function DS(i){var a=i.alternate;if(a!==null&&(i=a.child,i!==null)){a.child=null;do a=i.sibling,i.sibling=null,i=a;while(i!==null)}}function bu(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var m=a[c];Qn=m,OS(m,i)}DS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)jS(i),i=i.sibling}function jS(i){switch(i.tag){case 0:case 11:case 15:bu(i),i.flags&2048&&To(9,i,i.return);break;case 3:bu(i);break;case 12:bu(i);break;case 22:var a=i.stateNode;i.memoizedState!==null&&a._visibility&2&&(i.return===null||i.return.tag!==13)?(a._visibility&=-3,Qh(i)):bu(i);break;default:bu(i)}}function Qh(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var m=a[c];Qn=m,OS(m,i)}DS(i)}for(i=i.child;i!==null;){switch(a=i,a.tag){case 0:case 11:case 15:To(8,a,a.return),Qh(a);break;case 22:c=a.stateNode,c._visibility&2&&(c._visibility&=-3,Qh(a));break;default:Qh(a)}i=i.sibling}}function OS(i,a){for(;Qn!==null;){var c=Qn;switch(c.tag){case 0:case 11:case 15:To(8,c,a);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:tu(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,Qn=m;else e:for(c=i;Qn!==null;){m=Qn;var _=m.sibling,x=m.return;if(CS(m),m===c){Qn=null;break e}if(_!==null){_.return=x,Qn=_;break e}Qn=x}}}var NO={getCacheForType:function(i){var a=fr(zn),c=a.data.get(i);return c===void 0&&(c=i(),a.data.set(i,c)),c},cacheSignal:function(){return fr(zn).controller.signal}},MO=typeof WeakMap=="function"?WeakMap:Map,Ht=0,an=null,kt=null,Nt=0,Kt=0,ni=null,No=!1,Ll=!1,Tv=!1,Ws=0,Cn=0,Mo=0,Ra=0,Nv=0,ri=0,zl=0,_u=null,$r=null,Mv=!1,Jh=0,LS=0,ef=1/0,tf=null,Ao=null,Wn=0,Do=null,Pl=null,Vs=0,Av=0,Dv=null,zS=null,yu=0,jv=null;function ii(){return(Ht&2)!==0&&Nt!==0?Nt&-Nt:O.T!==null?Iv():on()}function PS(){if(ri===0)if((Nt&536870912)===0||At){var i=jn;jn<<=1,(jn&3932160)===0&&(jn=262144),ri=i}else ri=536870912;return i=ei.current,i!==null&&(i.flags|=32),ri}function Wr(i,a,c){(i===an&&(Kt===2||Kt===9)||i.cancelPendingCommit!==null)&&(Bl(i,0),jo(i,Nt,ri,!1)),ht(i,c),((Ht&2)===0||i!==an)&&(i===an&&((Ht&2)===0&&(Ra|=c),Cn===4&&jo(i,Nt,ri,!1)),as(i))}function BS(i,a,c){if((Ht&6)!==0)throw Error(r(327));var m=!c&&(a&127)===0&&(a&i.expiredLanes)===0||dt(i,a),_=m?jO(i,a):Lv(i,a,!0),x=m;do{if(_===0){Ll&&!m&&jo(i,a,0,!1);break}else{if(c=i.current.alternate,x&&!AO(c)){_=Lv(i,a,!1),x=!1;continue}if(_===2){if(x=a,i.errorRecoveryDisabledLanes&x)var T=0;else T=i.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){a=T;e:{var z=i;_=_u;var Q=z.current.memoizedState.isDehydrated;if(Q&&(Bl(z,T).flags|=256),T=Lv(z,T,!1),T!==2){if(Tv&&!Q){z.errorRecoveryDisabledLanes|=x,Ra|=x,_=4;break e}x=$r,$r=_,x!==null&&($r===null?$r=x:$r.push.apply($r,x))}_=T}if(x=!1,_!==2)continue}}if(_===1){Bl(i,0),jo(i,a,0,!0);break}e:{switch(m=i,x=_,x){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:jo(m,a,ri,!No);break e;case 2:$r=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(_=Jh+300-Ce(),10<_)){if(jo(m,a,ri,!No),Pe(m,0,!0)!==0)break e;Vs=a,m.timeoutHandle=pC(IS.bind(null,m,c,$r,tf,Mv,a,ri,Ra,zl,No,x,"Throttled",-0,0),_);break e}IS(m,c,$r,tf,Mv,a,ri,Ra,zl,No,x,null,-0,0)}}break}while(!0);as(i)}function IS(i,a,c,m,_,x,T,z,Q,le,ge,_e,ue,de){if(i.timeoutHandle=-1,_e=a.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ms},AS(a,x,_e);var He=(x&62914560)===x?Jh-Ce():(x&4194048)===x?LS-Ce():0;if(He=p4(_e,He),He!==null){Vs=x,i.cancelPendingCommit=He(KS.bind(null,i,a,x,c,m,_,T,z,Q,ge,_e,null,ue,de)),jo(i,x,T,!le);return}}KS(i,a,x,c,m,_,T,z,Q)}function AO(i){for(var a=i;;){var c=a.tag;if((c===0||c===11||c===15)&&a.flags&16384&&(c=a.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var _=c[m],x=_.getSnapshot;_=_.value;try{if(!Qr(x(),_))return!1}catch{return!1}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function jo(i,a,c,m){a&=~Nv,a&=~Ra,i.suspendedLanes|=a,i.pingedLanes&=~a,m&&(i.warmLanes|=a),m=i.expirationTimes;for(var _=a;0<_;){var x=31-Ue(_),T=1<<x;m[x]=-1,_&=~T}c!==0&&pn(i,c,a)}function nf(){return(Ht&6)===0?(xu(0),!1):!0}function Ov(){if(kt!==null){if(Kt===0)var i=kt.return;else i=kt,Os=ba=null,Xg(i),Tl=null,ru=0,i=kt;for(;i!==null;)gS(i.alternate,i),i=i.return;kt=null}}function Bl(i,a){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,ZO(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Vs=0,Ov(),an=i,kt=c=Ds(i.current,null),Nt=a,Kt=0,ni=null,No=!1,Ll=dt(i,a),Tv=!1,zl=ri=Nv=Ra=Mo=Cn=0,$r=_u=null,Mv=!1,(a&8)!==0&&(a|=a&32);var m=i.entangledLanes;if(m!==0)for(i=i.entanglements,m&=a;0<m;){var _=31-Ue(m),x=1<<_;a|=i[_],m&=~x}return Ws=a,Sh(),c}function FS(i,a){ct=null,O.H=du,a===Rl||a===Ah?(a=nw(),Kt=3):a===Bg?(a=nw(),Kt=4):Kt=a===hv?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ni=a,kt===null&&(Cn=1,Vh(i,gi(a,i.current)))}function HS(){var i=ei.current;return i===null?!0:(Nt&4194048)===Nt?yi===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?i===yi:!1}function US(){var i=O.H;return O.H=du,i===null?du:i}function $S(){var i=O.A;return O.A=NO,i}function rf(){Cn=4,No||(Nt&4194048)!==Nt&&ei.current!==null||(Ll=!0),(Mo&134217727)===0&&(Ra&134217727)===0||an===null||jo(an,Nt,ri,!1)}function Lv(i,a,c){var m=Ht;Ht|=2;var _=US(),x=$S();(an!==i||Nt!==a)&&(tf=null,Bl(i,a)),a=!1;var T=Cn;e:do try{if(Kt!==0&&kt!==null){var z=kt,Q=ni;switch(Kt){case 8:Ov(),T=6;break e;case 3:case 2:case 9:case 6:ei.current===null&&(a=!0);var le=Kt;if(Kt=0,ni=null,Il(i,z,Q,le),c&&Ll){T=0;break e}break;default:le=Kt,Kt=0,ni=null,Il(i,z,Q,le)}}DO(),T=Cn;break}catch(ge){FS(i,ge)}while(!0);return a&&i.shellSuspendCounter++,Os=ba=null,Ht=m,O.H=_,O.A=x,kt===null&&(an=null,Nt=0,Sh()),T}function DO(){for(;kt!==null;)WS(kt)}function jO(i,a){var c=Ht;Ht|=2;var m=US(),_=$S();an!==i||Nt!==a?(tf=null,ef=Ce()+500,Bl(i,a)):Ll=dt(i,a);e:do try{if(Kt!==0&&kt!==null){a=kt;var x=ni;t:switch(Kt){case 1:Kt=0,ni=null,Il(i,a,x,1);break;case 2:case 9:if(ew(x)){Kt=0,ni=null,VS(a);break}a=function(){Kt!==2&&Kt!==9||an!==i||(Kt=7),as(i)},x.then(a,a);break e;case 3:Kt=7;break e;case 4:Kt=5;break e;case 7:ew(x)?(Kt=0,ni=null,VS(a)):(Kt=0,ni=null,Il(i,a,x,7));break;case 5:var T=null;switch(kt.tag){case 26:T=kt.memoizedState;case 5:case 27:var z=kt;if(T?MC(T):z.stateNode.complete){Kt=0,ni=null;var Q=z.sibling;if(Q!==null)kt=Q;else{var le=z.return;le!==null?(kt=le,sf(le)):kt=null}break t}}Kt=0,ni=null,Il(i,a,x,5);break;case 6:Kt=0,ni=null,Il(i,a,x,6);break;case 8:Ov(),Cn=6;break e;default:throw Error(r(462))}}OO();break}catch(ge){FS(i,ge)}while(!0);return Os=ba=null,O.H=m,O.A=_,Ht=c,kt!==null?0:(an=null,Nt=0,Sh(),Cn)}function OO(){for(;kt!==null&&!nt();)WS(kt)}function WS(i){var a=mS(i.alternate,i,Ws);i.memoizedProps=i.pendingProps,a===null?sf(i):kt=a}function VS(i){var a=i,c=a.alternate;switch(a.tag){case 15:case 0:a=lS(c,a,a.pendingProps,a.type,void 0,Nt);break;case 11:a=lS(c,a,a.pendingProps,a.type.render,a.ref,Nt);break;case 5:Xg(a);default:gS(c,a),a=kt=$1(a,Ws),a=mS(c,a,Ws)}i.memoizedProps=i.pendingProps,a===null?sf(i):kt=a}function Il(i,a,c,m){Os=ba=null,Xg(a),Tl=null,ru=0;var _=a.return;try{if(wO(i,_,a,c,Nt)){Cn=1,Vh(i,gi(c,i.current)),kt=null;return}}catch(x){if(_!==null)throw kt=_,x;Cn=1,Vh(i,gi(c,i.current)),kt=null;return}a.flags&32768?(At||m===1?i=!0:Ll||(Nt&536870912)!==0?i=!1:(No=i=!0,(m===2||m===9||m===3||m===6)&&(m=ei.current,m!==null&&m.tag===13&&(m.flags|=16384))),qS(a,i)):sf(a)}function sf(i){var a=i;do{if((a.flags&32768)!==0){qS(a,No);return}i=a.return;var c=kO(a.alternate,a,Ws);if(c!==null){kt=c;return}if(a=a.sibling,a!==null){kt=a;return}kt=a=i}while(a!==null);Cn===0&&(Cn=5)}function qS(i,a){do{var c=EO(i.alternate,i);if(c!==null){c.flags&=32767,kt=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!a&&(i=i.sibling,i!==null)){kt=i;return}kt=i=c}while(i!==null);Cn=6,kt=null}function KS(i,a,c,m,_,x,T,z,Q){i.cancelPendingCommit=null;do of();while(Wn!==0);if((Ht&6)!==0)throw Error(r(327));if(a!==null){if(a===i.current)throw Error(r(177));if(x=a.lanes|a.childLanes,x|=Sg,ft(i,c,x,T,z,Q),i===an&&(kt=an=null,Nt=0),Pl=a,Do=i,Vs=c,Av=x,Dv=_,zS=m,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,BO(Te,function(){return QS(),null})):(i.callbackNode=null,i.callbackPriority=0),m=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||m){m=O.T,O.T=null,_=$.p,$.p=2,T=Ht,Ht|=4;try{RO(i,a,c)}finally{Ht=T,$.p=_,O.T=m}}Wn=1,GS(),YS(),XS()}}function GS(){if(Wn===1){Wn=0;var i=Do,a=Pl,c=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||c){c=O.T,O.T=null;var m=$.p;$.p=2;var _=Ht;Ht|=4;try{TS(a,i);var x=Kv,T=O1(i.containerInfo),z=x.focusedElem,Q=x.selectionRange;if(T!==z&&z&&z.ownerDocument&&j1(z.ownerDocument.documentElement,z)){if(Q!==null&&bg(z)){var le=Q.start,ge=Q.end;if(ge===void 0&&(ge=le),"selectionStart"in z)z.selectionStart=le,z.selectionEnd=Math.min(ge,z.value.length);else{var _e=z.ownerDocument||document,ue=_e&&_e.defaultView||window;if(ue.getSelection){var de=ue.getSelection(),He=z.textContent.length,tt=Math.min(Q.start,He),Jt=Q.end===void 0?tt:Math.min(Q.end,He);!de.extend&&tt>Jt&&(T=Jt,Jt=tt,tt=T);var se=D1(z,tt),te=D1(z,Jt);if(se&&te&&(de.rangeCount!==1||de.anchorNode!==se.node||de.anchorOffset!==se.offset||de.focusNode!==te.node||de.focusOffset!==te.offset)){var ae=_e.createRange();ae.setStart(se.node,se.offset),de.removeAllRanges(),tt>Jt?(de.addRange(ae),de.extend(te.node,te.offset)):(ae.setEnd(te.node,te.offset),de.addRange(ae))}}}}for(_e=[],de=z;de=de.parentNode;)de.nodeType===1&&_e.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<_e.length;z++){var be=_e[z];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}bf=!!qv,Kv=qv=null}finally{Ht=_,$.p=m,O.T=c}}i.current=a,Wn=2}}function YS(){if(Wn===2){Wn=0;var i=Do,a=Pl,c=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||c){c=O.T,O.T=null;var m=$.p;$.p=2;var _=Ht;Ht|=4;try{SS(i,a.alternate,a)}finally{Ht=_,$.p=m,O.T=c}}Wn=3}}function XS(){if(Wn===4||Wn===3){Wn=0,rn();var i=Do,a=Pl,c=Vs,m=zS;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Wn=5:(Wn=0,Pl=Do=null,ZS(i,i.pendingLanes));var _=i.pendingLanes;if(_===0&&(Ao=null),ot(c),a=a.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(je,a,void 0,(a.current.flags&128)===128)}catch{}if(m!==null){a=O.T,_=$.p,$.p=2,O.T=null;try{for(var x=i.onRecoverableError,T=0;T<m.length;T++){var z=m[T];x(z.value,{componentStack:z.stack})}}finally{O.T=a,$.p=_}}(Vs&3)!==0&&of(),as(i),_=i.pendingLanes,(c&261930)!==0&&(_&42)!==0?i===jv?yu++:(yu=0,jv=i):yu=0,xu(0)}}function ZS(i,a){(i.pooledCacheLanes&=a)===0&&(a=i.pooledCache,a!=null&&(i.pooledCache=null,tu(a)))}function of(){return GS(),YS(),XS(),QS()}function QS(){if(Wn!==5)return!1;var i=Do,a=Av;Av=0;var c=ot(Vs),m=O.T,_=$.p;try{$.p=32>c?32:c,O.T=null,c=Dv,Dv=null;var x=Do,T=Vs;if(Wn=0,Pl=Do=null,Vs=0,(Ht&6)!==0)throw Error(r(331));var z=Ht;if(Ht|=4,jS(x.current),MS(x,x.current,T,c),Ht=z,xu(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(je,x)}catch{}return!0}finally{$.p=_,O.T=m,ZS(i,a)}}function JS(i,a,c){a=gi(c,a),a=dv(i.stateNode,a,2),i=ko(i,a,2),i!==null&&(ht(i,2),as(i))}function Gt(i,a,c){if(i.tag===3)JS(i,i,c);else for(;a!==null;){if(a.tag===3){JS(a,i,c);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Ao===null||!Ao.has(m))){i=gi(c,i),c=eS(2),m=ko(a,c,2),m!==null&&(tS(c,m,a,i),ht(m,2),as(m));break}}a=a.return}}function zv(i,a,c){var m=i.pingCache;if(m===null){m=i.pingCache=new MO;var _=new Set;m.set(a,_)}else _=m.get(a),_===void 0&&(_=new Set,m.set(a,_));_.has(c)||(Tv=!0,_.add(c),i=LO.bind(null,i,a,c),a.then(i,i))}function LO(i,a,c){var m=i.pingCache;m!==null&&m.delete(a),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,an===i&&(Nt&c)===c&&(Cn===4||Cn===3&&(Nt&62914560)===Nt&&300>Ce()-Jh?(Ht&2)===0&&Bl(i,0):Nv|=c,zl===Nt&&(zl=0)),as(i)}function eC(i,a){a===0&&(a=wt()),i=pa(i,a),i!==null&&(ht(i,a),as(i))}function zO(i){var a=i.memoizedState,c=0;a!==null&&(c=a.retryLane),eC(i,c)}function PO(i,a){var c=0;switch(i.tag){case 31:case 13:var m=i.stateNode,_=i.memoizedState;_!==null&&(c=_.retryLane);break;case 19:m=i.stateNode;break;case 22:m=i.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(a),eC(i,c)}function BO(i,a){return lt(i,a)}var af=null,Fl=null,Pv=!1,lf=!1,Bv=!1,Oo=0;function as(i){i!==Fl&&i.next===null&&(Fl===null?af=Fl=i:Fl=Fl.next=i),lf=!0,Pv||(Pv=!0,FO())}function xu(i,a){if(!Bv&&lf){Bv=!0;do for(var c=!1,m=af;m!==null;){if(i!==0){var _=m.pendingLanes;if(_===0)var x=0;else{var T=m.suspendedLanes,z=m.pingedLanes;x=(1<<31-Ue(42|i)+1)-1,x&=_&~(T&~z),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,iC(m,x))}else x=Nt,x=Pe(m,m===an?x:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(x&3)===0||dt(m,x)||(c=!0,iC(m,x));m=m.next}while(c);Bv=!1}}function IO(){tC()}function tC(){lf=Pv=!1;var i=0;Oo!==0&&XO()&&(i=Oo);for(var a=Ce(),c=null,m=af;m!==null;){var _=m.next,x=nC(m,a);x===0?(m.next=null,c===null?af=_:c.next=_,_===null&&(Fl=c)):(c=m,(i!==0||(x&3)!==0)&&(lf=!0)),m=_}Wn!==0&&Wn!==5||xu(i),Oo!==0&&(Oo=0)}function nC(i,a){for(var c=i.suspendedLanes,m=i.pingedLanes,_=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var T=31-Ue(x),z=1<<T,Q=_[T];Q===-1?((z&c)===0||(z&m)!==0)&&(_[T]=gt(z,a)):Q<=a&&(i.expiredLanes|=z),x&=~z}if(a=an,c=Nt,c=Pe(i,i===a?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),m=i.callbackNode,c===0||i===a&&(Kt===2||Kt===9)||i.cancelPendingCommit!==null)return m!==null&&m!==null&&st(m),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||dt(i,c)){if(a=c&-c,a===i.callbackPriority)return a;switch(m!==null&&st(m),ot(c)){case 2:case 8:c=ve;break;case 32:c=Te;break;case 268435456:c=Ge;break;default:c=Te}return m=rC.bind(null,i),c=lt(c,m),i.callbackPriority=a,i.callbackNode=c,a}return m!==null&&m!==null&&st(m),i.callbackPriority=2,i.callbackNode=null,2}function rC(i,a){if(Wn!==0&&Wn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(of()&&i.callbackNode!==c)return null;var m=Nt;return m=Pe(i,i===an?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),m===0?null:(BS(i,m,a),nC(i,Ce()),i.callbackNode!=null&&i.callbackNode===c?rC.bind(null,i):null)}function iC(i,a){if(of())return null;BS(i,a,!0)}function FO(){QO(function(){(Ht&6)!==0?lt(oe,IO):tC()})}function Iv(){if(Oo===0){var i=kl;i===0&&(i=qt,qt<<=1,(qt&261888)===0&&(qt=256)),Oo=i}return Oo}function sC(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:ph(""+i)}function oC(i,a){var c=a.ownerDocument.createElement("input");return c.name=a.name,c.value=a.value,i.id&&c.setAttribute("form",i.id),a.parentNode.insertBefore(c,a),i=new FormData(i),c.parentNode.removeChild(c),i}function HO(i,a,c,m,_){if(a==="submit"&&c&&c.stateNode===_){var x=sC((_[Ft]||null).action),T=m.submitter;T&&(a=(a=T[Ft]||null)?sC(a.formAction):T.getAttribute("formAction"),a!==null&&(x=a,T=null));var z=new _h("action","action",null,m,_);i.push({event:z,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Oo!==0){var Q=T?oC(_,T):new FormData(_);sv(c,{pending:!0,data:Q,method:_.method,action:x},null,Q)}}else typeof x=="function"&&(z.preventDefault(),Q=T?oC(_,T):new FormData(_),sv(c,{pending:!0,data:Q,method:_.method,action:x},x,Q))},currentTarget:_}]})}}for(var Fv=0;Fv<wg.length;Fv++){var Hv=wg[Fv],UO=Hv.toLowerCase(),$O=Hv[0].toUpperCase()+Hv.slice(1);Fi(UO,"on"+$O)}Fi(P1,"onAnimationEnd"),Fi(B1,"onAnimationIteration"),Fi(I1,"onAnimationStart"),Fi("dblclick","onDoubleClick"),Fi("focusin","onFocus"),Fi("focusout","onBlur"),Fi(sO,"onTransitionRun"),Fi(oO,"onTransitionStart"),Fi(aO,"onTransitionCancel"),Fi(F1,"onTransitionEnd"),vo("onMouseEnter",["mouseout","mouseover"]),vo("onMouseLeave",["mouseout","mouseover"]),vo("onPointerEnter",["pointerout","pointerover"]),vo("onPointerLeave",["pointerout","pointerover"]),Ns("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ns("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ns("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ns("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ns("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ns("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wu="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(" "),WO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wu));function aC(i,a){a=(a&4)!==0;for(var c=0;c<i.length;c++){var m=i[c],_=m.event;m=m.listeners;e:{var x=void 0;if(a)for(var T=m.length-1;0<=T;T--){var z=m[T],Q=z.instance,le=z.currentTarget;if(z=z.listener,Q!==x&&_.isPropagationStopped())break e;x=z,_.currentTarget=le;try{x(_)}catch(ge){wh(ge)}_.currentTarget=null,x=Q}else for(T=0;T<m.length;T++){if(z=m[T],Q=z.instance,le=z.currentTarget,z=z.listener,Q!==x&&_.isPropagationStopped())break e;x=z,_.currentTarget=le;try{x(_)}catch(ge){wh(ge)}_.currentTarget=null,x=Q}}}}function Et(i,a){var c=a[ts];c===void 0&&(c=a[ts]=new Set);var m=i+"__bubble";c.has(m)||(lC(a,i,2,!1),c.add(m))}function Uv(i,a,c){var m=0;a&&(m|=4),lC(c,i,m,a)}var cf="_reactListening"+Math.random().toString(36).slice(2);function $v(i){if(!i[cf]){i[cf]=!0,lh.forEach(function(c){c!=="selectionchange"&&(WO.has(c)||Uv(c,!1,i),Uv(c,!0,i))});var a=i.nodeType===9?i:i.ownerDocument;a===null||a[cf]||(a[cf]=!0,Uv("selectionchange",!1,a))}}function lC(i,a,c,m){switch(PC(a)){case 2:var _=b4;break;case 8:_=_4;break;default:_=ib}c=_.bind(null,a,c,i),_=void 0,!cg||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(_=!0),m?_!==void 0?i.addEventListener(a,c,{capture:!0,passive:_}):i.addEventListener(a,c,!0):_!==void 0?i.addEventListener(a,c,{passive:_}):i.addEventListener(a,c,!1)}function Wv(i,a,c,m,_){var x=m;if((a&1)===0&&(a&2)===0&&m!==null)e:for(;;){if(m===null)return;var T=m.tag;if(T===3||T===4){var z=m.stateNode.containerInfo;if(z===_)break;if(T===4)for(T=m.return;T!==null;){var Q=T.tag;if((Q===3||Q===4)&&T.stateNode.containerInfo===_)return;T=T.return}for(;z!==null;){if(T=mi(z),T===null)return;if(Q=T.tag,Q===5||Q===6||Q===26||Q===27){m=x=T;continue e}z=z.parentNode}}m=m.return}f1(function(){var le=x,ge=ag(c),_e=[];e:{var ue=H1.get(i);if(ue!==void 0){var de=_h,He=i;switch(i){case"keypress":if(vh(c)===0)break e;case"keydown":case"keyup":de=P3;break;case"focusin":He="focus",de=fg;break;case"focusout":He="blur",de=fg;break;case"beforeblur":case"afterblur":de=fg;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=g1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=k3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=F3;break;case P1:case B1:case I1:de=T3;break;case F1:de=U3;break;case"scroll":case"scrollend":de=S3;break;case"wheel":de=W3;break;case"copy":case"cut":case"paste":de=M3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=b1;break;case"toggle":case"beforetoggle":de=q3}var tt=(a&4)!==0,Jt=!tt&&(i==="scroll"||i==="scrollend"),se=tt?ue!==null?ue+"Capture":null:ue;tt=[];for(var te=le,ae;te!==null;){var be=te;if(ae=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ae===null||se===null||(be=Wc(te,se),be!=null&&tt.push(Su(te,be,ae))),Jt)break;te=te.return}0<tt.length&&(ue=new de(ue,He,null,c,ge),_e.push({event:ue,listeners:tt}))}}if((a&7)===0){e:{if(ue=i==="mouseover"||i==="pointerover",de=i==="mouseout"||i==="pointerout",ue&&c!==og&&(He=c.relatedTarget||c.fromElement)&&(mi(He)||He[yr]))break e;if((de||ue)&&(ue=ge.window===ge?ge:(ue=ge.ownerDocument)?ue.defaultView||ue.parentWindow:window,de?(He=c.relatedTarget||c.toElement,de=le,He=He?mi(He):null,He!==null&&(Jt=o(He),tt=He.tag,He!==Jt||tt!==5&&tt!==27&&tt!==6)&&(He=null)):(de=null,He=le),de!==He)){if(tt=g1,be="onMouseLeave",se="onMouseEnter",te="mouse",(i==="pointerout"||i==="pointerover")&&(tt=b1,be="onPointerLeave",se="onPointerEnter",te="pointer"),Jt=de==null?ue:Tn(de),ae=He==null?ue:Tn(He),ue=new tt(be,te+"leave",de,c,ge),ue.target=Jt,ue.relatedTarget=ae,be=null,mi(ge)===le&&(tt=new tt(se,te+"enter",He,c,ge),tt.target=ae,tt.relatedTarget=Jt,be=tt),Jt=be,de&&He)t:{for(tt=VO,se=de,te=He,ae=0,be=se;be;be=tt(be))ae++;be=0;for(var Qe=te;Qe;Qe=tt(Qe))be++;for(;0<ae-be;)se=tt(se),ae--;for(;0<be-ae;)te=tt(te),be--;for(;ae--;){if(se===te||te!==null&&se===te.alternate){tt=se;break t}se=tt(se),te=tt(te)}tt=null}else tt=null;de!==null&&cC(_e,ue,de,tt,!1),He!==null&&Jt!==null&&cC(_e,Jt,He,tt,!0)}}e:{if(ue=le?Tn(le):window,de=ue.nodeName&&ue.nodeName.toLowerCase(),de==="select"||de==="input"&&ue.type==="file")var zt=E1;else if(C1(ue))if(R1)zt=nO;else{zt=eO;var qe=J3}else de=ue.nodeName,!de||de.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?le&&sg(le.elementType)&&(zt=E1):zt=tO;if(zt&&(zt=zt(i,le))){k1(_e,zt,c,ge);break e}qe&&qe(i,ue,le),i==="focusout"&&le&&ue.type==="number"&&le.memoizedProps.value!=null&&Fe(ue,"number",ue.value)}switch(qe=le?Tn(le):window,i){case"focusin":(C1(qe)||qe.contentEditable==="true")&&(vl=qe,_g=le,Qc=null);break;case"focusout":Qc=_g=vl=null;break;case"mousedown":yg=!0;break;case"contextmenu":case"mouseup":case"dragend":yg=!1,L1(_e,c,ge);break;case"selectionchange":if(iO)break;case"keydown":case"keyup":L1(_e,c,ge)}var mt;if(pg)e:{switch(i){case"compositionstart":var Mt="onCompositionStart";break e;case"compositionend":Mt="onCompositionEnd";break e;case"compositionupdate":Mt="onCompositionUpdate";break e}Mt=void 0}else gl?w1(i,c)&&(Mt="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Mt="onCompositionStart");Mt&&(_1&&c.locale!=="ko"&&(gl||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&gl&&(mt=m1()):(bo=ge,ug="value"in bo?bo.value:bo.textContent,gl=!0)),qe=uf(le,Mt),0<qe.length&&(Mt=new v1(Mt,i,null,c,ge),_e.push({event:Mt,listeners:qe}),mt?Mt.data=mt:(mt=S1(c),mt!==null&&(Mt.data=mt)))),(mt=G3?Y3(i,c):X3(i,c))&&(Mt=uf(le,"onBeforeInput"),0<Mt.length&&(qe=new v1("onBeforeInput","beforeinput",null,c,ge),_e.push({event:qe,listeners:Mt}),qe.data=mt)),HO(_e,i,le,c,ge)}aC(_e,a)})}function Su(i,a,c){return{instance:i,listener:a,currentTarget:c}}function uf(i,a){for(var c=a+"Capture",m=[];i!==null;){var _=i,x=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||x===null||(_=Wc(i,c),_!=null&&m.unshift(Su(i,_,x)),_=Wc(i,a),_!=null&&m.push(Su(i,_,x))),i.tag===3)return m;i=i.return}return[]}function VO(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function cC(i,a,c,m,_){for(var x=a._reactName,T=[];c!==null&&c!==m;){var z=c,Q=z.alternate,le=z.stateNode;if(z=z.tag,Q!==null&&Q===m)break;z!==5&&z!==26&&z!==27||le===null||(Q=le,_?(le=Wc(c,x),le!=null&&T.unshift(Su(c,le,Q))):_||(le=Wc(c,x),le!=null&&T.push(Su(c,le,Q)))),c=c.return}T.length!==0&&i.push({event:a,listeners:T})}var qO=/\r\n?/g,KO=/\u0000|\uFFFD/g;function uC(i){return(typeof i=="string"?i:""+i).replace(qO,`
|
|
49
|
+
`).replace(KO,"")}function dC(i,a){return a=uC(a),uC(i)===a}function Qt(i,a,c,m,_,x){switch(c){case"children":typeof m=="string"?a==="body"||a==="textarea"&&m===""||Br(i,m):(typeof m=="number"||typeof m=="bigint")&&a!=="body"&&Br(i,""+m);break;case"className":fl(i,"class",m);break;case"tabIndex":fl(i,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":fl(i,c,m);break;case"style":d1(i,m,x);break;case"data":if(a!=="object"){fl(i,"data",m);break}case"src":case"href":if(m===""&&(a!=="a"||c!=="href")){i.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){i.removeAttribute(c);break}m=ph(""+m),i.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){i.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(c==="formAction"?(a!=="input"&&Qt(i,a,"name",_.name,_,null),Qt(i,a,"formEncType",_.formEncType,_,null),Qt(i,a,"formMethod",_.formMethod,_,null),Qt(i,a,"formTarget",_.formTarget,_,null)):(Qt(i,a,"encType",_.encType,_,null),Qt(i,a,"method",_.method,_,null),Qt(i,a,"target",_.target,_,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){i.removeAttribute(c);break}m=ph(""+m),i.setAttribute(c,m);break;case"onClick":m!=null&&(i.onclick=Ms);break;case"onScroll":m!=null&&Et("scroll",i);break;case"onScrollEnd":m!=null&&Et("scrollend",i);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(c=m.__html,c!=null){if(_.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":i.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){i.removeAttribute("xlink:href");break}c=ph(""+m),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(c,""+m):i.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":m===!0?i.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(c,m):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?i.setAttribute(c,m):i.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?i.removeAttribute(c):i.setAttribute(c,m);break;case"popover":Et("beforetoggle",i),Et("toggle",i),hl(i,"popover",m);break;case"xlinkActuate":Ii(i,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Ii(i,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Ii(i,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Ii(i,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Ii(i,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Ii(i,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Ii(i,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Ii(i,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Ii(i,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":hl(i,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=x3.get(c)||c,hl(i,c,m))}}function Vv(i,a,c,m,_,x){switch(c){case"style":d1(i,m,x);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(c=m.__html,c!=null){if(_.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof m=="string"?Br(i,m):(typeof m=="number"||typeof m=="bigint")&&Br(i,""+m);break;case"onScroll":m!=null&&Et("scroll",i);break;case"onScrollEnd":m!=null&&Et("scrollend",i);break;case"onClick":m!=null&&(i.onclick=Ms);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ch.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(_=c.endsWith("Capture"),a=c.slice(2,_?c.length-7:void 0),x=i[Ft]||null,x=x!=null?x[c]:null,typeof x=="function"&&i.removeEventListener(a,x,_),typeof m=="function")){typeof x!="function"&&x!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(a,m,_);break e}c in i?i[c]=m:m===!0?i.setAttribute(c,""):hl(i,c,m)}}}function pr(i,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",i),Et("load",i);var m=!1,_=!1,x;for(x in c)if(c.hasOwnProperty(x)){var T=c[x];if(T!=null)switch(x){case"src":m=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Qt(i,a,x,T,c,null)}}_&&Qt(i,a,"srcSet",c.srcSet,c,null),m&&Qt(i,a,"src",c.src,c,null);return;case"input":Et("invalid",i);var z=x=T=_=null,Q=null,le=null;for(m in c)if(c.hasOwnProperty(m)){var ge=c[m];if(ge!=null)switch(m){case"name":_=ge;break;case"type":T=ge;break;case"checked":Q=ge;break;case"defaultChecked":le=ge;break;case"value":x=ge;break;case"defaultValue":z=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,a));break;default:Qt(i,a,m,ge,c,null)}}we(i,x,z,Q,le,T,_,!1);return;case"select":Et("invalid",i),m=T=x=null;for(_ in c)if(c.hasOwnProperty(_)&&(z=c[_],z!=null))switch(_){case"value":x=z;break;case"defaultValue":T=z;break;case"multiple":m=z;default:Qt(i,a,_,z,c,null)}a=x,c=T,i.multiple=!!m,a!=null?Dt(i,!!m,a,!1):c!=null&&Dt(i,!!m,c,!0);return;case"textarea":Et("invalid",i),x=_=m=null;for(T in c)if(c.hasOwnProperty(T)&&(z=c[T],z!=null))switch(T){case"value":m=z;break;case"defaultValue":_=z;break;case"children":x=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(91));break;default:Qt(i,a,T,z,c,null)}dr(i,m,_,x);return;case"option":for(Q in c)if(c.hasOwnProperty(Q)&&(m=c[Q],m!=null))switch(Q){case"selected":i.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Qt(i,a,Q,m,c,null)}return;case"dialog":Et("beforetoggle",i),Et("toggle",i),Et("cancel",i),Et("close",i);break;case"iframe":case"object":Et("load",i);break;case"video":case"audio":for(m=0;m<wu.length;m++)Et(wu[m],i);break;case"image":Et("error",i),Et("load",i);break;case"details":Et("toggle",i);break;case"embed":case"source":case"link":Et("error",i),Et("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in c)if(c.hasOwnProperty(le)&&(m=c[le],m!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Qt(i,a,le,m,c,null)}return;default:if(sg(a)){for(ge in c)c.hasOwnProperty(ge)&&(m=c[ge],m!==void 0&&Vv(i,a,ge,m,c,void 0));return}}for(z in c)c.hasOwnProperty(z)&&(m=c[z],m!=null&&Qt(i,a,z,m,c,null))}function GO(i,a,c,m){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,x=null,T=null,z=null,Q=null,le=null,ge=null;for(de in c){var _e=c[de];if(c.hasOwnProperty(de)&&_e!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":Q=_e;default:m.hasOwnProperty(de)||Qt(i,a,de,null,m,_e)}}for(var ue in m){var de=m[ue];if(_e=c[ue],m.hasOwnProperty(ue)&&(de!=null||_e!=null))switch(ue){case"type":x=de;break;case"name":_=de;break;case"checked":le=de;break;case"defaultChecked":ge=de;break;case"value":T=de;break;case"defaultValue":z=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,a));break;default:de!==_e&&Qt(i,a,ue,de,m,_e)}}ne(i,T,z,Q,le,ge,x,_);return;case"select":de=T=z=ue=null;for(x in c)if(Q=c[x],c.hasOwnProperty(x)&&Q!=null)switch(x){case"value":break;case"multiple":de=Q;default:m.hasOwnProperty(x)||Qt(i,a,x,null,m,Q)}for(_ in m)if(x=m[_],Q=c[_],m.hasOwnProperty(_)&&(x!=null||Q!=null))switch(_){case"value":ue=x;break;case"defaultValue":z=x;break;case"multiple":T=x;default:x!==Q&&Qt(i,a,_,x,m,Q)}a=z,c=T,m=de,ue!=null?Dt(i,!!c,ue,!1):!!m!=!!c&&(a!=null?Dt(i,!!c,a,!0):Dt(i,!!c,c?[]:"",!1));return;case"textarea":de=ue=null;for(z in c)if(_=c[z],c.hasOwnProperty(z)&&_!=null&&!m.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Qt(i,a,z,null,m,_)}for(T in m)if(_=m[T],x=c[T],m.hasOwnProperty(T)&&(_!=null||x!=null))switch(T){case"value":ue=_;break;case"defaultValue":de=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==x&&Qt(i,a,T,_,m,x)}gn(i,ue,de);return;case"option":for(var He in c)if(ue=c[He],c.hasOwnProperty(He)&&ue!=null&&!m.hasOwnProperty(He))switch(He){case"selected":i.selected=!1;break;default:Qt(i,a,He,null,m,ue)}for(Q in m)if(ue=m[Q],de=c[Q],m.hasOwnProperty(Q)&&ue!==de&&(ue!=null||de!=null))switch(Q){case"selected":i.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:Qt(i,a,Q,ue,m,de)}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 tt in c)ue=c[tt],c.hasOwnProperty(tt)&&ue!=null&&!m.hasOwnProperty(tt)&&Qt(i,a,tt,null,m,ue);for(le in m)if(ue=m[le],de=c[le],m.hasOwnProperty(le)&&ue!==de&&(ue!=null||de!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,a));break;default:Qt(i,a,le,ue,m,de)}return;default:if(sg(a)){for(var Jt in c)ue=c[Jt],c.hasOwnProperty(Jt)&&ue!==void 0&&!m.hasOwnProperty(Jt)&&Vv(i,a,Jt,void 0,m,ue);for(ge in m)ue=m[ge],de=c[ge],!m.hasOwnProperty(ge)||ue===de||ue===void 0&&de===void 0||Vv(i,a,ge,ue,m,de);return}}for(var se in c)ue=c[se],c.hasOwnProperty(se)&&ue!=null&&!m.hasOwnProperty(se)&&Qt(i,a,se,null,m,ue);for(_e in m)ue=m[_e],de=c[_e],!m.hasOwnProperty(_e)||ue===de||ue==null&&de==null||Qt(i,a,_e,ue,m,de)}function hC(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function YO(){if(typeof performance.getEntriesByType=="function"){for(var i=0,a=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var _=c[m],x=_.transferSize,T=_.initiatorType,z=_.duration;if(x&&z&&hC(T)){for(T=0,z=_.responseEnd,m+=1;m<c.length;m++){var Q=c[m],le=Q.startTime;if(le>z)break;var ge=Q.transferSize,_e=Q.initiatorType;ge&&hC(_e)&&(Q=Q.responseEnd,T+=ge*(Q<z?1:(z-le)/(Q-le)))}if(--m,a+=8*(x+T)/(_.duration/1e3),i++,10<i)break}}if(0<i)return a/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var qv=null,Kv=null;function df(i){return i.nodeType===9?i:i.ownerDocument}function fC(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function mC(i,a){if(i===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&a==="foreignObject"?0:i}function Gv(i,a){return i==="textarea"||i==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Yv=null;function XO(){var i=window.event;return i&&i.type==="popstate"?i===Yv?!1:(Yv=i,!0):(Yv=null,!1)}var pC=typeof setTimeout=="function"?setTimeout:void 0,ZO=typeof clearTimeout=="function"?clearTimeout:void 0,gC=typeof Promise=="function"?Promise:void 0,QO=typeof queueMicrotask=="function"?queueMicrotask:typeof gC<"u"?function(i){return gC.resolve(null).then(i).catch(JO)}:pC;function JO(i){setTimeout(function(){throw i})}function Lo(i){return i==="head"}function vC(i,a){var c=a,m=0;do{var _=c.nextSibling;if(i.removeChild(c),_&&_.nodeType===8)if(c=_.data,c==="/$"||c==="/&"){if(m===0){i.removeChild(_),Wl(a);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")Cu(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,Cu(c);for(var x=c.firstChild;x;){var T=x.nextSibling,z=x.nodeName;x[On]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=T}}else c==="body"&&Cu(i.ownerDocument.body);c=_}while(c);Wl(a)}function bC(i,a){var c=i;i=0;do{var m=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=m}while(c)}function Xv(i){var a=i.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Xv(c),ns(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function e4(i,a,c,m){for(;i.nodeType===1;){var _=c;if(i.nodeName.toLowerCase()!==a.toLowerCase()){if(!m&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(m){if(!i[On])switch(a){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==_.rel||i.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||i.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||i.getAttribute("title")!==(_.title==null?null:_.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(_.src==null?null:_.src)||i.getAttribute("type")!==(_.type==null?null:_.type)||i.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(a==="input"&&i.type==="hidden"){var x=_.name==null?null:""+_.name;if(_.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=xi(i.nextSibling),i===null)break}return null}function t4(i,a,c){if(a==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=xi(i.nextSibling),i===null))return null;return i}function _C(i,a){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=xi(i.nextSibling),i===null))return null;return i}function Zv(i){return i.data==="$?"||i.data==="$~"}function Qv(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function n4(i,a){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=a;else if(i.data!=="$?"||c.readyState!=="loading")a();else{var m=function(){a(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),i._reactRetry=m}}function xi(i){for(;i!=null;i=i.nextSibling){var a=i.nodeType;if(a===1||a===3)break;if(a===8){if(a=i.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return i}var Jv=null;function yC(i){i=i.nextSibling;for(var a=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(a===0)return xi(i.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}i=i.nextSibling}return null}function xC(i){i=i.previousSibling;for(var a=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return i;a--}else c!=="/$"&&c!=="/&"||a++}i=i.previousSibling}return null}function wC(i,a,c){switch(a=df(c),i){case"html":if(i=a.documentElement,!i)throw Error(r(452));return i;case"head":if(i=a.head,!i)throw Error(r(453));return i;case"body":if(i=a.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Cu(i){for(var a=i.attributes;a.length;)i.removeAttributeNode(a[0]);ns(i)}var wi=new Map,SC=new Set;function hf(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var qs=$.d;$.d={f:r4,r:i4,D:s4,C:o4,L:a4,m:l4,X:u4,S:c4,M:d4};function r4(){var i=qs.f(),a=nf();return i||a}function i4(i){var a=Ot(i);a!==null&&a.tag===5&&a.type==="form"?Fw(a):qs.r(i)}var Hl=typeof document>"u"?null:document;function CC(i,a,c){var m=Hl;if(m&&typeof a=="string"&&a){var _=Y(a);_='link[rel="'+i+'"][href="'+_+'"]',typeof c=="string"&&(_+='[crossorigin="'+c+'"]'),SC.has(_)||(SC.add(_),i={rel:i,crossOrigin:c,href:a},m.querySelector(_)===null&&(a=m.createElement("link"),pr(a,"link",i),Ln(a),m.head.appendChild(a)))}}function s4(i){qs.D(i),CC("dns-prefetch",i,null)}function o4(i,a){qs.C(i,a),CC("preconnect",i,a)}function a4(i,a,c){qs.L(i,a,c);var m=Hl;if(m&&i&&a){var _='link[rel="preload"][as="'+Y(a)+'"]';a==="image"&&c&&c.imageSrcSet?(_+='[imagesrcset="'+Y(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(_+='[imagesizes="'+Y(c.imageSizes)+'"]')):_+='[href="'+Y(i)+'"]';var x=_;switch(a){case"style":x=Ul(i);break;case"script":x=$l(i)}wi.has(x)||(i=p({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:i,as:a},c),wi.set(x,i),m.querySelector(_)!==null||a==="style"&&m.querySelector(ku(x))||a==="script"&&m.querySelector(Eu(x))||(a=m.createElement("link"),pr(a,"link",i),Ln(a),m.head.appendChild(a)))}}function l4(i,a){qs.m(i,a);var c=Hl;if(c&&i){var m=a&&typeof a.as=="string"?a.as:"script",_='link[rel="modulepreload"][as="'+Y(m)+'"][href="'+Y(i)+'"]',x=_;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=$l(i)}if(!wi.has(x)&&(i=p({rel:"modulepreload",href:i},a),wi.set(x,i),c.querySelector(_)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Eu(x)))return}m=c.createElement("link"),pr(m,"link",i),Ln(m),c.head.appendChild(m)}}}function c4(i,a,c){qs.S(i,a,c);var m=Hl;if(m&&i){var _=rs(m).hoistableStyles,x=Ul(i);a=a||"default";var T=_.get(x);if(!T){var z={loading:0,preload:null};if(T=m.querySelector(ku(x)))z.loading=5;else{i=p({rel:"stylesheet",href:i,"data-precedence":a},c),(c=wi.get(x))&&eb(i,c);var Q=T=m.createElement("link");Ln(Q),pr(Q,"link",i),Q._p=new Promise(function(le,ge){Q.onload=le,Q.onerror=ge}),Q.addEventListener("load",function(){z.loading|=1}),Q.addEventListener("error",function(){z.loading|=2}),z.loading|=4,ff(T,a,m)}T={type:"stylesheet",instance:T,count:1,state:z},_.set(x,T)}}}function u4(i,a){qs.X(i,a);var c=Hl;if(c&&i){var m=rs(c).hoistableScripts,_=$l(i),x=m.get(_);x||(x=c.querySelector(Eu(_)),x||(i=p({src:i,async:!0},a),(a=wi.get(_))&&tb(i,a),x=c.createElement("script"),Ln(x),pr(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},m.set(_,x))}}function d4(i,a){qs.M(i,a);var c=Hl;if(c&&i){var m=rs(c).hoistableScripts,_=$l(i),x=m.get(_);x||(x=c.querySelector(Eu(_)),x||(i=p({src:i,async:!0,type:"module"},a),(a=wi.get(_))&&tb(i,a),x=c.createElement("script"),Ln(x),pr(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},m.set(_,x))}}function kC(i,a,c,m){var _=(_=ee.current)?hf(_):null;if(!_)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(a=Ul(c.href),c=rs(_).hoistableStyles,m=c.get(a),m||(m={type:"style",instance:null,count:0,state:null},c.set(a,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=Ul(c.href);var x=rs(_).hoistableStyles,T=x.get(i);if(T||(_=_.ownerDocument||_,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,T),(x=_.querySelector(ku(i)))&&!x._p&&(T.instance=x,T.state.loading=5),wi.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},wi.set(i,c),x||h4(_,i,c,T.state))),a&&m===null)throw Error(r(528,""));return T}if(a&&m!==null)throw Error(r(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=$l(c),c=rs(_).hoistableScripts,m=c.get(a),m||(m={type:"script",instance:null,count:0,state:null},c.set(a,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ul(i){return'href="'+Y(i)+'"'}function ku(i){return'link[rel="stylesheet"]['+i+"]"}function EC(i){return p({},i,{"data-precedence":i.precedence,precedence:null})}function h4(i,a,c,m){i.querySelector('link[rel="preload"][as="style"]['+a+"]")?m.loading=1:(a=i.createElement("link"),m.preload=a,a.addEventListener("load",function(){return m.loading|=1}),a.addEventListener("error",function(){return m.loading|=2}),pr(a,"link",c),Ln(a),i.head.appendChild(a))}function $l(i){return'[src="'+Y(i)+'"]'}function Eu(i){return"script[async]"+i}function RC(i,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var m=i.querySelector('style[data-href~="'+Y(c.href)+'"]');if(m)return a.instance=m,Ln(m),m;var _=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(i.ownerDocument||i).createElement("style"),Ln(m),pr(m,"style",_),ff(m,c.precedence,i),a.instance=m;case"stylesheet":_=Ul(c.href);var x=i.querySelector(ku(_));if(x)return a.state.loading|=4,a.instance=x,Ln(x),x;m=EC(c),(_=wi.get(_))&&eb(m,_),x=(i.ownerDocument||i).createElement("link"),Ln(x);var T=x;return T._p=new Promise(function(z,Q){T.onload=z,T.onerror=Q}),pr(x,"link",m),a.state.loading|=4,ff(x,c.precedence,i),a.instance=x;case"script":return x=$l(c.src),(_=i.querySelector(Eu(x)))?(a.instance=_,Ln(_),_):(m=c,(_=wi.get(x))&&(m=p({},c),tb(m,_)),i=i.ownerDocument||i,_=i.createElement("script"),Ln(_),pr(_,"link",m),i.head.appendChild(_),a.instance=_);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(m=a.instance,a.state.loading|=4,ff(m,c.precedence,i));return a.instance}function ff(i,a,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=m.length?m[m.length-1]:null,x=_,T=0;T<m.length;T++){var z=m[T];if(z.dataset.precedence===a)x=z;else if(x!==_)break}x?x.parentNode.insertBefore(i,x.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(i,a.firstChild))}function eb(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.title==null&&(i.title=a.title)}function tb(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.integrity==null&&(i.integrity=a.integrity)}var mf=null;function TC(i,a,c){if(mf===null){var m=new Map,_=mf=new Map;_.set(c,m)}else _=mf,m=_.get(c),m||(m=new Map,_.set(c,m));if(m.has(i))return m;for(m.set(i,null),c=c.getElementsByTagName(i),_=0;_<c.length;_++){var x=c[_];if(!(x[On]||x[It]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var T=x.getAttribute(a)||"";T=i+T;var z=m.get(T);z?z.push(x):m.set(T,[x])}}return m}function NC(i,a,c){i=i.ownerDocument||i,i.head.insertBefore(c,a==="title"?i.querySelector("head > title"):null)}function f4(i,a,c){if(c===1||a.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return i=a.disabled,typeof a.precedence=="string"&&i==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function MC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function m4(i,a,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var _=Ul(m.href),x=a.querySelector(ku(_));if(x){a=x._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(i.count++,i=pf.bind(i),a.then(i,i)),c.state.loading|=4,c.instance=x,Ln(x);return}x=a.ownerDocument||a,m=EC(m),(_=wi.get(_))&&eb(m,_),x=x.createElement("link"),Ln(x);var T=x;T._p=new Promise(function(z,Q){T.onload=z,T.onerror=Q}),pr(x,"link",m),c.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=pf.bind(i),a.addEventListener("load",c),a.addEventListener("error",c))}}var nb=0;function p4(i,a){return i.stylesheets&&i.count===0&&vf(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var m=setTimeout(function(){if(i.stylesheets&&vf(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+a);0<i.imgBytes&&nb===0&&(nb=62500*YO());var _=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&vf(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>nb?50:800)+a);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(m),clearTimeout(_)}}:null}function pf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vf(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var gf=null;function vf(i,a){i.stylesheets=null,i.unsuspend!==null&&(i.count++,gf=new Map,a.forEach(g4,i),gf=null,pf.call(i))}function g4(i,a){if(!(a.state.loading&4)){var c=gf.get(i);if(c)var m=c.get(null);else{c=new Map,gf.set(i,c);for(var _=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<_.length;x++){var T=_[x];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(c.set(T.dataset.precedence,T),m=T)}m&&c.set(null,m)}_=a.instance,T=_.getAttribute("data-precedence"),x=c.get(T)||m,x===m&&c.set(null,_),c.set(T,_),this.count++,m=pf.bind(this),_.addEventListener("load",m),_.addEventListener("error",m),x?x.parentNode.insertBefore(_,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(_,i.firstChild)),a.state.loading|=4}}var Ru={$$typeof:E,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function v4(i,a,c,m,_,x,T,z,Q){this.tag=1,this.containerInfo=i,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=Vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.hiddenUpdates=Vt(null),this.identifierPrefix=m,this.onUncaughtError=_,this.onCaughtError=x,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function AC(i,a,c,m,_,x,T,z,Q,le,ge,_e){return i=new v4(i,a,c,T,Q,le,ge,_e,z),a=1,x===!0&&(a|=24),x=Jr(3,null,null,a),i.current=x,x.stateNode=i,a=Lg(),a.refCount++,i.pooledCache=a,a.refCount++,x.memoizedState={element:m,isDehydrated:c,cache:a},Ig(x),i}function DC(i){return i?(i=yl,i):yl}function jC(i,a,c,m,_,x){_=DC(_),m.context===null?m.context=_:m.pendingContext=_,m=Co(a),m.payload={element:c},x=x===void 0?null:x,x!==null&&(m.callback=x),c=ko(i,m,a),c!==null&&(Wr(c,i,a),su(c,i,a))}function OC(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<a?c:a}}function rb(i,a){OC(i,a),(i=i.alternate)&&OC(i,a)}function LC(i){if(i.tag===13||i.tag===31){var a=pa(i,67108864);a!==null&&Wr(a,i,67108864),rb(i,67108864)}}function zC(i){if(i.tag===13||i.tag===31){var a=ii();a=St(a);var c=pa(i,a);c!==null&&Wr(c,i,a),rb(i,a)}}var bf=!0;function b4(i,a,c,m){var _=O.T;O.T=null;var x=$.p;try{$.p=2,ib(i,a,c,m)}finally{$.p=x,O.T=_}}function _4(i,a,c,m){var _=O.T;O.T=null;var x=$.p;try{$.p=8,ib(i,a,c,m)}finally{$.p=x,O.T=_}}function ib(i,a,c,m){if(bf){var _=sb(m);if(_===null)Wv(i,a,m,_f,c),BC(i,m);else if(x4(_,i,a,c,m))m.stopPropagation();else if(BC(i,m),a&4&&-1<y4.indexOf(i)){for(;_!==null;){var x=Ot(_);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var T=Bt(x.pendingLanes);if(T!==0){var z=x;for(z.pendingLanes|=2,z.entangledLanes|=2;T;){var Q=1<<31-Ue(T);z.entanglements[1]|=Q,T&=~Q}as(x),(Ht&6)===0&&(ef=Ce()+500,xu(0))}}break;case 31:case 13:z=pa(x,2),z!==null&&Wr(z,x,2),nf(),rb(x,2)}if(x=sb(m),x===null&&Wv(i,a,m,_f,c),x===_)break;_=x}_!==null&&m.stopPropagation()}else Wv(i,a,m,null,c)}}function sb(i){return i=ag(i),ob(i)}var _f=null;function ob(i){if(_f=null,i=mi(i),i!==null){var a=o(i);if(a===null)i=null;else{var c=a.tag;if(c===13){if(i=l(a),i!==null)return i;i=null}else if(c===31){if(i=u(a),i!==null)return i;i=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return _f=i,null}function PC(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ze()){case oe:return 2;case ve:return 8;case Te:case Me:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var ab=!1,zo=null,Po=null,Bo=null,Tu=new Map,Nu=new Map,Io=[],y4="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 BC(i,a){switch(i){case"focusin":case"focusout":zo=null;break;case"dragenter":case"dragleave":Po=null;break;case"mouseover":case"mouseout":Bo=null;break;case"pointerover":case"pointerout":Tu.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nu.delete(a.pointerId)}}function Mu(i,a,c,m,_,x){return i===null||i.nativeEvent!==x?(i={blockedOn:a,domEventName:c,eventSystemFlags:m,nativeEvent:x,targetContainers:[_]},a!==null&&(a=Ot(a),a!==null&&LC(a)),i):(i.eventSystemFlags|=m,a=i.targetContainers,_!==null&&a.indexOf(_)===-1&&a.push(_),i)}function x4(i,a,c,m,_){switch(a){case"focusin":return zo=Mu(zo,i,a,c,m,_),!0;case"dragenter":return Po=Mu(Po,i,a,c,m,_),!0;case"mouseover":return Bo=Mu(Bo,i,a,c,m,_),!0;case"pointerover":var x=_.pointerId;return Tu.set(x,Mu(Tu.get(x)||null,i,a,c,m,_)),!0;case"gotpointercapture":return x=_.pointerId,Nu.set(x,Mu(Nu.get(x)||null,i,a,c,m,_)),!0}return!1}function IC(i){var a=mi(i.target);if(a!==null){var c=o(a);if(c!==null){if(a=c.tag,a===13){if(a=l(c),a!==null){i.blockedOn=a,dn(i.priority,function(){zC(c)});return}}else if(a===31){if(a=u(c),a!==null){i.blockedOn=a,dn(i.priority,function(){zC(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function yf(i){if(i.blockedOn!==null)return!1;for(var a=i.targetContainers;0<a.length;){var c=sb(i.nativeEvent);if(c===null){c=i.nativeEvent;var m=new c.constructor(c.type,c);og=m,c.target.dispatchEvent(m),og=null}else return a=Ot(c),a!==null&&LC(a),i.blockedOn=c,!1;a.shift()}return!0}function FC(i,a,c){yf(i)&&c.delete(a)}function w4(){ab=!1,zo!==null&&yf(zo)&&(zo=null),Po!==null&&yf(Po)&&(Po=null),Bo!==null&&yf(Bo)&&(Bo=null),Tu.forEach(FC),Nu.forEach(FC)}function xf(i,a){i.blockedOn===a&&(i.blockedOn=null,ab||(ab=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,w4)))}var wf=null;function HC(i){wf!==i&&(wf=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wf===i&&(wf=null);for(var a=0;a<i.length;a+=3){var c=i[a],m=i[a+1],_=i[a+2];if(typeof m!="function"){if(ob(m||c)===null)continue;break}var x=Ot(c);x!==null&&(i.splice(a,3),a-=3,sv(x,{pending:!0,data:_,method:c.method,action:m},m,_))}}))}function Wl(i){function a(Q){return xf(Q,i)}zo!==null&&xf(zo,i),Po!==null&&xf(Po,i),Bo!==null&&xf(Bo,i),Tu.forEach(a),Nu.forEach(a);for(var c=0;c<Io.length;c++){var m=Io[c];m.blockedOn===i&&(m.blockedOn=null)}for(;0<Io.length&&(c=Io[0],c.blockedOn===null);)IC(c),c.blockedOn===null&&Io.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var _=c[m],x=c[m+1],T=_[Ft]||null;if(typeof x=="function")T||HC(c);else if(T){var z=null;if(x&&x.hasAttribute("formAction")){if(_=x,T=x[Ft]||null)z=T.formAction;else if(ob(_)!==null)continue}else z=T.action;typeof z=="function"?c[m+1]=z:(c.splice(m,3),m-=3),HC(c)}}}function UC(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(T){return _=T})},focusReset:"manual",scroll:"manual"})}function a(){_!==null&&(_(),_=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,_=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),_!==null&&(_(),_=null)}}}function lb(i){this._internalRoot=i}Sf.prototype.render=lb.prototype.render=function(i){var a=this._internalRoot;if(a===null)throw Error(r(409));var c=a.current,m=ii();jC(c,m,i,a,null,null)},Sf.prototype.unmount=lb.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var a=i.containerInfo;jC(i.current,2,null,i,null,null),nf(),a[yr]=null}};function Sf(i){this._internalRoot=i}Sf.prototype.unstable_scheduleHydration=function(i){if(i){var a=on();i={blockedOn:null,target:i,priority:a};for(var c=0;c<Io.length&&a!==0&&a<Io[c].priority;c++);Io.splice(c,0,i),c===0&&IC(i)}};var $C=t.version;if($C!=="19.2.1")throw Error(r(527,$C,"19.2.1"));$.findDOMNode=function(i){var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(a),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var S4={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cf.isDisabled&&Cf.supportsFiber)try{je=Cf.inject(S4),We=Cf}catch{}}return ju.createRoot=function(i,a){if(!s(i))throw Error(r(299));var c=!1,m="",_=Xw,x=Zw,T=Qw;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(_=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError)),a=AC(i,1,!1,null,null,c,m,null,_,x,T,UC),i[yr]=a.current,$v(i),new lb(a)},ju.hydrateRoot=function(i,a,c){if(!s(i))throw Error(r(299));var m=!1,_="",x=Xw,T=Zw,z=Qw,Q=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(T=c.onCaughtError),c.onRecoverableError!==void 0&&(z=c.onRecoverableError),c.formState!==void 0&&(Q=c.formState)),a=AC(i,1,!0,a,c??null,m,_,Q,x,T,z,UC),a.context=DC(null),c=a.current,m=ii(),m=St(m),_=Co(m),_.callback=null,ko(c,_,m),c=m,a.current.lanes=c,ht(a,c),as(a),i[yr]=a.current,$v(i),new Sf(a)},ju.version="19.2.1",ju}var rk;function L4(){if(rk)return db.exports;rk=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(t){console.error(t)}}return e(),db.exports=O4(),db.exports}var z4=L4();/**
|
|
50
|
+
* react-router v7.13.2
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var ik="popstate";function sk(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function P4(e={}){function t(r,s){var d;let o=(d=s.state)==null?void 0:d.masked,{pathname:l,search:u,hash:h}=o||r.location;return A_("",{pathname:l,search:u,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:bd(s)}return I4(t,n,null,e)}function bn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Li(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function B4(){return Math.random().toString(36).substring(2,10)}function ok(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function A_(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?wc(t):t,state:n,key:t&&t.key||r||B4(),unstable_mask:s}}function bd({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function wc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function I4(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,l=s.history,u="POP",h=null,d=g();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function g(){return(l.state||{idx:null}).idx}function p(){u="POP";let C=g(),k=C==null?null:C-d;d=C,h&&h({action:u,location:S.location,delta:k})}function v(C,k){u="PUSH";let R=sk(C)?C:A_(S.location,C,k);d=g()+1;let E=ok(R,d),N=S.createHref(R.unstable_mask||R);try{l.pushState(E,"",N)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;s.location.assign(N)}o&&h&&h({action:u,location:S.location,delta:1})}function y(C,k){u="REPLACE";let R=sk(C)?C:A_(S.location,C,k);d=g();let E=ok(R,d),N=S.createHref(R.unstable_mask||R);l.replaceState(E,"",N),o&&h&&h({action:u,location:S.location,delta:0})}function w(C){return F4(C)}let S={get action(){return u},get location(){return e(s,l)},listen(C){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(ik,p),h=C,()=>{s.removeEventListener(ik,p),h=null}},createHref(C){return t(s,C)},createURL:w,encodeLocation(C){let k=w(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:v,replace:y,go(C){return l.go(C)}};return S}function F4(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:bd(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function hT(e,t,n="/"){return H4(e,t,n,!1)}function H4(e,t,n,r){let s=typeof t=="string"?wc(t):t,o=no(s.pathname||"/",n);if(o==null)return null;let l=fT(e);U4(l);let u=null;for(let h=0;u==null&&h<l.length;++h){let d=J4(o);u=Z4(l[h],d,r)}return u}function fT(e,t=[],n=[],r="",s=!1){let o=(l,u,h=s,d)=>{let g={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&h)return;bn(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let p=ws([r,g.relativePath]),v=n.concat(g);l.children&&l.children.length>0&&(bn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),fT(l.children,t,v,p,h)),!(l.path==null&&!l.index)&&t.push({path:p,score:Y4(p,l.index),routesMeta:v})};return e.forEach((l,u)=>{var h;if(l.path===""||!((h=l.path)!=null&&h.includes("?")))o(l,u);else for(let d of mT(l.path))o(l,u,!0,d)}),t}function mT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let l=mT(r.join("/")),u=[];return u.push(...l.map(h=>h===""?o:[o,h].join("/"))),s&&u.push(...l),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function U4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:X4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var $4=/^:[\w-]+$/,W4=3,V4=2,q4=1,K4=10,G4=-2,ak=e=>e==="*";function Y4(e,t){let n=e.split("/"),r=n.length;return n.some(ak)&&(r+=G4),t&&(r+=V4),n.filter(s=>!ak(s)).reduce((s,o)=>s+($4.test(o)?W4:o===""?q4:K4),r)}function X4(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function Z4(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",l=[];for(let u=0;u<r.length;++u){let h=r[u],d=u===r.length-1,g=o==="/"?t:t.slice(o.length)||"/",p=Cm({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},g),v=h.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=Cm({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!p)return null;Object.assign(s,p.params),l.push({params:s,pathname:ws([o,p.pathname]),pathnameBase:rL(ws([o,p.pathnameBase])),route:v}),p.pathnameBase!=="/"&&(o=ws([o,p.pathnameBase]))}return l}function Cm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Q4(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],l=o.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((d,{paramName:g,isOptional:p},v)=>{if(g==="*"){let w=u[v]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const y=u[v];return p&&!y?d[g]=void 0:d[g]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:l,pattern:e}}function Q4(e,t=!1,n=!0){Li(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,h,d,g)=>{if(r.push({paramName:u,isOptional:h!=null}),h){let p=g.charAt(d+l.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function J4(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Li(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function no(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var eL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function tL(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?wc(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=lk(n.substring(1),"/"):o=lk(n,t)):o=t,{pathname:o,search:iL(r),hash:sL(s)}}function lk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function pb(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function nL(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yx(e){let t=nL(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function up(e,t,n,r=!1){let s;typeof e=="string"?s=wc(e):(s={...e},bn(!s.pathname||!s.pathname.includes("?"),pb("?","pathname","search",s)),bn(!s.pathname||!s.pathname.includes("#"),pb("#","pathname","hash",s)),bn(!s.search||!s.search.includes("#"),pb("#","search","hash",s)));let o=e===""||s.pathname==="",l=o?"/":s.pathname,u;if(l==null)u=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),p-=1;s.pathname=v.join("/")}u=p>=0?t[p]:"/"}let h=tL(s,u),d=l&&l!=="/"&&l.endsWith("/"),g=(o||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(d||g)&&(h.pathname+="/"),h}var ws=e=>e.join("/").replace(/\/\/+/g,"/"),rL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),iL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,oL=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function aL(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function lL(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var pT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gT(e,t){let n=e;if(typeof n!="string"||!eL.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(pT)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),u=no(l.pathname,t);l.origin===o.origin&&u!=null?n=u+l.search+l.hash:s=!0}catch{Li(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var vT=["POST","PUT","PATCH","DELETE"];new Set(vT);var cL=["GET",...vT];new Set(cL);var Sc=b.createContext(null);Sc.displayName="DataRouter";var dp=b.createContext(null);dp.displayName="DataRouterState";var uL=b.createContext(!1),bT=b.createContext({isTransitioning:!1});bT.displayName="ViewTransition";var dL=b.createContext(new Map);dL.displayName="Fetchers";var hL=b.createContext(null);hL.displayName="Await";var fi=b.createContext(null);fi.displayName="Navigation";var Ld=b.createContext(null);Ld.displayName="Location";var zi=b.createContext({outlet:null,matches:[],isDataRoute:!1});zi.displayName="Route";var xx=b.createContext(null);xx.displayName="RouteError";var _T="REACT_ROUTER_ERROR",fL="REDIRECT",mL="ROUTE_ERROR_RESPONSE";function pL(e){if(e.startsWith(`${_T}:${fL}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function gL(e){if(e.startsWith(`${_T}:${mL}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new oL(t.status,t.statusText,t.data)}catch{}}function vL(e,{relative:t}={}){bn(Cc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=b.useContext(fi),{hash:s,pathname:o,search:l}=zd(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:ws([n,o])),r.createHref({pathname:u,search:l,hash:s})}function Cc(){return b.useContext(Ld)!=null}function Pi(){return bn(Cc(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Ld).location}var yT="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function xT(e){b.useContext(fi).static||b.useLayoutEffect(e)}function rl(){let{isDataRoute:e}=b.useContext(zi);return e?AL():bL()}function bL(){bn(Cc(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Sc),{basename:t,navigator:n}=b.useContext(fi),{matches:r}=b.useContext(zi),{pathname:s}=Pi(),o=JSON.stringify(yx(r)),l=b.useRef(!1);return xT(()=>{l.current=!0}),b.useCallback((h,d={})=>{if(Li(l.current,yT),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=up(h,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ws([t,g.pathname])),(d.replace?n.replace:n.push)(g,d.state,d)},[t,n,o,s,e])}var wT=b.createContext(null);function hp(){return b.useContext(wT)}function _L(e){let t=b.useContext(zi).outlet;return b.useMemo(()=>t&&b.createElement(wT.Provider,{value:e},t),[t,e])}function ST(){let{matches:e}=b.useContext(zi),t=e[e.length-1];return t?t.params:{}}function zd(e,{relative:t}={}){let{matches:n}=b.useContext(zi),{pathname:r}=Pi(),s=JSON.stringify(yx(n));return b.useMemo(()=>up(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function yL(e,t){return CT(e,t)}function CT(e,t,n){var C;bn(Cc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=b.useContext(fi),{matches:s}=b.useContext(zi),o=s[s.length-1],l=o?o.params:{},u=o?o.pathname:"/",h=o?o.pathnameBase:"/",d=o&&o.route;{let k=d&&d.path||"";ET(u,!d||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let g=Pi(),p;if(t){let k=typeof t=="string"?wc(t):t;bn(h==="/"||((C=k.pathname)==null?void 0:C.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${k.pathname}" was given in the \`location\` prop.`),p=k}else p=g;let v=p.pathname||"/",y=v;if(h!=="/"){let k=h.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=hT(e,{pathname:y});Li(d||w!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Li(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=kL(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:ws([h,r.encodeLocation?r.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:ws([h,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&S?b.createElement(Ld.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},S):S}function xL(){let e=ML(),t=aL(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:s},n):null,l)}var wL=b.createElement(xL,null),kT=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=gL(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(zi.Provider,{value:this.props.routeContext},b.createElement(xx.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(SL,{error:e},t):t}};kT.contextType=uL;var gb=new WeakMap;function SL({children:e,error:t}){let{basename:n}=b.useContext(fi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=pL(t.digest);if(r){let s=gb.get(t);if(s)throw s;let o=gT(r.location,n);if(pT&&!gb.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw gb.set(t,l),l}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function CL({routeContext:e,match:t,children:n}){let r=b.useContext(Sc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(zi.Provider,{value:e},n)}function kL(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,o=r==null?void 0:r.errors;if(o!=null){let g=s.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);bn(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,g+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let g=0;g<s.length;g++){let p=s[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=g),p.route.id){let{loaderData:v,errors:y}=r,w=p.route.loader&&!v.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||w){n.isStatic&&(l=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let h=n==null?void 0:n.onError,d=r&&h?(g,p)=>{var v,y;h(g,{location:r.location,params:((y=(v=r.matches)==null?void 0:v[0])==null?void 0:y.params)??{},unstable_pattern:lL(r.matches),errorInfo:p})}:void 0;return s.reduceRight((g,p,v)=>{let y,w=!1,S=null,C=null;r&&(y=o&&p.route.id?o[p.route.id]:void 0,S=p.route.errorElement||wL,l&&(u<0&&v===0?(ET("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):u===v&&(w=!0,C=p.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,v+1)),R=()=>{let E;return y?E=S:w?E=C:p.route.Component?E=b.createElement(p.route.Component,null):p.route.element?E=p.route.element:E=g,b.createElement(CL,{match:p,routeContext:{outlet:g,matches:k,isDataRoute:r!=null},children:E})};return r&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?b.createElement(kT,{location:r.location,revalidation:r.revalidation,component:S,error:y,children:R(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):R()},null)}function wx(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function EL(e){let t=b.useContext(Sc);return bn(t,wx(e)),t}function RL(e){let t=b.useContext(dp);return bn(t,wx(e)),t}function TL(e){let t=b.useContext(zi);return bn(t,wx(e)),t}function Sx(e){let t=TL(e),n=t.matches[t.matches.length-1];return bn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function NL(){return Sx("useRouteId")}function ML(){var r;let e=b.useContext(xx),t=RL("useRouteError"),n=Sx("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function AL(){let{router:e}=EL("useNavigate"),t=Sx("useNavigate"),n=b.useRef(!1);return xT(()=>{n.current=!0}),b.useCallback(async(s,o={})=>{Li(n.current,yT),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var ck={};function ET(e,t,n){!t&&!ck[e]&&(ck[e]=!0,Li(!1,n))}b.memo(DL);function DL({routes:e,future:t,state:n,isStatic:r,onError:s}){return CT(e,void 0,{state:n,isStatic:r,onError:s})}function jL({to:e,replace:t,state:n,relative:r}){bn(Cc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=b.useContext(fi);Li(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=b.useContext(zi),{pathname:l}=Pi(),u=rl(),h=up(e,yx(o),l,r==="path"),d=JSON.stringify(h);return b.useEffect(()=>{u(JSON.parse(d),{replace:t,state:n,relative:r})},[u,d,r,t,n]),null}function OL(e){return _L(e.context)}function La(e){bn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function LL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1,unstable_useTransitions:l}){bn(!Cc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:u,navigator:s,static:o,unstable_useTransitions:l,future:{}}),[u,s,o,l]);typeof n=="string"&&(n=wc(n));let{pathname:d="/",search:g="",hash:p="",state:v=null,key:y="default",unstable_mask:w}=n,S=b.useMemo(()=>{let C=no(d,u);return C==null?null:{location:{pathname:C,search:g,hash:p,state:v,key:y,unstable_mask:w},navigationType:r}},[u,d,g,p,v,y,r,w]);return Li(S!=null,`<Router basename="${u}"> is not able to match the URL "${d}${g}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:b.createElement(fi.Provider,{value:h},b.createElement(Ld.Provider,{children:t,value:S}))}function zL({children:e,location:t}){return yL(D_(e),t)}function D_(e,t=[]){let n=[];return b.Children.forEach(e,(r,s)=>{if(!b.isValidElement(r))return;let o=[...t,s];if(r.type===b.Fragment){n.push.apply(n,D_(r.props.children,o));return}bn(r.type===La,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=D_(r.props.children,o)),n.push(l)}),n}var am="get",lm="application/x-www-form-urlencoded";function fp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function PL(e){return fp(e)&&e.tagName.toLowerCase()==="button"}function BL(e){return fp(e)&&e.tagName.toLowerCase()==="form"}function IL(e){return fp(e)&&e.tagName.toLowerCase()==="input"}function FL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function HL(e,t){return e.button===0&&(!t||t==="_self")&&!FL(e)}function j_(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function UL(e,t){let n=j_(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var kf=null;function $L(){if(kf===null)try{new FormData(document.createElement("form"),0),kf=!1}catch{kf=!0}return kf}var WL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vb(e){return e!=null&&!WL.has(e)?(Li(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${lm}"`),null):e}function VL(e,t){let n,r,s,o,l;if(BL(e)){let u=e.getAttribute("action");r=u?no(u,t):null,n=e.getAttribute("method")||am,s=vb(e.getAttribute("enctype"))||lm,o=new FormData(e)}else if(PL(e)||IL(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||u.getAttribute("action");if(r=h?no(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||am,s=vb(e.getAttribute("formenctype"))||vb(u.getAttribute("enctype"))||lm,o=new FormData(u,e),!$L()){let{name:d,type:g,value:p}=e;if(g==="image"){let v=d?`${d}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else d&&o.append(d,p)}}else{if(fp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=am,r=null,s=lm,l=e}return o&&s==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Cx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qL(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&no(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function KL(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function GL(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function YL(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let l=await KL(o,n);return l.links?l.links():[]}return[]}));return JL(r.flat(1).filter(GL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function uk(e,t,n,r,s,o){let l=(h,d)=>n[d]?h.route.id!==n[d].route.id:!0,u=(h,d)=>{var g;return n[d].pathname!==h.pathname||((g=n[d].route.path)==null?void 0:g.endsWith("*"))&&n[d].params["*"]!==h.params["*"]};return o==="assets"?t.filter((h,d)=>l(h,d)||u(h,d)):o==="data"?t.filter((h,d)=>{var p;let g=r.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(l(h,d)||u(h,d))return!0;if(h.route.shouldRevalidate){let v=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function XL(e,t,{includeHydrateFallback:n}={}){return ZL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function ZL(e){return[...new Set(e)]}function QL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function JL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(QL(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function RT(){let e=b.useContext(Sc);return Cx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ez(){let e=b.useContext(dp);return Cx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var kx=b.createContext(void 0);kx.displayName="FrameworkContext";function TT(){let e=b.useContext(kx);return Cx(e,"You must render this element inside a <HydratedRouter> element"),e}function tz(e,t){let n=b.useContext(kx),[r,s]=b.useState(!1),[o,l]=b.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:d,onMouseLeave:g,onTouchStart:p}=t,v=b.useRef(null);b.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=k=>{k.forEach(R=>{l(R.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[e]),b.useEffect(()=>{if(r){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[r]);let y=()=>{s(!0)},w=()=>{s(!1),l(!1)};return n?e!=="intent"?[o,v,{}]:[o,v,{onFocus:Ou(u,y),onBlur:Ou(h,w),onMouseEnter:Ou(d,y),onMouseLeave:Ou(g,w),onTouchStart:Ou(p,y)}]:[!1,v,{}]}function Ou(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function nz({page:e,...t}){let{router:n}=RT(),r=b.useMemo(()=>hT(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?b.createElement(iz,{page:e,matches:r,...t}):null}function rz(e){let{manifest:t,routeModules:n}=TT(),[r,s]=b.useState([]);return b.useEffect(()=>{let o=!1;return YL(e,t,n).then(l=>{o||s(l)}),()=>{o=!0}},[e,t,n]),r}function iz({page:e,matches:t,...n}){let r=Pi(),{future:s,manifest:o,routeModules:l}=TT(),{basename:u}=RT(),{loaderData:h,matches:d}=ez(),g=b.useMemo(()=>uk(e,t,d,o,r,"data"),[e,t,d,o,r]),p=b.useMemo(()=>uk(e,t,d,o,r,"assets"),[e,t,d,o,r]),v=b.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,C=!1;if(t.forEach(R=>{var N;let E=o.routes[R.route.id];!E||!E.hasLoader||(!g.some(L=>L.route.id===R.route.id)&&R.route.id in h&&((N=l[R.route.id])!=null&&N.shouldRevalidate)||E.hasClientLoader?C=!0:S.add(R.route.id))}),S.size===0)return[];let k=qL(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return C&&S.size>0&&k.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[k.pathname+k.search]},[u,s.unstable_trailingSlashAwareDataRequests,h,r,o,g,t,e,l]),y=b.useMemo(()=>XL(p,o),[p,o]),w=rz(p);return b.createElement(b.Fragment,null,v.map(S=>b.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),y.map(S=>b.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),w.map(({key:S,link:C})=>b.createElement("link",{key:S,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function sz(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var oz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oz&&(window.__reactRouterVersion="7.13.2")}catch{}function az({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=b.useRef();s.current==null&&(s.current=P4({window:r,v5Compat:!0}));let o=s.current,[l,u]=b.useState({action:o.action,location:o.location}),h=b.useCallback(d=>{n===!1?u(d):b.startTransition(()=>u(d))},[n]);return b.useLayoutEffect(()=>o.listen(h),[o,h]),b.createElement(LL,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var NT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MT=b.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:l,unstable_mask:u,state:h,target:d,to:g,preventScrollReset:p,viewTransition:v,unstable_defaultShouldRevalidate:y,...w},S){let{basename:C,navigator:k,unstable_useTransitions:R}=b.useContext(fi),E=typeof g=="string"&&NT.test(g),N=gT(g,C);g=N.to;let L=vL(g,{relative:s}),D=Pi(),j=null;if(u){let W=up(u,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);C!=="/"&&(W.pathname=W.pathname==="/"?C:ws([C,W.pathname])),j=k.createHref(W)}let[H,G,B]=tz(r,w),q=dz(g,{replace:l,unstable_mask:u,state:h,target:d,preventScrollReset:p,relative:s,viewTransition:v,unstable_defaultShouldRevalidate:y,unstable_useTransitions:R});function I(W){t&&t(W),W.defaultPrevented||q(W)}let V=!(N.isExternal||o),F=b.createElement("a",{...w,...B,href:(V?j:void 0)||N.absoluteURL||L,onClick:V?I:t,ref:sz(S,G),target:d,"data-discover":!E&&n==="render"?"true":void 0});return H&&!E?b.createElement(b.Fragment,null,F,b.createElement(nz,{page:L})):F});MT.displayName="Link";var lz=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:l,viewTransition:u,children:h,...d},g){let p=zd(l,{relative:d.relative}),v=Pi(),y=b.useContext(dp),{navigator:w,basename:S}=b.useContext(fi),C=y!=null&&vz(p)&&u===!0,k=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,R=v.pathname,E=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(R=R.toLowerCase(),E=E?E.toLowerCase():null,k=k.toLowerCase()),E&&S&&(E=no(E,S)||E);const N=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let L=R===k||!s&&R.startsWith(k)&&R.charAt(N)==="/",D=E!=null&&(E===k||!s&&E.startsWith(k)&&E.charAt(k.length)==="/"),j={isActive:L,isPending:D,isTransitioning:C},H=L?t:void 0,G;typeof r=="function"?G=r(j):G=[r,L?"active":null,D?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(j):o;return b.createElement(MT,{...d,"aria-current":H,className:G,ref:g,style:B,to:l,viewTransition:u},typeof h=="function"?h(j):h)});lz.displayName="NavLink";var cz=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:l=am,action:u,onSubmit:h,relative:d,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:v,...y},w)=>{let{unstable_useTransitions:S}=b.useContext(fi),C=pz(),k=gz(u,{relative:d}),R=l.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&NT.test(u),N=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let D=L.nativeEvent.submitter,j=(D==null?void 0:D.getAttribute("formmethod"))||l,H=()=>C(D||L.currentTarget,{fetcherKey:t,method:j,navigate:n,replace:s,state:o,relative:d,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:v});S&&n!==!1?b.startTransition(()=>H()):H()};return b.createElement("form",{ref:w,method:R,action:k,onSubmit:r?h:N,...y,"data-discover":!E&&e==="render"?"true":void 0})});cz.displayName="Form";function uz(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function AT(e){let t=b.useContext(Sc);return bn(t,uz(e)),t}function dz(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:o,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:d}={}){let g=rl(),p=Pi(),v=zd(e,{relative:l});return b.useCallback(y=>{if(HL(y,t)){y.preventDefault();let w=n!==void 0?n:bd(p)===bd(v),S=()=>g(e,{replace:w,unstable_mask:r,state:s,preventScrollReset:o,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:h});d?b.startTransition(()=>S()):S()}},[p,g,v,n,r,s,t,e,o,l,u,h,d])}function hz(e){Li(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=b.useRef(j_(e)),n=b.useRef(!1),r=Pi(),s=b.useMemo(()=>UL(r.search,n.current?null:t.current),[r.search]),o=rl(),l=b.useCallback((u,h)=>{const d=j_(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,o("?"+d,h)},[o,s]);return[s,l]}var fz=0,mz=()=>`__${String(++fz)}__`;function pz(){let{router:e}=AT("useSubmit"),{basename:t}=b.useContext(fi),n=NL(),r=e.fetch,s=e.navigate;return b.useCallback(async(o,l={})=>{let{action:u,method:h,encType:d,formData:g,body:p}=VL(o,t);if(l.navigate===!1){let v=l.fetcherKey||mz();await r(v,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:p,formMethod:l.method||h,formEncType:l.encType||d,flushSync:l.flushSync})}else await s(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:p,formMethod:l.method||h,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,s,t,n])}function gz(e,{relative:t}={}){let{basename:n}=b.useContext(fi),r=b.useContext(zi);bn(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...zd(e||".",{relative:t})},l=Pi();if(e==null){o.search=l.search;let u=new URLSearchParams(o.search),h=u.getAll("index");if(h.some(g=>g==="")){u.delete("index"),h.filter(p=>p).forEach(p=>u.append("index",p));let g=u.toString();o.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:ws([n,o.pathname])),bd(o)}function vz(e,{relative:t}={}){let n=b.useContext(bT);bn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=AT("useViewTransitionState"),s=zd(e,{relative:t});if(!n.isTransitioning)return!1;let o=no(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=no(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Cm(s.pathname,l)!=null||Cm(s.pathname,o)!=null}var qi=dT();const DT=cp(qi);function bz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const _z=e=>{switch(e){case"success":return wz;case"info":return Cz;case"warning":return Sz;case"error":return kz;default:return null}},yz=Array(12).fill(0),xz=({visible:e,className:t})=>xe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},xe.createElement("div",{className:"sonner-spinner"},yz.map((n,r)=>xe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),wz=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Sz=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},xe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Cz=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),kz=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},xe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ez=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},xe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),xe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Rz=()=>{const[e,t]=xe.useState(document.hidden);return xe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let O_=1;class Tz{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:O_++,l=this.toasts.find(h=>h.id===o),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(h=>h.id===o?(this.publish({...h,...t,id:o,title:r}),{...h,...t,id:o,dismissible:u,title:r}):h):this.addToast({title:r,...s,dismissible:u,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const u=s.then(async d=>{if(l=["resolve",d],xe.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if(Mz(d)&&!d.ok){o=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!xe.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...w})}else if(d instanceof Error){o=!1;const p=typeof n.error=="function"?await n.error(d):n.error,v=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!xe.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...w})}else if(n.success!==void 0){o=!1;const p=typeof n.success=="function"?await n.success(d):n.success,v=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!xe.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:v,...w})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){o=!1;const g=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,y=typeof g=="object"&&!xe.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),h=()=>new Promise((d,g)=>u.then(()=>l[0]==="reject"?g(l[1]):d(l[1])).catch(g));return typeof r!="string"&&typeof r!="number"?{unwrap:h}:Object.assign(r,{unwrap:h})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||O_++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Gr=new Tz,Nz=(e,t)=>{const n=(t==null?void 0:t.id)||O_++;return Gr.addToast({title:e,...t,id:n}),n},Mz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Az=Nz,Dz=()=>Gr.toasts,jz=()=>Gr.getActiveToasts(),Ef=Object.assign(Az,{success:Gr.success,info:Gr.info,warning:Gr.warning,error:Gr.error,custom:Gr.custom,message:Gr.message,promise:Gr.promise,dismiss:Gr.dismiss,loading:Gr.loading},{getHistory:Dz,getToasts:jz});bz("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Rf(e){return e.label!==void 0}const Oz=3,Lz="24px",zz="16px",dk=4e3,Pz=356,Bz=14,Iz=45,Fz=200;function ls(...e){return e.filter(Boolean).join(" ")}function Hz(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Uz=e=>{var t,n,r,s,o,l,u,h,d;const{invert:g,toast:p,unstyled:v,interacting:y,setHeights:w,visibleToasts:S,heights:C,index:k,toasts:R,expanded:E,removeToast:N,defaultRichColors:L,closeButton:D,style:j,cancelButtonStyle:H,actionButtonStyle:G,className:B="",descriptionClassName:q="",duration:I,position:V,gap:F,expandByDefault:W,classNames:O,icons:$,closeButtonAriaLabel:U="Close toast"}=e,[X,M]=xe.useState(null),[P,Z]=xe.useState(null),[A,ie]=xe.useState(!1),[J,ee]=xe.useState(!1),[re,ce]=xe.useState(!1),[he,pe]=xe.useState(!1),[Se,Re]=xe.useState(!1),[Ae,Ke]=xe.useState(0),[yt,xt]=xe.useState(0),fe=xe.useRef(p.duration||I||dk),Ie=xe.useRef(null),De=xe.useRef(null),lt=k===0,st=k+1<=S,nt=p.type,rn=p.dismissible!==!1,Ce=p.className||"",Ze=p.descriptionClassName||"",oe=xe.useMemo(()=>C.findIndex(Pe=>Pe.toastId===p.id)||0,[C,p.id]),ve=xe.useMemo(()=>{var Pe;return(Pe=p.closeButton)!=null?Pe:D},[p.closeButton,D]),Te=xe.useMemo(()=>p.duration||I||dk,[p.duration,I]),Me=xe.useRef(0),Ge=xe.useRef(0),Ct=xe.useRef(0),Je=xe.useRef(null),[je,We]=V.split("-"),ut=xe.useMemo(()=>C.reduce((Pe,dt,gt)=>gt>=oe?Pe:Pe+dt.height,0),[C,oe]),Ue=Rz(),sn=p.invert||g,Yt=nt==="loading";Ge.current=xe.useMemo(()=>oe*F+ut,[oe,ut]),xe.useEffect(()=>{fe.current=Te},[Te]),xe.useEffect(()=>{ie(!0)},[]),xe.useEffect(()=>{const Pe=De.current;if(Pe){const dt=Pe.getBoundingClientRect().height;return xt(dt),w(gt=>[{toastId:p.id,height:dt,position:p.position},...gt]),()=>w(gt=>gt.filter(wt=>wt.toastId!==p.id))}},[w,p.id]),xe.useLayoutEffect(()=>{if(!A)return;const Pe=De.current,dt=Pe.style.height;Pe.style.height="auto";const gt=Pe.getBoundingClientRect().height;Pe.style.height=dt,xt(gt),w(wt=>wt.find(ht=>ht.toastId===p.id)?wt.map(ht=>ht.toastId===p.id?{...ht,height:gt}:ht):[{toastId:p.id,height:gt,position:p.position},...wt])},[A,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const Ye=xe.useCallback(()=>{ee(!0),Ke(Ge.current),w(Pe=>Pe.filter(dt=>dt.toastId!==p.id)),setTimeout(()=>{N(p)},Fz)},[p,N,w,Ge]);xe.useEffect(()=>{if(p.promise&&nt==="loading"||p.duration===1/0||p.type==="loading")return;let Pe;return E||y||Ue?(()=>{if(Ct.current<Me.current){const wt=new Date().getTime()-Me.current;fe.current=fe.current-wt}Ct.current=new Date().getTime()})():(()=>{fe.current!==1/0&&(Me.current=new Date().getTime(),Pe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Ye()},fe.current))})(),()=>clearTimeout(Pe)},[E,y,p,nt,Ue,Ye]),xe.useEffect(()=>{p.delete&&(Ye(),p.onDismiss==null||p.onDismiss.call(p,p))},[Ye,p.delete]);function qt(){var Pe;if($!=null&&$.loading){var dt;return xe.createElement("div",{className:ls(O==null?void 0:O.loader,p==null||(dt=p.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":nt==="loading"},$.loading)}return xe.createElement(xz,{className:ls(O==null?void 0:O.loader,p==null||(Pe=p.classNames)==null?void 0:Pe.loader),visible:nt==="loading"})}const jn=p.icon||($==null?void 0:$[nt])||_z(nt);var Wt,Bt;return xe.createElement("li",{tabIndex:0,ref:De,className:ls(B,Ce,O==null?void 0:O.toast,p==null||(t=p.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[nt],p==null||(n=p.classNames)==null?void 0:n[nt]),"data-sonner-toast":"","data-rich-colors":(Wt=p.richColors)!=null?Wt:L,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":A,"data-promise":!!p.promise,"data-swiped":Se,"data-removed":J,"data-visible":st,"data-y-position":je,"data-x-position":We,"data-index":k,"data-front":lt,"data-swiping":re,"data-dismissible":rn,"data-type":nt,"data-invert":sn,"data-swipe-out":he,"data-swipe-direction":P,"data-expanded":!!(E||W&&A),"data-testid":p.testId,style:{"--index":k,"--toasts-before":k,"--z-index":R.length-k,"--offset":`${J?Ae:Ge.current}px`,"--initial-height":W?"auto":`${yt}px`,...j,...p.style},onDragEnd:()=>{ce(!1),M(null),Je.current=null},onPointerDown:Pe=>{Pe.button!==2&&(Yt||!rn||(Ie.current=new Date,Ke(Ge.current),Pe.target.setPointerCapture(Pe.pointerId),Pe.target.tagName!=="BUTTON"&&(ce(!0),Je.current={x:Pe.clientX,y:Pe.clientY})))},onPointerUp:()=>{var Pe,dt,gt;if(he||!rn)return;Je.current=null;const wt=Number(((Pe=De.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Vt=Number(((dt=De.current)==null?void 0:dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ht=new Date().getTime()-((gt=Ie.current)==null?void 0:gt.getTime()),ft=X==="x"?wt:Vt,pn=Math.abs(ft)/ht;if(Math.abs(ft)>=Iz||pn>.11){Ke(Ge.current),p.onDismiss==null||p.onDismiss.call(p,p),Z(X==="x"?wt>0?"right":"left":Vt>0?"down":"up"),Ye(),pe(!0);return}else{var ke,Oe;(ke=De.current)==null||ke.style.setProperty("--swipe-amount-x","0px"),(Oe=De.current)==null||Oe.style.setProperty("--swipe-amount-y","0px")}Re(!1),ce(!1),M(null)},onPointerMove:Pe=>{var dt,gt,wt;if(!Je.current||!rn||((dt=window.getSelection())==null?void 0:dt.toString().length)>0)return;const ht=Pe.clientY-Je.current.y,ft=Pe.clientX-Je.current.x;var pn;const ke=(pn=e.swipeDirections)!=null?pn:Hz(V);!X&&(Math.abs(ft)>1||Math.abs(ht)>1)&&M(Math.abs(ft)>Math.abs(ht)?"x":"y");let Oe={x:0,y:0};const St=ot=>1/(1.5+Math.abs(ot)/20);if(X==="y"){if(ke.includes("top")||ke.includes("bottom"))if(ke.includes("top")&&ht<0||ke.includes("bottom")&&ht>0)Oe.y=ht;else{const ot=ht*St(ht);Oe.y=Math.abs(ot)<Math.abs(ht)?ot:ht}}else if(X==="x"&&(ke.includes("left")||ke.includes("right")))if(ke.includes("left")&&ft<0||ke.includes("right")&&ft>0)Oe.x=ft;else{const ot=ft*St(ft);Oe.x=Math.abs(ot)<Math.abs(ft)?ot:ft}(Math.abs(Oe.x)>0||Math.abs(Oe.y)>0)&&Re(!0),(gt=De.current)==null||gt.style.setProperty("--swipe-amount-x",`${Oe.x}px`),(wt=De.current)==null||wt.style.setProperty("--swipe-amount-y",`${Oe.y}px`)}},ve&&!p.jsx&&nt!=="loading"?xe.createElement("button",{"aria-label":U,"data-disabled":Yt,"data-close-button":!0,onClick:Yt||!rn?()=>{}:()=>{Ye(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ls(O==null?void 0:O.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Bt=$==null?void 0:$.close)!=null?Bt:Ez):null,(nt||p.icon||p.promise)&&p.icon!==null&&(($==null?void 0:$[nt])!==null||p.icon)?xe.createElement("div",{"data-icon":"",className:ls(O==null?void 0:O.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||qt():null,p.type!=="loading"?jn:null):null,xe.createElement("div",{"data-content":"",className:ls(O==null?void 0:O.content,p==null||(o=p.classNames)==null?void 0:o.content)},xe.createElement("div",{"data-title":"",className:ls(O==null?void 0:O.title,p==null||(l=p.classNames)==null?void 0:l.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?xe.createElement("div",{"data-description":"",className:ls(q,Ze,O==null?void 0:O.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),xe.isValidElement(p.cancel)?p.cancel:p.cancel&&Rf(p.cancel)?xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||H,onClick:Pe=>{Rf(p.cancel)&&rn&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Pe),Ye())},className:ls(O==null?void 0:O.cancelButton,p==null||(h=p.classNames)==null?void 0:h.cancelButton)},p.cancel.label):null,xe.isValidElement(p.action)?p.action:p.action&&Rf(p.action)?xe.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||G,onClick:Pe=>{Rf(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Pe),!Pe.defaultPrevented&&Ye())},className:ls(O==null?void 0:O.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function hk(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function $z(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,l=o?"--mobile-offset":"--offset",u=o?zz:Lz;function h(d){["top","right","bottom","left"].forEach(g=>{n[`${l}-${g}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?h(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=u:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):h(u)}),n}const Wz=xe.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:h,className:d,offset:g,mobileOffset:p,theme:v="light",richColors:y,duration:w,style:S,visibleToasts:C=Oz,toastOptions:k,dir:R=hk(),gap:E=Bz,icons:N,containerAriaLabel:L="Notifications"}=t,[D,j]=xe.useState([]),H=xe.useMemo(()=>r?D.filter(A=>A.toasterId===r):D.filter(A=>!A.toasterId),[D,r]),G=xe.useMemo(()=>Array.from(new Set([o].concat(H.filter(A=>A.position).map(A=>A.position)))),[H,o]),[B,q]=xe.useState([]),[I,V]=xe.useState(!1),[F,W]=xe.useState(!1),[O,$]=xe.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=xe.useRef(null),X=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=xe.useRef(null),P=xe.useRef(!1),Z=xe.useCallback(A=>{j(ie=>{var J;return(J=ie.find(ee=>ee.id===A.id))!=null&&J.delete||Gr.dismiss(A.id),ie.filter(({id:ee})=>ee!==A.id)})},[]);return xe.useEffect(()=>Gr.subscribe(A=>{if(A.dismiss){requestAnimationFrame(()=>{j(ie=>ie.map(J=>J.id===A.id?{...J,delete:!0}:J))});return}setTimeout(()=>{DT.flushSync(()=>{j(ie=>{const J=ie.findIndex(ee=>ee.id===A.id);return J!==-1?[...ie.slice(0,J),{...ie[J],...A},...ie.slice(J+1)]:[A,...ie]})})})}),[D]),xe.useEffect(()=>{if(v!=="system"){$(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const A=window.matchMedia("(prefers-color-scheme: dark)");try{A.addEventListener("change",({matches:ie})=>{$(ie?"dark":"light")})}catch{A.addListener(({matches:J})=>{try{$(J?"dark":"light")}catch(ee){console.error(ee)}})}},[v]),xe.useEffect(()=>{D.length<=1&&V(!1)},[D]),xe.useEffect(()=>{const A=ie=>{var J;if(l.every(ce=>ie[ce]||ie.code===ce)){var re;V(!0),(re=U.current)==null||re.focus()}ie.code==="Escape"&&(document.activeElement===U.current||(J=U.current)!=null&&J.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[l]),xe.useEffect(()=>{if(U.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,P.current=!1)}},[U.current]),xe.createElement("section",{ref:n,"aria-label":`${L} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},G.map((A,ie)=>{var J;const[ee,re]=A.split("-");return H.length?xe.createElement("ol",{key:A,dir:R==="auto"?hk():R,tabIndex:-1,ref:U,className:d,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":ee,"data-x-position":re,style:{"--front-toast-height":`${((J=B[0])==null?void 0:J.height)||0}px`,"--width":`${Pz}px`,"--gap":`${E}px`,...S,...$z(g,p)},onBlur:ce=>{P.current&&!ce.currentTarget.contains(ce.relatedTarget)&&(P.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||P.current||(P.current=!0,M.current=ce.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{F||V(!1)},onDragEnd:()=>V(!1),onPointerDown:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},H.filter(ce=>!ce.position&&ie===0||ce.position===A).map((ce,he)=>{var pe,Se;return xe.createElement(Uz,{key:ce.id,icons:N,index:he,toast:ce,defaultRichColors:y,duration:(pe=k==null?void 0:k.duration)!=null?pe:w,className:k==null?void 0:k.className,descriptionClassName:k==null?void 0:k.descriptionClassName,invert:s,visibleToasts:C,closeButton:(Se=k==null?void 0:k.closeButton)!=null?Se:h,interacting:F,position:A,style:k==null?void 0:k.style,unstyled:k==null?void 0:k.unstyled,classNames:k==null?void 0:k.classNames,cancelButtonStyle:k==null?void 0:k.cancelButtonStyle,actionButtonStyle:k==null?void 0:k.actionButtonStyle,closeButtonAriaLabel:k==null?void 0:k.closeButtonAriaLabel,removeToast:Z,toasts:H.filter(Re=>Re.position==ce.position),heights:B.filter(Re=>Re.position==ce.position),setHeights:q,expandByDefault:u,gap:E,expanded:I,swipeDirections:t.swipeDirections})})):null}))});function jT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=jT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function OT(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=jT(e))&&(r&&(r+=" "),r+=t);return r}const fk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mk=OT,Vz=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return mk(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(d=>{const g=n==null?void 0:n[d],p=o==null?void 0:o[d];if(g===null)return null;const v=fk(g)||fk(p);return s[d][v]}),u=n&&Object.entries(n).reduce((d,g)=>{let[p,v]=g;return v===void 0||(d[p]=v),d},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,g)=>{let{class:p,className:v,...y}=g;return Object.entries(y).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...o,...u}[S]):{...o,...u}[S]===C})?[...d,p,v]:d},[]);return mk(e,l,h,n==null?void 0:n.class,n==null?void 0:n.className)},qz=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Kz=(e,t)=>({classGroupId:e,validator:t}),LT=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),km="-",pk=[],Gz="arbitrary..",Yz=e=>{const t=Zz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Xz(l);const u=l.split(km),h=u[0]===""&&u.length>1?1:0;return zT(u,h,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const h=r[l],d=n[l];return h?d?qz(d,h):h:d||pk}return n[l]||pk}}},zT=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const d=zT(e,t+1,o);if(d)return d}const l=n.validators;if(l===null)return;const u=t===0?e.join(km):e.slice(t).join(km),h=l.length;for(let d=0;d<h;d++){const g=l[d];if(g.validator(u))return g.classGroupId}},Xz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Gz+r:void 0})(),Zz=e=>{const{theme:t,classGroups:n}=e;return Qz(n,t)},Qz=(e,t)=>{const n=LT();for(const r in e){const s=e[r];Ex(s,n,r,t)}return n},Ex=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const l=e[o];Jz(l,t,n,r)}},Jz=(e,t,n,r)=>{if(typeof e=="string"){eP(e,t,n);return}if(typeof e=="function"){tP(e,t,n,r);return}nP(e,t,n,r)},eP=(e,t,n)=>{const r=e===""?t:PT(t,e);r.classGroupId=n},tP=(e,t,n,r)=>{if(rP(e)){Ex(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Kz(n,e))},nP=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let l=0;l<o;l++){const[u,h]=s[l];Ex(h,PT(t,u),n,r)}},PT=(e,t)=>{let n=e;const r=t.split(km),s=r.length;for(let o=0;o<s;o++){const l=r[o];let u=n.nextPart.get(l);u||(u=LT(),n.nextPart.set(l,u)),n=u}return n},rP=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,iP=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return s(o,l),l},set(o,l){o in n?n[o]=l:s(o,l)}}},L_="!",gk=":",sP=[],vk=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),oP=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let l=0,u=0,h=0,d;const g=s.length;for(let S=0;S<g;S++){const C=s[S];if(l===0&&u===0){if(C===gk){o.push(s.slice(h,S)),h=S+1;continue}if(C==="/"){d=S;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const p=o.length===0?s:s.slice(h);let v=p,y=!1;p.endsWith(L_)?(v=p.slice(0,-1),y=!0):p.startsWith(L_)&&(v=p.slice(1),y=!0);const w=d&&d>h?d-h:void 0;return vk(o,y,v,w)};if(t){const s=t+gk,o=r;r=l=>l.startsWith(s)?o(l.slice(s.length)):vk(sP,!1,l,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},aP=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let o=0;o<n.length;o++){const l=n[o],u=l[0]==="[",h=t.has(l);u||h?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},lP=e=>({cache:iP(e.cacheSize),parseClassName:oP(e),sortModifiers:aP(e),...Yz(e)}),cP=/\s+/,uP=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,l=[],u=e.trim().split(cP);let h="";for(let d=u.length-1;d>=0;d-=1){const g=u[d],{isExternal:p,modifiers:v,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:S}=n(g);if(p){h=g+(h.length>0?" "+h:h);continue}let C=!!S,k=r(C?w.substring(0,S):w);if(!k){if(!C){h=g+(h.length>0?" "+h:h);continue}if(k=r(w),!k){h=g+(h.length>0?" "+h:h);continue}C=!1}const R=v.length===0?"":v.length===1?v[0]:o(v).join(":"),E=y?R+L_:R,N=E+k;if(l.indexOf(N)>-1)continue;l.push(N);const L=s(k,C);for(let D=0;D<L.length;++D){const j=L[D];l.push(E+j)}h=g+(h.length>0?" "+h:h)}return h},dP=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=BT(n))&&(s&&(s+=" "),s+=r);return s},BT=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=BT(e[r]))&&(n&&(n+=" "),n+=t);return n},hP=(e,...t)=>{let n,r,s,o;const l=h=>{const d=t.reduce((g,p)=>p(g),e());return n=lP(d),r=n.cache.get,s=n.cache.set,o=u,u(h)},u=h=>{const d=r(h);if(d)return d;const g=uP(h,n);return s(h,g),g};return o=l,(...h)=>o(dP(...h))},fP=[],qn=e=>{const t=n=>n[e]||fP;return t.isThemeGetter=!0,t},IT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,FT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mP=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gP=/\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$/,vP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_P=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ho=e=>mP.test(e),bt=e=>!!e&&!Number.isNaN(Number(e)),Uo=e=>!!e&&Number.isInteger(Number(e)),bb=e=>e.endsWith("%")&&bt(e.slice(0,-1)),Ks=e=>pP.test(e),HT=()=>!0,yP=e=>gP.test(e)&&!vP.test(e),Rx=()=>!1,xP=e=>bP.test(e),wP=e=>_P.test(e),SP=e=>!$e(e)&&!Ve(e),CP=e=>sa(e,WT,Rx),$e=e=>IT.test(e),Ta=e=>sa(e,VT,yP),bk=e=>sa(e,DP,bt),kP=e=>sa(e,KT,HT),EP=e=>sa(e,qT,Rx),_k=e=>sa(e,UT,Rx),RP=e=>sa(e,$T,wP),Tf=e=>sa(e,GT,xP),Ve=e=>FT.test(e),Lu=e=>il(e,VT),TP=e=>il(e,qT),yk=e=>il(e,UT),NP=e=>il(e,WT),MP=e=>il(e,$T),Nf=e=>il(e,GT,!0),AP=e=>il(e,KT,!0),sa=(e,t,n)=>{const r=IT.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},il=(e,t,n=!1)=>{const r=FT.exec(e);return r?r[1]?t(r[1]):n:!1},UT=e=>e==="position"||e==="percentage",$T=e=>e==="image"||e==="url",WT=e=>e==="length"||e==="size"||e==="bg-size",VT=e=>e==="length",DP=e=>e==="number",qT=e=>e==="family-name",KT=e=>e==="number"||e==="weight",GT=e=>e==="shadow",jP=()=>{const e=qn("color"),t=qn("font"),n=qn("text"),r=qn("font-weight"),s=qn("tracking"),o=qn("leading"),l=qn("breakpoint"),u=qn("container"),h=qn("spacing"),d=qn("radius"),g=qn("shadow"),p=qn("inset-shadow"),v=qn("text-shadow"),y=qn("drop-shadow"),w=qn("blur"),S=qn("perspective"),C=qn("aspect"),k=qn("ease"),R=qn("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...N(),Ve,$e],D=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],H=()=>[Ve,$e,h],G=()=>[Ho,"full","auto",...H()],B=()=>[Uo,"none","subgrid",Ve,$e],q=()=>["auto",{span:["full",Uo,Ve,$e]},Uo,Ve,$e],I=()=>[Uo,"auto",Ve,$e],V=()=>["auto","min","max","fr",Ve,$e],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...H()],$=()=>[Ho,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],U=()=>[Ho,"screen","full","dvw","lvw","svw","min","max","fit",...H()],X=()=>[Ho,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],M=()=>[e,Ve,$e],P=()=>[...N(),yk,_k,{position:[Ve,$e]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",NP,CP,{size:[Ve,$e]}],ie=()=>[bb,Lu,Ta],J=()=>["","none","full",d,Ve,$e],ee=()=>["",bt,Lu,Ta],re=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[bt,bb,yk,_k],pe=()=>["","none",w,Ve,$e],Se=()=>["none",bt,Ve,$e],Re=()=>["none",bt,Ve,$e],Ae=()=>[bt,Ve,$e],Ke=()=>[Ho,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ks],breakpoint:[Ks],color:[HT],container:[Ks],"drop-shadow":[Ks],ease:["in","out","in-out"],font:[SP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ks],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ks],shadow:[Ks],spacing:["px",bt],text:[Ks],"text-shadow":[Ks],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ho,$e,Ve,C]}],container:["container"],columns:[{columns:[bt,$e,Ve,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{"inset-s":G(),start:G()}],end:[{"inset-e":G(),end:G()}],"inset-bs":[{"inset-bs":G()}],"inset-be":[{"inset-be":G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[Uo,"auto",Ve,$e]}],basis:[{basis:[Ho,"full","auto",u,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[bt,Ho,"auto","initial","none",$e]}],grow:[{grow:["",bt,Ve,$e]}],shrink:[{shrink:["",bt,Ve,$e]}],order:[{order:[Uo,"first","last","none",Ve,$e]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pbs:[{pbs:H()}],pbe:[{pbe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...X()]}],"min-block-size":[{"min-block":["auto",...X()]}],"max-block-size":[{"max-block":["none",...X()]}],w:[{w:[u,"screen",...$()]}],"min-w":[{"min-w":[u,"screen","none",...$()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Lu,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,AP,kP]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bb,$e]}],"font-family":[{font:[TP,EP,t]}],"font-features":[{"font-features":[$e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ve,$e]}],"line-clamp":[{"line-clamp":[bt,"none",Ve,bk]}],leading:[{leading:[o,...H()]}],"list-image":[{"list-image":["none",Ve,$e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ve,$e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[bt,"from-font","auto",Ve,Ta]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[bt,"auto",Ve,$e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve,$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ve,$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Uo,Ve,$e],radial:["",Ve,$e],conic:[Uo,Ve,$e]},MP,RP]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[bt,Ve,$e]}],"outline-w":[{outline:["",bt,Lu,Ta]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",g,Nf,Tf]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",p,Nf,Tf]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[bt,Ta]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",v,Nf,Tf]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[bt,Ve,$e]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[bt]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Ve,$e]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[bt]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ve,$e]}],filter:[{filter:["","none",Ve,$e]}],blur:[{blur:pe()}],brightness:[{brightness:[bt,Ve,$e]}],contrast:[{contrast:[bt,Ve,$e]}],"drop-shadow":[{"drop-shadow":["","none",y,Nf,Tf]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",bt,Ve,$e]}],"hue-rotate":[{"hue-rotate":[bt,Ve,$e]}],invert:[{invert:["",bt,Ve,$e]}],saturate:[{saturate:[bt,Ve,$e]}],sepia:[{sepia:["",bt,Ve,$e]}],"backdrop-filter":[{"backdrop-filter":["","none",Ve,$e]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[bt,Ve,$e]}],"backdrop-contrast":[{"backdrop-contrast":[bt,Ve,$e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",bt,Ve,$e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[bt,Ve,$e]}],"backdrop-invert":[{"backdrop-invert":["",bt,Ve,$e]}],"backdrop-opacity":[{"backdrop-opacity":[bt,Ve,$e]}],"backdrop-saturate":[{"backdrop-saturate":[bt,Ve,$e]}],"backdrop-sepia":[{"backdrop-sepia":["",bt,Ve,$e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ve,$e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[bt,"initial",Ve,$e]}],ease:[{ease:["linear","initial",k,Ve,$e]}],delay:[{delay:[bt,Ve,$e]}],animate:[{animate:["none",R,Ve,$e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ve,$e]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Re()}],"scale-x":[{"scale-x":Re()}],"scale-y":[{"scale-y":Re()}],"scale-z":[{"scale-z":Re()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[Ve,$e,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ke()}],"translate-x":[{"translate-x":Ke()}],"translate-y":[{"translate-y":Ke()}],"translate-z":[{"translate-z":Ke()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ve,$e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mbs":[{"scroll-mbs":H()}],"scroll-mbe":[{"scroll-mbe":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pbs":[{"scroll-pbs":H()}],"scroll-pbe":[{"scroll-pbe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ve,$e]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[bt,Lu,Ta,bk]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},OP=hP(jP);function me(...e){return OP(OT(e))}function sd(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function xk(e){return e.startsWith("chatId:")?e.slice(7):e}const YT=Vz("touch-manipulation inline-flex items-center justify-center whitespace-nowrap cursor-pointer rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none",{variants:{variant:{default:"bg-primary text-primary-foreground disabled:bg-primary/50 disabled:text-primary-foreground/90 hover:bg-primary/90",juicy:"bg-logo text-primary-foreground disabled:text-primary-foreground/50 hover:bg-logo/90",destructive:"bg-destructive/80 dark:text-white",outline:"border border-input disabled:bg-transparent disabled:text-foreground/50 disabled:border-input/90 bg-card hover:bg-muted hover:text-accent-foreground",secondary:"bg-transparent border border-border text-secondary-foreground hover:text-secondary-foreground/60 disabled:text-secondary-foreground/50",ghost:"hover:bg-accent dark:hover:bg-card hover:text-accent-foreground text-muted-foreground disabled:text-muted-foreground/50 border border-border/0 hover:border-border",link:"text-primary disabled:text-primary/50 underline-offset-4 hover:underline",none:""},size:{default:"h-10 px-4 rounded-full py-2",sm:"h-9 rounded-full px-3",lg:"h-11 rounded-full px-8",icon:"h-9 w-9 rounded-full","icon-sm":"h-5.5 w-5.5 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),Xe=b.forwardRef(({className:e,variant:t,size:n,...r},s)=>f.jsx("button",{className:me(YT({variant:t,size:n,className:e})),ref:s,...r}));Xe.displayName="Button";function Be(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function wk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tx(...e){return t=>{let n=!1;const r=e.map(s=>{const o=wk(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():wk(e[s],null)}}}}function $t(...e){return b.useCallback(Tx(...e),e)}function LP(e,t){const n=b.createContext(t),r=o=>{const{children:l,...u}=o,h=b.useMemo(()=>u,Object.values(u));return f.jsx(n.Provider,{value:h,children:l})};r.displayName=e+"Provider";function s(o){const l=b.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function lo(e,t=[]){let n=[];function r(o,l){const u=b.createContext(l),h=n.length;n=[...n,l];const d=p=>{var k;const{scope:v,children:y,...w}=p,S=((k=v==null?void 0:v[e])==null?void 0:k[h])||u,C=b.useMemo(()=>w,Object.values(w));return f.jsx(S.Provider,{value:C,children:y})};d.displayName=o+"Provider";function g(p,v){var S;const y=((S=v==null?void 0:v[e])==null?void 0:S[h])||u,w=b.useContext(y);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[d,g]}const s=()=>{const o=n.map(l=>b.createContext(l));return function(u){const h=(u==null?void 0:u[e])||o;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:h}}),[u,h])}};return s.scopeName=e,[r,zP(s,...t)]}function zP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=r.reduce((u,{useScope:h,scopeName:d})=>{const p=h(o)[`__scope${d}`];return{...u,...p}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Rr=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},PP=uT[" useId ".trim().toString()]||(()=>{}),BP=0;function to(e){const[t,n]=b.useState(PP());return Rr(()=>{n(r=>r??String(BP++))},[e]),t?`radix-${t}`:""}var IP=uT[" useInsertionEffect ".trim().toString()]||Rr;function mc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,l]=FP({defaultProp:t,onChange:n}),u=e!==void 0,h=u?e:s;{const g=b.useRef(e!==void 0);b.useEffect(()=>{const p=g.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=u},[u,r])}const d=b.useCallback(g=>{var p;if(u){const v=HP(g)?g(e):g;v!==e&&((p=l.current)==null||p.call(l,v))}else o(g)},[u,e,o,l]);return[h,d]}function FP({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),s=b.useRef(n),o=b.useRef(t);return IP(()=>{o.current=t},[t]),b.useEffect(()=>{var l;s.current!==n&&((l=o.current)==null||l.call(o,n),s.current=n)},[n,s]),[n,r,o]}function HP(e){return typeof e=="function"}function qa(e){const t=UP(e),n=b.forwardRef((r,s)=>{const{children:o,...l}=r,u=b.Children.toArray(o),h=u.find(WP);if(h){const d=h.props.children,g=u.map(p=>p===h?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:p);return f.jsx(t,{...l,ref:s,children:b.isValidElement(d)?b.cloneElement(d,void 0,g):null})}return f.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function UP(e){const t=b.forwardRef((n,r)=>{const{children:s,...o}=n;if(b.isValidElement(s)){const l=qP(s),u=VP(o,s.props);return s.type!==b.Fragment&&(u.ref=r?Tx(r,l):l),b.cloneElement(s,u)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var XT=Symbol("radix.slottable");function $P(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=XT,t}function WP(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===XT}function VP(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{const h=o(...u);return s(...u),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function qP(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var KP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tt=KP.reduce((e,t)=>{const n=qa(`Primitive.${t}`),r=b.forwardRef((s,o)=>{const{asChild:l,...u}=s,h=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(h,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ZT(e,t){e&&qi.flushSync(()=>e.dispatchEvent(t))}function Yi(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function GP(e,t=globalThis==null?void 0:globalThis.document){const n=Yi(e);b.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var YP="DismissableLayer",z_="dismissableLayer.update",XP="dismissableLayer.pointerDownOutside",ZP="dismissableLayer.focusOutside",Sk,QT=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kc=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...h}=e,d=b.useContext(QT),[g,p]=b.useState(null),v=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=b.useState({}),w=$t(t,j=>p(j)),S=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),R=g?S.indexOf(g):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,N=R>=k,L=eB(j=>{const H=j.target,G=[...d.branches].some(B=>B.contains(H));!N||G||(s==null||s(j),l==null||l(j),j.defaultPrevented||u==null||u())},v),D=tB(j=>{const H=j.target;[...d.branches].some(B=>B.contains(H))||(o==null||o(j),l==null||l(j),j.defaultPrevented||u==null||u())},v);return GP(j=>{R===d.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&u&&(j.preventDefault(),u()))},v),b.useEffect(()=>{if(g)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Sk=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(g)),d.layers.add(g),Ck(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Sk)}},[g,v,n,d]),b.useEffect(()=>()=>{g&&(d.layers.delete(g),d.layersWithOutsidePointerEventsDisabled.delete(g),Ck())},[g,d]),b.useEffect(()=>{const j=()=>y({});return document.addEventListener(z_,j),()=>document.removeEventListener(z_,j)},[]),f.jsx(Tt.div,{...h,ref:w,style:{pointerEvents:E?N?"auto":"none":void 0,...e.style},onFocusCapture:Be(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Be(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Be(e.onPointerDownCapture,L.onPointerDownCapture)})});kc.displayName=YP;var QP="DismissableLayerBranch",JP=b.forwardRef((e,t)=>{const n=b.useContext(QT),r=b.useRef(null),s=$t(t,r);return b.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),f.jsx(Tt.div,{...e,ref:s})});JP.displayName=QP;function eB(e,t=globalThis==null?void 0:globalThis.document){const n=Yi(e),r=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let h=function(){JT(XP,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=h,t.addEventListener("click",s.current,{once:!0})):h()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tB(e,t=globalThis==null?void 0:globalThis.document){const n=Yi(e),r=b.useRef(!1);return b.useEffect(()=>{const s=o=>{o.target&&!r.current&&JT(ZP,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ck(){const e=new CustomEvent(z_);document.dispatchEvent(e)}function JT(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ZT(s,o):s.dispatchEvent(o)}var _b="focusScope.autoFocusOnMount",yb="focusScope.autoFocusOnUnmount",kk={bubbles:!1,cancelable:!0},nB="FocusScope",Pd=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=e,[u,h]=b.useState(null),d=Yi(s),g=Yi(o),p=b.useRef(null),v=$t(t,S=>h(S)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let S=function(E){if(y.paused||!u)return;const N=E.target;u.contains(N)?p.current=N:Go(p.current,{select:!0})},C=function(E){if(y.paused||!u)return;const N=E.relatedTarget;N!==null&&(u.contains(N)||Go(p.current,{select:!0}))},k=function(E){if(document.activeElement===document.body)for(const L of E)L.removedNodes.length>0&&Go(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const R=new MutationObserver(k);return u&&R.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),R.disconnect()}}},[r,u,y.paused]),b.useEffect(()=>{if(u){Rk.add(y);const S=document.activeElement;if(!u.contains(S)){const k=new CustomEvent(_b,kk);u.addEventListener(_b,d),u.dispatchEvent(k),k.defaultPrevented||(rB(lB(eN(u)),{select:!0}),document.activeElement===S&&Go(u))}return()=>{u.removeEventListener(_b,d),setTimeout(()=>{const k=new CustomEvent(yb,kk);u.addEventListener(yb,g),u.dispatchEvent(k),k.defaultPrevented||Go(S??document.body,{select:!0}),u.removeEventListener(yb,g),Rk.remove(y)},0)}}},[u,d,g,y]);const w=b.useCallback(S=>{if(!n&&!r||y.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const R=S.currentTarget,[E,N]=iB(R);E&&N?!S.shiftKey&&k===N?(S.preventDefault(),n&&Go(E,{select:!0})):S.shiftKey&&k===E&&(S.preventDefault(),n&&Go(N,{select:!0})):k===R&&S.preventDefault()}},[n,r,y.paused]);return f.jsx(Tt.div,{tabIndex:-1,...l,ref:v,onKeyDown:w})});Pd.displayName=nB;function rB(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Go(r,{select:t}),document.activeElement!==n)return}function iB(e){const t=eN(e),n=Ek(t,e),r=Ek(t.reverse(),e);return[n,r]}function eN(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ek(e,t){for(const n of e)if(!sB(n,{upTo:t}))return n}function sB(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function oB(e){return e instanceof HTMLInputElement&&"select"in e}function Go(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&oB(e)&&t&&e.select()}}var Rk=aB();function aB(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Tk(e,t),e.unshift(t)},remove(t){var n;e=Tk(e,t),(n=e[0])==null||n.resume()}}}function Tk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lB(e){return e.filter(t=>t.tagName!=="A")}var cB="Portal",Ec=b.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,o]=b.useState(!1);Rr(()=>o(!0),[]);const l=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?DT.createPortal(f.jsx(Tt.div,{...r,ref:t}),l):null});Ec.displayName=cB;function uB(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Bi=e=>{const{present:t,children:n}=e,r=dB(t),s=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=$t(r.ref,hB(s));return typeof n=="function"||r.isPresent?b.cloneElement(s,{ref:o}):null};Bi.displayName="Presence";function dB(e){const[t,n]=b.useState(),r=b.useRef(null),s=b.useRef(e),o=b.useRef("none"),l=e?"mounted":"unmounted",[u,h]=uB(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const d=Mf(r.current);o.current=u==="mounted"?d:"none"},[u]),Rr(()=>{const d=r.current,g=s.current;if(g!==e){const v=o.current,y=Mf(d);e?h("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?h("UNMOUNT"):h(g&&v!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),Rr(()=>{if(t){let d;const g=t.ownerDocument.defaultView??window,p=y=>{const S=Mf(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(h("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=Mf(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{g.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Mf(e){return(e==null?void 0:e.animationName)||"none"}function hB(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xb=0;function mp(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Nk()),document.body.insertAdjacentElement("beforeend",e[1]??Nk()),xb++,()=>{xb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xb--}},[])}function Nk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gs=function(){return gs=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},gs.apply(this,arguments)};function tN(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function fB(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var cm="right-scroll-bar-position",um="width-before-scroll-bar",mB="with-scroll-bars-hidden",pB="--removed-body-scroll-bar-size";function wb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gB(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var vB=typeof window<"u"?b.useLayoutEffect:b.useEffect,Mk=new WeakMap;function bB(e,t){var n=gB(null,function(r){return e.forEach(function(s){return wb(s,r)})});return vB(function(){var r=Mk.get(n);if(r){var s=new Set(r),o=new Set(e),l=n.current;s.forEach(function(u){o.has(u)||wb(u,null)}),o.forEach(function(u){s.has(u)||wb(u,l)})}Mk.set(n,e)},[e]),n}function _B(e){return e}function yB(e,t){t===void 0&&(t=_B);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(o),l=n}var h=function(){var g=l;l=[],g.forEach(o)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(g){l.push(g),d()},filter:function(g){return l=l.filter(g),n}}}};return s}function xB(e){e===void 0&&(e={});var t=yB(null);return t.options=gs({async:!0,ssr:!1},e),t}var nN=function(e){var t=e.sideCar,n=tN(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,gs({},n))};nN.isSideCarExport=!0;function wB(e,t){return e.useMedium(t),nN}var rN=xB(),Sb=function(){},pp=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Sb,onWheelCapture:Sb,onTouchMoveCapture:Sb}),s=r[0],o=r[1],l=e.forwardProps,u=e.children,h=e.className,d=e.removeScrollBar,g=e.enabled,p=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,R=k===void 0?"div":k,E=e.gapMode,N=tN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=v,D=bB([n,t]),j=gs(gs({},N),s);return b.createElement(b.Fragment,null,g&&b.createElement(L,{sideCar:rN,removeScrollBar:d,shards:p,noRelative:y,noIsolation:w,inert:S,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:E}),l?b.cloneElement(b.Children.only(u),gs(gs({},j),{ref:D})):b.createElement(R,gs({},j,{className:h,ref:D}),u))});pp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};pp.classNames={fullWidth:um,zeroRight:cm};var SB=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function CB(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=SB();return t&&e.setAttribute("nonce",t),e}function kB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function EB(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var RB=function(){var e=0,t=null;return{add:function(n){e==0&&(t=CB())&&(kB(t,n),EB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TB=function(){var e=RB();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},iN=function(){var e=TB(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},NB={left:0,top:0,right:0,gap:0},Cb=function(e){return parseInt(e||"",10)||0},MB=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Cb(n),Cb(r),Cb(s)]},AB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return NB;var t=MB(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},DB=iN(),lc="data-scroll-locked",jB=function(e,t,n,r){var s=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
+
.`.concat(mB,` {
|
|
62
|
+
overflow: hidden `).concat(r,`;
|
|
63
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
64
|
+
}
|
|
65
|
+
body[`).concat(lc,`] {
|
|
66
|
+
overflow: hidden `).concat(r,`;
|
|
67
|
+
overscroll-behavior: contain;
|
|
68
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
69
|
+
padding-left: `.concat(s,`px;
|
|
70
|
+
padding-top: `).concat(o,`px;
|
|
71
|
+
padding-right: `).concat(l,`px;
|
|
72
|
+
margin-left:0;
|
|
73
|
+
margin-top:0;
|
|
74
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
75
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.`).concat(cm,` {
|
|
79
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(um,` {
|
|
83
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.`).concat(cm," .").concat(cm,` {
|
|
87
|
+
right: 0 `).concat(r,`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.`).concat(um," .").concat(um,` {
|
|
91
|
+
margin-right: 0 `).concat(r,`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
body[`).concat(lc,`] {
|
|
95
|
+
`).concat(pB,": ").concat(u,`px;
|
|
96
|
+
}
|
|
97
|
+
`)},Ak=function(){var e=parseInt(document.body.getAttribute(lc)||"0",10);return isFinite(e)?e:0},OB=function(){b.useEffect(function(){return document.body.setAttribute(lc,(Ak()+1).toString()),function(){var e=Ak()-1;e<=0?document.body.removeAttribute(lc):document.body.setAttribute(lc,e.toString())}},[])},LB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;OB();var o=b.useMemo(function(){return AB(s)},[s]);return b.createElement(DB,{styles:jB(o,!t,s,n?"":"!important")})},P_=!1;if(typeof window<"u")try{var Af=Object.defineProperty({},"passive",{get:function(){return P_=!0,!0}});window.addEventListener("test",Af,Af),window.removeEventListener("test",Af,Af)}catch{P_=!1}var Vl=P_?{passive:!1}:!1,zB=function(e){return e.tagName==="TEXTAREA"},sN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zB(e)&&n[t]==="visible")},PB=function(e){return sN(e,"overflowY")},BB=function(e){return sN(e,"overflowX")},Dk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=oN(e,r);if(s){var o=aN(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},IB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},FB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},oN=function(e,t){return e==="v"?PB(t):BB(t)},aN=function(e,t){return e==="v"?IB(t):FB(t)},HB=function(e,t){return e==="h"&&t==="rtl"?-1:1},UB=function(e,t,n,r,s){var o=HB(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,h=t.contains(u),d=!1,g=l>0,p=0,v=0;do{if(!u)break;var y=aN(e,u),w=y[0],S=y[1],C=y[2],k=S-C-o*w;(w||k)&&oN(e,u)&&(p+=k,v+=w);var R=u.parentNode;u=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!h&&u!==document.body||h&&(t.contains(u)||t===u));return(g&&Math.abs(p)<1||!g&&Math.abs(v)<1)&&(d=!0),d},Df=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jk=function(e){return[e.deltaX,e.deltaY]},Ok=function(e){return e&&"current"in e?e.current:e},$B=function(e,t){return e[0]===t[0]&&e[1]===t[1]},WB=function(e){return`
|
|
98
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
99
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
100
|
+
`)},VB=0,ql=[];function qB(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),s=b.useState(VB++)[0],o=b.useState(iN)[0],l=b.useRef(e);b.useEffect(function(){l.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=fB([e.lockRef.current],(e.shards||[]).map(Ok),!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 u=b.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var k=Df(S),R=n.current,E="deltaX"in S?S.deltaX:R[0]-k[0],N="deltaY"in S?S.deltaY:R[1]-k[1],L,D=S.target,j=Math.abs(E)>Math.abs(N)?"h":"v";if("touches"in S&&j==="h"&&D.type==="range")return!1;var H=window.getSelection(),G=H&&H.anchorNode,B=G?G===D||G.contains(D):!1;if(B)return!1;var q=Dk(j,D);if(!q)return!0;if(q?L=j:(L=j==="v"?"h":"v",q=Dk(j,D)),!q)return!1;if(!r.current&&"changedTouches"in S&&(E||N)&&(r.current=L),!L)return!0;var I=r.current||L;return UB(I,C,S,I==="h"?E:N)},[]),h=b.useCallback(function(S){var C=S;if(!(!ql.length||ql[ql.length-1]!==o)){var k="deltaY"in C?jk(C):Df(C),R=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&$B(L.delta,k)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var E=(l.current.shards||[]).map(Ok).filter(Boolean).filter(function(L){return L.contains(C.target)}),N=E.length>0?u(C,E[0]):!l.current.noIsolation;N&&C.cancelable&&C.preventDefault()}}},[]),d=b.useCallback(function(S,C,k,R){var E={name:S,delta:C,target:k,should:R,shadowParent:KB(k)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(N){return N!==E})},1)},[]),g=b.useCallback(function(S){n.current=Df(S),r.current=void 0},[]),p=b.useCallback(function(S){d(S.type,jk(S),S.target,u(S,e.lockRef.current))},[]),v=b.useCallback(function(S){d(S.type,Df(S),S.target,u(S,e.lockRef.current))},[]);b.useEffect(function(){return ql.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",h,Vl),document.addEventListener("touchmove",h,Vl),document.addEventListener("touchstart",g,Vl),function(){ql=ql.filter(function(S){return S!==o}),document.removeEventListener("wheel",h,Vl),document.removeEventListener("touchmove",h,Vl),document.removeEventListener("touchstart",g,Vl)}},[]);var y=e.removeScrollBar,w=e.inert;return b.createElement(b.Fragment,null,w?b.createElement(o,{styles:WB(s)}):null,y?b.createElement(LB,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function KB(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const GB=wB(rN,qB);var Bd=b.forwardRef(function(e,t){return b.createElement(pp,gs({},e,{ref:t,sideCar:GB}))});Bd.classNames=pp.classNames;var YB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Kl=new WeakMap,jf=new WeakMap,Of={},kb=0,lN=function(e){return e&&(e.host||lN(e.parentNode))},XB=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=lN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ZB=function(e,t,n,r){var s=XB(t,Array.isArray(e)?e:[e]);Of[n]||(Of[n]=new WeakMap);var o=Of[n],l=[],u=new Set,h=new Set(s),d=function(p){!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);var g=function(p){!p||h.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))g(v);else try{var y=v.getAttribute(r),w=y!==null&&y!=="false",S=(Kl.get(v)||0)+1,C=(o.get(v)||0)+1;Kl.set(v,S),o.set(v,C),l.push(v),S===1&&w&&jf.set(v,!0),C===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",v,k)}})};return g(t),u.clear(),kb++,function(){l.forEach(function(p){var v=Kl.get(p)-1,y=o.get(p)-1;Kl.set(p,v),o.set(p,y),v||(jf.has(p)||p.removeAttribute(r),jf.delete(p)),y||p.removeAttribute(n)}),kb--,kb||(Kl=new WeakMap,Kl=new WeakMap,jf=new WeakMap,Of={})}},gp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=YB(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),ZB(r,s,n,"aria-hidden")):function(){return null}},vp="Dialog",[cN,Lre]=lo(vp),[QB,es]=cN(vp),uN=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,u=b.useRef(null),h=b.useRef(null),[d,g]=mc({prop:r,defaultProp:s??!1,onChange:o,caller:vp});return f.jsx(QB,{scope:t,triggerRef:u,contentRef:h,contentId:to(),titleId:to(),descriptionId:to(),open:d,onOpenChange:g,onOpenToggle:b.useCallback(()=>g(p=>!p),[g]),modal:l,children:n})};uN.displayName=vp;var dN="DialogTrigger",JB=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=es(dN,n),o=$t(t,s.triggerRef);return f.jsx(Tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ax(s.open),...r,ref:o,onClick:Be(e.onClick,s.onOpenToggle)})});JB.displayName=dN;var Nx="DialogPortal",[eI,hN]=cN(Nx,{forceMount:void 0}),fN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=es(Nx,t);return f.jsx(eI,{scope:t,forceMount:n,children:b.Children.map(r,l=>f.jsx(Bi,{present:n||o.open,children:f.jsx(Ec,{asChild:!0,container:s,children:l})}))})};fN.displayName=Nx;var Em="DialogOverlay",mN=b.forwardRef((e,t)=>{const n=hN(Em,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=es(Em,e.__scopeDialog);return o.modal?f.jsx(Bi,{present:r||o.open,children:f.jsx(nI,{...s,ref:t})}):null});mN.displayName=Em;var tI=qa("DialogOverlay.RemoveScroll"),nI=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=es(Em,n);return f.jsx(Bd,{as:tI,allowPinchZoom:!0,shards:[s.contentRef],children:f.jsx(Tt.div,{"data-state":Ax(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ka="DialogContent",pN=b.forwardRef((e,t)=>{const n=hN(Ka,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=es(Ka,e.__scopeDialog);return f.jsx(Bi,{present:r||o.open,children:o.modal?f.jsx(rI,{...s,ref:t}):f.jsx(iI,{...s,ref:t})})});pN.displayName=Ka;var rI=b.forwardRef((e,t)=>{const n=es(Ka,e.__scopeDialog),r=b.useRef(null),s=$t(t,n.contentRef,r);return b.useEffect(()=>{const o=r.current;if(o)return gp(o)},[]),f.jsx(gN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Be(e.onFocusOutside,o=>o.preventDefault())})}),iI=b.forwardRef((e,t)=>{const n=es(Ka,e.__scopeDialog),r=b.useRef(!1),s=b.useRef(!1);return f.jsx(gN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),gN=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,u=es(Ka,n),h=b.useRef(null),d=$t(t,h);return mp(),f.jsxs(f.Fragment,{children:[f.jsx(Pd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:f.jsx(kc,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Ax(u.open),...l,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(sI,{titleId:u.titleId}),f.jsx(aI,{contentRef:h,descriptionId:u.descriptionId})]})]})}),Mx="DialogTitle",vN=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=es(Mx,n);return f.jsx(Tt.h2,{id:s.titleId,...r,ref:t})});vN.displayName=Mx;var bN="DialogDescription",_N=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=es(bN,n);return f.jsx(Tt.p,{id:s.descriptionId,...r,ref:t})});_N.displayName=bN;var yN="DialogClose",xN=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=es(yN,n);return f.jsx(Tt.button,{type:"button",...r,ref:t,onClick:Be(e.onClick,()=>s.onOpenChange(!1))})});xN.displayName=yN;function Ax(e){return e?"open":"closed"}var wN="DialogTitleWarning",[zre,SN]=LP(wN,{contentName:Ka,titleName:Mx,docsSlug:"dialog"}),sI=({titleId:e})=>{const t=SN(wN),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
101
|
+
|
|
102
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
103
|
+
|
|
104
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},oI="DialogDescriptionWarning",aI=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${SN(oI).contentName}}.`;return b.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},lI=uN,cI=fN,CN=mN,kN=pN,uI=vN,dI=_N,hI=xN;/**
|
|
105
|
+
* @license lucide-react v0.562.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 fI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mI=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Lk=e=>{const t=mI(e);return t.charAt(0).toUpperCase()+t.slice(1)},EN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),pI=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
110
|
+
* @license lucide-react v0.562.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
|
+
*/var gI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
115
|
+
* @license lucide-react v0.562.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 vI=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:l,...u},h)=>b.createElement("svg",{ref:h,...gI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:EN("lucide",s),...!o&&!pI(u)&&{"aria-hidden":"true"},...u},[...l.map(([d,g])=>b.createElement(d,g)),...Array.isArray(o)?o:[o]]));/**
|
|
120
|
+
* @license lucide-react v0.562.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 Le=(e,t)=>{const n=b.forwardRef(({className:r,...s},o)=>b.createElement(vI,{ref:o,iconNode:t,className:EN(`lucide-${fI(Lk(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Lk(e),n};/**
|
|
125
|
+
* @license lucide-react v0.562.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 bI=[["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"}]],_I=Le("archive",bI);/**
|
|
130
|
+
* @license lucide-react v0.562.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 yI=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],xI=Le("arrow-down-to-line",yI);/**
|
|
135
|
+
* @license lucide-react v0.562.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 wI=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],SI=Le("arrow-down",wI);/**
|
|
140
|
+
* @license lucide-react v0.562.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 CI=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],kI=Le("arrow-left-right",CI);/**
|
|
145
|
+
* @license lucide-react v0.562.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 EI=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],RI=Le("arrow-left",EI);/**
|
|
150
|
+
* @license lucide-react v0.562.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 TI=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],NI=Le("arrow-up",TI);/**
|
|
155
|
+
* @license lucide-react v0.562.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 MI=[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]],AI=Le("asterisk",MI);/**
|
|
160
|
+
* @license lucide-react v0.562.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 DI=[["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"}]],ai=Le("brain",DI);/**
|
|
165
|
+
* @license lucide-react v0.562.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 jI=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],OI=Le("check-check",jI);/**
|
|
170
|
+
* @license lucide-react v0.562.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 LI=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],zI=Le("check-line",LI);/**
|
|
175
|
+
* @license lucide-react v0.562.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 PI=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Xi=Le("check",PI);/**
|
|
180
|
+
* @license lucide-react v0.562.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 BI=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],bp=Le("chevron-down",BI);/**
|
|
185
|
+
* @license lucide-react v0.562.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 II=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],RN=Le("chevron-left",II);/**
|
|
190
|
+
* @license lucide-react v0.562.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 FI=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Or=Le("chevron-right",FI);/**
|
|
195
|
+
* @license lucide-react v0.562.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 HI=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],UI=Le("chevron-up",HI);/**
|
|
200
|
+
* @license lucide-react v0.562.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 $I=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],WI=Le("chevrons-up",$I);/**
|
|
205
|
+
* @license lucide-react v0.562.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 VI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],qI=Le("circle-slash",VI);/**
|
|
210
|
+
* @license lucide-react v0.562.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 KI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],GI=Le("circle",KI);/**
|
|
215
|
+
* @license lucide-react v0.562.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 YI=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],XI=Le("cloud-download",YI);/**
|
|
220
|
+
* @license lucide-react v0.562.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 ZI=[["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"}]],zk=Le("code-xml",ZI);/**
|
|
225
|
+
* @license lucide-react v0.562.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 QI=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],B_=Le("code",QI);/**
|
|
230
|
+
* @license lucide-react v0.562.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 JI=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],e6=Le("command",JI);/**
|
|
235
|
+
* @license lucide-react v0.562.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 t6=[["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"}]],Id=Le("copy",t6);/**
|
|
240
|
+
* @license lucide-react v0.562.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 n6=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],r6=Le("corner-down-left",n6);/**
|
|
245
|
+
* @license lucide-react v0.562.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 i6=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],s6=Le("eraser",i6);/**
|
|
250
|
+
* @license lucide-react v0.562.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 o6=[["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"}]],a6=Le("external-link",o6);/**
|
|
255
|
+
* @license lucide-react v0.562.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 l6=[["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"}]],Pk=Le("eye",l6);/**
|
|
260
|
+
* @license lucide-react v0.562.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 c6=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],u6=Le("file-pen",c6);/**
|
|
265
|
+
* @license lucide-react v0.562.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 d6=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 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 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],h6=Le("file-plus-corner",d6);/**
|
|
270
|
+
* @license lucide-react v0.562.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 f6=[["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"}]],m6=Le("file-text",f6);/**
|
|
275
|
+
* @license lucide-react v0.562.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 p6=[["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"}]],g6=Le("file",p6);/**
|
|
280
|
+
* @license lucide-react v0.562.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 v6=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],Eb=Le("folder-git-2",v6);/**
|
|
285
|
+
* @license lucide-react v0.562.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 b6=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],TN=Le("folder-open",b6);/**
|
|
290
|
+
* @license lucide-react v0.562.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 _6=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],NN=Le("folder-plus",_6);/**
|
|
295
|
+
* @license lucide-react v0.562.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 y6=[["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"}]],MN=Le("folder",y6);/**
|
|
300
|
+
* @license lucide-react v0.562.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 x6=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Gs=Le("gauge",x6);/**
|
|
305
|
+
* @license lucide-react v0.562.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 w6=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],S6=Le("git-branch",w6);/**
|
|
310
|
+
* @license lucide-react v0.562.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 C6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],k6=Le("info",C6);/**
|
|
315
|
+
* @license lucide-react v0.562.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 E6=[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]],R6=Le("layout-panel-left",E6);/**
|
|
320
|
+
* @license lucide-react v0.562.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 T6=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],N6=Le("list-checks",T6);/**
|
|
325
|
+
* @license lucide-react v0.562.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 M6=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Rm=Le("list-todo",M6);/**
|
|
330
|
+
* @license lucide-react v0.562.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 A6=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],kr=Le("loader-circle",A6);/**
|
|
335
|
+
* @license lucide-react v0.562.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 D6=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],Bk=Le("lock-open",D6);/**
|
|
340
|
+
* @license lucide-react v0.562.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 j6=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],Ik=Le("map",j6);/**
|
|
345
|
+
* @license lucide-react v0.562.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 O6=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],I_=Le("menu",O6);/**
|
|
350
|
+
* @license lucide-react v0.562.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 L6=[["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"}]],AN=Le("message-circle-question-mark",L6);/**
|
|
355
|
+
* @license lucide-react v0.562.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 z6=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["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:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],P6=Le("message-square-quote",z6);/**
|
|
360
|
+
* @license lucide-react v0.562.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 B6=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],DN=Le("minimize",B6);/**
|
|
365
|
+
* @license lucide-react v0.562.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 I6=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],jN=Le("monitor",I6);/**
|
|
370
|
+
* @license lucide-react v0.562.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 F6=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],H6=Le("palette",F6);/**
|
|
375
|
+
* @license lucide-react v0.562.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 U6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],F_=Le("panel-left",U6);/**
|
|
380
|
+
* @license lucide-react v0.562.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 $6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],W6=Le("panel-right",$6);/**
|
|
385
|
+
* @license lucide-react v0.562.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 V6=[["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"}]],ON=Le("paperclip",V6);/**
|
|
390
|
+
* @license lucide-react v0.562.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 q6=[["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"}]],pc=Le("pencil",q6);/**
|
|
395
|
+
* @license lucide-react v0.562.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 K6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Dx=Le("plus",K6);/**
|
|
400
|
+
* @license lucide-react v0.562.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 G6=[["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"}]],Tm=Le("refresh-cw",G6);/**
|
|
405
|
+
* @license lucide-react v0.562.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 Y6=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Rb=Le("search",Y6);/**
|
|
410
|
+
* @license lucide-react v0.562.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 X6=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Z6=Le("send",X6);/**
|
|
415
|
+
* @license lucide-react v0.562.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 Q6=[["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"}]],J6=Le("settings",Q6);/**
|
|
420
|
+
* @license lucide-react v0.562.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 e8=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],t8=Le("settings-2",e8);/**
|
|
425
|
+
* @license lucide-react v0.562.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 n8=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],r8=Le("slash",n8);/**
|
|
430
|
+
* @license lucide-react v0.562.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 i8=[["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"}]],Dn=Le("sparkles",i8);/**
|
|
435
|
+
* @license lucide-react v0.562.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 s8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 8h10",key:"1jw688"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h10",key:"wp8him"}]],Fk=Le("square-menu",s8);/**
|
|
440
|
+
* @license lucide-react v0.562.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 o8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}]],Hk=Le("square-minus",o8);/**
|
|
445
|
+
* @license lucide-react v0.562.0 - ISC
|
|
446
|
+
*
|
|
447
|
+
* This source code is licensed under the ISC license.
|
|
448
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
449
|
+
*/const a8=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],LN=Le("square-pen",a8);/**
|
|
450
|
+
* @license lucide-react v0.562.0 - ISC
|
|
451
|
+
*
|
|
452
|
+
* This source code is licensed under the ISC license.
|
|
453
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
454
|
+
*/const l8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],c8=Le("square-x",l8);/**
|
|
455
|
+
* @license lucide-react v0.562.0 - ISC
|
|
456
|
+
*
|
|
457
|
+
* This source code is licensed under the ISC license.
|
|
458
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
459
|
+
*/const u8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],d8=Le("square",u8);/**
|
|
460
|
+
* @license lucide-react v0.562.0 - ISC
|
|
461
|
+
*
|
|
462
|
+
* This source code is licensed under the ISC license.
|
|
463
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
464
|
+
*/const h8=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],jx=Le("terminal",h8);/**
|
|
465
|
+
* @license lucide-react v0.562.0 - ISC
|
|
466
|
+
*
|
|
467
|
+
* This source code is licensed under the ISC license.
|
|
468
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
469
|
+
*/const f8=[["rect",{width:"18",height:"12",x:"3",y:"8",rx:"1",key:"158fvp"}],["path",{d:"M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3",key:"s0042v"}],["path",{d:"M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3",key:"9wmeh2"}]],m8=Le("toy-brick",f8);/**
|
|
470
|
+
* @license lucide-react v0.562.0 - ISC
|
|
471
|
+
*
|
|
472
|
+
* This source code is licensed under the ISC license.
|
|
473
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
474
|
+
*/const p8=[["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"}]],_d=Le("trash-2",p8);/**
|
|
475
|
+
* @license lucide-react v0.562.0 - ISC
|
|
476
|
+
*
|
|
477
|
+
* This source code is licensed under the ISC license.
|
|
478
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
479
|
+
*/const g8=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Ox=Le("user-round",g8);/**
|
|
480
|
+
* @license lucide-react v0.562.0 - ISC
|
|
481
|
+
*
|
|
482
|
+
* This source code is licensed under the ISC license.
|
|
483
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
484
|
+
*/const v8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ro=Le("x",v8);/**
|
|
485
|
+
* @license lucide-react v0.562.0 - ISC
|
|
486
|
+
*
|
|
487
|
+
* This source code is licensed under the ISC license.
|
|
488
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
489
|
+
*/const b8=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ps=Le("zap",b8),yd="data-focus-fallback-ignore",zN="data-allow-focus-retain",Nm="kaizen:restore-chat-input-focus",Lx="data-chat-input",Mm="data-chat-selection-zone";function Ba(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function H_(e){var n;const t=e;return t!=null&&t.matches?t.matches("input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']), textarea, select")||t.isContentEditable||((n=t.getAttribute)==null?void 0:n.call(t,"role"))==="textbox"?!0:Ba(e,zN):!1}function _8(e){const t=e;return t!=null&&t.matches?H_(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:Ba(e,zN):!1}function Uk(e){return!!e.querySelector(`[${yd}][data-state='open']`)}function y8(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function x8(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${Lx}]`)).filter(l=>!l.disabled);if(n.length===0)return!1;const r=n.indexOf(e),s=r>=0?(r+1)%n.length:0,o=n[s];return o?(o.focus({preventScroll:!0}),!0):!1}function $k(e){const{activeElement:t,fallback:n,hasActiveOverlay:r}=e;if(!n||n.disabled||r||t===n)return"none";if(e.trigger==="escape")return e.defaultPrevented||Ba(t,Lx)||e.canCancel?"none":"escape-focus";const{pointerStartTarget:s,pointerEndTarget:o,root:l,hasActiveSelection:u}=e,h=o??s;return!l||!h||!l.contains(h)||Ba(h,yd)||Ba(t,yd)||H_(h)||u&&(Ba(s,Mm)||Ba(h,Mm))||H_(t)?"none":t&&t===h?"restore":_8(t)?"none":"restore"}const _p=lI,w8=cI,PN=b.forwardRef(({className:e,...t},n)=>f.jsx(CN,{ref:n,className:me("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));PN.displayName=CN.displayName;const S8={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},Fd=b.forwardRef(({className:e,children:t,size:n="md",...r},s)=>f.jsxs(w8,{children:[f.jsx(PN,{}),f.jsxs(kN,{ref:s,[yd]:"",onCloseAutoFocus:o=>{var l;o.preventDefault(),window.dispatchEvent(new Event(Nm)),(l=r.onCloseAutoFocus)==null||l.call(r,o)},className:me("fixed left-1/2 top-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-background shadow-xl backdrop-blur-md duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","max-h-[85vh] flex flex-col",S8[n],e),...r,children:[t,f.jsxs(hI,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[f.jsx(ro,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Fd.displayName=kN.displayName;function yp({className:e,...t}){return f.jsx(uI,{className:me("text-lg font-medium leading-none tracking-tight",e),...t})}function zx({className:e,...t}){return f.jsx(dI,{className:me("text-sm text-muted-foreground",e),...t})}function xp({className:e,...t}){return f.jsx("div",{className:me("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function wp({className:e,...t}){return f.jsx("div",{className:me("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",e),...t})}const Ti=b.forwardRef(({className:e,type:t,...n},r)=>f.jsx("input",{ref:r,type:t,className:me("flex w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n}));Ti.displayName="Input";const BN=b.createContext(null);function C8({children:e}){const[t,n]=b.useState(null),[r,s]=b.useState(""),o=b.useRef(null);b.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(s(t.options.initialValue??""),setTimeout(()=>{var y,w;(y=o.current)==null||y.focus(),(w=o.current)==null||w.select()},0))},[t]);const l=b.useCallback(()=>{n(null),s("")},[]),u=b.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!1):t.kind==="prompt"?t.resolve(null):t.resolve(),l())},[l,t]),h=b.useCallback(()=>{t&&(t.kind==="confirm"?t.resolve(!0):t.kind==="prompt"?t.resolve(r.trim()||null):t.resolve(),l())},[l,t,r]),d=b.useCallback(y=>new Promise(w=>{n({kind:"confirm",options:y,resolve:w})}),[]),g=b.useCallback(y=>new Promise(w=>{n({kind:"prompt",options:y,resolve:w})}),[]),p=b.useCallback(y=>new Promise(w=>{n({kind:"alert",options:y,resolve:w})}),[]),v=b.useMemo(()=>({confirm:d,prompt:g,alert:p}),[p,d,g]);return f.jsxs(BN.Provider,{value:v,children:[e,f.jsx(_p,{open:t!==null,onOpenChange:y=>{y||!t||u()},children:f.jsx(Fd,{size:"sm",onKeyDown:y=>{y.key!=="Enter"||y.shiftKey||!t||t.kind!=="confirm"||(y.preventDefault(),h())},children:t?f.jsxs(f.Fragment,{children:[f.jsxs(xp,{className:"space-y-4",children:[f.jsx(yp,{children:t.options.title}),t.options.description?f.jsx(zx,{children:t.options.description}):null,t.kind==="prompt"?f.jsx(Ti,{ref:o,type:"text",value:r,onChange:y=>s(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),h())},placeholder:t.options.placeholder}):null]}),f.jsxs(wp,{children:[f.jsx(Xe,{variant:"ghost",size:"sm",onClick:u,className:t.kind==="alert"?"hidden":void 0,children:"cancelLabel"in t.options?t.options.cancelLabel??"Cancel":"Cancel"}),f.jsx(Xe,{variant:t.kind==="confirm"?t.options.confirmVariant??"default":"secondary",size:"sm",onClick:h,disabled:t.kind==="prompt"&&!r.trim(),children:t.kind==="alert"?t.options.closeLabel??"OK":"confirmLabel"in t.options?t.options.confirmLabel??"Confirm":"Confirm"})]})]}):null})})]})}function k8(){const e=b.useContext(BN);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const Hd=b.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:me("flex w-full rounded-lg border border-border bg-background px-2.5 py-2 text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Hd.displayName="Textarea";function E8(e){return e.trim().length>0}function R8({open:e,onOpenChange:t,onConfirm:n}){const[r,s]=b.useState(""),[o,l]=b.useState(""),u=b.useRef(null);b.useEffect(()=>{e&&(s(""),l(""),setTimeout(()=>{var g;return(g=u.current)==null?void 0:g.focus()},0))},[e]);const h=E8(r),d=()=>{h&&n({title:r.trim(),description:o.trim()})};return f.jsx(_p,{open:e,onOpenChange:t,children:f.jsx(Fd,{size:"sm",onKeyDown:g=>{(g.metaKey||g.ctrlKey)&&g.key==="Enter"&&(g.preventDefault(),d())},children:f.jsxs("form",{onSubmit:g=>{g.preventDefault(),d()},children:[f.jsxs(xp,{className:"space-y-4",children:[f.jsx(yp,{children:"Create Feature"}),f.jsx(zx,{children:"Name the feature folder and optionally add a short description for the feature."}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{htmlFor:"feature-title",className:"text-sm font-medium",children:"Feature name"}),f.jsx(Ti,{id:"feature-title",ref:u,type:"text",value:r,onChange:g=>s(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),d())},placeholder:"Feature name"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"feature-description",className:"text-sm font-medium",children:["Description ",f.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),f.jsx(Hd,{id:"feature-description",value:o,onChange:g=>l(g.target.value),rows:5,placeholder:"Leave blank to add it later"})]})]}),f.jsxs(wp,{children:[f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),f.jsx(Xe,{type:"submit",variant:"secondary",size:"sm",disabled:!h,children:"Create"})]})]})})})}const Wk=`1. Sign in on the opened Cursor spending page.
|
|
490
|
+
2. Open DevTools > Network.
|
|
491
|
+
3. Refresh the page.
|
|
492
|
+
4. Right-click the get-current-period-usage request.
|
|
493
|
+
5. Copy > Copy as cURL.
|
|
494
|
+
6. Paste it here.`;function T8({open:e,onOpenChange:t,onSubmit:n}){const r=b.useRef(null),[s,o]=b.useState(""),[l,u]=b.useState(!1);b.useEffect(()=>{e&&(o(""),setTimeout(()=>{var p;return(p=r.current)==null?void 0:p.focus()},0))},[e]);async function h(){const p=await navigator.clipboard.readText();o(p)}async function d(){await navigator.clipboard.writeText(Wk),u(!0),setTimeout(()=>u(!1),2e3)}const g=s.trim().length>0;return f.jsx(_p,{open:e,onOpenChange:t,children:f.jsx(Fd,{size:"lg",children:f.jsxs("form",{onSubmit:p=>{p.preventDefault(),g&&n(s.trim())},children:[f.jsxs(xp,{className:"space-y-4",children:[f.jsx(yp,{children:"Import Cursor Session"}),f.jsxs(zx,{children:["Paste the copied ",f.jsx("code",{children:"get-current-period-usage"})," curl command and Kaizen will import the session for you."]}),f.jsx("div",{className:"rounded-xl border border-border bg-card px-3 py-3 text-sm text-muted-foreground whitespace-pre-line",children:Wk}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>void h(),children:"Paste Clipboard"}),f.jsxs(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>void d(),children:[l?f.jsx(Xi,{className:"h-4 w-4"}):f.jsx(Id,{className:"h-4 w-4"}),f.jsx("span",{className:"ml-1",children:l?"Copied":"Copy Steps"})]})]}),f.jsx(Hd,{ref:r,value:s,onChange:p=>o(p.target.value),rows:10,placeholder:"Paste the copied curl command here",className:"font-mono text-xs"})]}),f.jsxs(wp,{children:[f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),f.jsx(Xe,{type:"submit",variant:"secondary",size:"sm",disabled:!g,children:"Import Session"})]})]})})})}const N8=["top","right","bottom","left"],ra=Math.min,ui=Math.max,Am=Math.round,Lf=Math.floor,Ss=e=>({x:e,y:e}),M8={left:"right",right:"left",bottom:"top",top:"bottom"};function U_(e,t,n){return ui(e,ra(t,n))}function io(e,t){return typeof e=="function"?e(t):e}function so(e){return e.split("-")[0]}function Rc(e){return e.split("-")[1]}function Px(e){return e==="x"?"y":"x"}function Bx(e){return e==="y"?"height":"width"}function vs(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ix(e){return Px(vs(e))}function A8(e,t,n){n===void 0&&(n=!1);const r=Rc(e),s=Ix(e),o=Bx(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Dm(l)),[l,Dm(l)]}function D8(e){const t=Dm(e);return[$_(e),t,$_(t)]}function $_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Vk=["left","right"],qk=["right","left"],j8=["top","bottom"],O8=["bottom","top"];function L8(e,t,n){switch(e){case"top":case"bottom":return n?t?qk:Vk:t?Vk:qk;case"left":case"right":return t?j8:O8;default:return[]}}function z8(e,t,n,r){const s=Rc(e);let o=L8(so(e),n==="start",r);return s&&(o=o.map(l=>l+"-"+s),t&&(o=o.concat(o.map($_)))),o}function Dm(e){const t=so(e);return M8[t]+e.slice(t.length)}function P8(e){return{top:0,right:0,bottom:0,left:0,...e}}function IN(e){return typeof e!="number"?P8(e):{top:e,right:e,bottom:e,left:e}}function jm(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Kk(e,t,n){let{reference:r,floating:s}=e;const o=vs(t),l=Ix(t),u=Bx(l),h=so(t),d=o==="y",g=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,v=r[u]/2-s[u]/2;let y;switch(h){case"top":y={x:g,y:r.y-s.height};break;case"bottom":y={x:g,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}switch(Rc(t)){case"start":y[l]-=v*(n&&d?-1:1);break;case"end":y[l]+=v*(n&&d?-1:1);break}return y}async function B8(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:l,elements:u,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:g="viewport",elementContext:p="floating",altBoundary:v=!1,padding:y=0}=io(t,e),w=IN(y),C=u[v?p==="floating"?"reference":"floating":p],k=jm(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:d,rootBoundary:g,strategy:h})),R=p==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),N=await(o.isElement==null?void 0:o.isElement(E))?await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1}:{x:1,y:1},L=jm(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:E,strategy:h}):R);return{top:(k.top-L.top+w.top)/N.y,bottom:(L.bottom-k.bottom+w.bottom)/N.y,left:(k.left-L.left+w.left)/N.x,right:(L.right-k.right+w.right)/N.x}}const I8=50,F8=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:B8},h=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:p}=Kk(d,r,h),v=r,y=0;const w={};for(let S=0;S<o.length;S++){const C=o[S];if(!C)continue;const{name:k,fn:R}=C,{x:E,y:N,data:L,reset:D}=await R({x:g,y:p,initialPlacement:r,placement:v,strategy:s,middlewareData:w,rects:d,platform:u,elements:{reference:e,floating:t}});g=E??g,p=N??p,w[k]={...w[k],...L},D&&y<I8&&(y++,typeof D=="object"&&(D.placement&&(v=D.placement),D.rects&&(d=D.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x:g,y:p}=Kk(d,v,h)),S=-1)}return{x:g,y:p,placement:v,strategy:s,middlewareData:w}},H8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:l,elements:u,middlewareData:h}=t,{element:d,padding:g=0}=io(e,t)||{};if(d==null)return{};const p=IN(g),v={x:n,y:r},y=Ix(s),w=Bx(y),S=await l.getDimensions(d),C=y==="y",k=C?"top":"left",R=C?"bottom":"right",E=C?"clientHeight":"clientWidth",N=o.reference[w]+o.reference[y]-v[y]-o.floating[w],L=v[y]-o.reference[y],D=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let j=D?D[E]:0;(!j||!await(l.isElement==null?void 0:l.isElement(D)))&&(j=u.floating[E]||o.floating[w]);const H=N/2-L/2,G=j/2-S[w]/2-1,B=ra(p[k],G),q=ra(p[R],G),I=B,V=j-S[w]-q,F=j/2-S[w]/2+H,W=U_(I,F,V),O=!h.arrow&&Rc(s)!=null&&F!==W&&o.reference[w]/2-(F<I?B:q)-S[w]/2<0,$=O?F<I?F-I:F-V:0;return{[y]:v[y]+$,data:{[y]:W,centerOffset:F-W-$,...O&&{alignmentOffset:$}},reset:O}}}),U8=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:l,initialPlacement:u,platform:h,elements:d}=t,{mainAxis:g=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...C}=io(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=so(s),R=vs(u),E=so(u)===u,N=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=v||(E||!S?[Dm(u)]:D8(u)),D=w!=="none";!v&&D&&L.push(...z8(u,S,w,N));const j=[u,...L],H=await h.detectOverflow(t,C),G=[];let B=((r=o.flip)==null?void 0:r.overflows)||[];if(g&&G.push(H[k]),p){const F=A8(s,l,N);G.push(H[F[0]],H[F[1]])}if(B=[...B,{placement:s,overflows:G}],!G.every(F=>F<=0)){var q,I;const F=(((q=o.flip)==null?void 0:q.index)||0)+1,W=j[F];if(W&&(!(p==="alignment"?R!==vs(W):!1)||B.every(U=>vs(U.placement)===R?U.overflows[0]>0:!0)))return{data:{index:F,overflows:B},reset:{placement:W}};let O=(I=B.filter($=>$.overflows[0]<=0).sort(($,U)=>$.overflows[1]-U.overflows[1])[0])==null?void 0:I.placement;if(!O)switch(y){case"bestFit":{var V;const $=(V=B.filter(U=>{if(D){const X=vs(U.placement);return X===R||X==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(X=>X>0).reduce((X,M)=>X+M,0)]).sort((U,X)=>U[1]-X[1])[0])==null?void 0:V[0];$&&(O=$);break}case"initialPlacement":O=u;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function Gk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yk(e){return N8.some(t=>e[t]>=0)}const $8=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...o}=io(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...o,elementContext:"reference"}),u=Gk(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Yk(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...o,altBoundary:!0}),u=Gk(l,n.floating);return{data:{escapedOffsets:u,escaped:Yk(u)}}}default:return{}}}}},FN=new Set(["left","top"]);async function W8(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=so(n),u=Rc(n),h=vs(n)==="y",d=FN.has(l)?-1:1,g=o&&h?-1:1,p=io(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof w=="number"&&(y=u==="end"?w*-1:w),h?{x:y*g,y:v*d}:{x:v*d,y:y*g}}const V8=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:l,middlewareData:u}=t,h=await W8(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:o+h.y,data:{...h,placement:l}}}}},q8=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:h={fn:k=>{let{x:R,y:E}=k;return{x:R,y:E}}},...d}=io(e,t),g={x:n,y:r},p=await o.detectOverflow(t,d),v=vs(so(s)),y=Px(v);let w=g[y],S=g[v];if(l){const k=y==="y"?"top":"left",R=y==="y"?"bottom":"right",E=w+p[k],N=w-p[R];w=U_(E,w,N)}if(u){const k=v==="y"?"top":"left",R=v==="y"?"bottom":"right",E=S+p[k],N=S-p[R];S=U_(E,S,N)}const C=h.fn({...t,[y]:w,[v]:S});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[y]:l,[v]:u}}}}}},K8=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=io(e,t),g={x:n,y:r},p=vs(s),v=Px(p);let y=g[v],w=g[p];const S=io(u,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const E=v==="y"?"height":"width",N=o.reference[v]-o.floating[E]+C.mainAxis,L=o.reference[v]+o.reference[E]-C.mainAxis;y<N?y=N:y>L&&(y=L)}if(d){var k,R;const E=v==="y"?"width":"height",N=FN.has(so(s)),L=o.reference[p]-o.floating[E]+(N&&((k=l.offset)==null?void 0:k[p])||0)+(N?0:C.crossAxis),D=o.reference[p]+o.reference[E]+(N?0:((R=l.offset)==null?void 0:R[p])||0)-(N?C.crossAxis:0);w<L?w=L:w>D&&(w=D)}return{[v]:y,[p]:w}}}},G8=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:l,elements:u}=t,{apply:h=()=>{},...d}=io(e,t),g=await l.detectOverflow(t,d),p=so(s),v=Rc(s),y=vs(s)==="y",{width:w,height:S}=o.floating;let C,k;p==="top"||p==="bottom"?(C=p,k=v===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(k=p,C=v==="end"?"top":"bottom");const R=S-g.top-g.bottom,E=w-g.left-g.right,N=ra(S-g[C],R),L=ra(w-g[k],E),D=!t.middlewareData.shift;let j=N,H=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(H=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=R),D&&!v){const B=ui(g.left,0),q=ui(g.right,0),I=ui(g.top,0),V=ui(g.bottom,0);y?H=w-2*(B!==0||q!==0?B+q:ui(g.left,g.right)):j=S-2*(I!==0||V!==0?I+V:ui(g.top,g.bottom))}await h({...t,availableWidth:H,availableHeight:j});const G=await l.getDimensions(u.floating);return w!==G.width||S!==G.height?{reset:{rects:!0}}:{}}}};function Sp(){return typeof window<"u"}function Tc(e){return HN(e)?(e.nodeName||"").toLowerCase():"#document"}function di(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rs(e){var t;return(t=(HN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function HN(e){return Sp()?e instanceof Node||e instanceof di(e).Node:!1}function Zi(e){return Sp()?e instanceof Element||e instanceof di(e).Element:!1}function co(e){return Sp()?e instanceof HTMLElement||e instanceof di(e).HTMLElement:!1}function Xk(e){return!Sp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof di(e).ShadowRoot}function Ud(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Qi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function Y8(e){return/^(table|td|th)$/.test(Tc(e))}function Cp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const X8=/transform|translate|scale|rotate|perspective|filter/,Z8=/paint|layout|strict|content/,Na=e=>!!e&&e!=="none";let Tb;function Fx(e){const t=Zi(e)?Qi(e):e;return Na(t.transform)||Na(t.translate)||Na(t.scale)||Na(t.rotate)||Na(t.perspective)||!Hx()&&(Na(t.backdropFilter)||Na(t.filter))||X8.test(t.willChange||"")||Z8.test(t.contain||"")}function Q8(e){let t=ia(e);for(;co(t)&&!gc(t);){if(Fx(t))return t;if(Cp(t))return null;t=ia(t)}return null}function Hx(){return Tb==null&&(Tb=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Tb}function gc(e){return/^(html|body|#document)$/.test(Tc(e))}function Qi(e){return di(e).getComputedStyle(e)}function kp(e){return Zi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ia(e){if(Tc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xk(e)&&e.host||Rs(e);return Xk(t)?t.host:t}function UN(e){const t=ia(e);return gc(t)?e.ownerDocument?e.ownerDocument.body:e.body:co(t)&&Ud(t)?t:UN(t)}function xd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=UN(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),l=di(s);if(o){const u=W_(l);return t.concat(l,l.visualViewport||[],Ud(s)?s:[],u&&n?xd(u):[])}else return t.concat(s,xd(s,[],n))}function W_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $N(e){const t=Qi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=co(e),o=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=Am(n)!==o||Am(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function Ux(e){return Zi(e)?e:e.contextElement}function cc(e){const t=Ux(e);if(!co(t))return Ss(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=$N(t);let l=(o?Am(n.width):n.width)/r,u=(o?Am(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const J8=Ss(0);function WN(e){const t=di(e);return!Hx()||!t.visualViewport?J8:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function e9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==di(e)?!1:t}function Ga(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Ux(e);let l=Ss(1);t&&(r?Zi(r)&&(l=cc(r)):l=cc(e));const u=e9(o,n,r)?WN(o):Ss(0);let h=(s.left+u.x)/l.x,d=(s.top+u.y)/l.y,g=s.width/l.x,p=s.height/l.y;if(o){const v=di(o),y=r&&Zi(r)?di(r):r;let w=v,S=W_(w);for(;S&&r&&y!==w;){const C=cc(S),k=S.getBoundingClientRect(),R=Qi(S),E=k.left+(S.clientLeft+parseFloat(R.paddingLeft))*C.x,N=k.top+(S.clientTop+parseFloat(R.paddingTop))*C.y;h*=C.x,d*=C.y,g*=C.x,p*=C.y,h+=E,d+=N,w=di(S),S=W_(w)}}return jm({width:g,height:p,x:h,y:d})}function Ep(e,t){const n=kp(e).scrollLeft;return t?t.left+n:Ga(Rs(e)).left+n}function VN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ep(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function t9(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",l=Rs(r),u=t?Cp(t.floating):!1;if(r===l||u&&o)return n;let h={scrollLeft:0,scrollTop:0},d=Ss(1);const g=Ss(0),p=co(r);if((p||!p&&!o)&&((Tc(r)!=="body"||Ud(l))&&(h=kp(r)),p)){const y=Ga(r);d=cc(r),g.x=y.x+r.clientLeft,g.y=y.y+r.clientTop}const v=l&&!p&&!o?VN(l,h):Ss(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-h.scrollLeft*d.x+g.x+v.x,y:n.y*d.y-h.scrollTop*d.y+g.y+v.y}}function n9(e){return Array.from(e.getClientRects())}function r9(e){const t=Rs(e),n=kp(e),r=e.ownerDocument.body,s=ui(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ui(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Ep(e);const u=-n.scrollTop;return Qi(r).direction==="rtl"&&(l+=ui(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:l,y:u}}const Zk=25;function i9(e,t){const n=di(e),r=Rs(e),s=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,h=0;if(s){o=s.width,l=s.height;const g=Hx();(!g||g&&t==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}const d=Ep(r);if(d<=0){const g=r.ownerDocument,p=g.body,v=getComputedStyle(p),y=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(r.clientWidth-p.clientWidth-y);w<=Zk&&(o-=w)}else d<=Zk&&(o+=d);return{width:o,height:l,x:u,y:h}}function s9(e,t){const n=Ga(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=co(e)?cc(e):Ss(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,h=s*o.x,d=r*o.y;return{width:l,height:u,x:h,y:d}}function Qk(e,t,n){let r;if(t==="viewport")r=i9(e,n);else if(t==="document")r=r9(Rs(e));else if(Zi(t))r=s9(t,n);else{const s=WN(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return jm(r)}function qN(e,t){const n=ia(e);return n===t||!Zi(n)||gc(n)?!1:Qi(n).position==="fixed"||qN(n,t)}function o9(e,t){const n=t.get(e);if(n)return n;let r=xd(e,[],!1).filter(u=>Zi(u)&&Tc(u)!=="body"),s=null;const o=Qi(e).position==="fixed";let l=o?ia(e):e;for(;Zi(l)&&!gc(l);){const u=Qi(l),h=Fx(l);!h&&u.position==="fixed"&&(s=null),(o?!h&&!s:!h&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Ud(l)&&!h&&qN(e,l))?r=r.filter(g=>g!==l):s=u,l=ia(l)}return t.set(e,r),r}function a9(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Cp(t)?[]:o9(t,this._c):[].concat(n),r],u=Qk(t,l[0],s);let h=u.top,d=u.right,g=u.bottom,p=u.left;for(let v=1;v<l.length;v++){const y=Qk(t,l[v],s);h=ui(y.top,h),d=ra(y.right,d),g=ra(y.bottom,g),p=ui(y.left,p)}return{width:d-p,height:g-h,x:p,y:h}}function l9(e){const{width:t,height:n}=$N(e);return{width:t,height:n}}function c9(e,t,n){const r=co(t),s=Rs(t),o=n==="fixed",l=Ga(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const h=Ss(0);function d(){h.x=Ep(s)}if(r||!r&&!o)if((Tc(t)!=="body"||Ud(s))&&(u=kp(t)),r){const y=Ga(t,!0,o,t);h.x=y.x+t.clientLeft,h.y=y.y+t.clientTop}else s&&d();o&&!r&&s&&d();const g=s&&!r&&!o?VN(s,u):Ss(0),p=l.left+u.scrollLeft-h.x-g.x,v=l.top+u.scrollTop-h.y-g.y;return{x:p,y:v,width:l.width,height:l.height}}function Nb(e){return Qi(e).position==="static"}function Jk(e,t){if(!co(e)||Qi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Rs(e)===n&&(n=n.ownerDocument.body),n}function KN(e,t){const n=di(e);if(Cp(e))return n;if(!co(e)){let s=ia(e);for(;s&&!gc(s);){if(Zi(s)&&!Nb(s))return s;s=ia(s)}return n}let r=Jk(e,t);for(;r&&Y8(r)&&Nb(r);)r=Jk(r,t);return r&&gc(r)&&Nb(r)&&!Fx(r)?n:r||Q8(e)||n}const u9=async function(e){const t=this.getOffsetParent||KN,n=this.getDimensions,r=await n(e.floating);return{reference:c9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function d9(e){return Qi(e).direction==="rtl"}const h9={convertOffsetParentRelativeRectToViewportRelativeRect:t9,getDocumentElement:Rs,getClippingRect:a9,getOffsetParent:KN,getElementRects:u9,getClientRects:n9,getDimensions:l9,getScale:cc,isElement:Zi,isRTL:d9};function GN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function f9(e,t){let n=null,r;const s=Rs(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),o();const d=e.getBoundingClientRect(),{left:g,top:p,width:v,height:y}=d;if(u||t(),!v||!y)return;const w=Lf(p),S=Lf(s.clientWidth-(g+v)),C=Lf(s.clientHeight-(p+y)),k=Lf(g),E={rootMargin:-w+"px "+-S+"px "+-C+"px "+-k+"px",threshold:ui(0,ra(1,h))||1};let N=!0;function L(D){const j=D[0].intersectionRatio;if(j!==h){if(!N)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!GN(d,e.getBoundingClientRect())&&l(),N=!1}try{n=new IntersectionObserver(L,{...E,root:s.ownerDocument})}catch{n=new IntersectionObserver(L,E)}n.observe(e)}return l(!0),o}function m9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,d=Ux(e),g=s||o?[...d?xd(d):[],...t?xd(t):[]]:[];g.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const p=d&&u?f9(d,n):null;let v=-1,y=null;l&&(y=new ResizeObserver(k=>{let[R]=k;R&&R.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var E;(E=y)==null||E.observe(t)})),n()}),d&&!h&&y.observe(d),t&&y.observe(t));let w,S=h?Ga(e):null;h&&C();function C(){const k=Ga(e);S&&!GN(S,k)&&n(),S=k,w=requestAnimationFrame(C)}return n(),()=>{var k;g.forEach(R=>{s&&R.removeEventListener("scroll",n),o&&R.removeEventListener("resize",n)}),p==null||p(),(k=y)==null||k.disconnect(),y=null,h&&cancelAnimationFrame(w)}}const p9=V8,g9=q8,v9=U8,b9=G8,_9=$8,e2=H8,y9=K8,x9=(e,t,n)=>{const r=new Map,s={platform:h9,...n},o={...s.platform,_c:r};return F8(e,t,{...s,platform:o})};var w9=typeof document<"u",S9=function(){},dm=w9?b.useLayoutEffect:S9;function Om(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Om(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Om(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function YN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function t2(e,t){const n=YN(e);return Math.round(t*n)/n}function Mb(e){const t=b.useRef(e);return dm(()=>{t.current=e}),t}function C9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:h,open:d}=e,[g,p]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=b.useState(r);Om(v,r)||y(r);const[w,S]=b.useState(null),[C,k]=b.useState(null),R=b.useCallback(U=>{U!==D.current&&(D.current=U,S(U))},[]),E=b.useCallback(U=>{U!==j.current&&(j.current=U,k(U))},[]),N=o||w,L=l||C,D=b.useRef(null),j=b.useRef(null),H=b.useRef(g),G=h!=null,B=Mb(h),q=Mb(s),I=Mb(d),V=b.useCallback(()=>{if(!D.current||!j.current)return;const U={placement:t,strategy:n,middleware:v};q.current&&(U.platform=q.current),x9(D.current,j.current,U).then(X=>{const M={...X,isPositioned:I.current!==!1};F.current&&!Om(H.current,M)&&(H.current=M,qi.flushSync(()=>{p(M)}))})},[v,t,n,q,I]);dm(()=>{d===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[d]);const F=b.useRef(!1);dm(()=>(F.current=!0,()=>{F.current=!1}),[]),dm(()=>{if(N&&(D.current=N),L&&(j.current=L),N&&L){if(B.current)return B.current(N,L,V);V()}},[N,L,V,B,G]);const W=b.useMemo(()=>({reference:D,floating:j,setReference:R,setFloating:E}),[R,E]),O=b.useMemo(()=>({reference:N,floating:L}),[N,L]),$=b.useMemo(()=>{const U={position:n,left:0,top:0};if(!O.floating)return U;const X=t2(O.floating,g.x),M=t2(O.floating,g.y);return u?{...U,transform:"translate("+X+"px, "+M+"px)",...YN(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:M}},[n,u,O.floating,g.x,g.y]);return b.useMemo(()=>({...g,update:V,refs:W,elements:O,floatingStyles:$}),[g,V,W,O,$])}const k9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?e2({element:r.current,padding:s}).fn(n):{}:r?e2({element:r,padding:s}).fn(n):{}}}},E9=(e,t)=>{const n=p9(e);return{name:n.name,fn:n.fn,options:[e,t]}},R9=(e,t)=>{const n=g9(e);return{name:n.name,fn:n.fn,options:[e,t]}},T9=(e,t)=>({fn:y9(e).fn,options:[e,t]}),N9=(e,t)=>{const n=v9(e);return{name:n.name,fn:n.fn,options:[e,t]}},M9=(e,t)=>{const n=b9(e);return{name:n.name,fn:n.fn,options:[e,t]}},A9=(e,t)=>{const n=_9(e);return{name:n.name,fn:n.fn,options:[e,t]}},D9=(e,t)=>{const n=k9(e);return{name:n.name,fn:n.fn,options:[e,t]}};var j9="Arrow",XN=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return f.jsx(Tt.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});XN.displayName=j9;var O9=XN;function L9(e){const[t,n]=b.useState(void 0);return Rr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let l,u;if("borderBoxSize"in o){const h=o.borderBoxSize,d=Array.isArray(h)?h[0]:h;l=d.inlineSize,u=d.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $x="Popper",[ZN,oa]=lo($x),[z9,QN]=ZN($x),JN=e=>{const{__scopePopper:t,children:n}=e,[r,s]=b.useState(null);return f.jsx(z9,{scope:t,anchor:r,onAnchorChange:s,children:n})};JN.displayName=$x;var eM="PopperAnchor",tM=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=QN(eM,n),l=b.useRef(null),u=$t(t,l),h=b.useRef(null);return b.useEffect(()=>{const d=h.current;h.current=(r==null?void 0:r.current)||l.current,d!==h.current&&o.onAnchorChange(h.current)}),r?null:f.jsx(Tt.div,{...s,ref:u})});tM.displayName=eM;var Wx="PopperContent",[P9,B9]=ZN(Wx),nM=b.forwardRef((e,t)=>{var re,ce,he,pe,Se,Re;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:g=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:w,...S}=e,C=QN(Wx,n),[k,R]=b.useState(null),E=$t(t,Ae=>R(Ae)),[N,L]=b.useState(null),D=L9(N),j=(D==null?void 0:D.width)??0,H=(D==null?void 0:D.height)??0,G=r+(o!=="center"?"-"+o:""),B=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},q=Array.isArray(d)?d:[d],I=q.length>0,V={padding:B,boundary:q.filter(F9),altBoundary:I},{refs:F,floatingStyles:W,placement:O,isPositioned:$,middlewareData:U}=C9({strategy:"fixed",placement:G,whileElementsMounted:(...Ae)=>m9(...Ae,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[E9({mainAxis:s+H,alignmentAxis:l}),h&&R9({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?T9():void 0,...V}),h&&N9({...V}),M9({...V,apply:({elements:Ae,rects:Ke,availableWidth:yt,availableHeight:xt})=>{const{width:fe,height:Ie}=Ke.reference,De=Ae.floating.style;De.setProperty("--radix-popper-available-width",`${yt}px`),De.setProperty("--radix-popper-available-height",`${xt}px`),De.setProperty("--radix-popper-anchor-width",`${fe}px`),De.setProperty("--radix-popper-anchor-height",`${Ie}px`)}}),N&&D9({element:N,padding:u}),H9({arrowWidth:j,arrowHeight:H}),v&&A9({strategy:"referenceHidden",...V})]}),[X,M]=sM(O),P=Yi(w);Rr(()=>{$&&(P==null||P())},[$,P]);const Z=(re=U.arrow)==null?void 0:re.x,A=(ce=U.arrow)==null?void 0:ce.y,ie=((he=U.arrow)==null?void 0:he.centerOffset)!==0,[J,ee]=b.useState();return Rr(()=>{k&&ee(window.getComputedStyle(k).zIndex)},[k]),f.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:$?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(pe=U.transformOrigin)==null?void 0:pe.x,(Se=U.transformOrigin)==null?void 0:Se.y].join(" "),...((Re=U.hide)==null?void 0:Re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(P9,{scope:n,placedSide:X,onArrowChange:L,arrowX:Z,arrowY:A,shouldHideArrow:ie,children:f.jsx(Tt.div,{"data-side":X,"data-align":M,...S,ref:E,style:{...S.style,animation:$?void 0:"none"}})})})});nM.displayName=Wx;var rM="PopperArrow",I9={top:"bottom",right:"left",bottom:"top",left:"right"},iM=b.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=B9(rM,r),l=I9[o.placedSide];return f.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:f.jsx(O9,{...s,ref:n,style:{...s.style,display:"block"}})})});iM.displayName=rM;function F9(e){return e!==null}var H9=e=>({name:"transformOrigin",options:e,fn(t){var C,k,R;const{placement:n,rects:r,middlewareData:s}=t,l=((C=s.arrow)==null?void 0:C.centerOffset)!==0,u=l?0:e.arrowWidth,h=l?0:e.arrowHeight,[d,g]=sM(n),p={start:"0%",center:"50%",end:"100%"}[g],v=(((k=s.arrow)==null?void 0:k.x)??0)+u/2,y=(((R=s.arrow)==null?void 0:R.y)??0)+h/2;let w="",S="";return d==="bottom"?(w=l?p:`${v}px`,S=`${-h}px`):d==="top"?(w=l?p:`${v}px`,S=`${r.floating.height+h}px`):d==="right"?(w=`${-h}px`,S=l?p:`${y}px`):d==="left"&&(w=`${r.floating.width+h}px`,S=l?p:`${y}px`),{data:{x:w,y:S}}}});function sM(e){const[t,n="center"]=e.split("-");return[t,n]}var Rp=JN,$d=tM,Tp=nM,Np=iM,oM=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"}),U9="VisuallyHidden",aM=b.forwardRef((e,t)=>f.jsx(Tt.span,{...e,ref:t,style:{...oM,...e.style}}));aM.displayName=U9;var $9=aM,[Mp,Pre]=lo("Tooltip",[oa]),Ap=oa(),lM="TooltipProvider",W9=700,V_="tooltip.open",[V9,Vx]=Mp(lM),cM=e=>{const{__scopeTooltip:t,delayDuration:n=W9,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,l=b.useRef(!0),u=b.useRef(!1),h=b.useRef(0);return b.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),f.jsx(V9,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(h.current),l.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:b.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:o})};cM.displayName=lM;var wd="Tooltip",[q9,Wd]=Mp(wd),uM=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,h=Vx(wd,e.__scopeTooltip),d=Ap(t),[g,p]=b.useState(null),v=to(),y=b.useRef(0),w=l??h.disableHoverableContent,S=u??h.delayDuration,C=b.useRef(!1),[k,R]=mc({prop:r,defaultProp:s??!1,onChange:j=>{j?(h.onOpen(),document.dispatchEvent(new CustomEvent(V_))):h.onClose(),o==null||o(j)},caller:wd}),E=b.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),N=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,R(!0)},[R]),L=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,R(!1)},[R]),D=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,R(!0),y.current=0},S)},[S,R]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),f.jsx(Rp,{...d,children:f.jsx(q9,{scope:t,contentId:v,open:k,stateAttribute:E,trigger:g,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{h.isOpenDelayedRef.current?D():N()},[h.isOpenDelayedRef,D,N]),onTriggerLeave:b.useCallback(()=>{w?L():(window.clearTimeout(y.current),y.current=0)},[L,w]),onOpen:N,onClose:L,disableHoverableContent:w,children:n})})};uM.displayName=wd;var q_="TooltipTrigger",dM=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Wd(q_,n),o=Vx(q_,n),l=Ap(n),u=b.useRef(null),h=$t(t,u,s.onTriggerChange),d=b.useRef(!1),g=b.useRef(!1),p=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),f.jsx($d,{asChild:!0,...l,children:f.jsx(Tt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:Be(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:Be(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:Be(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Be(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Be(e.onBlur,s.onClose),onClick:Be(e.onClick,s.onClose)})})});dM.displayName=q_;var qx="TooltipPortal",[K9,G9]=Mp(qx,{forceMount:void 0}),hM=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,o=Wd(qx,t);return f.jsx(K9,{scope:t,forceMount:n,children:f.jsx(Bi,{present:n||o.open,children:f.jsx(Ec,{asChild:!0,container:s,children:r})})})};hM.displayName=qx;var vc="TooltipContent",fM=b.forwardRef((e,t)=>{const n=G9(vc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,l=Wd(vc,e.__scopeTooltip);return f.jsx(Bi,{present:r||l.open,children:l.disableHoverableContent?f.jsx(mM,{side:s,...o,ref:t}):f.jsx(Y9,{side:s,...o,ref:t})})}),Y9=b.forwardRef((e,t)=>{const n=Wd(vc,e.__scopeTooltip),r=Vx(vc,e.__scopeTooltip),s=b.useRef(null),o=$t(t,s),[l,u]=b.useState(null),{trigger:h,onClose:d}=n,g=s.current,{onPointerInTransitChange:p}=r,v=b.useCallback(()=>{u(null),p(!1)},[p]),y=b.useCallback((w,S)=>{const C=w.currentTarget,k={x:w.clientX,y:w.clientY},R=e7(k,C.getBoundingClientRect()),E=t7(k,R),N=n7(S.getBoundingClientRect()),L=i7([...E,...N]);u(L),p(!0)},[p]);return b.useEffect(()=>()=>v(),[v]),b.useEffect(()=>{if(h&&g){const w=C=>y(C,g),S=C=>y(C,h);return h.addEventListener("pointerleave",w),g.addEventListener("pointerleave",S),()=>{h.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",S)}}},[h,g,y,v]),b.useEffect(()=>{if(l){const w=S=>{const C=S.target,k={x:S.clientX,y:S.clientY},R=(h==null?void 0:h.contains(C))||(g==null?void 0:g.contains(C)),E=!r7(k,l);R?v():E&&(v(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[h,g,l,d,v]),f.jsx(mM,{...e,ref:o})}),[X9,Z9]=Mp(wd,{isInside:!1}),Q9=$P("TooltipContent"),mM=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,h=Wd(vc,n),d=Ap(n),{onClose:g}=h;return b.useEffect(()=>(document.addEventListener(V_,g),()=>document.removeEventListener(V_,g)),[g]),b.useEffect(()=>{if(h.trigger){const p=v=>{const y=v.target;y!=null&&y.contains(h.trigger)&&g()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[h.trigger,g]),f.jsx(kc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:g,children:f.jsxs(Tp,{"data-state":h.stateAttribute,...d,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(Q9,{children:r}),f.jsx(X9,{scope:n,isInside:!0,children:f.jsx($9,{id:h.contentId,role:"tooltip",children:s||r})})]})})});fM.displayName=vc;var pM="TooltipArrow",J9=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Ap(n);return Z9(pM,n).isInside?null:f.jsx(Np,{...s,...r,ref:t})});J9.displayName=pM;function e7(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function t7(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function n7(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function r7(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],h=t[l],d=u.x,g=u.y,p=h.x,v=h.y;g>r!=v>r&&n<(p-d)*(r-g)/(v-g)+d&&(s=!s)}return s}function i7(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),s7(t)}function s7(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var o7=cM,gM=uM,vM=dM,bM=hM,Kx=fM;function a7({className:e,...t}){return f.jsx("kbd",{className:me("pointer-events-none inline-flex h-5 min-w-5 items-center justify-center rounded border border-border/60 bg-muted/50 px-1.5 font-mono text-[11px] font-medium text-current select-none",e),...t})}function l7({className:e,...t}){return f.jsx("span",{className:me("inline-flex items-center gap-0.5",e),...t})}const c7="z-50 overflow-hidden rounded-md border border-border backdrop-blur-md p-0.5 text-[11px] font-medium text-card-foreground shadow-sm animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",u7=o7,bs=gM,_s=vM,Ki=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>f.jsx(bM,{children:f.jsx(Kx,{ref:r,sideOffset:t,className:me("z-50 overflow-hidden rounded-md bg-card text-card-foreground border border-border backdrop-blur-md px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ki.displayName=Kx.displayName;const qu=gM,Ku=vM;function _M(e){return e.toUpperCase()}function d7(e){const t=e.split("+");return f.jsx(l7,{children:t.map((n,r)=>f.jsx(a7,{children:_M(n)},`${n}-${r}`))})}const rc=b.forwardRef(({className:e,sideOffset:t=4,children:n,shortcut:r,...s},o)=>{const l=r===void 0?null:Array.isArray(r)?r[0]??null:r;return f.jsx(bM,{children:f.jsx(Kx,{ref:o,sideOffset:t,className:me(c7,e),...s,children:l?d7(l):f.jsx("span",{children:typeof n=="string"?_M(n):n})})})});rc.displayName="HotkeyTooltipContent";const h7="0.4.0",f7={version:h7},Un="Kaizen",n2="kaizen",m7=".kaizen",p7=".kaizen-dev",Ab=".kaizen",g7="KAIZEN_RUNTIME_PROFILE",Gx=`kaizen/${f7.version}`,v7="[kaizen]",b7=`~/${Un}`,Dp="kaizen:";function Nc(){var t;return(t=globalThis.process)==null?void 0:t.env}function _7(e=Nc()){const t=e==null?void 0:e[g7];return(t==null?void 0:t.trim().toLowerCase())==="dev"?"dev":"prod"}function y7(e=Nc()){return _7(e)==="dev"?p7:m7}function yM(e=Nc()){return`~/${y7(e)}`}function x7(e=Nc()){return`${yM(e)}/keybindings.json`}function w7(e=Nc()){return`${yM(e)}/themes`}function S7(e=Nc()){return`${w7(e)}/THEME_README.md`}function zf(e){return e?`${n2} ${e}`:n2}const Lm=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],K_=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],G_=[{id:"off",label:"Off"},{id:"standard",label:"Standard"},{id:"high",label:"High"}],Y_="claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]",xM=[{id:"composer-2[fast=true]",label:"Composer 2",supportsEffort:!1},{id:"composer-1.5[]",label:"Composer 1.5",supportsEffort:!1},{id:"gpt-5.3-codex[reasoning=medium,fast=false]",label:"Codex 5.3",supportsEffort:!1},{id:"gpt-5.4[reasoning=medium,context=272k,fast=false]",label:"GPT-5.4",supportsEffort:!1},{id:"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]",label:"Sonnet 4.6",supportsEffort:!1},{id:"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]",label:"Opus 4.6",supportsEffort:!1},{id:"claude-opus-4-5[thinking=true]",label:"Opus 4.5",supportsEffort:!1},{id:"gpt-5.2[reasoning=medium,fast=false]",label:"GPT-5.2",supportsEffort:!1},{id:"gemini-3.1-pro[]",label:"Gemini 3.1 Pro",supportsEffort:!1},{id:"gpt-5.4-mini[reasoning=medium]",label:"GPT-5.4 Mini",supportsEffort:!1},{id:"gpt-5.4-nano[reasoning=medium]",label:"GPT-5.4 Nano",supportsEffort:!1},{id:"claude-haiku-4-5[thinking=true]",label:"Haiku 4.5",supportsEffort:!1},{id:"gpt-5.3-codex-spark[reasoning=medium]",label:"Codex 5.3 Spark",supportsEffort:!1},{id:"grok-4-20[thinking=true]",label:"Grok 4.20",supportsEffort:!1},{id:"claude-sonnet-4-5[thinking=true,context=200k]",label:"Sonnet 4.5",supportsEffort:!1},{id:"gpt-5.2-codex[reasoning=medium,fast=false]",label:"Codex 5.2",supportsEffort:!1},{id:"gemini-3-flash[]",label:"Gemini 3 Flash",supportsEffort:!1},{id:"claude-sonnet-4[thinking=false,context=200k]",label:"Sonnet 4",supportsEffort:!1},{id:"kimi-k2.5[]",label:"Kimi K2.5",supportsEffort:!1}],C7={"composer-2-fast":"composer-2[fast=true]","composer-1.5":"composer-1.5[]","gpt-5.3-codex":"gpt-5.3-codex[reasoning=medium,fast=false]","gpt-5.4":"gpt-5.4[reasoning=medium,context=272k,fast=false]","gpt-5.4-medium":"gpt-5.4[reasoning=medium,context=272k,fast=false]","claude-4.6-sonnet-medium-thinking":"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]","claude-4.6-opus-high-thinking":"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]","claude-4.5-opus-high-thinking":"claude-opus-4-5[thinking=true]","gpt-5.2":"gpt-5.2[reasoning=medium,fast=false]","gemini-3.1-pro":"gemini-3.1-pro[]","gpt-5.4-mini":"gpt-5.4-mini[reasoning=medium]","gpt-5.4-mini-medium":"gpt-5.4-mini[reasoning=medium]","gpt-5.4-nano":"gpt-5.4-nano[reasoning=medium]","gpt-5.4-nano-medium":"gpt-5.4-nano[reasoning=medium]","claude-haiku-4.5":"claude-haiku-4-5[thinking=true]","gpt-5.3-codex-spark-preview":"gpt-5.3-codex-spark[reasoning=medium]","grok-4-20":"grok-4-20[thinking=true]","grok-4-20-thinking":"grok-4-20[thinking=true]","claude-4.5-sonnet-thinking":"claude-sonnet-4-5[thinking=true,context=200k]","gpt-5.2-codex":"gpt-5.2-codex[reasoning=medium,fast=false]","gemini-3-flash":"gemini-3-flash[]","claude-4-sonnet":"claude-sonnet-4[thinking=false,context=200k]","kimi-k2.5":"kimi-k2.5[]"};function k7(e){return e?xM.some(t=>t.id===e)?e:C7[e]??Y_:Y_}function r2(e){const t=e.indexOf("[");return t>=0?e.slice(0,t):e}function tc(e){const t=e.match(/\bfast=(true|false)\b/);return t?t[1]==="true"?"fast":"standard":null}function i2(e){return Lm.some(t=>t.id===e)}function s2(e){return K_.some(t=>t.id===e)}const X_=[{id:"200k",label:"200k"},{id:"1m",label:"1M"}];function E7(e){return G_.some(t=>t.id===e)}const Jo=[{id:"claude",label:"Claude",systemActive:!0,defaultModel:"sonnet",defaultEffort:"high",defaultModelOptions:{reasoningEffort:"high",contextWindow:"200k"},supportsPlanMode:!0,models:[{id:"opus",label:"Opus",supportsEffort:!0,contextWindowOptions:[...X_]},{id:"sonnet",label:"Sonnet",supportsEffort:!0,contextWindowOptions:[...X_]},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...Lm]},{id:"codex",label:"Codex",systemActive:!0,defaultModel:"gpt-5.4",defaultModelOptions:{reasoningEffort:"high",fastMode:!1},supportsPlanMode:!0,models:[{id:"gpt-5.4",label:"GPT-5.4",supportsEffort:!1},{id:"gpt-5.3-codex",label:"GPT-5.3 Codex",supportsEffort:!1},{id:"gpt-5.3-codex-spark",label:"GPT-5.3 Codex Spark",supportsEffort:!1}],efforts:[]},{id:"gemini",label:"Gemini",systemActive:!1,defaultModel:"auto-gemini-2.5",defaultModelOptions:{thinkingMode:"standard"},supportsPlanMode:!0,models:[{id:"auto-gemini-3",label:"Auto (Gemini 3)",supportsEffort:!1},{id:"auto-gemini-2.5",label:"Auto (Gemini 2.5)",supportsEffort:!1},{id:"gemini-3.1-pro-preview",label:"3.1 Pro Preview",supportsEffort:!1},{id:"gemini-3-pro-preview",label:"3 Pro Preview",supportsEffort:!1},{id:"gemini-3-flash-preview",label:"3 Flash Preview",supportsEffort:!1},{id:"gemini-2.5-pro",label:"2.5 Pro",supportsEffort:!1},{id:"gemini-2.5-flash",label:"2.5 Flash",supportsEffort:!1},{id:"gemini-2.5-flash-lite",label:"2.5 Flash Lite",supportsEffort:!1}],efforts:[]},{id:"cursor",label:"Cursor",systemActive:!0,defaultModel:Y_,defaultModelOptions:{},supportsPlanMode:!0,models:[...xM],efforts:[]}],Yn={claude:{active:!0},codex:{active:!0},gemini:{active:!0},cursor:{active:!0}};function tn(e){const t=Jo.find(n=>n.id===e);if(!t)throw new Error(`Unknown provider: ${e}`);return t}function Yx(e,t){const n=Yn[t],r=e==null?void 0:e[t];return{active:(r==null?void 0:r.active)??n.active}}function R7(e,t){const n=tn(e),r=Yx(t,e);return n.systemActive&&r.active?null:`Provider ${n.label} is currently not active.`}function o2(e,t){const n=tn(e),r=Yx(t,e);return n.systemActive&&r.active}function T7(e){return Jo.map(t=>{const n=Yx(e,t.id),r=t.systemActive&&n.active;return{...t,active:n.active,isSelectable:r,isUsageEnabled:r,isInactive:!r,inactiveMessage:R7(t.id,e)}})}function Xx(e){return T7(e).filter(t=>t.isSelectable).map(({active:t,isSelectable:n,isUsageEnabled:r,isInactive:s,inactiveMessage:o,...l})=>l)}function Di(e){return tn(e).defaultModelOptions}const wM=Di("claude");Di("codex");Di("gemini");Di("cursor");function N7(e){return tn("claude").models.find(t=>t.id===e)}function M7(e){var t;return((t=N7(e))==null?void 0:t.contextWindowOptions)??[]}function A7(e,t){const n=M7(e);if(n.length!==0)return n.some(r=>r.id===t)?t:wM.contextWindow}const D7=["idea","todo","progress","testing","done"],a2={idea:"IDEA",todo:"TODO",progress:"PROGRESS",testing:"TESTING",done:"DONE"},fs={submitChatMessage:["enter"],toggleProjectsSidebar:["ctrl+a"],toggleEmbeddedTerminal:["cmd+j","ctrl+`"],toggleRightSidebar:["cmd+b","ctrl+b"],openInFinder:["cmd+alt+f","ctrl+alt+f"],openInEditor:["cmd+shift+o","ctrl+shift+o"],addSplitTerminal:["cmd+/","ctrl+/"]},zm=8,SM=10*1024*1024,Pm=["image/png","image/jpeg","image/webp","image/gif"],j7="/assets/icon-4rSnra9R.svg";function od({alt:e="",className:t,...n}){return f.jsx("img",{alt:e,src:j7,className:me("shrink-0 object-contain",t),...n})}var jp="Popover",[CM,Bre]=lo(jp,[oa]),Vd=oa(),[O7,aa]=CM(jp),kM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:l=!1}=e,u=Vd(t),h=b.useRef(null),[d,g]=b.useState(!1),[p,v]=mc({prop:r,defaultProp:s??!1,onChange:o,caller:jp});return f.jsx(Rp,{...u,children:f.jsx(O7,{scope:t,contentId:to(),triggerRef:h,open:p,onOpenChange:v,onOpenToggle:b.useCallback(()=>v(y=>!y),[v]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>g(!0),[]),onCustomAnchorRemove:b.useCallback(()=>g(!1),[]),modal:l,children:n})})};kM.displayName=jp;var EM="PopoverAnchor",RM=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=aa(EM,n),o=Vd(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=s;return b.useEffect(()=>(l(),()=>u()),[l,u]),f.jsx($d,{...o,...r,ref:t})});RM.displayName=EM;var TM="PopoverTrigger",NM=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=aa(TM,n),o=Vd(n),l=$t(t,s.triggerRef),u=f.jsx(Tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":OM(s.open),...r,ref:l,onClick:Be(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:f.jsx($d,{asChild:!0,...o,children:u})});NM.displayName=TM;var Zx="PopoverPortal",[L7,z7]=CM(Zx,{forceMount:void 0}),MM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,o=aa(Zx,t);return f.jsx(L7,{scope:t,forceMount:n,children:f.jsx(Bi,{present:n||o.open,children:f.jsx(Ec,{asChild:!0,container:s,children:r})})})};MM.displayName=Zx;var bc="PopoverContent",AM=b.forwardRef((e,t)=>{const n=z7(bc,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,o=aa(bc,e.__scopePopover);return f.jsx(Bi,{present:r||o.open,children:o.modal?f.jsx(B7,{...s,ref:t}):f.jsx(I7,{...s,ref:t})})});AM.displayName=bc;var P7=qa("PopoverContent.RemoveScroll"),B7=b.forwardRef((e,t)=>{const n=aa(bc,e.__scopePopover),r=b.useRef(null),s=$t(t,r),o=b.useRef(!1);return b.useEffect(()=>{const l=r.current;if(l)return gp(l)},[]),f.jsx(Bd,{as:P7,allowPinchZoom:!0,children:f.jsx(DM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,d=u.button===2||h;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Be(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),I7=b.forwardRef((e,t)=>{const n=aa(bc,e.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return f.jsx(DM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),DM=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:g,...p}=e,v=aa(bc,n),y=Vd(n);return mp(),f.jsx(Pd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:f.jsx(kc,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:g,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:f.jsx(Tp,{"data-state":OM(v.open),role:"dialog",id:v.contentId,...y,...p,ref:t,style:{...p.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)"}})})})}),jM="PopoverClose",F7=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=aa(jM,n);return f.jsx(Tt.button,{type:"button",...r,ref:t,onClick:Be(e.onClick,()=>s.onOpenChange(!1))})});F7.displayName=jM;var H7="PopoverArrow",U7=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Vd(n);return f.jsx(Np,{...s,...r,ref:t})});U7.displayName=H7;function OM(e){return e?"open":"closed"}var LM=kM,$7=RM,W7=NM,zM=MM,Qx=AM;const PM=LM,BM=W7,Jx=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>f.jsx(zM,{children:f.jsx(Qx,{ref:s,align:t,sideOffset:n,[yd]:"",onCloseAutoFocus:o=>{var l;o.preventDefault(),window.dispatchEvent(new Event(Nm)),(l=r.onCloseAutoFocus)==null||l.call(r,o)},className:me("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg backdrop-blur-md outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Jx.displayName=Qx.displayName;function V7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:me("shrink-0",e),...t,children:f.jsx("path",{d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})})}function q7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:me("shrink-0",e),...t,children:f.jsx("path",{d:"M60.8734 57.2556V42.3124c0-1.2586.4722-2.2029 1.5728-2.8314l30.0443-17.3023c4.0899-2.3593 8.9662-3.4599 13.9988-3.4599 18.8759 0 30.8307 14.6289 30.8307 30.2006 0 1.1007 0 2.3593-.158 3.6178l-31.1446-18.2467c-1.8872-1.1006-3.7754-1.1006-5.6629 0L60.8734 57.2556Zm70.1542 58.2005V79.7487c0-2.2028-.9446-3.7756-2.8318-4.8763l-39.481-22.9651 12.8982-7.3934c1.1007-.6285 2.0453-.6285 3.1458 0l30.0441 17.3024c8.6523 5.0341 14.4708 15.7296 14.4708 26.1107 0 11.9539-7.0769 22.965-18.2461 27.527ZM51.593 83.9964l-12.8982-7.5497c-1.1007-.6285-1.5728-1.5728-1.5728-2.8314V39.0105c0-16.8303 12.8982-29.5722 30.3585-29.5722 6.607 0 12.7403 2.2029 17.9324 6.1349l-30.987 17.9324c-1.8871 1.1007-2.8314 2.6735-2.8314 4.8764v45.6159ZM79.3562 100.0403 60.8733 89.6592V67.6383l18.4829-10.3811 18.4812 10.3811v22.0209l-18.4812 10.3811Zm11.8757 47.8188c-6.607 0-12.7403-2.2031-17.9324-6.1344l30.9866-17.9333c1.8872-1.1005 2.8318-2.6728 2.8318-4.8759v-45.616l13.0564 7.5498c1.1005.6285 1.5723 1.5728 1.5723 2.8314v34.6051c0 16.8297-13.0564 29.5723-30.5147 29.5723ZM53.9522 112.7822 23.9079 95.4798c-8.652-5.0343-14.471-15.7296-14.471-26.1107 0-12.1119 7.2356-22.9652 18.403-27.5272v35.8634c0 2.2028.9443 3.7756 2.8314 4.8763l39.3248 22.8068-12.8982 7.3938c-1.1007.6287-2.045.6287-3.1456 0ZM52.2229 138.5791c-17.7745 0-30.8306-13.3713-30.8306-29.8871 0-1.2585.1578-2.5169.3143-3.7754l30.987 17.9323c1.8871 1.1005 3.7757 1.1005 5.6628 0l39.4811-22.807v14.9435c0 1.2585-.4721 2.2021-1.5728 2.8308l-30.0443 17.3025c-4.0898 2.359-8.9662 3.4605-13.9989 3.4605h.0014ZM91.2319 157.296c19.0327 0 34.9188-13.5272 38.5383-31.4594 17.6164-4.562 28.9425-21.0779 28.9425-37.908 0-11.0112-4.719-21.7066-13.2133-29.4143.7867-3.3035 1.2595-6.607 1.2595-9.909 0-22.4929-18.2471-39.3247-39.3251-39.3247-4.2461 0-8.3363.6285-12.4262 2.045-7.0792-6.9213-16.8318-11.3254-27.5271-11.3254-19.0331 0-34.9191 13.5268-38.5384 31.4591C11.3255 36.0212 0 52.5373 0 69.3675c0 11.0112 4.7184 21.7065 13.2125 29.4142-.7865 3.3035-1.2586 6.6067-1.2586 9.9092 0 22.4923 18.2466 39.3241 39.3248 39.3241 4.2462 0 8.3362-.6277 12.426-2.0441 7.0776 6.921 16.8302 11.3251 27.5271 11.3251Z"})})}function K7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:me("shrink-0",e),...t,children:f.jsx("path",{d:"M12 0C12 0 12 8 8 12C4 16 0 12 0 12C0 12 4 12 8 12C12 12 12 16 12 24C12 24 12 16 16 12C20 8 24 12 24 12C24 12 16 12 16 12C12 12 12 4 12 0Z"})})}function G7({className:e,...t}){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:me("shrink-0",e),...t,children:f.jsx("path",{d:"M12 0 2.4 5.5v13L12 24l9.6-5.5v-13Zm0 3.1 6.8 3.9v5.1L15 14.3V9.7L12 8l-3 1.7v4.6l-3.8-2.2V7Zm-6.8 9.8 3.8 2.2v4.5l3 1.8 3-1.8v-4.5l3.8-2.2v3.8L12 20.9l-6.8-3.9Z"})})}function Y7(e){return!(e.startsWith("gemini-3")||e==="auto-gemini-3")}const X7=["Composer","GPT","Claude","Gemini","Grok","Kimi"];function Z7(e){return e.startsWith("composer-")?"Composer":e.startsWith("gpt-")?"GPT":e.startsWith("claude-")?"Claude":e.startsWith("gemini-")?"Gemini":e.startsWith("grok-")?"Grok":"Kimi"}function Db(e,t){const n=tc(t);return!n||n==="standard"?e:`${e} (${n==="fast"?"Fast":"Standard"})`}const Bm={claude:V7,codex:q7,gemini:K7,cursor:G7},Pf={auto:Dn,opus:ai,sonnet:Dn,haiku:ps,"gpt-5.4":ai,"gpt-5.4[reasoning=medium,context=272k,fast=false]":ai,"gpt-5.4-mini[reasoning=medium]":Dn,"gpt-5.4-nano[reasoning=medium]":ps,"gpt-5.3-codex":Dn,"gpt-5.3-codex[reasoning=medium,fast=false]":Dn,"gpt-5.3-codex-spark[reasoning=medium]":ps,"gpt-5.2[reasoning=medium,fast=false]":Dn,"gpt-5.2-codex[reasoning=medium,fast=false]":Dn,"gpt-5.3-codex-spark":ps,"gemini-2.5-pro":ai,"gemini-2.5-flash":Dn,"gemini-2.5-flash-lite":ps,"auto-gemini-3":ai,"auto-gemini-2.5":Dn,"gemini-3.1-pro-preview":ai,"gemini-3.1-pro[]":ai,"gemini-3-flash[]":Dn,"gemini-3-pro-preview":ai,"gemini-3-flash-preview":Dn,"claude-opus-4-6[thinking=true,context=200k,effort=high,fast=false]":ai,"claude-opus-4-5[thinking=true]":ai,"claude-sonnet-4-6[thinking=true,context=200k,effort=medium]":Dn,"claude-sonnet-4-5[thinking=true,context=200k]":Dn,"claude-sonnet-4[thinking=false,context=200k]":Dn,"claude-haiku-4-5[thinking=true]":ps,"grok-4-20[thinking=true]":ai,"kimi-k2.5[]":Dn,"composer-2[fast=true]":ai,"composer-1.5[]":Dn};function Vr({onClick:e,selected:t,icon:n,label:r,description:s,disabled:o}){return f.jsxs("button",{onClick:e,disabled:o,className:me("w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity",t?"bg-muted border-border":"hover:opacity-60",o&&"opacity-40 cursor-not-allowed"),children:[n,f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium",children:r}),s?f.jsx("div",{className:"text-xs text-muted-foreground",children:s}):null]})]})}function $o({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[s,o]=b.useState(!1);return n?f.jsx("button",{disabled:!0,className:me("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default",t),children:e}):f.jsxs(PM,{open:s,onOpenChange:o,children:[f.jsx(BM,{asChild:!0,children:f.jsx("button",{className:me("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0","hover:bg-muted/50",t),children:e})}),f.jsx(Jx,{align:"center",className:"w-64 p-1",children:f.jsx("div",{className:"max-h-[min(24rem,60vh)] space-y-1 overflow-y-auto pr-1",children:typeof r=="function"?r(()=>o(!1)):r})})]})}function Gu({availableProviders:e,selectedProvider:t,disabled:n=!1,showProviderPicker:r=!0,providerLocked:s=!1,model:o,modelOptions:l,onProviderChange:u,onModelChange:h,onClaudeReasoningEffortChange:d,onClaudeContextWindowChange:g,onCodexReasoningEffortChange:p,onGeminiThinkingModeChange:v,onCodexFastModeChange:y,planMode:w=!1,onPlanModeChange:S,includePlanMode:C=!0,className:k}){var X,M,P,Z,A,ie,J;const[R,E]=b.useState(null),N=e.find(ee=>ee.id===t)??tn(t),L=Bm[t],D=Pf[o]??Dn,j=C&&(N==null?void 0:N.supportsPlanMode)&&S,H=t==="claude"?l:null,G=t==="codex"?l:null,B=t==="gemini"?l:null,q=((X=N.models.find(ee=>ee.id===o))==null?void 0:X.contextWindowOptions)??[],I=(H==null?void 0:H.contextWindow)??X_[0].id,V=I==="1m"?Fk:Hk,F=t==="claude"||t==="codex",W=t==="cursor"?tc(o):null,O=N.id==="cursor"?N.models.filter(ee=>r2(ee.id)===r2(o)):[],$=t==="cursor"&&O.some(ee=>tc(ee.id)==="fast")&&O.some(ee=>tc(ee.id)==="standard"),U=N.id==="cursor"?X7.map(ee=>({family:ee,models:N.models.filter(re=>Z7(re.id)===ee)})).filter(ee=>ee.models.length>0):[];return b.useEffect(()=>{E(null)},[t]),f.jsx("div",{className:me("max-w-full overflow-x-auto scrollbar-hide",n&&"pointer-events-none opacity-60",k),children:f.jsxs("div",{className:"flex w-max items-center justify-center gap-0.5 mx-auto",children:[r?f.jsx($o,{disabled:s||!u,trigger:f.jsxs(f.Fragment,{children:[f.jsx(L,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"hidden md:inline",children:(N==null?void 0:N.label)??t})]}),children:ee=>e.map(re=>{const ce=Bm[re.id];return f.jsx(Vr,{onClick:()=>{u==null||u(re.id),ee()},selected:t===re.id,icon:f.jsx(ce,{className:"h-4 w-4 text-muted-foreground"}),label:re.label},re.id)})}):null,f.jsx($o,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(D,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:N.id==="cursor"?Db(((M=N.models.find(ee=>ee.id===o))==null?void 0:M.label)??o,o):((P=N.models.find(ee=>ee.id===o))==null?void 0:P.label)??o})]}),children:ee=>{var re;return N.id==="cursor"?R?f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:()=>E(null),className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm text-muted-foreground transition-opacity hover:opacity-70",children:[f.jsx(RN,{className:"h-4 w-4"}),f.jsx("span",{children:R})]}),(re=U.find(ce=>ce.family===R))==null?void 0:re.models.map(ce=>{const he=Pf[ce.id]??Dn;return f.jsx(Vr,{onClick:()=>{h(t,ce.id),E(null),ee()},selected:o===ce.id,icon:f.jsx(he,{className:"h-4 w-4 text-muted-foreground"}),label:Db(ce.label,ce.id)},ce.id)})]}):U.map(ce=>{var Se;const he=ce.models.some(Re=>Re.id===o),pe=Pf[((Se=ce.models[0])==null?void 0:Se.id)??""]??Dn;return f.jsxs("div",{className:"relative",children:[f.jsx(Vr,{onClick:()=>E(ce.family),selected:he,icon:f.jsx(pe,{className:"h-4 w-4 text-muted-foreground"}),label:ce.family,description:`${ce.models.length} model${ce.models.length===1?"":"s"}`}),f.jsx(Or,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"})]},ce.family)}):N.models.map(ce=>{const he=Pf[ce.id]??Dn;return f.jsx(Vr,{onClick:()=>{h(t,ce.id),ee()},selected:o===ce.id,icon:f.jsx(he,{className:"h-4 w-4 text-muted-foreground"}),label:N.id==="cursor"?Db(ce.label,ce.id):ce.label},ce.id)})}}),$?f.jsx($o,{trigger:f.jsxs(f.Fragment,{children:[W==="fast"?f.jsx(ps,{className:"h-3.5 w-3.5"}):f.jsx(Gs,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:W==="fast"?"Fast":"Standard"})]}),triggerClassName:W==="fast"?"text-emerald-500 dark:text-emerald-400":void 0,children:ee=>f.jsxs(f.Fragment,{children:[O.filter(re=>tc(re.id)==="standard").map(re=>f.jsx(Vr,{onClick:()=>{h(t,re.id),ee()},selected:o===re.id,icon:f.jsx(Gs,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"},re.id)),O.filter(re=>tc(re.id)==="fast").map(re=>f.jsx(Vr,{onClick:()=>{h(t,re.id),ee()},selected:o===re.id,icon:f.jsx(ps,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast"},re.id))]})}):null,F?f.jsx($o,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(Gs,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:t==="claude"?((Z=Lm.find(ee=>ee.id===l.reasoningEffort))==null?void 0:Z.label)??l.reasoningEffort:((A=K_.find(ee=>ee.id===l.reasoningEffort))==null?void 0:A.label)??l.reasoningEffort})]}),children:ee=>t==="claude"?Lm.map(re=>f.jsx(Vr,{onClick:()=>{d(re.id),ee()},selected:l.reasoningEffort===re.id,icon:f.jsx(Gs,{className:"h-4 w-4 text-muted-foreground"}),label:re.label,disabled:re.id==="max"&&o!=="opus"},re.id)):K_.map(re=>f.jsx(Vr,{onClick:()=>{p(re.id),ee()},selected:l.reasoningEffort===re.id,icon:f.jsx(Gs,{className:"h-4 w-4 text-muted-foreground"}),label:re.label},re.id))}):null,t==="claude"&&q.length>1?f.jsx($o,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(V,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:((ie=q.find(ee=>ee.id===I))==null?void 0:ie.label)??I})]}),children:ee=>q.map(re=>f.jsx(Vr,{onClick:()=>{g(re.id),ee()},selected:I===re.id,icon:re.id==="1m"?f.jsx(Fk,{className:"h-4 w-4 text-muted-foreground"}):f.jsx(Hk,{className:"h-4 w-4 text-muted-foreground"}),label:re.label,description:re.id==="1m"?"Expanded context window":"Standard context window"},re.id))}):null,t==="gemini"?f.jsx($o,{trigger:f.jsxs(f.Fragment,{children:[f.jsx(Gs,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:((J=G_.find(ee=>ee.id===(B==null?void 0:B.thinkingMode)))==null?void 0:J.label)??(B==null?void 0:B.thinkingMode)??"Standard"})]}),children:ee=>G_.map(re=>f.jsx(Vr,{onClick:()=>{v(re.id),ee()},selected:(B==null?void 0:B.thinkingMode)===re.id,icon:f.jsx(Gs,{className:"h-4 w-4 text-muted-foreground"}),label:re.label,disabled:re.id==="off"&&!Y7(o)},re.id))}):null,t==="codex"?f.jsx($o,{trigger:f.jsxs(f.Fragment,{children:[G!=null&&G.fastMode?f.jsx(ps,{className:"h-3.5 w-3.5"}):f.jsx(Gs,{className:"h-3.5 w-3.5"}),f.jsx("span",{children:G!=null&&G.fastMode?"Fast Mode":"Standard"})]}),triggerClassName:G!=null&&G.fastMode?"text-emerald-500 dark:text-emerald-400":void 0,children:ee=>f.jsxs(f.Fragment,{children:[f.jsx(Vr,{onClick:()=>{y(!1),ee()},selected:!(G!=null&&G.fastMode),icon:f.jsx(Gs,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"}),f.jsx(Vr,{onClick:()=>{y(!0),ee()},selected:!!(G!=null&&G.fastMode),icon:f.jsx(ps,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,j?f.jsx($o,{trigger:f.jsxs(f.Fragment,{children:[w?f.jsx(Rm,{className:"h-3.5 w-3.5"}):f.jsx(Bk,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"hidden md:inline",children:w?"Plan":"Implement"}),f.jsx("span",{className:"md:hidden",children:w?"Plan":"Impl"})]}),triggerClassName:w?"text-blue-400 dark:text-blue-300":void 0,children:ee=>f.jsxs(f.Fragment,{children:[f.jsx(Vr,{onClick:()=>{S(!1),ee()},selected:!w,icon:f.jsx(Bk,{className:"h-4 w-4 text-muted-foreground"}),label:"Implement",description:"Start execution"}),f.jsx(Vr,{onClick:()=>{S(!0),ee()},selected:w,icon:f.jsx(Rm,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan",description:"Review a plan before execution"})]})}):null]})})}const Op=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...s})=>f.jsx("span",{style:{"--shiny-width":`${Math.min(n,100)}px`},className:me("mx-auto max-w-md text-foreground/50",r?["animate-shiny-text [background-size:var(--shiny-width)_100%] bg-clip-text [background-position:0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]","bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80"]:["text-neutral"],t),...s,children:e});function Z_(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const Q7=[/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(['"])([\s\S]*)\1$/,/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(.+)$/,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(.+)$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(.+)$/i];function J7(e){const t=e.trim();for(const n of Q7){const r=t.match(n);if(!r)continue;const s=(r[2]??r[1]??"").trim();if(s)return s}return t}function Im(e){return e.split("/").pop()||e}function eF(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,s=60*r,o=24*s,l=7*o;return n<r?"now":n<s?`${Math.floor(n/r)}m`:n<o?`${Math.floor(n/s)}h`:n<l?`${Math.floor(n/o)}d`:`${Math.floor(n/l)}w`}const tF='button, select, input, textarea, [role="combobox"], [role="listbox"], [data-no-touch-drag]';function l2(e){var t;try{(t=navigator.vibrate)==null||t.call(navigator,e)}catch{}}function e0({enabled:e,visualElementRef:t,onTap:n,onContextMenu:r,onDragStart:s,onDragMove:o,onDragEnd:l,holdDelay:u=300,contextMenuDelay:h=2500,scrollThreshold:d=8,dragMoveThreshold:g=5}){const[p,v]=b.useState(!1),[y,w]=b.useState(!1),[S,C]=b.useState(null),[k,R]=b.useState(null),E=b.useCallback(O=>{R(O)},[]),N=b.useRef("idle"),L=b.useRef({x:0,y:0}),D=b.useRef(null),j=b.useRef(null),H=b.useRef(n),G=b.useRef(r),B=b.useRef(s),q=b.useRef(o),I=b.useRef(l);H.current=n,G.current=r,B.current=s,q.current=o,I.current=l;const V=b.useCallback((O,$)=>{const U=(t==null?void 0:t.current)??k;if(!U)return document.elementFromPoint(O,$);const X=U.style.pointerEvents;U.style.pointerEvents="none";const M=document.elementFromPoint(O,$);return U.style.pointerEvents=X,M},[t,k]),F=b.useCallback(()=>{D.current&&(clearTimeout(D.current),D.current=null),j.current&&(clearTimeout(j.current),j.current=null)},[]),W=b.useCallback(()=>{F(),N.current="idle",w(!1),v(!1),C(null)},[F]);return b.useEffect(()=>{if(!k||!e)return;const O=M=>{if(M.target.closest(tF))return;const P=M.touches[0];P&&(L.current={x:P.clientX,y:P.clientY},N.current="holding",D.current=setTimeout(()=>{D.current=null,N.current==="holding"&&(N.current="armed",w(!0),l2(30),j.current=setTimeout(()=>{var A;if(j.current=null,N.current!=="armed")return;l2(100);const Z={...L.current};N.current="idle",w(!1),(A=G.current)==null||A.call(G,Z)},h))},u))},$=M=>{var ee,re;const P=N.current;if(P==="idle")return;const Z=M.touches[0];if(!Z)return;const A=Z.clientX-L.current.x,ie=Z.clientY-L.current.y,J=Math.sqrt(A*A+ie*ie);if(P==="holding"){J>d&&(F(),N.current="idle");return}if(P==="armed"){J>g&&(j.current&&(clearTimeout(j.current),j.current=null),N.current="dragging",w(!1),v(!0),C({x:Z.clientX,y:Z.clientY}),M.preventDefault(),(ee=B.current)==null||ee.call(B,{x:Z.clientX,y:Z.clientY}));return}if(P==="dragging"){M.preventDefault(),C({x:Z.clientX,y:Z.clientY});const ce=V(Z.clientX,Z.clientY);(re=q.current)==null||re.call(q,{x:Z.clientX,y:Z.clientY,elementBelow:ce})}},U=M=>{var Z,A;const P=N.current;if(P==="holding"){F(),N.current="idle",w(!1),v(!1),M.preventDefault(),(Z=H.current)==null||Z.call(H);return}if(P==="armed"){W();return}if(P==="dragging"){const ie=M.changedTouches[0];if(ie){const J=V(ie.clientX,ie.clientY);(A=I.current)==null||A.call(I,{x:ie.clientX,y:ie.clientY,elementBelow:J})}W()}},X=()=>{var M;N.current==="dragging"&&((M=I.current)==null||M.call(I,{x:0,y:0,elementBelow:null})),W()};return k.addEventListener("touchstart",O,{passive:!1}),k.addEventListener("touchmove",$,{passive:!1}),k.addEventListener("touchend",U),k.addEventListener("touchcancel",X),()=>{k.removeEventListener("touchstart",O),k.removeEventListener("touchmove",$),k.removeEventListener("touchend",U),k.removeEventListener("touchcancel",X),F(),N.current="idle"}},[k,e,u,h,d,g,F,W,V]),{touchRef:E,isDragging:p,isArmed:y,dragPosition:S}}function IM({position:e,children:t,className:n}){return e?qi.createPortal(f.jsx("div",{style:{position:"fixed",left:e.x,top:e.y,transform:"translate(-50%, calc(-100% - 14px))",zIndex:9999,pointerEvents:"none",willChange:"transform"},className:me("flex items-center gap-2 rounded-xl border-2 border-primary/60 bg-card px-3 py-2","shadow-[0_8px_32px_rgba(0,0,0,0.25)] dark:shadow-[0_8px_32px_rgba(0,0,0,0.5)]","min-w-[120px] max-w-[240px]","scale-[1.04]",n),children:t}),document.body):null}const nF=new Set(["starting","running"]);function rF({chat:e,activeChatId:t,nowMs:n,showProviderIcon:r=!1,isCompleted:s=!1,onSelectChat:o,onDeleteChat:l,draggable:u=!1,onDragStart:h,onDragEnd:d,isTouchDevice:g=!1,onTouchDragMove:p,onTouchDragEnd:v}){const y=eF(e.lastMessageAt,n),w=g&&u,S=e.provider?Bm[e.provider]:null,{touchRef:C,isArmed:k,isDragging:R,dragPosition:E}=e0({enabled:w,onTap:()=>o(e.chatId),onDragStart:()=>h==null?void 0:h(e),onDragMove:({x:N,y:L,elementBelow:D})=>p==null?void 0:p(N,L,D),onDragEnd:({x:N,y:L,elementBelow:D})=>{v==null||v(N,L,D),d==null||d()}});return f.jsxs(f.Fragment,{children:[f.jsxs("div",{ref:w?C:void 0,"data-chat-id":xk(e.chatId),className:me("group flex items-center gap-2 pl-2.5 pr-0.5 py-0.5 rounded-lg cursor-pointer border transition-all duration-150 select-none",t===xk(e.chatId)?"bg-muted hover:bg-muted border-border":"border-border/0 hover:border-border hover:bg-muted/20 dark:hover:border-slate-400/10",k&&"scale-[1.03] shadow-md ring-2 ring-primary/50 bg-card border-primary/40",R&&!k&&"opacity-20 scale-[0.98]"),draggable:u&&!g,onDragStart:u&&!g?()=>h==null?void 0:h(e):void 0,onDragEnd:u&&!g?d:void 0,onClick:g?void 0:()=>o(e.chatId),children:[nF.has(e.status)?f.jsx(kr,{className:"size-3.5 flex-shrink-0 animate-spin text-muted-foreground"}):e.status==="waiting_for_user"?f.jsx("div",{className:"relative",children:f.jsxs("div",{className:"rounded-full z-0 size-3.5 flex items-center justify-center",children:[f.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-blue-400/80 animate-ping"}),f.jsx("div",{className:"rounded-full z-0 size-2.5 bg-blue-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):s?f.jsx("div",{className:"relative",children:f.jsxs("div",{className:"rounded-full z-0 size-3.5 flex items-center justify-center",children:[f.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-emerald-400/80 animate-ping"}),f.jsx("div",{className:"rounded-full z-0 size-2.5 bg-emerald-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):null,r&&S?f.jsx(S,{className:"size-3.5 flex-shrink-0 text-muted-foreground/80","aria-label":`${e.provider} provider`}):null,f.jsx("span",{className:"text-sm truncate flex-1 translate-y-[-0.5px]",children:e.status!=="idle"&&e.status!=="waiting_for_user"?f.jsx(Op,{animate:e.status==="running",shimmerWidth:Math.max(20,e.title.length*3),children:e.title}):e.title}),f.jsxs("div",{className:"relative h-7 w-7 mr-[2px] shrink-0",children:[y?f.jsx("span",{className:"hidden md:flex absolute inset-0 items-center justify-end pr-1 text-[11px] text-muted-foreground opacity-50 transition-opacity group-hover:opacity-0",children:y}):null,f.jsx(Xe,{variant:"ghost",size:"icon",className:me("absolute inset-0 h-7 w-7 opacity-100 cursor-pointer rounded-sm hover:!bg-transparent !border-0",y?"md:opacity-0 md:group-hover:opacity-100":"opacity-100 md:opacity-0 md:group-hover:opacity-100"),"data-no-touch-drag":!0,onClick:N=>{N.stopPropagation(),l(e.chatId)},title:"Delete chat",children:f.jsx(_I,{className:"size-3.5"})})]})]},e._id),f.jsx(IM,{position:E,children:f.jsx("span",{className:"text-sm font-medium truncate",children:e.title})})]})}function iF(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Lp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function t0(e){return"nodeType"in e}function Xr(e){var t,n;return e?Mc(e)?e:t0(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function n0(e){const{Document:t}=Xr(e);return e instanceof t}function qd(e){return Mc(e)?!1:e instanceof Xr(e).HTMLElement}function FM(e){return e instanceof Xr(e).SVGElement}function Ac(e){return e?Mc(e)?e.document:t0(e)?n0(e)?e:qd(e)||FM(e)?e.ownerDocument:document:document:document}const ks=Lp?b.useLayoutEffect:b.useEffect;function r0(e){const t=b.useRef(e);return ks(()=>{t.current=e}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function sF(){const e=b.useRef(null),t=b.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Sd(e,t){t===void 0&&(t=[e]);const n=b.useRef(e);return ks(()=>{n.current!==e&&(n.current=e)},t),n}function Kd(e,t){const n=b.useRef();return b.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Fm(e){const t=r0(e),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Q_(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let jb={};function Gd(e,t){return b.useMemo(()=>{if(t)return t;const n=jb[e]==null?0:jb[e]+1;return jb[e]=n,e+"-"+n},[e,t])}function HM(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((o,l)=>{const u=Object.entries(l);for(const[h,d]of u){const g=o[h];g!=null&&(o[h]=g+e*d)}return o},{...t})}}const uc=HM(1),Hm=HM(-1);function oF(e){return"clientX"in e&&"clientY"in e}function i0(e){if(!e)return!1;const{KeyboardEvent:t}=Xr(e.target);return t&&e instanceof t}function aF(e){if(!e)return!1;const{TouchEvent:t}=Xr(e.target);return t&&e instanceof t}function J_(e){if(aF(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return oF(e)?{x:e.clientX,y:e.clientY}:null}const Cd=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Cd.Translate.toString(e),Cd.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),c2="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function lF(e){return e.matches(c2)?e:e.querySelector(c2)}const cF={display:"none"};function uF(e){let{id:t,value:n}=e;return xe.createElement("div",{id:t,style:cF},n)}function dF(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return xe.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function hF(){const[e,t]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const UM=b.createContext(null);function fF(e){const t=b.useContext(UM);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function mF(){const[e]=b.useState(()=>new Set),t=b.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[b.useCallback(r=>{let{type:s,event:o}=r;e.forEach(l=>{var u;return(u=l[s])==null?void 0:u.call(l,o)})},[e]),t]}const pF={draggable:`
|
|
495
|
+
To pick up a draggable item, press the space bar.
|
|
496
|
+
While dragging, use the arrow keys to move the item.
|
|
497
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
498
|
+
`},gF={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function vF(e){let{announcements:t=gF,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=pF}=e;const{announce:o,announcement:l}=hF(),u=Gd("DndLiveRegion"),[h,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),fF(b.useMemo(()=>({onDragStart(p){let{active:v}=p;o(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:y}=p;t.onDragMove&&o(t.onDragMove({active:v,over:y}))},onDragOver(p){let{active:v,over:y}=p;o(t.onDragOver({active:v,over:y}))},onDragEnd(p){let{active:v,over:y}=p;o(t.onDragEnd({active:v,over:y}))},onDragCancel(p){let{active:v,over:y}=p;o(t.onDragCancel({active:v,over:y}))}}),[o,t])),!h)return null;const g=xe.createElement(xe.Fragment,null,xe.createElement(uF,{id:r,value:s.draggable}),xe.createElement(dF,{id:u,announcement:l}));return n?qi.createPortal(g,n):g}var Xn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Xn||(Xn={}));function Um(){}function Ob(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function bF(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ji=Object.freeze({x:0,y:0});function _F(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function yF(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function xF(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function wF(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function u2(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const SF=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=u2(t,t.left,t.top),o=[];for(const l of r){const{id:u}=l,h=n.get(u);if(h){const d=_F(u2(h),s);o.push({id:u,data:{droppableContainer:l,value:d}})}}return o.sort(yF)};function CF(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),l=s-r,u=o-n;if(r<s&&n<o){const h=t.width*t.height,d=e.width*e.height,g=l*u,p=g/(h+d-g);return Number(p.toFixed(4))}return 0}const kF=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const o of r){const{id:l}=o,u=n.get(l);if(u){const h=CF(u,t);h>0&&s.push({id:l,data:{droppableContainer:o,value:h}})}}return s.sort(xF)};function EF(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function $M(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ji}function RF(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s.reduce((l,u)=>({...l,top:l.top+e*u.y,bottom:l.bottom+e*u.y,left:l.left+e*u.x,right:l.right+e*u.x}),{...n})}}const TF=RF(1);function NF(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function MF(e,t,n){const r=NF(t);if(!r)return e;const{scaleX:s,scaleY:o,x:l,y:u}=r,h=e.left-l-(1-s)*parseFloat(n),d=e.top-u-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),g=s?e.width/s:e.width,p=o?e.height/o:e.height;return{width:g,height:p,top:d,right:h+g,bottom:d+p,left:h}}const AF={ignoreTransform:!1};function Dc(e,t){t===void 0&&(t=AF);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=Xr(e).getComputedStyle(e);d&&(n=MF(n,d,g))}const{top:r,left:s,width:o,height:l,bottom:u,right:h}=n;return{top:r,left:s,width:o,height:l,bottom:u,right:h}}function d2(e){return Dc(e,{ignoreTransform:!0})}function DF(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function jF(e,t){return t===void 0&&(t=Xr(e).getComputedStyle(e)),t.position==="fixed"}function OF(e,t){t===void 0&&(t=Xr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?n.test(o):!1})}function s0(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(n0(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!qd(s)||FM(s)||n.includes(s))return n;const o=Xr(e).getComputedStyle(s);return s!==e&&OF(s,o)&&n.push(s),jF(s,o)?n:r(s.parentNode)}return e?r(e):n}function WM(e){const[t]=s0(e,1);return t??null}function Lb(e){return!Lp||!e?null:Mc(e)?e:t0(e)?n0(e)||e===Ac(e).scrollingElement?window:qd(e)?e:null:null}function VM(e){return Mc(e)?e.scrollX:e.scrollLeft}function qM(e){return Mc(e)?e.scrollY:e.scrollTop}function ey(e){return{x:VM(e),y:qM(e)}}var nr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(nr||(nr={}));function KM(e){return!Lp||!e?!1:e===document.scrollingElement}function GM(e){const t={x:0,y:0},n=KM(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:o,isBottom:l,isRight:u,maxScroll:r,minScroll:t}}const LF={x:.2,y:.2};function zF(e,t,n,r,s){let{top:o,left:l,right:u,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=LF);const{isTop:d,isBottom:g,isLeft:p,isRight:v}=GM(e),y={x:0,y:0},w={x:0,y:0},S={height:t.height*s.y,width:t.width*s.x};return!d&&o<=t.top+S.height?(y.y=nr.Backward,w.y=r*Math.abs((t.top+S.height-o)/S.height)):!g&&h>=t.bottom-S.height&&(y.y=nr.Forward,w.y=r*Math.abs((t.bottom-S.height-h)/S.height)),!v&&u>=t.right-S.width?(y.x=nr.Forward,w.x=r*Math.abs((t.right-S.width-u)/S.width)):!p&&l<=t.left+S.width&&(y.x=nr.Backward,w.x=r*Math.abs((t.left+S.width-l)/S.width)),{direction:y,speed:w}}function PF(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function YM(e){return e.reduce((t,n)=>uc(t,ey(n)),Ji)}function BF(e){return e.reduce((t,n)=>t+VM(n),0)}function IF(e){return e.reduce((t,n)=>t+qM(n),0)}function FF(e,t){if(t===void 0&&(t=Dc),!e)return;const{top:n,left:r,bottom:s,right:o}=t(e);WM(e)&&(s<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const HF=[["x",["left","right"],BF],["y",["top","bottom"],IF]];class o0{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=s0(n),s=YM(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,l,u]of HF)for(const h of l)Object.defineProperty(this,h,{get:()=>{const d=u(r),g=s[o]-d;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ad{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function UF(e){const{EventTarget:t}=Xr(e);return e instanceof t?e:Ac(e)}function zb(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ni;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ni||(Ni={}));function h2(e){e.preventDefault()}function $F(e){e.stopPropagation()}var Ut;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ut||(Ut={}));const XM={start:[Ut.Space,Ut.Enter],cancel:[Ut.Esc],end:[Ut.Space,Ut.Enter,Ut.Tab]},WF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ut.Right:return{...n,x:n.x+25};case Ut.Left:return{...n,x:n.x-25};case Ut.Down:return{...n,y:n.y+25};case Ut.Up:return{...n,y:n.y-25}}};class a0{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new ad(Ac(n)),this.windowListeners=new ad(Xr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ni.Resize,this.handleCancel),this.windowListeners.add(Ni.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ni.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&FF(r),n(Ji)}handleKeyDown(t){if(i0(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:o=XM,coordinateGetter:l=WF,scrollBehavior:u="smooth"}=s,{code:h}=t;if(o.end.includes(h)){this.handleEnd(t);return}if(o.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:d}=r.current,g=d?{x:d.left,y:d.top}:Ji;this.referenceCoordinates||(this.referenceCoordinates=g);const p=l(t,{active:n,context:r.current,currentCoordinates:g});if(p){const v=Hm(p,g),y={x:0,y:0},{scrollableAncestors:w}=r.current;for(const S of w){const C=t.code,{isTop:k,isRight:R,isLeft:E,isBottom:N,maxScroll:L,minScroll:D}=GM(S),j=PF(S),H={x:Math.min(C===Ut.Right?j.right-j.width/2:j.right,Math.max(C===Ut.Right?j.left:j.left+j.width/2,p.x)),y:Math.min(C===Ut.Down?j.bottom-j.height/2:j.bottom,Math.max(C===Ut.Down?j.top:j.top+j.height/2,p.y))},G=C===Ut.Right&&!R||C===Ut.Left&&!E,B=C===Ut.Down&&!N||C===Ut.Up&&!k;if(G&&H.x!==p.x){const q=S.scrollLeft+v.x,I=C===Ut.Right&&q<=L.x||C===Ut.Left&&q>=D.x;if(I&&!v.y){S.scrollTo({left:q,behavior:u});return}I?y.x=S.scrollLeft-q:y.x=C===Ut.Right?S.scrollLeft-L.x:S.scrollLeft-D.x,y.x&&S.scrollBy({left:-y.x,behavior:u});break}else if(B&&H.y!==p.y){const q=S.scrollTop+v.y,I=C===Ut.Down&&q<=L.y||C===Ut.Up&&q>=D.y;if(I&&!v.x){S.scrollTo({top:q,behavior:u});return}I?y.y=S.scrollTop-q:y.y=C===Ut.Down?S.scrollTop-L.y:S.scrollTop-D.y,y.y&&S.scrollBy({top:-y.y,behavior:u});break}}this.handleMove(t,uc(Hm(p,this.referenceCoordinates),y))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}a0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=XM,onActivation:s}=t,{active:o}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const u=o.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function f2(e){return!!(e&&"distance"in e)}function m2(e){return!!(e&&"delay"in e)}class l0{constructor(t,n,r){var s;r===void 0&&(r=UF(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:l}=o;this.props=t,this.events=n,this.document=Ac(l),this.documentListeners=new ad(this.document),this.listeners=new ad(r),this.windowListeners=new ad(Xr(l)),this.initialCoordinates=(s=J_(o))!=null?s:Ji,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ni.Resize,this.handleCancel),this.windowListeners.add(Ni.DragStart,h2),this.windowListeners.add(Ni.VisibilityChange,this.handleCancel),this.windowListeners.add(Ni.ContextMenu,h2),this.documentListeners.add(Ni.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(m2(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(f2(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ni.Click,$F,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ni.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:o}=this,{onMove:l,options:{activationConstraint:u}}=o;if(!s)return;const h=(n=J_(t))!=null?n:Ji,d=Hm(s,h);if(!r&&u){if(f2(u)){if(u.tolerance!=null&&zb(d,u.tolerance))return this.handleCancel();if(zb(d,u.distance))return this.handleStart()}if(m2(u)&&zb(d,u.tolerance))return this.handleCancel();this.handlePending(u,d);return}t.cancelable&&t.preventDefault(),l(h)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ut.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const VF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class c0 extends l0{constructor(t){const{event:n}=t,r=Ac(n.target);super(t,VF,r)}}c0.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const qF={move:{name:"mousemove"},end:{name:"mouseup"}};var ty;(function(e){e[e.RightClick=2]="RightClick"})(ty||(ty={}));class KF extends l0{constructor(t){super(t,qF,Ac(t.event.target))}}KF.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===ty.RightClick?!1:(r==null||r({event:n}),!0)}}];const Pb={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ZM extends l0{constructor(t){super(t,Pb)}static setup(){return window.addEventListener(Pb.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Pb.move.name,t)};function t(){}}}ZM.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var ld;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ld||(ld={}));var $m;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})($m||($m={}));function GF(e){let{acceleration:t,activator:n=ld.Pointer,canScroll:r,draggingRect:s,enabled:o,interval:l=5,order:u=$m.TreeOrder,pointerCoordinates:h,scrollableAncestors:d,scrollableAncestorRects:g,delta:p,threshold:v}=e;const y=XF({delta:p,disabled:!o}),[w,S]=sF(),C=b.useRef({x:0,y:0}),k=b.useRef({x:0,y:0}),R=b.useMemo(()=>{switch(n){case ld.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case ld.DraggableRect:return s}},[n,s,h]),E=b.useRef(null),N=b.useCallback(()=>{const D=E.current;if(!D)return;const j=C.current.x*k.current.x,H=C.current.y*k.current.y;D.scrollBy(j,H)},[]),L=b.useMemo(()=>u===$m.TreeOrder?[...d].reverse():d,[u,d]);b.useEffect(()=>{if(!o||!d.length||!R){S();return}for(const D of L){if((r==null?void 0:r(D))===!1)continue;const j=d.indexOf(D),H=g[j];if(!H)continue;const{direction:G,speed:B}=zF(D,H,R,t,v);for(const q of["x","y"])y[q][G[q]]||(B[q]=0,G[q]=0);if(B.x>0||B.y>0){S(),E.current=D,w(N,l),C.current=B,k.current=G;return}}C.current={x:0,y:0},k.current={x:0,y:0},S()},[t,N,r,S,o,l,JSON.stringify(R),JSON.stringify(y),w,d,L,g,JSON.stringify(v)])}const YF={x:{[nr.Backward]:!1,[nr.Forward]:!1},y:{[nr.Backward]:!1,[nr.Forward]:!1}};function XF(e){let{delta:t,disabled:n}=e;const r=Q_(t);return Kd(s=>{if(n||!r||!s)return YF;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[nr.Backward]:s.x[nr.Backward]||o.x===-1,[nr.Forward]:s.x[nr.Forward]||o.x===1},y:{[nr.Backward]:s.y[nr.Backward]||o.y===-1,[nr.Forward]:s.y[nr.Forward]||o.y===1}}},[n,t,r])}function ZF(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Kd(s=>{var o;return t==null?null:(o=r??s)!=null?o:null},[r,t])}function QF(e,t){return b.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,o=s.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...o]},[]),[e,t])}var kd;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(kd||(kd={}));var ny;(function(e){e.Optimized="optimized"})(ny||(ny={}));const p2=new Map;function JF(e,t){let{dragging:n,dependencies:r,config:s}=t;const[o,l]=b.useState(null),{frequency:u,measure:h,strategy:d}=s,g=b.useRef(e),p=C(),v=Sd(p),y=b.useCallback(function(k){k===void 0&&(k=[]),!v.current&&l(R=>R===null?k:R.concat(k.filter(E=>!R.includes(E))))},[v]),w=b.useRef(null),S=Kd(k=>{if(p&&!n)return p2;if(!k||k===p2||g.current!==e||o!=null){const R=new Map;for(let E of e){if(!E)continue;if(o&&o.length>0&&!o.includes(E.id)&&E.rect.current){R.set(E.id,E.rect.current);continue}const N=E.node.current,L=N?new o0(h(N),N):null;E.rect.current=L,L&&R.set(E.id,L)}return R}return k},[e,o,n,p,h]);return b.useEffect(()=>{g.current=e},[e]),b.useEffect(()=>{p||y()},[n,p]),b.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),b.useEffect(()=>{p||typeof u!="number"||w.current!==null||(w.current=setTimeout(()=>{y(),w.current=null},u))},[u,p,y,...r]),{droppableRects:S,measureDroppableContainers:y,measuringScheduled:o!=null};function C(){switch(d){case kd.Always:return!1;case kd.BeforeDragging:return n;default:return!n}}}function QM(e,t){return Kd(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function eH(e,t){return QM(e,t)}function tH(e){let{callback:t,disabled:n}=e;const r=r0(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function zp(e){let{callback:t,disabled:n}=e;const r=r0(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function nH(e){return new o0(Dc(e),e)}function g2(e,t,n){t===void 0&&(t=nH);const[r,s]=b.useState(null);function o(){s(h=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=h??n)!=null?d:null}const g=t(e);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const l=tH({callback(h){if(e)for(const d of h){const{type:g,target:p}=d;if(g==="childList"&&p instanceof HTMLElement&&p.contains(e)){o();break}}}}),u=zp({callback:o});return ks(()=>{o(),e?(u==null||u.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),l==null||l.disconnect())},[e]),r}function rH(e){const t=QM(e);return $M(e,t)}const v2=[];function iH(e){const t=b.useRef(e),n=Kd(r=>e?r&&r!==v2&&e&&t.current&&e.parentNode===t.current.parentNode?r:s0(e):v2,[e]);return b.useEffect(()=>{t.current=e},[e]),n}function sH(e){const[t,n]=b.useState(null),r=b.useRef(e),s=b.useCallback(o=>{const l=Lb(o.target);l&&n(u=>u?(u.set(l,ey(l)),new Map(u)):null)},[]);return b.useEffect(()=>{const o=r.current;if(e!==o){l(o);const u=e.map(h=>{const d=Lb(h);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,ey(d)]):null}).filter(h=>h!=null);n(u.length?new Map(u):null),r.current=e}return()=>{l(e),l(o)};function l(u){u.forEach(h=>{const d=Lb(h);d==null||d.removeEventListener("scroll",s)})}},[s,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,l)=>uc(o,l),Ji):YM(e):Ji,[e,t])}function b2(e,t){t===void 0&&(t=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},t),b.useEffect(()=>{const r=e!==Ji;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Hm(e,n.current):Ji}function oH(e){b.useEffect(()=>{if(!Lp)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function aH(e,t){return b.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:o}=r;return n[s]=l=>{o(l,t)},n},{}),[e,t])}function JM(e){return b.useMemo(()=>e?DF(e):null,[e])}const _2=[];function lH(e,t){t===void 0&&(t=Dc);const[n]=e,r=JM(n?Xr(n):null),[s,o]=b.useState(_2);function l(){o(()=>e.length?e.map(h=>KM(h)?r:new o0(t(h),h)):_2)}const u=zp({callback:l});return ks(()=>{u==null||u.disconnect(),l(),e.forEach(h=>u==null?void 0:u.observe(h))},[e]),s}function cH(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return qd(t)?t:e}function uH(e){let{measure:t}=e;const[n,r]=b.useState(null),s=b.useCallback(d=>{for(const{target:g}of d)if(qd(g)){r(p=>{const v=t(g);return p?{...p,width:v.width,height:v.height}:v});break}},[t]),o=zp({callback:s}),l=b.useCallback(d=>{const g=cH(d);o==null||o.disconnect(),g&&(o==null||o.observe(g)),r(g?t(g):null)},[t,o]),[u,h]=Fm(l);return b.useMemo(()=>({nodeRef:u,rect:n,setRef:h}),[n,u,h])}const dH=[{sensor:c0,options:{}},{sensor:a0,options:{}}],hH={current:{}},hm={draggable:{measure:d2},droppable:{measure:d2,strategy:kd.WhileDragging,frequency:ny.Optimized},dragOverlay:{measure:Dc}};class cd extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const fH={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new cd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Um},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:hm,measureDroppableContainers:Um,windowRect:null,measuringScheduled:!1},mH={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Um,draggableNodes:new Map,over:null,measureDroppableContainers:Um},Pp=b.createContext(mH),e5=b.createContext(fH);function pH(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new cd}}}function gH(e,t){switch(t.type){case Xn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Xn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Xn.DragEnd:case Xn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xn.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new cd(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Xn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new cd(e.droppable.containers);return l.set(n,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:l}}}case Xn.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const o=new cd(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function vH(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(Pp),o=Q_(r),l=Q_(n==null?void 0:n.id);return b.useEffect(()=>{if(!t&&!r&&o&&l!=null){if(!i0(o)||document.activeElement===o.target)return;const u=s.get(l);if(!u)return;const{activatorNode:h,node:d}=u;if(!h.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[h.current,d.current]){if(!g)continue;const p=lF(g);if(p){p.focus();break}}})}},[r,t,s,l,o]),null}function bH(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...r}),n):n}function _H(e){return b.useMemo(()=>({draggable:{...hm.draggable,...e==null?void 0:e.draggable},droppable:{...hm.droppable,...e==null?void 0:e.droppable},dragOverlay:{...hm.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function yH(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const o=b.useRef(!1),{x:l,y:u}=typeof s=="boolean"?{x:s,y:s}:s;ks(()=>{if(!l&&!u||!t){o.current=!1;return}if(o.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const g=n(d),p=$M(g,r);if(l||(p.x=0),u||(p.y=0),o.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const v=WM(d);v&&v.scrollBy({top:p.y,left:p.x})}},[t,l,u,r,n])}const t5=b.createContext({...Ji,scaleX:1,scaleY:1});var Xo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Xo||(Xo={}));const xH=b.memo(function(t){var n,r,s,o;let{id:l,accessibility:u,autoScroll:h=!0,children:d,sensors:g=dH,collisionDetection:p=kF,measuring:v,modifiers:y,...w}=t;const S=b.useReducer(gH,void 0,pH),[C,k]=S,[R,E]=mF(),[N,L]=b.useState(Xo.Uninitialized),D=N===Xo.Initialized,{draggable:{active:j,nodes:H,translate:G},droppable:{containers:B}}=C,q=j!=null?H.get(j):null,I=b.useRef({initial:null,translated:null}),V=b.useMemo(()=>{var Wt;return j!=null?{id:j,data:(Wt=q==null?void 0:q.data)!=null?Wt:hH,rect:I}:null},[j,q]),F=b.useRef(null),[W,O]=b.useState(null),[$,U]=b.useState(null),X=Sd(w,Object.values(w)),M=Gd("DndDescribedBy",l),P=b.useMemo(()=>B.getEnabled(),[B]),Z=_H(v),{droppableRects:A,measureDroppableContainers:ie,measuringScheduled:J}=JF(P,{dragging:D,dependencies:[G.x,G.y],config:Z.droppable}),ee=ZF(H,j),re=b.useMemo(()=>$?J_($):null,[$]),ce=jn(),he=eH(ee,Z.draggable.measure);yH({activeNode:j!=null?H.get(j):null,config:ce.layoutShiftCompensation,initialRect:he,measure:Z.draggable.measure});const pe=g2(ee,Z.draggable.measure,he),Se=g2(ee?ee.parentElement:null),Re=b.useRef({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:A,draggableNodes:H,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ae=B.getNodeFor((n=Re.current.over)==null?void 0:n.id),Ke=uH({measure:Z.dragOverlay.measure}),yt=(r=Ke.nodeRef.current)!=null?r:ee,xt=D?(s=Ke.rect)!=null?s:pe:null,fe=!!(Ke.nodeRef.current&&Ke.rect),Ie=rH(fe?null:pe),De=JM(yt?Xr(yt):null),lt=iH(D?Ae??ee:null),st=lH(lt),nt=bH(y,{transform:{x:G.x-Ie.x,y:G.y-Ie.y,scaleX:1,scaleY:1},activatorEvent:$,active:V,activeNodeRect:pe,containerNodeRect:Se,draggingNodeRect:xt,over:Re.current.over,overlayNodeRect:Ke.rect,scrollableAncestors:lt,scrollableAncestorRects:st,windowRect:De}),rn=re?uc(re,G):null,Ce=sH(lt),Ze=b2(Ce),oe=b2(Ce,[pe]),ve=uc(nt,Ze),Te=xt?TF(xt,nt):null,Me=V&&Te?p({active:V,collisionRect:Te,droppableRects:A,droppableContainers:P,pointerCoordinates:rn}):null,Ge=wF(Me,"id"),[Ct,Je]=b.useState(null),je=fe?nt:uc(nt,oe),We=EF(je,(o=Ct==null?void 0:Ct.rect)!=null?o:null,pe),ut=b.useRef(null),Ue=b.useCallback((Wt,Bt)=>{let{sensor:Pe,options:dt}=Bt;if(F.current==null)return;const gt=H.get(F.current);if(!gt)return;const wt=Wt.nativeEvent,Vt=new Pe({active:F.current,activeNode:gt,event:wt,options:dt,context:Re,onAbort(ft){if(!H.get(ft))return;const{onDragAbort:ke}=X.current,Oe={id:ft};ke==null||ke(Oe),R({type:"onDragAbort",event:Oe})},onPending(ft,pn,ke,Oe){if(!H.get(ft))return;const{onDragPending:ot}=X.current,on={id:ft,constraint:pn,initialCoordinates:ke,offset:Oe};ot==null||ot(on),R({type:"onDragPending",event:on})},onStart(ft){const pn=F.current;if(pn==null)return;const ke=H.get(pn);if(!ke)return;const{onDragStart:Oe}=X.current,St={activatorEvent:wt,active:{id:pn,data:ke.data,rect:I}};qi.unstable_batchedUpdates(()=>{Oe==null||Oe(St),L(Xo.Initializing),k({type:Xn.DragStart,initialCoordinates:ft,active:pn}),R({type:"onDragStart",event:St}),O(ut.current),U(wt)})},onMove(ft){k({type:Xn.DragMove,coordinates:ft})},onEnd:ht(Xn.DragEnd),onCancel:ht(Xn.DragCancel)});ut.current=Vt;function ht(ft){return async function(){const{active:ke,collisions:Oe,over:St,scrollAdjustedTranslate:ot}=Re.current;let on=null;if(ke&&ot){const{cancelDrop:dn}=X.current;on={activatorEvent:wt,active:ke,collisions:Oe,delta:ot,over:St},ft===Xn.DragEnd&&typeof dn=="function"&&await Promise.resolve(dn(on))&&(ft=Xn.DragCancel)}F.current=null,qi.unstable_batchedUpdates(()=>{k({type:ft}),L(Xo.Uninitialized),Je(null),O(null),U(null),ut.current=null;const dn=ft===Xn.DragEnd?"onDragEnd":"onDragCancel";if(on){const Xt=X.current[dn];Xt==null||Xt(on),R({type:dn,event:on})}})}}},[H]),sn=b.useCallback((Wt,Bt)=>(Pe,dt)=>{const gt=Pe.nativeEvent,wt=H.get(dt);if(F.current!==null||!wt||gt.dndKit||gt.defaultPrevented)return;const Vt={active:wt};Wt(Pe,Bt.options,Vt)===!0&&(gt.dndKit={capturedBy:Bt.sensor},F.current=dt,Ue(Pe,Bt))},[H,Ue]),Yt=QF(g,sn);oH(g),ks(()=>{pe&&N===Xo.Initializing&&L(Xo.Initialized)},[pe,N]),b.useEffect(()=>{const{onDragMove:Wt}=X.current,{active:Bt,activatorEvent:Pe,collisions:dt,over:gt}=Re.current;if(!Bt||!Pe)return;const wt={active:Bt,activatorEvent:Pe,collisions:dt,delta:{x:ve.x,y:ve.y},over:gt};qi.unstable_batchedUpdates(()=>{Wt==null||Wt(wt),R({type:"onDragMove",event:wt})})},[ve.x,ve.y]),b.useEffect(()=>{const{active:Wt,activatorEvent:Bt,collisions:Pe,droppableContainers:dt,scrollAdjustedTranslate:gt}=Re.current;if(!Wt||F.current==null||!Bt||!gt)return;const{onDragOver:wt}=X.current,Vt=dt.get(Ge),ht=Vt&&Vt.rect.current?{id:Vt.id,rect:Vt.rect.current,data:Vt.data,disabled:Vt.disabled}:null,ft={active:Wt,activatorEvent:Bt,collisions:Pe,delta:{x:gt.x,y:gt.y},over:ht};qi.unstable_batchedUpdates(()=>{Je(ht),wt==null||wt(ft),R({type:"onDragOver",event:ft})})},[Ge]),ks(()=>{Re.current={activatorEvent:$,active:V,activeNode:ee,collisionRect:Te,collisions:Me,droppableRects:A,draggableNodes:H,draggingNode:yt,draggingNodeRect:xt,droppableContainers:B,over:Ct,scrollableAncestors:lt,scrollAdjustedTranslate:ve},I.current={initial:xt,translated:Te}},[V,ee,Me,Te,H,yt,xt,A,B,Ct,lt,ve]),GF({...ce,delta:G,draggingRect:Te,pointerCoordinates:rn,scrollableAncestors:lt,scrollableAncestorRects:st});const Ye=b.useMemo(()=>({active:V,activeNode:ee,activeNodeRect:pe,activatorEvent:$,collisions:Me,containerNodeRect:Se,dragOverlay:Ke,draggableNodes:H,droppableContainers:B,droppableRects:A,over:Ct,measureDroppableContainers:ie,scrollableAncestors:lt,scrollableAncestorRects:st,measuringConfiguration:Z,measuringScheduled:J,windowRect:De}),[V,ee,pe,$,Me,Se,Ke,H,B,A,Ct,ie,lt,st,Z,J,De]),qt=b.useMemo(()=>({activatorEvent:$,activators:Yt,active:V,activeNodeRect:pe,ariaDescribedById:{draggable:M},dispatch:k,draggableNodes:H,over:Ct,measureDroppableContainers:ie}),[$,Yt,V,pe,k,M,H,Ct,ie]);return xe.createElement(UM.Provider,{value:E},xe.createElement(Pp.Provider,{value:qt},xe.createElement(e5.Provider,{value:Ye},xe.createElement(t5.Provider,{value:We},d)),xe.createElement(vH,{disabled:(u==null?void 0:u.restoreFocus)===!1})),xe.createElement(vF,{...u,hiddenTextDescribedById:M}));function jn(){const Wt=(W==null?void 0:W.autoScrollEnabled)===!1,Bt=typeof h=="object"?h.enabled===!1:h===!1,Pe=D&&!Wt&&!Bt;return typeof h=="object"?{...h,enabled:Pe}:{enabled:Pe}}}),wH=b.createContext(null),y2="button",SH="Draggable";function CH(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const o=Gd(SH),{activators:l,activatorEvent:u,active:h,activeNodeRect:d,ariaDescribedById:g,draggableNodes:p,over:v}=b.useContext(Pp),{role:y=y2,roleDescription:w="draggable",tabIndex:S=0}=s??{},C=(h==null?void 0:h.id)===t,k=b.useContext(C?t5:wH),[R,E]=Fm(),[N,L]=Fm(),D=aH(l,t),j=Sd(n);ks(()=>(p.set(t,{id:t,key:o,node:R,activatorNode:N,data:j}),()=>{const G=p.get(t);G&&G.key===o&&p.delete(t)}),[p,t]);const H=b.useMemo(()=>({role:y,tabIndex:S,"aria-disabled":r,"aria-pressed":C&&y===y2?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,y,S,C,w,g.draggable]);return{active:h,activatorEvent:u,activeNodeRect:d,attributes:H,isDragging:C,listeners:r?void 0:D,node:R,over:v,setNodeRef:E,setActivatorNodeRef:L,transform:k}}function kH(){return b.useContext(e5)}const EH="Droppable",RH={timeout:25};function TH(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const o=Gd(EH),{active:l,dispatch:u,over:h,measureDroppableContainers:d}=b.useContext(Pp),g=b.useRef({disabled:n}),p=b.useRef(!1),v=b.useRef(null),y=b.useRef(null),{disabled:w,updateMeasurementsFor:S,timeout:C}={...RH,...s},k=Sd(S??r),R=b.useCallback(()=>{if(!p.current){p.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),y.current=null},C)},[C]),E=zp({callback:R,disabled:w||!l}),N=b.useCallback((H,G)=>{E&&(G&&(E.unobserve(G),p.current=!1),H&&E.observe(H))},[E]),[L,D]=Fm(N),j=Sd(t);return b.useEffect(()=>{!E||!L.current||(E.disconnect(),p.current=!1,E.observe(L.current))},[L,E]),b.useEffect(()=>(u({type:Xn.RegisterDroppable,element:{id:r,key:o,disabled:n,node:L,rect:v,data:j}}),()=>u({type:Xn.UnregisterDroppable,key:o,id:r})),[r]),b.useEffect(()=>{n!==g.current.disabled&&(u({type:Xn.SetDroppableDisabled,id:r,key:o,disabled:n}),g.current.disabled=n)},[r,o,n,u]),{active:l,rect:v,isOver:(h==null?void 0:h.id)===r,node:L,over:h,setNodeRef:D}}function Bp(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function NH(e,t){return e.reduce((n,r,s)=>{const o=t.get(r);return o&&(n[s]=o),n},Array(e.length))}function Bf(e){return e!==null&&e>=0}function MH(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function AH(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const n5=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const o=Bp(t,r,n),l=t[s],u=o[s];return!u||!l?null:{x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height}},If={scaleX:1,scaleY:1},DH=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:o,overIndex:l}=e;const u=(t=o[n])!=null?t:r;if(!u)return null;if(s===n){const d=o[l];return d?{x:0,y:n<l?d.top+d.height-(u.top+u.height):d.top-u.top,...If}:null}const h=jH(o,s,n);return s>n&&s<=l?{x:0,y:-u.height-h,...If}:s<n&&s>=l?{x:0,y:u.height+h,...If}:{x:0,y:0,...If}};function jH(e,t,n){const r=e[t],s=e[t-1],o=e[t+1];return r?n<t?s?r.top-(s.top+s.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const r5="Sortable",i5=xe.createContext({activeIndex:-1,containerId:r5,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:n5,disabled:{draggable:!1,droppable:!1}});function OH(e){let{children:t,id:n,items:r,strategy:s=n5,disabled:o=!1}=e;const{active:l,dragOverlay:u,droppableRects:h,over:d,measureDroppableContainers:g}=kH(),p=Gd(r5,n),v=u.rect!==null,y=b.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),w=l!=null,S=l?y.indexOf(l.id):-1,C=d?y.indexOf(d.id):-1,k=b.useRef(y),R=!MH(y,k.current),E=C!==-1&&S===-1||R,N=AH(o);ks(()=>{R&&w&&g(y)},[R,y,w,g]),b.useEffect(()=>{k.current=y},[y]);const L=b.useMemo(()=>({activeIndex:S,containerId:p,disabled:N,disableTransforms:E,items:y,overIndex:C,useDragOverlay:v,sortedRects:NH(y,h),strategy:s}),[S,p,N.draggable,N.droppable,E,y,C,h,v,s]);return xe.createElement(i5.Provider,{value:L},t)}const LH=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Bp(n,r,s).indexOf(t)},zH=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:o,newIndex:l,previousItems:u,previousContainerId:h,transition:d}=e;return!d||!r||u!==o&&s===l?!1:n?!0:l!==s&&t===h},PH={duration:200,easing:"ease"},s5="transform",BH=Cd.Transition.toString({property:s5,duration:0,easing:"linear"}),IH={roleDescription:"sortable"};function FH(e){let{disabled:t,index:n,node:r,rect:s}=e;const[o,l]=b.useState(null),u=b.useRef(n);return ks(()=>{if(!t&&n!==u.current&&r.current){const h=s.current;if(h){const d=Dc(r.current,{ignoreTransform:!0}),g={x:h.left-d.left,y:h.top-d.top,scaleX:h.width/d.width,scaleY:h.height/d.height};(g.x||g.y)&&l(g)}}n!==u.current&&(u.current=n)},[t,n,r,s]),b.useEffect(()=>{o&&l(null)},[o]),o}function HH(e){let{animateLayoutChanges:t=zH,attributes:n,disabled:r,data:s,getNewIndex:o=LH,id:l,strategy:u,resizeObserverConfig:h,transition:d=PH}=e;const{items:g,containerId:p,activeIndex:v,disabled:y,disableTransforms:w,sortedRects:S,overIndex:C,useDragOverlay:k,strategy:R}=b.useContext(i5),E=UH(r,y),N=g.indexOf(l),L=b.useMemo(()=>({sortable:{containerId:p,index:N,items:g},...s}),[p,s,N,g]),D=b.useMemo(()=>g.slice(g.indexOf(l)),[g,l]),{rect:j,node:H,isOver:G,setNodeRef:B}=TH({id:l,data:L,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...h}}),{active:q,activatorEvent:I,activeNodeRect:V,attributes:F,setNodeRef:W,listeners:O,isDragging:$,over:U,setActivatorNodeRef:X,transform:M}=CH({id:l,data:L,attributes:{...IH,...n},disabled:E.draggable}),P=iF(B,W),Z=!!q,A=Z&&!w&&Bf(v)&&Bf(C),ie=!k&&$,J=ie&&A?M:null,re=A?J??(u??R)({rects:S,activeNodeRect:V,activeIndex:v,overIndex:C,index:N}):null,ce=Bf(v)&&Bf(C)?o({id:l,items:g,activeIndex:v,overIndex:C}):N,he=q==null?void 0:q.id,pe=b.useRef({activeId:he,items:g,newIndex:ce,containerId:p}),Se=g!==pe.current.items,Re=t({active:q,containerId:p,isDragging:$,isSorting:Z,id:l,index:N,items:g,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:d,wasDragging:pe.current.activeId!=null}),Ae=FH({disabled:!Re,index:N,node:H,rect:j});return b.useEffect(()=>{Z&&pe.current.newIndex!==ce&&(pe.current.newIndex=ce),p!==pe.current.containerId&&(pe.current.containerId=p),g!==pe.current.items&&(pe.current.items=g)},[Z,ce,p,g]),b.useEffect(()=>{if(he===pe.current.activeId)return;if(he!=null&&pe.current.activeId==null){pe.current.activeId=he;return}const yt=setTimeout(()=>{pe.current.activeId=he},50);return()=>clearTimeout(yt)},[he]),{active:q,activeIndex:v,attributes:F,data:L,rect:j,index:N,newIndex:ce,items:g,isOver:G,isSorting:Z,isDragging:$,listeners:O,node:H,overIndex:C,over:U,setNodeRef:P,setActivatorNodeRef:X,setDroppableNodeRef:B,setDraggableNodeRef:W,transform:Ae??re,transition:Ke()};function Ke(){if(Ae||Se&&pe.current.newIndex===N)return BH;if(!(ie&&!i0(I)||!d)&&(Z||Re))return Cd.Transition.toString({...d,property:s5})}}function UH(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}Ut.Down,Ut.Right,Ut.Up,Ut.Left;const x2={idea:"border-amber-500/30 bg-amber-500/15 text-amber-700 dark:border-amber-500/40 dark:bg-amber-500/12 dark:text-amber-200",todo:"border-sky-500/30 bg-sky-500/15 text-sky-700 dark:border-sky-500/40 dark:bg-sky-500/12 dark:text-sky-200",progress:"border-indigo-500/30 bg-indigo-500/15 text-indigo-700 dark:border-indigo-500/40 dark:bg-indigo-500/12 dark:text-indigo-200",testing:"border-cyan-500/30 bg-cyan-500/15 text-cyan-700 dark:border-cyan-500/40 dark:bg-cyan-500/12 dark:text-cyan-200",done:"border-emerald-500/30 bg-emerald-500/15 text-emerald-700 dark:border-emerald-500/40 dark:bg-emerald-500/12 dark:text-emerald-200"};function w2(e,[t,n]){return Math.min(n,Math.max(t,e))}function u0(e){const t=e+"CollectionProvider",[n,r]=lo(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:k}=S,R=xe.useRef(null),E=xe.useRef(new Map).current;return f.jsx(s,{scope:C,itemMap:E,collectionRef:R,children:k})};l.displayName=t;const u=e+"CollectionSlot",h=qa(u),d=xe.forwardRef((S,C)=>{const{scope:k,children:R}=S,E=o(u,k),N=$t(C,E.collectionRef);return f.jsx(h,{ref:N,children:R})});d.displayName=u;const g=e+"CollectionItemSlot",p="data-radix-collection-item",v=qa(g),y=xe.forwardRef((S,C)=>{const{scope:k,children:R,...E}=S,N=xe.useRef(null),L=$t(C,N),D=o(g,k);return xe.useEffect(()=>(D.itemMap.set(N,{ref:N,...E}),()=>void D.itemMap.delete(N))),f.jsx(v,{[p]:"",ref:L,children:R})});y.displayName=g;function w(S){const C=o(e+"CollectionConsumer",S);return xe.useCallback(()=>{const R=C.collectionRef.current;if(!R)return[];const E=Array.from(R.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((D,j)=>E.indexOf(D.ref.current)-E.indexOf(j.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:d,ItemSlot:y},w,r]}var $H=b.createContext(void 0);function d0(e){const t=b.useContext($H);return e||t||"ltr"}function WH(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var VH=[" ","Enter","ArrowUp","ArrowDown"],qH=[" ","Enter"],Ya="Select",[Ip,Fp,KH]=u0(Ya),[jc,Ire]=lo(Ya,[KH,oa]),Hp=oa(),[GH,la]=jc(Ya),[YH,XH]=jc(Ya),o5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:l,defaultValue:u,onValueChange:h,dir:d,name:g,autoComplete:p,disabled:v,required:y,form:w}=e,S=Hp(t),[C,k]=b.useState(null),[R,E]=b.useState(null),[N,L]=b.useState(!1),D=d0(d),[j,H]=mc({prop:r,defaultProp:s??!1,onChange:o,caller:Ya}),[G,B]=mc({prop:l,defaultProp:u,onChange:h,caller:Ya}),q=b.useRef(null),I=C?w||!!C.closest("form"):!0,[V,F]=b.useState(new Set),W=Array.from(V).map(O=>O.props.value).join(";");return f.jsx(Rp,{...S,children:f.jsxs(GH,{required:y,scope:t,trigger:C,onTriggerChange:k,valueNode:R,onValueNodeChange:E,valueNodeHasChildren:N,onValueNodeHasChildrenChange:L,contentId:to(),value:G,onValueChange:B,open:j,onOpenChange:H,dir:D,triggerPointerDownPosRef:q,disabled:v,children:[f.jsx(Ip.Provider,{scope:t,children:f.jsx(YH,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(O=>{F($=>new Set($).add(O))},[]),onNativeOptionRemove:b.useCallback(O=>{F($=>{const U=new Set($);return U.delete(O),U})},[]),children:n})}),I?f.jsxs(A5,{"aria-hidden":!0,required:y,tabIndex:-1,name:g,autoComplete:p,value:G,onChange:O=>B(O.target.value),disabled:v,form:w,children:[G===void 0?f.jsx("option",{value:""}):null,Array.from(V)]},W):null]})})};o5.displayName=Ya;var a5="SelectTrigger",l5=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Hp(n),l=la(a5,n),u=l.disabled||r,h=$t(t,l.onTriggerChange),d=Fp(n),g=b.useRef("touch"),[p,v,y]=j5(S=>{const C=d().filter(E=>!E.disabled),k=C.find(E=>E.value===l.value),R=O5(C,S,k);R!==void 0&&l.onValueChange(R.value)}),w=S=>{u||(l.onOpenChange(!0),y()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return f.jsx($d,{asChild:!0,...o,children:f.jsx(Tt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":D5(l.value)?"":void 0,...s,ref:h,onClick:Be(s.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&w(S)}),onPointerDown:Be(s.onPointerDown,S=>{g.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(w(S),S.preventDefault())}),onKeyDown:Be(s.onKeyDown,S=>{const C=p.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&v(S.key),!(C&&S.key===" ")&&VH.includes(S.key)&&(w(),S.preventDefault())})})})});l5.displayName=a5;var c5="SelectValue",u5=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:l="",...u}=e,h=la(c5,n),{onValueNodeHasChildrenChange:d}=h,g=o!==void 0,p=$t(t,h.onValueNodeChange);return Rr(()=>{d(g)},[d,g]),f.jsx(Tt.span,{...u,ref:p,style:{pointerEvents:"none"},children:D5(h.value)?f.jsx(f.Fragment,{children:l}):o})});u5.displayName=c5;var ZH="SelectIcon",d5=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return f.jsx(Tt.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});d5.displayName=ZH;var QH="SelectPortal",h5=e=>f.jsx(Ec,{asChild:!0,...e});h5.displayName=QH;var Xa="SelectContent",f5=b.forwardRef((e,t)=>{const n=la(Xa,e.__scopeSelect),[r,s]=b.useState();if(Rr(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?qi.createPortal(f.jsx(m5,{scope:e.__scopeSelect,children:f.jsx(Ip.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),o):null}return f.jsx(p5,{...e,ref:t})});f5.displayName=Xa;var Vi=10,[m5,ca]=jc(Xa),JH="SelectContentImpl",eU=qa("SelectContent.RemoveScroll"),p5=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:h,align:d,alignOffset:g,arrowPadding:p,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:S,avoidCollisions:C,...k}=e,R=la(Xa,n),[E,N]=b.useState(null),[L,D]=b.useState(null),j=$t(t,re=>N(re)),[H,G]=b.useState(null),[B,q]=b.useState(null),I=Fp(n),[V,F]=b.useState(!1),W=b.useRef(!1);b.useEffect(()=>{if(E)return gp(E)},[E]),mp();const O=b.useCallback(re=>{const[ce,...he]=I().map(Re=>Re.ref.current),[pe]=he.slice(-1),Se=document.activeElement;for(const Re of re)if(Re===Se||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===ce&&L&&(L.scrollTop=0),Re===pe&&L&&(L.scrollTop=L.scrollHeight),Re==null||Re.focus(),document.activeElement!==Se))return},[I,L]),$=b.useCallback(()=>O([H,E]),[O,H,E]);b.useEffect(()=>{V&&$()},[V,$]);const{onOpenChange:U,triggerPointerDownPosRef:X}=R;b.useEffect(()=>{if(E){let re={x:0,y:0};const ce=pe=>{var Se,Re;re={x:Math.abs(Math.round(pe.pageX)-(((Se=X.current)==null?void 0:Se.x)??0)),y:Math.abs(Math.round(pe.pageY)-(((Re=X.current)==null?void 0:Re.y)??0))}},he=pe=>{re.x<=10&&re.y<=10?pe.preventDefault():E.contains(pe.target)||U(!1),document.removeEventListener("pointermove",ce),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",he,{capture:!0})}}},[E,U,X]),b.useEffect(()=>{const re=()=>U(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[U]);const[M,P]=j5(re=>{const ce=I().filter(Se=>!Se.disabled),he=ce.find(Se=>Se.ref.current===document.activeElement),pe=O5(ce,re,he);pe&&setTimeout(()=>pe.ref.current.focus())}),Z=b.useCallback((re,ce,he)=>{const pe=!W.current&&!he;(R.value!==void 0&&R.value===ce||pe)&&(G(re),pe&&(W.current=!0))},[R.value]),A=b.useCallback(()=>E==null?void 0:E.focus(),[E]),ie=b.useCallback((re,ce,he)=>{const pe=!W.current&&!he;(R.value!==void 0&&R.value===ce||pe)&&q(re)},[R.value]),J=r==="popper"?ry:g5,ee=J===ry?{side:u,sideOffset:h,align:d,alignOffset:g,arrowPadding:p,collisionBoundary:v,collisionPadding:y,sticky:w,hideWhenDetached:S,avoidCollisions:C}:{};return f.jsx(m5,{scope:n,content:E,viewport:L,onViewportChange:D,itemRefCallback:Z,selectedItem:H,onItemLeave:A,itemTextRefCallback:ie,focusSelectedItem:$,selectedItemText:B,position:r,isPositioned:V,searchRef:M,children:f.jsx(Bd,{as:eU,allowPinchZoom:!0,children:f.jsx(Pd,{asChild:!0,trapped:R.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Be(s,re=>{var ce;(ce=R.trigger)==null||ce.focus({preventScroll:!0}),re.preventDefault()}),children:f.jsx(kc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:f.jsx(J,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:re=>re.preventDefault(),...k,...ee,onPlaced:()=>F(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Be(k.onKeyDown,re=>{const ce=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!ce&&re.key.length===1&&P(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let pe=I().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(re.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const Se=re.target,Re=pe.indexOf(Se);pe=pe.slice(Re+1)}setTimeout(()=>O(pe)),re.preventDefault()}})})})})})})});p5.displayName=JH;var tU="SelectItemAlignedPosition",g5=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=la(Xa,n),l=ca(Xa,n),[u,h]=b.useState(null),[d,g]=b.useState(null),p=$t(t,j=>g(j)),v=Fp(n),y=b.useRef(!1),w=b.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:k,focusSelectedItem:R}=l,E=b.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&S&&C&&k){const j=o.trigger.getBoundingClientRect(),H=d.getBoundingClientRect(),G=o.valueNode.getBoundingClientRect(),B=k.getBoundingClientRect();if(o.dir!=="rtl"){const Se=B.left-H.left,Re=G.left-Se,Ae=j.left-Re,Ke=j.width+Ae,yt=Math.max(Ke,H.width),xt=window.innerWidth-Vi,fe=w2(Re,[Vi,Math.max(Vi,xt-yt)]);u.style.minWidth=Ke+"px",u.style.left=fe+"px"}else{const Se=H.right-B.right,Re=window.innerWidth-G.right-Se,Ae=window.innerWidth-j.right-Re,Ke=j.width+Ae,yt=Math.max(Ke,H.width),xt=window.innerWidth-Vi,fe=w2(Re,[Vi,Math.max(Vi,xt-yt)]);u.style.minWidth=Ke+"px",u.style.right=fe+"px"}const q=v(),I=window.innerHeight-Vi*2,V=S.scrollHeight,F=window.getComputedStyle(d),W=parseInt(F.borderTopWidth,10),O=parseInt(F.paddingTop,10),$=parseInt(F.borderBottomWidth,10),U=parseInt(F.paddingBottom,10),X=W+O+V+U+$,M=Math.min(C.offsetHeight*5,X),P=window.getComputedStyle(S),Z=parseInt(P.paddingTop,10),A=parseInt(P.paddingBottom,10),ie=j.top+j.height/2-Vi,J=I-ie,ee=C.offsetHeight/2,re=C.offsetTop+ee,ce=W+O+re,he=X-ce;if(ce<=ie){const Se=q.length>0&&C===q[q.length-1].ref.current;u.style.bottom="0px";const Re=d.clientHeight-S.offsetTop-S.offsetHeight,Ae=Math.max(J,ee+(Se?A:0)+Re+$),Ke=ce+Ae;u.style.height=Ke+"px"}else{const Se=q.length>0&&C===q[0].ref.current;u.style.top="0px";const Ae=Math.max(ie,W+S.offsetTop+(Se?Z:0)+ee)+he;u.style.height=Ae+"px",S.scrollTop=ce-ie+S.offsetTop}u.style.margin=`${Vi}px 0`,u.style.minHeight=M+"px",u.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[v,o.trigger,o.valueNode,u,d,S,C,k,o.dir,r]);Rr(()=>E(),[E]);const[N,L]=b.useState();Rr(()=>{d&&L(window.getComputedStyle(d).zIndex)},[d]);const D=b.useCallback(j=>{j&&w.current===!0&&(E(),R==null||R(),w.current=!1)},[E,R]);return f.jsx(rU,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:y,onScrollButtonChange:D,children:f.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:f.jsx(Tt.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});g5.displayName=tU;var nU="SelectPopperPosition",ry=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Vi,...o}=e,l=Hp(n);return f.jsx(Tp,{...l,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});ry.displayName=nU;var[rU,h0]=jc(Xa,{}),iy="SelectViewport",v5=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=ca(iy,n),l=h0(iy,n),u=$t(t,o.onViewportChange),h=b.useRef(0);return f.jsxs(f.Fragment,{children:[f.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:r}),f.jsx(Ip.Slot,{scope:n,children:f.jsx(Tt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Be(s.onScroll,d=>{const g=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:v}=l;if(v!=null&&v.current&&p){const y=Math.abs(h.current-g.scrollTop);if(y>0){const w=window.innerHeight-Vi*2,S=parseFloat(p.style.minHeight),C=parseFloat(p.style.height),k=Math.max(S,C);if(k<w){const R=k+y,E=Math.min(w,R),N=R-E;p.style.height=E+"px",p.style.bottom==="0px"&&(g.scrollTop=N>0?N:0,p.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})});v5.displayName=iy;var b5="SelectGroup",[iU,sU]=jc(b5),_5=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=to();return f.jsx(iU,{scope:n,id:s,children:f.jsx(Tt.div,{role:"group","aria-labelledby":s,...r,ref:t})})});_5.displayName=b5;var y5="SelectLabel",x5=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=sU(y5,n);return f.jsx(Tt.div,{id:s.id,...r,ref:t})});x5.displayName=y5;var Wm="SelectItem",[oU,w5]=jc(Wm),S5=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...l}=e,u=la(Wm,n),h=ca(Wm,n),d=u.value===r,[g,p]=b.useState(o??""),[v,y]=b.useState(!1),w=$t(t,R=>{var E;return(E=h.itemRefCallback)==null?void 0:E.call(h,R,r,s)}),S=to(),C=b.useRef("touch"),k=()=>{s||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(oU,{scope:n,value:r,disabled:s,textId:S,isSelected:d,onItemTextChange:b.useCallback(R=>{p(E=>E||((R==null?void 0:R.textContent)??"").trim())},[]),children:f.jsx(Ip.ItemSlot,{scope:n,value:r,disabled:s,textValue:g,children:f.jsx(Tt.div,{role:"option","aria-labelledby":S,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:w,onFocus:Be(l.onFocus,()=>y(!0)),onBlur:Be(l.onBlur,()=>y(!1)),onClick:Be(l.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Be(l.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Be(l.onPointerDown,R=>{C.current=R.pointerType}),onPointerMove:Be(l.onPointerMove,R=>{var E;C.current=R.pointerType,s?(E=h.onItemLeave)==null||E.call(h):C.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Be(l.onPointerLeave,R=>{var E;R.currentTarget===document.activeElement&&((E=h.onItemLeave)==null||E.call(h))}),onKeyDown:Be(l.onKeyDown,R=>{var N;((N=h.searchRef)==null?void 0:N.current)!==""&&R.key===" "||(qH.includes(R.key)&&k(),R.key===" "&&R.preventDefault())})})})})});S5.displayName=Wm;var Yu="SelectItemText",C5=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,l=la(Yu,n),u=ca(Yu,n),h=w5(Yu,n),d=XH(Yu,n),[g,p]=b.useState(null),v=$t(t,k=>p(k),h.onItemTextChange,k=>{var R;return(R=u.itemTextRefCallback)==null?void 0:R.call(u,k,h.value,h.disabled)}),y=g==null?void 0:g.textContent,w=b.useMemo(()=>f.jsx("option",{value:h.value,disabled:h.disabled,children:y},h.value),[h.disabled,h.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=d;return Rr(()=>(S(w),()=>C(w)),[S,C,w]),f.jsxs(f.Fragment,{children:[f.jsx(Tt.span,{id:h.textId,...o,ref:v}),h.isSelected&&l.valueNode&&!l.valueNodeHasChildren?qi.createPortal(o.children,l.valueNode):null]})});C5.displayName=Yu;var k5="SelectItemIndicator",E5=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w5(k5,n).isSelected?f.jsx(Tt.span,{"aria-hidden":!0,...r,ref:t}):null});E5.displayName=k5;var sy="SelectScrollUpButton",R5=b.forwardRef((e,t)=>{const n=ca(sy,e.__scopeSelect),r=h0(sy,e.__scopeSelect),[s,o]=b.useState(!1),l=$t(t,r.onScrollButtonChange);return Rr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollTop>0;o(d)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?f.jsx(N5,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop-h.offsetHeight)}}):null});R5.displayName=sy;var oy="SelectScrollDownButton",T5=b.forwardRef((e,t)=>{const n=ca(oy,e.__scopeSelect),r=h0(oy,e.__scopeSelect),[s,o]=b.useState(!1),l=$t(t,r.onScrollButtonChange);return Rr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollHeight-h.clientHeight,g=Math.ceil(h.scrollTop)<d;o(g)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?f.jsx(N5,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop+h.offsetHeight)}}):null});T5.displayName=oy;var N5=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=ca("SelectScrollButton",n),l=b.useRef(null),u=Fp(n),h=b.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return b.useEffect(()=>()=>h(),[h]),Rr(()=>{var g;const d=u().find(p=>p.ref.current===document.activeElement);(g=d==null?void 0:d.ref.current)==null||g.scrollIntoView({block:"nearest"})},[u]),f.jsx(Tt.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Be(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Be(s.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Be(s.onPointerLeave,()=>{h()})})}),aU="SelectSeparator",M5=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(Tt.div,{"aria-hidden":!0,...r,ref:t})});M5.displayName=aU;var ay="SelectArrow",lU=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Hp(n),o=la(ay,n),l=ca(ay,n);return o.open&&l.position==="popper"?f.jsx(Np,{...s,...r,ref:t}):null});lU.displayName=ay;var cU="SelectBubbleInput",A5=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=b.useRef(null),o=$t(r,s),l=WH(t);return b.useEffect(()=>{const u=s.current;if(!u)return;const h=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(h,"value").set;if(l!==t&&g){const p=new Event("change",{bubbles:!0});g.call(u,t),u.dispatchEvent(p)}},[l,t]),f.jsx(Tt.select,{...n,style:{...oM,...n.style},ref:o,defaultValue:t})});A5.displayName=cU;function D5(e){return e===""||e===void 0}function j5(e){const t=Yi(e),n=b.useRef(""),r=b.useRef(0),s=b.useCallback(l=>{const u=n.current+l;t(u),function h(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>h(""),1e3))}(u)},[t]),o=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function O5(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=uU(e,Math.max(o,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function uU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dU=o5,L5=l5,hU=u5,fU=d5,mU=h5,z5=f5,pU=v5,gU=_5,P5=x5,f0=S5,B5=C5,I5=E5,F5=R5,H5=T5,U5=M5;const gr=dU,Bb=gU,wr=hU,Jn=b.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(L5,{ref:r,className:me("flex h-9 w-full items-center justify-between gap-2 rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none transition-colors","placeholder:text-muted-foreground","focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:line-clamp-1",e),...n,children:[t,f.jsx(fU,{asChild:!0,children:f.jsx(bp,{className:"h-4 w-4 shrink-0 opacity-50"})})]}));Jn.displayName=L5.displayName;const $5=b.forwardRef(({className:e,...t},n)=>f.jsx(F5,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(UI,{className:"h-4 w-4"})}));$5.displayName=F5.displayName;const W5=b.forwardRef(({className:e,...t},n)=>f.jsx(H5,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(bp,{className:"h-4 w-4"})}));W5.displayName=H5.displayName;const er=b.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>f.jsx(mU,{children:f.jsxs(z5,{ref:s,className:me("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-background text-foreground shadow-md backdrop-blur-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[f.jsx($5,{}),f.jsx(pU,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(W5,{})]})}));er.displayName=z5.displayName;const vU=b.forwardRef(({className:e,...t},n)=>f.jsx(P5,{ref:n,className:me("px-2 py-1.5 text-sm font-semibold",e),...t}));vU.displayName=P5.displayName;const Lt=b.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(f0,{ref:r,className:me("relative flex w-full cursor-default select-none items-center rounded-md py-1.5 pl-2 pr-8 text-sm outline-none","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[f.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(I5,{children:f.jsx(Xi,{className:"h-4 w-4"})})}),f.jsx(B5,{children:t})]}));Lt.displayName=f0.displayName;const fm=b.forwardRef(({className:e,children:t,thumbnail:n,thumbnailAlt:r="",...s},o)=>f.jsxs(f0,{ref:o,className:me("flex w-full cursor-default select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-2 text-sm outline-none","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[f.jsx("div",{className:"min-w-0 flex-1 truncate",children:f.jsx(B5,{children:t})}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[n?f.jsx("img",{src:n,alt:r,className:"h-5 w-9 rounded object-cover opacity-90"}):null,f.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(I5,{children:f.jsx(Xi,{className:"h-4 w-4"})})})]})]}));fm.displayName="SelectItemWithThumbnail";const bU=b.forwardRef(({className:e,...t},n)=>f.jsx(U5,{ref:n,className:me("-mx-1 my-1 h-px bg-border",e),...t}));bU.displayName=U5.displayName;var Ib="rovingFocusGroup.onEntryFocus",_U={bubbles:!1,cancelable:!0},Yd="RovingFocusGroup",[ly,V5,yU]=u0(Yd),[xU,q5]=lo(Yd,[yU]),[wU,SU]=xU(Yd),K5=b.forwardRef((e,t)=>f.jsx(ly.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(ly.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(CU,{...e,ref:t})})}));K5.displayName=Yd;var CU=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:g=!1,...p}=e,v=b.useRef(null),y=$t(t,v),w=d0(o),[S,C]=mc({prop:l,defaultProp:u??null,onChange:h,caller:Yd}),[k,R]=b.useState(!1),E=Yi(d),N=V5(n),L=b.useRef(!1),[D,j]=b.useState(0);return b.useEffect(()=>{const H=v.current;if(H)return H.addEventListener(Ib,E),()=>H.removeEventListener(Ib,E)},[E]),f.jsx(wU,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:S,onItemFocus:b.useCallback(H=>C(H),[C]),onItemShiftTab:b.useCallback(()=>R(!0),[]),onFocusableItemAdd:b.useCallback(()=>j(H=>H+1),[]),onFocusableItemRemove:b.useCallback(()=>j(H=>H-1),[]),children:f.jsx(Tt.div,{tabIndex:k||D===0?-1:0,"data-orientation":r,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:Be(e.onMouseDown,()=>{L.current=!0}),onFocus:Be(e.onFocus,H=>{const G=!L.current;if(H.target===H.currentTarget&&G&&!k){const B=new CustomEvent(Ib,_U);if(H.currentTarget.dispatchEvent(B),!B.defaultPrevented){const q=N().filter(O=>O.focusable),I=q.find(O=>O.active),V=q.find(O=>O.id===S),W=[I,V,...q].filter(Boolean).map(O=>O.ref.current);X5(W,g)}}L.current=!1}),onBlur:Be(e.onBlur,()=>R(!1))})})}),G5="RovingFocusGroupItem",Y5=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...u}=e,h=to(),d=o||h,g=SU(G5,n),p=g.currentTabStopId===d,v=V5(n),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:S}=g;return b.useEffect(()=>{if(r)return y(),()=>w()},[r,y,w]),f.jsx(ly.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:f.jsx(Tt.span,{tabIndex:p?0:-1,"data-orientation":g.orientation,...u,ref:t,onMouseDown:Be(e.onMouseDown,C=>{r?g.onItemFocus(d):C.preventDefault()}),onFocus:Be(e.onFocus,()=>g.onItemFocus(d)),onKeyDown:Be(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){g.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=RU(C,g.orientation,g.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let E=v().filter(N=>N.focusable).map(N=>N.ref.current);if(k==="last")E.reverse();else if(k==="prev"||k==="next"){k==="prev"&&E.reverse();const N=E.indexOf(C.currentTarget);E=g.loop?TU(E,N+1):E.slice(N+1)}setTimeout(()=>X5(E))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:S!=null}):l})})});Y5.displayName=G5;var kU={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function EU(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function RU(e,t,n){const r=EU(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return kU[r]}function X5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function TU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var NU=K5,MU=Y5,cy=["Enter"," "],AU=["ArrowDown","PageUp","Home"],Z5=["ArrowUp","PageDown","End"],DU=[...AU,...Z5],jU={ltr:[...cy,"ArrowRight"],rtl:[...cy,"ArrowLeft"]},OU={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Xd="Menu",[Ed,LU,zU]=u0(Xd),[sl,Q5]=lo(Xd,[zU,oa,q5]),Up=oa(),J5=q5(),[PU,ol]=sl(Xd),[BU,Zd]=sl(Xd),eA=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:l=!0}=e,u=Up(t),[h,d]=b.useState(null),g=b.useRef(!1),p=Yi(o),v=d0(s);return b.useEffect(()=>{const y=()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>g.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),f.jsx(Rp,{...u,children:f.jsx(PU,{scope:t,open:n,onOpenChange:p,content:h,onContentChange:d,children:f.jsx(BU,{scope:t,onClose:b.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:g,dir:v,modal:l,children:r})})})};eA.displayName=Xd;var IU="MenuAnchor",m0=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Up(n);return f.jsx($d,{...s,...r,ref:t})});m0.displayName=IU;var p0="MenuPortal",[FU,tA]=sl(p0,{forceMount:void 0}),nA=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=ol(p0,t);return f.jsx(FU,{scope:t,forceMount:n,children:f.jsx(Bi,{present:n||o.open,children:f.jsx(Ec,{asChild:!0,container:s,children:r})})})};nA.displayName=p0;var ji="MenuContent",[HU,g0]=sl(ji),rA=b.forwardRef((e,t)=>{const n=tA(ji,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ol(ji,e.__scopeMenu),l=Zd(ji,e.__scopeMenu);return f.jsx(Ed.Provider,{scope:e.__scopeMenu,children:f.jsx(Bi,{present:r||o.open,children:f.jsx(Ed.Slot,{scope:e.__scopeMenu,children:l.modal?f.jsx(UU,{...s,ref:t}):f.jsx($U,{...s,ref:t})})})})}),UU=b.forwardRef((e,t)=>{const n=ol(ji,e.__scopeMenu),r=b.useRef(null),s=$t(t,r);return b.useEffect(()=>{const o=r.current;if(o)return gp(o)},[]),f.jsx(v0,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Be(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$U=b.forwardRef((e,t)=>{const n=ol(ji,e.__scopeMenu);return f.jsx(v0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),WU=qa("MenuContent.ScrollLock"),v0=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:h,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:p,onInteractOutside:v,onDismiss:y,disableOutsideScroll:w,...S}=e,C=ol(ji,n),k=Zd(ji,n),R=Up(n),E=J5(n),N=LU(n),[L,D]=b.useState(null),j=b.useRef(null),H=$t(t,j,C.onContentChange),G=b.useRef(0),B=b.useRef(""),q=b.useRef(0),I=b.useRef(null),V=b.useRef("right"),F=b.useRef(0),W=w?Bd:b.Fragment,O=w?{as:WU,allowPinchZoom:!0}:void 0,$=X=>{var re,ce;const M=B.current+X,P=N().filter(he=>!he.disabled),Z=document.activeElement,A=(re=P.find(he=>he.ref.current===Z))==null?void 0:re.textValue,ie=P.map(he=>he.textValue),J=n$(ie,M,A),ee=(ce=P.find(he=>he.textValue===J))==null?void 0:ce.ref.current;(function he(pe){B.current=pe,window.clearTimeout(G.current),pe!==""&&(G.current=window.setTimeout(()=>he(""),1e3))})(M),ee&&setTimeout(()=>ee.focus())};b.useEffect(()=>()=>window.clearTimeout(G.current),[]),mp();const U=b.useCallback(X=>{var P,Z;return V.current===((P=I.current)==null?void 0:P.side)&&i$(X,(Z=I.current)==null?void 0:Z.area)},[]);return f.jsx(HU,{scope:n,searchRef:B,onItemEnter:b.useCallback(X=>{U(X)&&X.preventDefault()},[U]),onItemLeave:b.useCallback(X=>{var M;U(X)||((M=j.current)==null||M.focus(),D(null))},[U]),onTriggerLeave:b.useCallback(X=>{U(X)&&X.preventDefault()},[U]),pointerGraceTimerRef:q,onPointerGraceIntentChange:b.useCallback(X=>{I.current=X},[]),children:f.jsx(W,{...O,children:f.jsx(Pd,{asChild:!0,trapped:s,onMountAutoFocus:Be(o,X=>{var M;X.preventDefault(),(M=j.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:f.jsx(kc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:p,onInteractOutside:v,onDismiss:y,children:f.jsx(NU,{asChild:!0,...E,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:L,onCurrentTabStopIdChange:D,onEntryFocus:Be(h,X=>{k.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(Tp,{role:"menu","aria-orientation":"vertical","data-state":_A(C.open),"data-radix-menu-content":"",dir:k.dir,...R,...S,ref:H,style:{outline:"none",...S.style},onKeyDown:Be(S.onKeyDown,X=>{const P=X.target.closest("[data-radix-menu-content]")===X.currentTarget,Z=X.ctrlKey||X.altKey||X.metaKey,A=X.key.length===1;P&&(X.key==="Tab"&&X.preventDefault(),!Z&&A&&$(X.key));const ie=j.current;if(X.target!==ie||!DU.includes(X.key))return;X.preventDefault();const ee=N().filter(re=>!re.disabled).map(re=>re.ref.current);Z5.includes(X.key)&&ee.reverse(),e$(ee)}),onBlur:Be(e.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(G.current),B.current="")}),onPointerMove:Be(e.onPointerMove,Rd(X=>{const M=X.target,P=F.current!==X.clientX;if(X.currentTarget.contains(M)&&P){const Z=X.clientX>F.current?"right":"left";V.current=Z,F.current=X.clientX}}))})})})})})})});rA.displayName=ji;var VU="MenuGroup",b0=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Tt.div,{role:"group",...r,ref:t})});b0.displayName=VU;var qU="MenuLabel",iA=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Tt.div,{...r,ref:t})});iA.displayName=qU;var Vm="MenuItem",S2="menu.itemSelect",$p=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=b.useRef(null),l=Zd(Vm,e.__scopeMenu),u=g0(Vm,e.__scopeMenu),h=$t(t,o),d=b.useRef(!1),g=()=>{const p=o.current;if(!n&&p){const v=new CustomEvent(S2,{bubbles:!0,cancelable:!0});p.addEventListener(S2,y=>r==null?void 0:r(y),{once:!0}),ZT(p,v),v.defaultPrevented?d.current=!1:l.onClose()}};return f.jsx(sA,{...s,ref:h,disabled:n,onClick:Be(e.onClick,g),onPointerDown:p=>{var v;(v=e.onPointerDown)==null||v.call(e,p),d.current=!0},onPointerUp:Be(e.onPointerUp,p=>{var v;d.current||(v=p.currentTarget)==null||v.click()}),onKeyDown:Be(e.onKeyDown,p=>{const v=u.searchRef.current!=="";n||v&&p.key===" "||cy.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});$p.displayName=Vm;var sA=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,l=g0(Vm,n),u=J5(n),h=b.useRef(null),d=$t(t,h),[g,p]=b.useState(!1),[v,y]=b.useState("");return b.useEffect(()=>{const w=h.current;w&&y((w.textContent??"").trim())},[o.children]),f.jsx(Ed.ItemSlot,{scope:n,disabled:r,textValue:s??v,children:f.jsx(MU,{asChild:!0,...u,focusable:!r,children:f.jsx(Tt.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:d,onPointerMove:Be(e.onPointerMove,Rd(w=>{r?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Be(e.onPointerLeave,Rd(w=>l.onItemLeave(w))),onFocus:Be(e.onFocus,()=>p(!0)),onBlur:Be(e.onBlur,()=>p(!1))})})})}),KU="MenuCheckboxItem",oA=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return f.jsx(dA,{scope:e.__scopeMenu,checked:n,children:f.jsx($p,{role:"menuitemcheckbox","aria-checked":qm(n)?"mixed":n,...s,ref:t,"data-state":y0(n),onSelect:Be(s.onSelect,()=>r==null?void 0:r(qm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});oA.displayName=KU;var aA="MenuRadioGroup",[GU,YU]=sl(aA,{value:void 0,onValueChange:()=>{}}),lA=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=Yi(r);return f.jsx(GU,{scope:e.__scopeMenu,value:n,onValueChange:o,children:f.jsx(b0,{...s,ref:t})})});lA.displayName=aA;var cA="MenuRadioItem",uA=b.forwardRef((e,t)=>{const{value:n,...r}=e,s=YU(cA,e.__scopeMenu),o=n===s.value;return f.jsx(dA,{scope:e.__scopeMenu,checked:o,children:f.jsx($p,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":y0(o),onSelect:Be(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});uA.displayName=cA;var _0="MenuItemIndicator",[dA,XU]=sl(_0,{checked:!1}),hA=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=XU(_0,n);return f.jsx(Bi,{present:r||qm(o.checked)||o.checked===!0,children:f.jsx(Tt.span,{...s,ref:t,"data-state":y0(o.checked)})})});hA.displayName=_0;var ZU="MenuSeparator",fA=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Tt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});fA.displayName=ZU;var QU="MenuArrow",mA=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Up(n);return f.jsx(Np,{...s,...r,ref:t})});mA.displayName=QU;var JU="MenuSub",[Fre,pA]=sl(JU),Xu="MenuSubTrigger",gA=b.forwardRef((e,t)=>{const n=ol(Xu,e.__scopeMenu),r=Zd(Xu,e.__scopeMenu),s=pA(Xu,e.__scopeMenu),o=g0(Xu,e.__scopeMenu),l=b.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=o,d={__scopeMenu:e.__scopeMenu},g=b.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return b.useEffect(()=>g,[g]),b.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),h(null)}},[u,h]),f.jsx(m0,{asChild:!0,...d,children:f.jsx(sA,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":_A(n.open),...e,ref:Tx(t,s.onTriggerChange),onClick:p=>{var v;(v=e.onClick)==null||v.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Be(e.onPointerMove,Rd(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:Be(e.onPointerLeave,Rd(p=>{var y,w;g();const v=(y=n.content)==null?void 0:y.getBoundingClientRect();if(v){const S=(w=n.content)==null?void 0:w.dataset.side,C=S==="right",k=C?-5:5,R=v[C?"left":"right"],E=v[C?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+k,y:p.clientY},{x:R,y:v.top},{x:E,y:v.top},{x:E,y:v.bottom},{x:R,y:v.bottom}],side:S}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Be(e.onKeyDown,p=>{var y;const v=o.searchRef.current!=="";e.disabled||v&&p.key===" "||jU[r.dir].includes(p.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),p.preventDefault())})})})});gA.displayName=Xu;var vA="MenuSubContent",bA=b.forwardRef((e,t)=>{const n=tA(ji,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=ol(ji,e.__scopeMenu),l=Zd(ji,e.__scopeMenu),u=pA(vA,e.__scopeMenu),h=b.useRef(null),d=$t(t,h);return f.jsx(Ed.Provider,{scope:e.__scopeMenu,children:f.jsx(Bi,{present:r||o.open,children:f.jsx(Ed.Slot,{scope:e.__scopeMenu,children:f.jsx(v0,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:d,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var p;l.isUsingKeyboardRef.current&&((p=h.current)==null||p.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Be(e.onFocusOutside,g=>{g.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Be(e.onEscapeKeyDown,g=>{l.onClose(),g.preventDefault()}),onKeyDown:Be(e.onKeyDown,g=>{var y;const p=g.currentTarget.contains(g.target),v=OU[l.dir].includes(g.key);p&&v&&(o.onOpenChange(!1),(y=u.trigger)==null||y.focus(),g.preventDefault())})})})})})});bA.displayName=vA;function _A(e){return e?"open":"closed"}function qm(e){return e==="indeterminate"}function y0(e){return qm(e)?"indeterminate":e?"checked":"unchecked"}function e$(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function t$(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function n$(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=t$(e,Math.max(o,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function r$(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],h=t[l],d=u.x,g=u.y,p=h.x,v=h.y;g>r!=v>r&&n<(p-d)*(r-g)/(v-g)+d&&(s=!s)}return s}function i$(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return r$(n,t)}function Rd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var s$=eA,o$=m0,a$=nA,l$=rA,c$=b0,u$=iA,d$=$p,h$=oA,f$=lA,m$=uA,p$=hA,g$=fA,v$=mA,b$=gA,_$=bA,x0="ContextMenu",[y$,Hre]=lo(x0,[Q5]),Lr=Q5(),[x$,yA]=y$(x0),xA=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:o=!0}=e,[l,u]=b.useState(!1),h=Lr(t),d=Yi(r),g=b.useCallback(p=>{u(p),d(p)},[d]);return f.jsx(x$,{scope:t,open:l,onOpenChange:g,modal:o,children:f.jsx(s$,{...h,dir:s,open:l,onOpenChange:g,modal:o,children:n})})};xA.displayName=x0;var wA="ContextMenuTrigger",SA=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,o=yA(wA,n),l=Lr(n),u=b.useRef({x:0,y:0}),h=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),d=b.useRef(0),g=b.useCallback(()=>window.clearTimeout(d.current),[]),p=v=>{u.current={x:v.clientX,y:v.clientY},o.onOpenChange(!0)};return b.useEffect(()=>g,[g]),b.useEffect(()=>void(r&&g()),[r,g]),f.jsxs(f.Fragment,{children:[f.jsx(o$,{...l,virtualRef:h}),f.jsx(Tt.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Be(e.onContextMenu,v=>{g(),p(v),v.preventDefault()}),onPointerDown:r?e.onPointerDown:Be(e.onPointerDown,Ff(v=>{g(),d.current=window.setTimeout(()=>p(v),700)})),onPointerMove:r?e.onPointerMove:Be(e.onPointerMove,Ff(g)),onPointerCancel:r?e.onPointerCancel:Be(e.onPointerCancel,Ff(g)),onPointerUp:r?e.onPointerUp:Be(e.onPointerUp,Ff(g))})]})});SA.displayName=wA;var w$="ContextMenuPortal",CA=e=>{const{__scopeContextMenu:t,...n}=e,r=Lr(t);return f.jsx(a$,{...r,...n})};CA.displayName=w$;var kA="ContextMenuContent",EA=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=yA(kA,n),o=Lr(n),l=b.useRef(!1);return f.jsx(l$,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{var h;(h=e.onCloseAutoFocus)==null||h.call(e,u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{var h;(h=e.onInteractOutside)==null||h.call(e,u),!u.defaultPrevented&&!s.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});EA.displayName=kA;var S$="ContextMenuGroup",C$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(c$,{...s,...r,ref:t})});C$.displayName=S$;var k$="ContextMenuLabel",E$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(u$,{...s,...r,ref:t})});E$.displayName=k$;var R$="ContextMenuItem",RA=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(d$,{...s,...r,ref:t})});RA.displayName=R$;var T$="ContextMenuCheckboxItem",N$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(h$,{...s,...r,ref:t})});N$.displayName=T$;var M$="ContextMenuRadioGroup",A$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(f$,{...s,...r,ref:t})});A$.displayName=M$;var D$="ContextMenuRadioItem",j$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(m$,{...s,...r,ref:t})});j$.displayName=D$;var O$="ContextMenuItemIndicator",L$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(p$,{...s,...r,ref:t})});L$.displayName=O$;var z$="ContextMenuSeparator",P$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(g$,{...s,...r,ref:t})});P$.displayName=z$;var B$="ContextMenuArrow",I$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(v$,{...s,...r,ref:t})});I$.displayName=B$;var F$="ContextMenuSubTrigger",H$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(b$,{...s,...r,ref:t})});H$.displayName=F$;var U$="ContextMenuSubContent",$$=b.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Lr(n);return f.jsx(_$,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$$.displayName=U$;function Ff(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var W$=xA,V$=SA,q$=CA,TA=EA,NA=RA;const MA=W$,AA=V$,w0=b.forwardRef(({className:e,...t},n)=>f.jsx(q$,{children:f.jsx(TA,{ref:n,className:me("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg backdrop-blur-md outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...t})}));w0.displayName=TA.displayName;const Km=b.forwardRef(({className:e,...t},n)=>f.jsx(NA,{ref:n,className:me("relative flex cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Km.displayName=NA.displayName;function DA({open:e,onOpenChange:t,position:n,children:r}){return f.jsxs(LM,{open:e,onOpenChange:t,children:[f.jsx($7,{style:n?{position:"fixed",left:n.x,top:n.y,width:0,height:0}:void 0}),f.jsx(zM,{children:f.jsx(Qx,{side:"bottom",align:"start",sideOffset:4,onOpenAutoFocus:s=>s.preventDefault(),className:me("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg backdrop-blur-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"),children:r})})]})}function uy({onSelect:e,className:t,children:n}){return f.jsx("button",{type:"button",className:me("relative flex w-full cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium outline-hidden transition-colors","hover:bg-accent focus:bg-accent",t),onPointerDown:r=>{r.preventDefault(),e()},children:n})}function K$({onRemove:e,children:t,mobileMenuPosition:n,onMobileMenuClose:r,skipContextMenu:s}){return f.jsxs(f.Fragment,{children:[s?t:f.jsxs(MA,{children:[f.jsx(AA,{asChild:!0,children:t}),f.jsx(w0,{children:f.jsxs(Km,{onSelect:o=>{o.stopPropagation(),e()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[f.jsx(_d,{className:"h-4 w-4"}),f.jsx("span",{className:"text-xs font-medium",children:"Hide"})]})})]}),f.jsx(DA,{open:!!n,onOpenChange:o=>{o||r==null||r()},position:n??null,children:f.jsxs(uy,{onSelect:()=>{r==null||r(),e()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[f.jsx(_d,{className:"h-4 w-4"}),f.jsx("span",{children:"Hide"})]})})]})}function G$({onRename:e,onDelete:t,children:n,mobileMenuPosition:r,onMobileMenuClose:s,skipContextMenu:o}){return f.jsxs(f.Fragment,{children:[o?n:f.jsxs(MA,{children:[f.jsx(AA,{asChild:!0,children:n}),f.jsxs(w0,{children:[f.jsxs(Km,{onSelect:l=>{l.stopPropagation(),e()},children:[f.jsx(pc,{className:"h-4 w-4"}),f.jsx("span",{className:"text-xs font-medium",children:"Rename Feature"})]}),f.jsxs(Km,{onSelect:l=>{l.stopPropagation(),t()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[f.jsx(_d,{className:"h-4 w-4"}),f.jsx("span",{className:"text-xs font-medium",children:"Delete Feature"})]})]})]}),f.jsxs(DA,{open:!!r,onOpenChange:l=>{l||s==null||s()},position:r??null,children:[f.jsxs(uy,{onSelect:()=>{s==null||s(),e()},children:[f.jsx(pc,{className:"h-4 w-4"}),f.jsx("span",{children:"Rename Feature"})]}),f.jsxs(uy,{onSelect:()=>{s==null||s(),t()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[f.jsx(_d,{className:"h-4 w-4"}),f.jsx("span",{children:"Delete Feature"})]})]})]})}function Qd(e){const[t,n]=b.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return b.useEffect(()=>{const r=window.matchMedia(e),s=()=>n(r.matches);return s(),r.addEventListener?(r.addEventListener("change",s),()=>r.removeEventListener("change",s)):(r.addListener(s),()=>r.removeListener(s))},[e]),t}function jA({iconDataUrl:e,alt:t,className:n,fallback:r=null}){return e?f.jsx("img",{src:e,alt:t,className:me("shrink-0 object-contain",n)}):f.jsx(f.Fragment,{children:r})}const C2=e=>{let t;const n=new Set,r=(d,g)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const v=t;t=g??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,v))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>h,subscribe:d=>(n.add(d),()=>n.delete(d))},h=t=e(r,s,u);return u},Y$=e=>e?C2(e):C2,X$=e=>e;function Z$(e,t=X$){const n=xe.useSyncExternalStore(e.subscribe,xe.useCallback(()=>t(e.getState()),[e,t]),xe.useCallback(()=>t(e.getInitialState()),[e,t]));return xe.useDebugValue(n),n}const Q$=e=>{const t=Y$(e),n=r=>Z$(t,r);return Object.assign(n,t),n},uo=e=>Q$;function J$(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const l=h=>h===null?null:JSON.parse(h,void 0),u=(o=n.getItem(s))!=null?o:null;return u instanceof Promise?u.then(l):l(u)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const dy=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return dy(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return dy(r)(n)}}}},eW=(e,t)=>(n,r,s)=>{let o={storage:J$(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},l=!1,u=0;const h=new Set,d=new Set;let g=o.storage;if(!g)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...C)},r,s);const p=()=>{const C=o.partialize({...r()});return g.setItem(o.name,{state:C,version:o.version})},v=s.setState;s.setState=(C,k)=>(v(C,k),p());const y=e((...C)=>(n(...C),p()),r,s);s.getInitialState=()=>y;let w;const S=()=>{var C,k;if(!g)return;const R=++u;l=!1,h.forEach(N=>{var L;return N((L=r())!=null?L:y)});const E=((k=o.onRehydrateStorage)==null?void 0:k.call(o,(C=r())!=null?C:y))||void 0;return dy(g.getItem.bind(g))(o.name).then(N=>{if(N)if(typeof N.version=="number"&&N.version!==o.version){if(o.migrate){const L=o.migrate(N.state,N.version);return L instanceof Promise?L.then(D=>[!0,D]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,N.state];return[!1,void 0]}).then(N=>{var L;if(R!==u)return;const[D,j]=N;if(w=o.merge(j,(L=r())!=null?L:y),n(w,!0),D)return p()}).then(()=>{R===u&&(E==null||E(r(),void 0),w=r(),l=!0,d.forEach(N=>N(w)))}).catch(N=>{R===u&&(E==null||E(void 0,N))})};return s.persist={setOptions:C=>{o={...o,...C},C.storage&&(g=C.storage)},clearStorage:()=>{g==null||g.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},o.skipHydration||S(),w||y},ho=eW,un=uo()(ho(e=>({themePreference:"system",themeId:"default",customAppearance:"system",backgroundImage:null,backgroundOpacity:1,backgroundBlur:0,showProjectIconsInSidebar:!0,availableThemes:[],themeCssText:"",setThemePreference:t=>e({themePreference:t}),setThemeId:t=>e({themeId:t}),setCustomAppearance:t=>e({customAppearance:t}),setBackgroundImage:t=>e({backgroundImage:t}),setBackgroundOpacity:t=>e({backgroundOpacity:t}),setBackgroundBlur:t=>e({backgroundBlur:t}),setShowProjectIconsInSidebar:t=>e({showProjectIconsInSidebar:t}),setAvailableThemes:t=>e({availableThemes:t}),setThemeCssText:t=>e({themeCssText:t})}),{name:"theme-settings"})),OA=8;function hy(e,t){return!e.has(t)}function Fb(e,t,n){const r=e.map(l=>l.featureId),s=r.indexOf(t),o=r.indexOf(n);return s===-1||o===-1||s===o?null:Bp(r,s,o)}function tW(e){return{activeFeatures:e.filter(t=>t.stage!=="done"),completedFeatures:e.filter(t=>t.stage==="done")}}function nW(e,t){return t?e:e.slice(0,OA)}function rW(e,t){return e.map(n=>`feature:${n.featureId}`).filter(n=>!t.has(n))}function k2({feature:e,groupKey:t,collapsedSections:n,onToggleSection:r,renderChatRow:s,onNewLocalChat:o,onRenameFeature:l,onDeleteFeature:u,onSetFeatureBrowserState:h,onSetFeatureStage:d,kanbanStatusesEnabled:g=!0,showFeatureOverviewInSidebar:p=!1,activeOverviewFeatureId:v=null,onOpenFeatureOverview:y,showAllChats:w,onToggleShowAllChats:S,draggedFeatureId:C,draggedChatId:k,hoveredDropTarget:R,isTouchDevice:E,onFeatureDragStart:N,onFeatureDragEnd:L,onFeatureDrop:D,onChatDrop:j,onTouchDragMove:H,onTouchDragEnd:G,onChatDragStart:B,onChatDragEnd:q}){const I=`feature:${e.featureId}`,V=hy(n,I),F=k!==null,W=nW(e.chats,w),O=Math.max(0,e.chats.length-OA),$=O>0,U=v===e.featureId,[X,M]=b.useState(null);function P(){r(I),h==null||h(e.featureId,V?"CLOSED":"OPEN")}const Z=b.useRef(null),{touchRef:A,isDragging:ie,isArmed:J,dragPosition:ee}=e0({enabled:E,visualElementRef:Z,onTap:P,onContextMenu:pe=>M(pe),onDragStart:()=>N(e.featureId),onDragMove:({x:pe,y:Se,elementBelow:Re})=>H(pe,Se,Re),onDragEnd:({x:pe,y:Se,elementBelow:Re})=>G(pe,Se,Re)}),re=C===e.featureId||ie,ce=f.jsxs("div",{ref:Z,"data-feature-drop-target":e.featureId,onDragOver:E?void 0:pe=>{if(C&&C!==e.featureId){pe.preventDefault();return}F&&pe.preventDefault()},onDrop:E?void 0:pe=>{if(pe.preventDefault(),C&&C!==e.featureId){D(C,e.featureId);return}k&&j(k,e.featureId)},className:me("rounded-lg border border-border/60 bg-muted/10 transition-all duration-150 select-none",F&&!E&&"border-dashed hover:border-primary/60 hover:bg-primary/5",R===e.featureId&&"border-primary/60 bg-primary/5",J&&"scale-[1.03] shadow-md ring-2 ring-primary/50 bg-card",re&&!J&&"opacity-20 scale-[0.98]"),children:[f.jsxs("div",{ref:E?A:void 0,className:"flex items-center gap-2 px-2 py-1.5",children:[E?f.jsxs(f.Fragment,{children:[f.jsx("button",{type:"button","data-no-touch-drag":!0,onClick:P,className:"flex shrink-0 items-center",children:f.jsx(Or,{className:me("size-3 transition-transform",V&&"rotate-90")})}),f.jsx(Eb,{className:"size-3.5 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.title})]}):f.jsxs("button",{type:"button",onClick:P,draggable:!0,"data-feature-drag-handle":e.featureId,onDragStart:()=>N(e.featureId),onDragEnd:L,className:"flex min-w-0 flex-1 basis-0 items-center gap-2 text-left",children:[f.jsx(Or,{className:me("size-3 transition-transform",V&&"rotate-90")}),f.jsx(Eb,{className:"size-3.5 text-muted-foreground"}),f.jsxs(bs,{children:[f.jsx(_s,{asChild:!0,children:f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.title})}),f.jsx(Ki,{side:"right",sideOffset:4,children:e.title})]})]}),g?f.jsxs(gr,{value:e.stage,onValueChange:pe=>d==null?void 0:d(e.featureId,pe),children:[f.jsx(Jn,{"data-no-touch-drag":!0,className:me("h-7 w-auto min-w-[70px] shrink-0 items-center gap-1 rounded-full px-2 pr-1.5 text-[10px] font-semibold leading-none tracking-[0.04em] shadow-none focus:ring-0 focus:ring-offset-0 [&>span]:flex [&>span]:items-center [&>span]:leading-none [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:translate-y-0 [&>svg]:opacity-60",x2[e.stage]),children:f.jsx(wr,{children:a2[e.stage]})}),f.jsx(er,{children:D7.map(pe=>f.jsx(Lt,{value:pe,className:me("text-[11px] font-medium",pe===e.stage&&x2[pe]),children:a2[pe]},pe))})]}):null,o?f.jsx(Xe,{variant:"ghost",size:"icon",className:"h-6 w-6","data-no-touch-drag":!0,onClick:()=>o(t,e.featureId),title:"New chat in feature",children:f.jsx(LN,{className:"size-3.5"})}):null]}),V?f.jsxs("div",{className:"space-y-[2px] border-t border-border/50 p-1 pl-3",children:[p&&e.overviewRelativePath?f.jsxs("button",{type:"button",onClick:()=>y==null?void 0:y(e.featureId),className:me("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors",U?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"),children:[f.jsx(m6,{className:"size-3.5 shrink-0"}),f.jsx("span",{className:"truncate",children:"overview.md"})]}):null,W.map(pe=>s(pe,{draggable:!0,onDragStart:Se=>B(Se.chatId),onDragEnd:q,isTouchDevice:E,onTouchDragMove:H,onTouchDragEnd:G})),$?f.jsx("div",{className:"pt-1",children:f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:S,children:w?"Show less":`Show ${O} more`})}):null]}):null]}),he=f.jsxs(IM,{position:ee,children:[f.jsx(Eb,{className:"size-3.5 shrink-0 text-primary"}),f.jsx("span",{className:"text-sm font-medium truncate",children:e.title})]});return u?f.jsxs(f.Fragment,{children:[f.jsx(G$,{onRename:()=>l==null?void 0:l(e.featureId),onDelete:()=>u(e.featureId),mobileMenuPosition:X,onMobileMenuClose:()=>M(null),skipContextMenu:E,children:ce}),he]}):f.jsxs(f.Fragment,{children:[ce,he]})}function iW({group:e,collapsedSections:t,onToggleSection:n,renderChatRow:r,onNewLocalChat:s,onCreateFeature:o,onRenameFeature:l,onDeleteFeature:u,onSetProjectBrowserState:h,onSetProjectGeneralChatsBrowserState:d,onSetFeatureBrowserState:g,onSetFeatureStage:p,onSetChatFeature:v,onReorderFeatures:y,onRemoveProject:w,isConnected:S,startingLocalPath:C,folderGroupsEnabled:k=!0,showFeatureOverviewInSidebar:R=!1,kanbanStatusesEnabled:E=!0,activeOverviewFeatureId:N=null,onOpenFeatureOverview:L}){const D=un(je=>je.showProjectIconsInSidebar),{groupKey:j,localPath:H,features:G,generalChats:B}=e,{activeFeatures:q,completedFeatures:I}=b.useMemo(()=>tW(G),[G]),V=`project:${j}`,F=`general:${j}`,W=hy(t,V),O=G.length===0||hy(t,F),[$,U]=b.useState(null),[X,M]=b.useState(null),[P,Z]=b.useState(null),[A,ie]=b.useState(!1),[J,ee]=b.useState(!1),[re,ce]=b.useState({}),[he,pe]=b.useState(null),Se=Qd("(pointer: coarse)"),Re=k&&!A?B.slice(0,10):B,Ae=k&&B.length>10,{attributes:Ke,listeners:yt,setNodeRef:xt,setActivatorNodeRef:fe,transform:Ie,transition:De,isDragging:lt}=HH({id:j}),st=b.useRef(null),nt={transform:Cd.Translate.toString(Ie),transition:De};function rn(){n(V),h==null||h(j,W?"CLOSED":"OPEN")}function Ce(){n(F),d==null||d(j,O?"CLOSED":"OPEN")}function Ze(je){ce(We=>({...We,[je]:!We[je]}))}function oe(je){je.stopPropagation();for(const We of rW(G,t))n(We);for(const We of G)g==null||g(We.featureId,"CLOSED")}function ve(je){if(!je)return null;const We=je.closest("[data-feature-drop-target]");return We?{type:"feature",featureId:We.getAttribute("data-feature-drop-target")}:je.closest(`[data-general-chats-drop-target="${j}"]`)?{type:"general"}:null}function Te(je,We,ut){const Ue=st.current;if(Ue){const Yt=Ue.getBoundingClientRect(),Ye=60;We<Yt.top+Ye?Ue.scrollBy(0,-6):We>Yt.bottom-Ye&&Ue.scrollBy(0,6)}const sn=ve(ut);Z((sn==null?void 0:sn.type)==="feature"?sn.featureId:null)}function Me(je,We,ut){const Ue=ve(ut);if(X){if((Ue==null?void 0:Ue.type)==="feature"&&Ue.featureId!==X&&y){const sn=Fb(G,X,Ue.featureId);sn&&y(j,sn)}M(null)}else $&&v&&((Ue==null?void 0:Ue.type)==="feature"?v($,Ue.featureId):(Ue==null?void 0:Ue.type)==="general"&&v($,null),U(null));Z(null)}const Ge=b.useRef(null),{touchRef:Ct}=e0({enabled:Se&&!!w,onTap:rn,onContextMenu:je=>pe(je)}),Je=f.jsxs("div",{ref:je=>{fe(je),Ge.current=je,Se&&w&&Ct(je)},className:me("sticky top-0 bg-background dark:bg-card z-10 relative p-[10px] flex items-center justify-between cursor-grab active:cursor-grabbing select-none",lt&&"cursor-grabbing"),onClick:Se?void 0:rn,...yt,children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx("span",{className:"relative size-3.5 shrink-0 cursor-pointer",children:f.jsx(Or,{className:me("translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-transform duration-200",W&&"rotate-90")})}),D?f.jsx(jA,{iconDataUrl:e.iconDataUrl,alt:`${e.title||Im(H)} icon`,className:"size-5",fallback:f.jsx("span",{className:"size-5 shrink-0","aria-hidden":"true"})}):null,f.jsxs(bs,{children:[f.jsx(_s,{asChild:!0,children:f.jsx("span",{className:"truncate max-w-[180px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:e.title||Im(H)})}),f.jsx(Ki,{side:"right",sideOffset:4,children:H})]})]}),f.jsxs("div",{className:"absolute right-2 flex items-center gap-1",children:[o?f.jsxs(bs,{children:[f.jsx(_s,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",className:"h-5.5 w-5.5 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100","data-no-touch-drag":!0,onClick:je=>{je.stopPropagation(),o(j)},children:f.jsx(NN,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),f.jsx(Ki,{side:"right",sideOffset:4,children:"New feature"})]}):null,G.length>0?f.jsxs(bs,{children:[f.jsx(_s,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",className:"h-5.5 w-5.5 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100","data-no-touch-drag":!0,onClick:oe,children:f.jsx(WI,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),f.jsx(Ki,{side:"right",sideOffset:4,children:"Close all feature folders"})]}):null,s?f.jsxs(bs,{children:[f.jsx(_s,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",className:me("h-5.5 w-5.5 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100",(!S||C===H)&&"opacity-50 cursor-not-allowed"),disabled:!S||C===H,"data-no-touch-drag":!0,onClick:je=>{je.stopPropagation(),s(j)},children:C===H?f.jsx(kr,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):f.jsx(LN,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),f.jsx(Ki,{side:"right",sideOffset:4,children:S?"New general chat":`Start ${Un} to connect`})]}):null]})]});return f.jsxs("div",{ref:je=>{xt(je),st.current=(je==null?void 0:je.closest("[data-sidebar-scroll]"))??null},style:nt,className:me("group/section",lt&&"opacity-50 shadow-lg z-50 relative"),...Ke,children:[w?f.jsx(K$,{onRemove:()=>w(j),mobileMenuPosition:he,onMobileMenuClose:()=>pe(null),skipContextMenu:Se,children:Je}):Je,W?f.jsxs("div",{className:"mb-2 space-y-2",children:[k&&q.length>0?f.jsx("section",{className:"space-y-2 pl-6",children:q.map(je=>f.jsx(k2,{feature:je,groupKey:j,collapsedSections:t,onToggleSection:n,renderChatRow:r,onNewLocalChat:s,onRenameFeature:l,onDeleteFeature:u,onSetFeatureBrowserState:g,onSetFeatureStage:p,kanbanStatusesEnabled:E,showFeatureOverviewInSidebar:R,activeOverviewFeatureId:N,onOpenFeatureOverview:L,showAllChats:!!re[je.featureId],onToggleShowAllChats:()=>Ze(je.featureId),draggedFeatureId:X,draggedChatId:$,hoveredDropTarget:P,isTouchDevice:Se,onFeatureDragStart:We=>M(We),onFeatureDragEnd:()=>M(null),onFeatureDrop:(We,ut)=>{const Ue=Fb(G,We,ut);M(null),Ue&&(y==null||y(j,Ue))},onChatDrop:(We,ut)=>{v==null||v(We,ut),U(null)},onTouchDragMove:Te,onTouchDragEnd:Me,onChatDragStart:We=>U(We),onChatDragEnd:()=>U(null)},je.featureId))}):null,k&&I.length>0?f.jsxs("section",{className:"pl-6",children:[f.jsxs("button",{type:"button",onClick:()=>ee(je=>!je),className:"flex w-full items-center gap-2 px-2 py-1 text-left text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:[f.jsx(Or,{className:me("size-3 transition-transform",J&&"rotate-90")}),f.jsx("span",{children:J?"Hide completed":"Show completed"}),f.jsx("span",{className:"ml-auto",children:I.length})]}),J?f.jsx("div",{className:"space-y-2 pt-1",children:I.map(je=>f.jsx(k2,{feature:je,groupKey:j,collapsedSections:t,onToggleSection:n,renderChatRow:r,onNewLocalChat:s,onRenameFeature:l,onDeleteFeature:u,onSetFeatureBrowserState:g,onSetFeatureStage:p,kanbanStatusesEnabled:E,showFeatureOverviewInSidebar:R,activeOverviewFeatureId:N,onOpenFeatureOverview:L,showAllChats:!!re[je.featureId],onToggleShowAllChats:()=>Ze(je.featureId),draggedFeatureId:X,draggedChatId:$,hoveredDropTarget:P,isTouchDevice:Se,onFeatureDragStart:We=>M(We),onFeatureDragEnd:()=>M(null),onFeatureDrop:(We,ut)=>{const Ue=Fb(G,We,ut);M(null),Ue&&(y==null||y(j,Ue))},onChatDrop:(We,ut)=>{v==null||v(We,ut),U(null)},onTouchDragMove:Te,onTouchDragEnd:Me,onChatDragStart:We=>U(We),onChatDragEnd:()=>U(null)},je.featureId))}):null]}):null,B.length>0?f.jsxs("section",{"data-general-chats-drop-target":j,onDragOver:$&&!Se?je=>je.preventDefault():void 0,onDrop:$&&!Se&&v?je=>{je.preventDefault(),v($,null),U(null)}:void 0,children:[k?f.jsxs("button",{type:"button",onClick:Ce,className:"flex w-full items-center gap-2 px-4 py-1 text-left text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:[f.jsx(Or,{className:me("size-3 transition-transform",O&&"rotate-90")}),f.jsx("span",{children:"General Chats"}),f.jsx("span",{className:"ml-auto",children:B.length})]}):null,!k||O?f.jsxs("div",{className:me("space-y-[2px]",k?"pl-7":"pl-4"),children:[Re.map(je=>r(je,{draggable:!0,onDragStart:We=>U(We.chatId),onDragEnd:()=>U(null),isTouchDevice:Se,onTouchDragMove:Te,onTouchDragEnd:Me})),Ae?f.jsx("div",{className:"pt-1",children:f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground",onClick:()=>ie(je=>!je),children:A?"Show less":`Show ${B.length-10} more`})}):null]}):null]}):null]}):null]})}function sW({projectGroups:e,collapsedSections:t,onToggleSection:n,onSetProjectBrowserState:r,onSetProjectGeneralChatsBrowserState:s,renderChatRow:o,onNewLocalChat:l,onCreateFeature:u,onRenameFeature:h,onDeleteFeature:d,onSetFeatureBrowserState:g,onSetFeatureStage:p,onSetChatFeature:v,onReorderFeatures:y,onRemoveProject:w,onReorderGroups:S,isConnected:C,startingLocalPath:k,folderGroupsEnabled:R=!0,showFeatureOverviewInSidebar:E=!1,kanbanStatusesEnabled:N=!0,activeOverviewFeatureId:L=null,onOpenFeatureOverview:D}){const j=bF(Ob(c0,{activationConstraint:{distance:8}}),Ob(ZM,{activationConstraint:{delay:250,tolerance:5}}),Ob(a0)),H=b.useMemo(()=>e.map(I=>I.groupKey),[e]),G=b.useRef(null);function B(I){const V=I.active.id;t.has(V)?G.current=null:(G.current=V,n(V))}function q(I){const{active:V,over:F}=I;if(F&&V.id!==F.id&&S){const W=H.indexOf(V.id),O=H.indexOf(F.id);W!==-1&&O!==-1&&S(Bp(H,W,O))}if(G.current){const W=G.current;G.current=null,requestAnimationFrame(()=>n(W))}}return f.jsx(xH,{sensors:j,collisionDetection:SF,onDragStart:B,onDragEnd:q,children:f.jsx(OH,{items:H,strategy:DH,children:e.map(I=>f.jsx(iW,{group:I,collapsedSections:t,onToggleSection:n,onSetProjectBrowserState:r,onSetProjectGeneralChatsBrowserState:s,renderChatRow:o,onNewLocalChat:l,onCreateFeature:u,onRenameFeature:h,onDeleteFeature:d,onSetFeatureBrowserState:g,onSetFeatureStage:p,onSetChatFeature:v,onReorderFeatures:y,onRemoveProject:w,onReorderGroups:S,isConnected:C,startingLocalPath:k,folderGroupsEnabled:R,showFeatureOverviewInSidebar:E,kanbanStatusesEnabled:N,activeOverviewFeatureId:L,onOpenFeatureOverview:D},I.groupKey))})})}const LA=`${Dp}provider-usage-collapsed`,zA=`${Dp}provider-usage-mode`,oW=Jo.map(e=>e.id),aW=["claude","codex"],fy=Object.fromEntries(Jo.map(e=>[e.id,e.label]));function E2(e){return e===null?"bg-muted":e>=90?"bg-red-500":e>=75?"bg-amber-500":"bg-emerald-500"}function Hb(e){return e===null?"N/A":`${e.toFixed(1)}%`}function R2(e,t){if(t!=null&&t.trim())return`Resets ${t.trim()}`;if(e===null)return null;const n=Date.now();if(e<=n)return"Limit may have reset";const r=e-n,s=Math.ceil(r/6e4);return s<60?`Resets in ${s} min`:`Resets at ${new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`}function lW(){try{return localStorage.getItem(LA)==="true"}catch{return!1}}function cW(){try{return localStorage.getItem(zA)==="weekly"?"weekly":"session"}catch{return"session"}}function uW(e){try{localStorage.setItem(LA,String(e))}catch{}}function dW(e){try{localStorage.setItem(zA,e)}catch{}}function T2(e){const{entry:t,mode:n,isPending:r,onRefreshProviderUsage:s,onOpenProviderLogin:o}=e,l=Bm[t.provider],u=e.labelOverride??fy[t.provider],h=t.availability==="unavailable",d=t.availability==="login_required",g=t.availability==="stale",p=t.provider==="cursor",v=e.percentOverride!==void 0?e.percentOverride:n==="weekly"?t.weeklyLimitUsedPercent??null:t.sessionLimitUsedPercent,y=v,w=p?null:n==="weekly"?R2(t.weeklyRateLimitResetAt??null,t.weeklyRateLimitResetLabel??null):R2(t.rateLimitResetAt,t.rateLimitResetLabel),S=[];d?S.push("Login required to fetch Cursor usage"):h?S.push("Usage data unavailable"):(e.bars?S.push("Cursor limit usage"):v!==null&&S.push(`${Hb(v)} of ${n} limit used`),w&&S.push(w),g&&S.push("Data may be outdated"),S.length===0&&S.push("No usage data yet")),t.statusDetail&&S.push(t.statusDetail.replaceAll("_"," "));const C=!e.hideActions&&p&&d,k=p&&!e.hideActions&&h&&!d&&t.statusDetail!=="unsupported_platform";return f.jsxs(bs,{children:[f.jsx(_s,{asChild:!0,children:f.jsxs("div",{className:me("flex flex-col",g&&"opacity-50"),children:[f.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 rounded-md",children:[f.jsx(l,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"text-[11px] text-muted-foreground w-11 shrink-0",children:u}),h&&!e.bars?f.jsx("span",{className:"text-[10px] text-muted-foreground/60 ml-auto",children:"N/A"}):e.bars?f.jsx("div",{className:"flex-1"}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden min-w-0",children:y!==null?f.jsx("div",{className:me("h-full rounded-full transition-all",E2(y)),style:{width:`${Math.min(100,Math.max(0,y))}%`}}):null}),f.jsx("span",{className:"text-[10px] tabular-nums text-muted-foreground w-7 text-right shrink-0",children:Hb(y)})]}),C?f.jsx("button",{type:"button",disabled:r,onClick:R=>{R.stopPropagation(),o==null||o("cursor")},className:"ml-auto rounded border border-border/70 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50",children:"Sign In"}):null,k?f.jsxs("button",{type:"button",disabled:r,onClick:R=>{R.stopPropagation(),s==null||s("cursor")},className:"flex items-center gap-1 rounded border border-border/70 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50",children:[r&&f.jsx(Tm,{className:"h-2 w-2 animate-spin"}),r?"Checking":"Refresh"]}):null]}),e.bars&&f.jsx("div",{className:"flex flex-col gap-1 pb-1",children:e.bars.map((R,E)=>f.jsxs("div",{className:"flex items-center gap-2 pl-7 pr-2",children:[f.jsx("span",{className:"text-[10px] text-muted-foreground w-12 shrink-0",children:R.label}),h?f.jsx("span",{className:"text-[10px] text-muted-foreground/60 ml-auto",children:"N/A"}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden min-w-0",children:R.percent!==null?f.jsx("div",{className:me("h-full rounded-full transition-all",E2(R.percent)),style:{width:`${Math.min(100,Math.max(0,R.percent))}%`}}):null}),f.jsx("span",{className:"text-[10px] tabular-nums text-muted-foreground w-7 text-right shrink-0",children:Hb(R.percent)})]})]},E))})]})}),f.jsx(Ki,{side:"right",className:"max-w-48",children:S.map((R,E)=>f.jsx("div",{className:"text-xs",children:R},E))})]})}function hW({providerUsage:e,visibleProviders:t=oW,onRefreshProviderUsage:n,onOpenProviderLogin:r}){const[s,o]=b.useState(lW),[l,u]=b.useState(cW),[h,d]=b.useState(null),g=()=>{o(v=>{const y=!v;return uW(y),y})},p=async()=>{d("all");try{await(n==null?void 0:n()),Ef("Usage checked successfully.")}catch{Ef("Failed to check usage.")}finally{d(v=>v==="all"?null:v)}};return f.jsxs("div",{className:"px-1 pb-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2 px-2 pb-0.5",children:[f.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-1 text-left group",children:[s?f.jsx(Or,{className:"h-3 w-3 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors"}):f.jsx(bp,{className:"h-3 w-3 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors"}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 font-medium group-hover:text-muted-foreground transition-colors",children:"Provider Usage"})]}),!s&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{type:"button",onClick:p,disabled:h==="all",className:"shrink-0 rounded-md border border-border/70 bg-muted/40 p-1 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors disabled:opacity-50",title:"Refresh usages",children:f.jsx(Tm,{className:me("h-3 w-3",h==="all"&&"animate-spin")})}),f.jsx("button",{type:"button",onClick:()=>{u(v=>{const y=v==="session"?"weekly":"session";return dW(y),y})},className:"shrink-0 rounded-md border border-border/70 bg-muted/40 px-2 py-0.5 text-[10px] uppercase tracking-wider text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:l==="session"?"Session":"Weekly"})]})]}),!s&&(l==="weekly"?aW:t).flatMap(v=>{const y=(e==null?void 0:e[v])??{provider:v,sessionLimitUsedPercent:null,apiLimitUsedPercent:null,rateLimitResetAt:null,rateLimitResetLabel:null,weeklyLimitUsedPercent:null,weeklyRateLimitResetAt:null,weeklyRateLimitResetLabel:null,statusDetail:null,availability:"unavailable",lastRequestedAt:null,updatedAt:null,warnings:[]},w=async C=>{d(C);try{await(n==null?void 0:n(C)),Ef(`${fy[C]??"Provider"} usage checked successfully.`)}catch{Ef(`Failed to check ${fy[C]??"provider"} usage.`)}finally{d(k=>k===C?null:k)}},S=C=>{d(C),Promise.resolve(r==null?void 0:r(C)).finally(()=>{d(k=>k===C?null:k)})};return v==="cursor"&&l==="session"?[f.jsx(T2,{entry:y,mode:l,isPending:h==="cursor",bars:[{label:"API",percent:y.apiLimitUsedPercent??null},{label:"Composer",percent:y.sessionLimitUsedPercent}],onRefreshProviderUsage:w,onOpenProviderLogin:S},"cursor")]:[f.jsx(T2,{entry:y,mode:l,isPending:h===v||h==="all",onRefreshProviderUsage:w,onOpenProviderLogin:S},v)]})]})}function fW(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function mW(e){return e==="claude"||e==="codex"||e==="gemini"||e==="cursor"?e:"last_used"}function Ha(e){var o,l;const t=(o=e==null?void 0:e.modelOptions)==null?void 0:o.reasoningEffort,n=i2(t)?t:i2(e==null?void 0:e.effort)?e.effort:wM.reasoningEffort,r=(e==null?void 0:e.model)??tn("claude").defaultModel,s=A7(r,(l=e==null?void 0:e.modelOptions)==null?void 0:l.contextWindow);return{model:r,modelOptions:{reasoningEffort:r!=="opus"&&n==="max"?"high":n,...s?{contextWindow:s}:{}},planMode:!!(e!=null&&e.planMode)}}function Ua(e){var r,s;const t=Di("codex"),n=(r=e==null?void 0:e.modelOptions)==null?void 0:r.reasoningEffort;return{model:fW((e==null?void 0:e.model)??tn("codex").defaultModel),modelOptions:{reasoningEffort:s2(n)?n:s2(e==null?void 0:e.effort)?e.effort:t.reasoningEffort,fastMode:typeof((s=e==null?void 0:e.modelOptions)==null?void 0:s.fastMode)=="boolean"?e.modelOptions.fastMode:t.fastMode},planMode:!!(e!=null&&e.planMode)}}function ic(e){var n;const t=Di("gemini");return{model:(e==null?void 0:e.model)??tn("gemini").defaultModel,modelOptions:{thinkingMode:E7((n=e==null?void 0:e.modelOptions)==null?void 0:n.thinkingMode)?e.modelOptions.thinkingMode:t.thinkingMode},planMode:!!(e!=null&&e.planMode)}}function $a(e){return e==null||e.modelOptions,{model:k7((e==null?void 0:e.model)??tn("cursor").defaultModel),modelOptions:{...Di("cursor")},planMode:!!(e!=null&&e.planMode)}}function pW(){return{claude:{model:tn("claude").defaultModel,modelOptions:{...Di("claude")},planMode:!1},codex:{model:tn("codex").defaultModel,modelOptions:{...Di("codex")},planMode:!1},gemini:{model:tn("gemini").defaultModel,modelOptions:{...Di("gemini")},planMode:!1},cursor:{model:tn("cursor").defaultModel,modelOptions:{...Di("cursor")},planMode:!1}}}function gW(e){return{claude:Ha(e==null?void 0:e.claude),codex:Ua(e==null?void 0:e.codex),gemini:ic(e==null?void 0:e.gemini),cursor:$a(e==null?void 0:e.cursor)}}function N2(e,t){if(t===void 0){console.info(`[chat-preferences] ${e}`);return}console.info(`[chat-preferences] ${e}`,t)}function my(e,t){if(e==="claude"){const r=t.claude;return{provider:"claude",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}if(e==="gemini"){const r=t.gemini;return{provider:"gemini",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}if(e==="cursor"){const r=t.cursor;return{provider:"cursor",model:r.model,modelOptions:{...r.modelOptions},planMode:r.planMode}}const n=t.codex;return{provider:"codex",model:n.model,modelOptions:{...n.modelOptions},planMode:n.planMode}}function vW(e,t,n,r){if((e==null?void 0:e.provider)==="claude"){const s=Ha(e);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="codex"){const s=Ua(e);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="gemini"){const s=ic(e);return{provider:"gemini",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if((e==null?void 0:e.provider)==="cursor"){const s=$a(e);return{provider:"cursor",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="claude"){const s=Ha(r==null?void 0:r.claude);return{provider:"claude",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="codex"){const s=Ua(r==null?void 0:r.codex);return{provider:"codex",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}if(n==="cursor"){const s=$a(r==null?void 0:r.cursor);return{provider:"cursor",model:s.model,modelOptions:s.modelOptions,planMode:s.planMode}}return my("claude",t)}function bW(e){const t=gW(e==null?void 0:e.providerDefaults);return{defaultProvider:mW(e==null?void 0:e.defaultProvider),providerDefaults:t,showProviderIconsInSideTray:(e==null?void 0:e.showProviderIconsInSideTray)===!0,composerState:vW(e==null?void 0:e.composerState,t,e==null?void 0:e.liveProvider,e==null?void 0:e.livePreferences)}}const Ei=uo()(ho(e=>({defaultProvider:"last_used",providerDefaults:pW(),showProviderIconsInSideTray:!1,composerState:{provider:"claude",model:tn("claude").defaultModel,modelOptions:{...Di("claude")},planMode:!1},setDefaultProvider:t=>e({defaultProvider:t}),setShowProviderIconsInSideTray:t=>e({showProviderIconsInSideTray:t}),setProviderDefaultModel:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?Ha({...r.providerDefaults.claude,model:n}):t==="gemini"?ic({...r.providerDefaults.gemini,model:n}):t==="cursor"?$a({...r.providerDefaults.cursor,model:n}):Ua({...r.providerDefaults.codex,model:n})}})),setProviderDefaultModelOptions:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:t==="claude"?Ha({...r.providerDefaults.claude,modelOptions:{...r.providerDefaults.claude.modelOptions,...n}}):t==="gemini"?ic({...r.providerDefaults.gemini,modelOptions:{...r.providerDefaults.gemini.modelOptions,...n}}):t==="cursor"?$a({...r.providerDefaults.cursor,modelOptions:{...r.providerDefaults.cursor.modelOptions,...n}}):Ua({...r.providerDefaults.codex,modelOptions:{...r.providerDefaults.codex.modelOptions,...n}})}})),setProviderDefaultPlanMode:(t,n)=>e(r=>({providerDefaults:{...r.providerDefaults,[t]:{...r.providerDefaults[t],planMode:n}}})),setComposerProvider:t=>e(n=>({composerState:{...n.composerState,provider:t}})),setComposerModel:t=>e(n=>n.composerState.provider==="claude"?{composerState:{provider:"claude",model:t,modelOptions:Ha({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="gemini"?{composerState:{provider:"gemini",model:t,modelOptions:ic({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="cursor"?{composerState:{provider:"cursor",model:t,modelOptions:$a({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:t,modelOptions:Ua({...n.composerState,model:t}).modelOptions,planMode:n.composerState.planMode}}),setComposerModelOptions:t=>e(n=>n.composerState.provider==="claude"?{composerState:{provider:"claude",model:n.composerState.model,modelOptions:Ha({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="gemini"?{composerState:{provider:"gemini",model:n.composerState.model,modelOptions:ic({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:n.composerState.provider==="cursor"?{composerState:{provider:"cursor",model:n.composerState.model,modelOptions:$a({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}:{composerState:{provider:"codex",model:n.composerState.model,modelOptions:Ua({...n.composerState,modelOptions:{...n.composerState.modelOptions,...t}}).modelOptions,planMode:n.composerState.planMode}}),setComposerPlanMode:t=>e(n=>({composerState:{...n.composerState,planMode:t}})),resetComposerFromProvider:t=>e(n=>({composerState:my(t,n.providerDefaults)})),initializeComposerForNewChat:()=>e(t=>{if(t.defaultProvider==="last_used")return N2("initializeComposerForNewChat:last_used",{defaultProvider:t.defaultProvider,composerState:t.composerState,providerDefaults:t.providerDefaults}),{composerState:{...t.composerState}};const n=my(t.defaultProvider,t.providerDefaults);return N2("initializeComposerForNewChat:explicit_default",{defaultProvider:t.defaultProvider,composerState:n,providerDefaults:t.providerDefaults}),{composerState:n}})}),{name:"chat-preferences",version:5,migrate:e=>bW(e)})),M2=uo()(ho(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"})),Gm=315,_W=240,yW=520;function xW(e){return typeof e=="object"&&e!==null}function Wp(e){return Number.isFinite(e)?Math.min(yW,Math.max(_W,Math.round(e))):Gm}function wW(e){return xW(e)?{widthPx:Wp(typeof e.widthPx=="number"?e.widthPx:Gm)}:{widthPx:Gm}}const A2=uo()(ho(e=>({widthPx:Gm,setWidth:t=>e({widthPx:Wp(t)})}),{name:"left-sidebar-layout",version:1,migrate:wW}));function PA(e,t){return e&&!t}function SW(e,t,n){if(PA(e,t))return{width:`${Wp(n)}px`}}function CW({data:e,completedChatIds:t,activeChatId:n,activeOverviewFeatureId:r,connectionStatus:s,ready:o,open:l,collapsed:u,isDesktopViewport:h,showMobileOpenButton:d,desktopWidth:g,onOpen:p,onClose:v,onToggle:y,onExpand:w,toggleShortcut:S,onResizeDesktopWidth:C,onCreateChat:k,onCreateFeature:R,onRenameFeature:E,onDeleteFeature:N,onSetProjectBrowserState:L,onSetProjectGeneralChatsBrowserState:D,onSetFeatureBrowserState:j,onSetFeatureStage:H,onSetChatFeature:G,onReorderFeatures:B,folderGroupsEnabled:q,showFeatureOverviewInSidebar:I,kanbanStatusesEnabled:V,onOpenFeatureOverview:F,onDeleteChat:W,onRemoveProject:O,onRefreshProviderUsage:$,onOpenProviderLogin:U,providerSettings:X,startingLocalPath:M,updateSnapshot:P,onInstallUpdate:Z}){const A=Pi(),ie=rl(),J=b.useRef(null),ee=b.useRef(null),re=b.useRef(0),ce=b.useRef(null),he=b.useRef(null),pe=b.useRef({}),Se=b.useRef({}),Re=b.useRef({}),[Ae,Ke]=b.useState(new Set),[yt,xt]=b.useState(!1),[fe,Ie]=b.useState(null),[De,lt]=b.useState(()=>Date.now()),st=M2(ke=>ke.order),nt=M2(ke=>ke.setOrder),rn=b.useMemo(()=>Xx((X==null?void 0:X.settings)??Yn).map(ke=>ke.id),[X==null?void 0:X.settings]),Ce=b.useMemo(()=>{if(st.length===0)return e.projectGroups;const ke=new Map(e.projectGroups.map(ot=>[ot.groupKey,ot])),Oe=st.filter(ot=>ke.has(ot)).map(ot=>ke.get(ot)),St=new Set(st);for(const ot of e.projectGroups)St.has(ot.groupKey)||Oe.push(ot);return Oe},[e.projectGroups,st]),Ze=b.useCallback(()=>{ie({pathname:"/",search:"?newProject=1"}),v()},[ie,v]),oe=b.useMemo(()=>q?Ce:Ce.map(ke=>({...ke,features:[],generalChats:D2(ke)})),[q,Ce]),ve=b.useCallback(ke=>nt(ke),[nt]),Te=b.useMemo(()=>oe.reduce((ke,Oe)=>ke+D2(Oe).length,0),[oe]),Me=b.useCallback(ke=>{Ke(Oe=>{const St=new Set(Oe);return St.has(ke)?St.delete(ke):St.add(ke),St})},[]);b.useEffect(()=>{const ke=pe.current,Oe=Se.current,St=Re.current;Ke(Xt=>{const It=new Set([...Xt].filter(Ft=>!Ft.startsWith("project:")&&!Ft.startsWith("general:")&&!Ft.startsWith("feature:")));for(const Ft of oe)(ke[Ft.groupKey]??Ft.browserState)==="CLOSED"&&It.add(`project:${Ft.groupKey}`),(Oe[Ft.groupKey]??Ft.generalChatsBrowserState)==="CLOSED"&&It.add(`general:${Ft.groupKey}`);for(const Ft of oe)for(const yr of Ft.features)(St[yr.featureId]??yr.browserState)==="CLOSED"&&It.add(`feature:${yr.featureId}`);return It});const ot={...ke};for(const Xt of oe)ot[Xt.groupKey]===Xt.browserState&&delete ot[Xt.groupKey];pe.current=ot;const on={...Oe};for(const Xt of oe)on[Xt.groupKey]===Xt.generalChatsBrowserState&&delete on[Xt.groupKey];Se.current=on;const dn={...St};for(const Xt of oe)for(const It of Xt.features)dn[It.featureId]===It.browserState&&delete dn[It.featureId];Re.current=dn},[oe]);const Ge=b.useCallback((ke,Oe)=>{pe.current={...pe.current,[ke]:Oe},L(ke,Oe)},[L]),Ct=b.useCallback((ke,Oe)=>{Se.current={...Se.current,[ke]:Oe},D(ke,Oe)},[D]),Je=b.useCallback((ke,Oe)=>{Re.current={...Re.current,[ke]:Oe},j(ke,Oe)},[j]),je=b.useCallback(ke=>{ie(`/chat/${ke}`),l&&v()},[ie,v,l]),We=Ei(ke=>ke.showProviderIconsInSideTray),ut=b.useCallback((ke,Oe)=>f.jsx(rF,{chat:ke,activeChatId:n,nowMs:De,showProviderIcon:We,isCompleted:t.has(ke.chatId),onSelectChat:je,onDeleteChat:()=>W(ke),draggable:Oe==null?void 0:Oe.draggable,onDragStart:Oe==null?void 0:Oe.onDragStart,onDragEnd:Oe==null?void 0:Oe.onDragEnd,isTouchDevice:Oe==null?void 0:Oe.isTouchDevice,onTouchDragMove:Oe==null?void 0:Oe.onTouchDragMove,onTouchDragEnd:Oe==null?void 0:Oe.onTouchDragEnd},ke._id),[n,t,je,De,W,We]);b.useEffect(()=>{const ke=window.setInterval(()=>{lt(Date.now())},3e4);return()=>window.clearInterval(ke)},[]),b.useEffect(()=>{if(yt)return document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.body.style.cursor="",document.body.style.userSelect=""}},[yt]),b.useEffect(()=>()=>{he.current!==null&&window.cancelAnimationFrame(he.current)},[]),b.useEffect(()=>{!n||!ee.current||requestAnimationFrame(()=>{const ke=ee.current,Oe=ke==null?void 0:ke.querySelector(`[data-chat-id="${n}"]`);if(!Oe||!ke)return;const St=Oe.getBoundingClientRect(),ot=ke.getBoundingClientRect();if(St.top<ot.top+38){const on=St.top-ot.top+ke.scrollTop;ke.scrollTo({top:on-38,behavior:"smooth"})}else if(St.bottom>ot.bottom){const on=St.top+St.height/2-ot.top+ke.scrollTop,dn=ke.clientHeight/2;ke.scrollTo({top:on-dn,behavior:"smooth"})}})},[n,Te]);const Ue=Te>0,sn=A.pathname==="/",Yt=A.pathname.startsWith("/settings"),Ye=sn||Yt,qt=s==="connecting"||!o,jn=qt?"Connecting":s==="connected"?"Connected":"Disconnected",Wt=s==="connected"?"bg-emerald-500":"bg-amber-500",Bt=(P==null?void 0:P.updateAvailable)===!0,Pe=P?P.latestVersion===`${P.currentVersion}-dev`:!1,dt=(P==null?void 0:P.status)==="updating"||(P==null?void 0:P.status)==="restart_pending",wt=SW(h,u,fe??g),Vt=PA(h,u),ht=S&&S.length>0?`Toggle sidebar (${S[0]})`:"Toggle sidebar",ft=t.size>0,pn=b.useCallback(ke=>{var on;if(!Vt)return;ke.preventDefault(),xt(!0),re.current=((on=J.current)==null?void 0:on.getBoundingClientRect().left)??0,Ie(g);const Oe=dn=>{ce.current=Wp(dn-re.current),he.current===null&&(he.current=window.requestAnimationFrame(()=>{he.current=null,ce.current!==null&&Ie(ce.current)}))};Oe(ke.clientX);const St=dn=>{Oe(dn.clientX)},ot=()=>{xt(!1),he.current!==null&&(window.cancelAnimationFrame(he.current),he.current=null);const dn=ce.current??g;ce.current=null,Ie(null),C(dn),window.removeEventListener("pointermove",St),window.removeEventListener("pointerup",ot),window.removeEventListener("pointercancel",ot)};window.addEventListener("pointermove",St),window.addEventListener("pointerup",ot),window.addEventListener("pointercancel",ot)},[g,C,Vt]);return f.jsxs(f.Fragment,{children:[!l&&d&&f.jsx("div",{className:me("fixed top-2 left-2.5 z-50 md:hidden","flex items-center gap-1 flex-shrink-0","bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1"),children:f.jsxs(Xe,{variant:"ghost",size:"icon",className:"relative",onClick:p,children:[f.jsx(I_,{className:"h-5 w-5"}),ft&&f.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]})}),u&&Ye&&f.jsx("div",{className:"hidden md:flex fixed left-0 top-0 h-full z-40 items-start pt-4 pl-5 border-l border-border/0",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs("div",{className:"relative",children:[f.jsx(od,{className:"size-6 text-logo"}),ft&&f.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]}),f.jsx(Xe,{variant:"ghost",size:"icon",onClick:w,title:"Expand sidebar",children:f.jsx(F_,{className:"h-5 w-5"})})]})}),f.jsxs("div",{ref:J,"data-sidebar":"open",className:me("fixed inset-0 z-50 bg-background dark:bg-card backdrop-blur-2xl flex flex-col h-[100dvh] select-none","md:relative md:inset-auto md:bg-background md:dark:bg-card md:backdrop-blur-none md:flex-none md:mr-0 md:h-[calc(100dvh-16px)] md:my-2 md:ml-2 md:border md:border-border md:rounded-2xl",l?"flex":"hidden md:flex",u&&"md:hidden"),style:wt,children:[Vt?f.jsx("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical",className:me("group/sidebar-resize hidden md:flex absolute top-0 right-0 z-20 h-full w-3 translate-x-1/2 cursor-col-resize items-center justify-center",yt&&"after:bg-logo/70"),onPointerDown:pn,children:f.jsx("span",{className:me("h-14 w-px rounded-full bg-border/80 opacity-0 transition-opacity group-hover/sidebar-resize:opacity-100",yt&&"bg-logo/70 opacity-100")})}):null,f.jsxs("div",{className:"relative pl-2.5 md:pl-3 pr-[7px] h-[64px] max-h-[64px] md:h-[55px] md:max-h-[55px] border-b flex items-center justify-between",children:[f.jsxs("div",{className:me("flex items-center gap-1 flex-shrink-0 z-10","bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1","md:bg-transparent md:dark:bg-transparent md:backdrop-blur-none md:border-transparent md:p-0 md:rounded-none"),children:[f.jsxs(Xe,{variant:"ghost",size:"icon",className:"relative md:hidden",onClick:()=>y(h),children:[f.jsx(I_,{className:"h-5 w-5"}),ft&&f.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]}),f.jsxs("button",{type:"button",onClick:()=>y(h),title:ht,"aria-label":ht,className:"group/sidebar-collapse hidden md:flex relative items-center justify-center h-5 w-5",children:[f.jsx(od,{className:"absolute inset-0.5 h-4 w-4 sm:h-5 sm:w-5 text-logo transition-all duration-200 ease-out opacity-100 scale-100 group-hover/sidebar-collapse:opacity-0 group-hover/sidebar-collapse:scale-0"}),f.jsx(F_,{className:"absolute inset-0 h-4 w-4 sm:h-6 sm:w-6 text-slate-500 dark:text-slate-400 transition-all duration-200 ease-out opacity-0 scale-0 group-hover/sidebar-collapse:opacity-100 group-hover/sidebar-collapse:scale-80 hover:opacity-50"})]})]}),f.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 md:hidden",children:f.jsx(od,{className:"h-6 w-6 text-logo"})}),f.jsxs("div",{className:"flex items-center z-10",children:[Pe?f.jsx("span",{className:"mr-1 inline-flex items-center rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-bold tracking-wider text-muted-foreground",title:"Development build",children:"DEV"}):Bt?f.jsxs(Xe,{variant:"outline",size:"sm",className:"rounded-full !h-auto mr-1 py-0.5 px-2 bg-logo/20 hover:bg-logo text-logo border-logo/20 hover:text-foreground hover:border-logo/20 text-[11px] font-bold tracking-wider",onClick:Z,disabled:dt,title:P!=null&&P.latestVersion?`Update to ${P.latestVersion}`:"Update Kaizen",children:[dt?f.jsx(kr,{className:"mr-1.5 h-3 w-3 animate-spin"}):null,"UPDATE"]}):null,f.jsx(Xe,{variant:"ghost",size:"icon",onClick:Ze,className:"size-10 rounded-lg",title:"Add project",children:f.jsx(NN,{className:"size-5"})})]})]}),f.jsx("div",{ref:ee,"data-sidebar-scroll":!0,className:"flex-1 min-h-0 overflow-y-auto scrollbar-hide",style:{WebkitOverflowScrolling:"touch"},children:f.jsxs("div",{className:"p-[7px]",children:[!Ue&&qt?f.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(ke=>f.jsxs("div",{className:"space-y-2 animate-pulse",children:[f.jsx("div",{className:"h-4 w-28 rounded bg-muted"}),f.jsx("div",{className:"space-y-1",children:[0,1,2].map(Oe=>f.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",children:[f.jsx("div",{className:"h-3.5 w-3.5 rounded-full bg-muted"}),f.jsx("div",{className:me("h-3.5 rounded bg-muted",Oe===0?"w-32":Oe===1?"w-40":"w-28")})]},Oe))})]},ke))}):null,!Ue&&!qt&&e.projectGroups.length===0?f.jsx("p",{className:"text-sm text-slate-400 p-2 mt-6 text-center",children:"No conversations yet"}):null,f.jsx(sW,{projectGroups:oe,onReorderGroups:ve,collapsedSections:Ae,onToggleSection:Me,onSetProjectBrowserState:Ge,onSetProjectGeneralChatsBrowserState:Ct,onSetFeatureBrowserState:Je,renderChatRow:ut,onNewLocalChat:k,onCreateFeature:q?R:void 0,onRenameFeature:E,onDeleteFeature:N,onSetFeatureStage:V?H:void 0,onSetChatFeature:G,onReorderFeatures:B,onRemoveProject:O,isConnected:s==="connected",startingLocalPath:M,folderGroupsEnabled:q,showFeatureOverviewInSidebar:I,kanbanStatusesEnabled:V,activeOverviewFeatureId:r,onOpenFeatureOverview:F})]})}),f.jsxs("div",{className:"border-t border-border p-2",children:[f.jsx(hW,{providerUsage:e.providerUsage,visibleProviders:rn,onRefreshProviderUsage:$,onOpenProviderLogin:U}),f.jsx("button",{type:"button",onClick:()=>{ie("/settings/general"),v()},className:me("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",Yt?"bg-muted border-border":"border-border/0 hover:bg-muted hover:border-border active:bg-muted/80"),children:f.jsxs("div",{className:"flex items- justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(J6,{className:"h-4 w-4 text-muted-foreground"}),f.jsx("span",{className:"text-sm",children:"Settings"})]}),f.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[f.jsx("span",{children:jn}),qt?f.jsx(kr,{className:"h-2 w-2 animate-spin"}):f.jsx("span",{className:me("h-2 w-2 rounded-full",Wt)})]})]})})]})]})]})}function D2(e){return[...e.features.flatMap(t=>t.chats),...e.generalChats]}const BA={submitChatMessage:"Submit Chat Message",toggleProjectsSidebar:"Toggle Projects Sidebar",toggleEmbeddedTerminal:"Toggle Embedded Terminal",toggleRightSidebar:"Toggle Right Sidebar",openInFinder:"Open In Finder",openInEditor:"Open In Editor",addSplitTerminal:"Add Split Terminal"};function Ub(e){return(e??[]).join(", ")}function Ma(e){return e.split(",").map(t=>t.trim()).map(t=>t.toLowerCase()).filter(Boolean)}const kW=new Map([["cmd","meta"],["meta","meta"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["option","alt"],["shift","shift"]]);function EW(e,t){const n=RW(e);return n?t.key.toLowerCase()===n.key&&t.ctrlKey===n.ctrl&&t.metaKey===n.meta&&t.altKey===n.alt&&t.shiftKey===n.shift:!1}function Ia(e,t,n){return((e==null?void 0:e.bindings[t])??fs[t]).some(s=>EW(s,n))}function S0(e){return{bindings:{submitChatMessage:(e==null?void 0:e.bindings.submitChatMessage)??fs.submitChatMessage,toggleProjectsSidebar:(e==null?void 0:e.bindings.toggleProjectsSidebar)??fs.toggleProjectsSidebar,toggleEmbeddedTerminal:(e==null?void 0:e.bindings.toggleEmbeddedTerminal)??fs.toggleEmbeddedTerminal,toggleRightSidebar:(e==null?void 0:e.bindings.toggleRightSidebar)??fs.toggleRightSidebar,openInFinder:(e==null?void 0:e.bindings.openInFinder)??fs.openInFinder,openInEditor:(e==null?void 0:e.bindings.openInEditor)??fs.openInEditor,addSplitTerminal:(e==null?void 0:e.bindings.addSplitTerminal)??fs.addSplitTerminal},warning:(e==null?void 0:e.warning)??null,filePathDisplay:(e==null?void 0:e.filePathDisplay)??""}}function RW(e){const t=e.split("+").map(r=>r.trim()).filter(Boolean);if(t.length===0)return null;const n={key:"",ctrl:!1,meta:!1,alt:!1,shift:!1};for(const r of t){const s=r.toLowerCase(),o=kW.get(s);if(o==="ctrl"){n.ctrl=!0;continue}if(o==="meta"){n.meta=!0;continue}if(o==="alt"){n.alt=!0;continue}if(o==="shift"){n.shift=!0;continue}if(n.key)return null;n.key=s}return n.key?n:null}function TW(e){if(!e||typeof e!="object")return!1;const t=e;if(t.isContentEditable===!0)return!0;if(typeof t.tagName=="string"){const n=t.tagName.toLowerCase();if(n==="input"||n==="textarea"||n==="select")return!0}return typeof t.closest=="function"?!!t.closest('input, textarea, select, [contenteditable], [contenteditable="true"]'):!1}function NW(){const[e,t]=b.useState(()=>{if(typeof window>"u")return!1;const n=navigator.standalone===!0,r=window.matchMedia("(display-mode: standalone)").matches;return n||r});return b.useEffect(()=>{const n=window.matchMedia("(display-mode: standalone)"),r=s=>{t(s.matches||navigator.standalone===!0)};return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const MW=uo()(ho((e,t)=>({drafts:{},setDraft:(n,r)=>e(s=>{if(!r){const{[n]:o,...l}=s.drafts;return{drafts:l}}return{drafts:{...s.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:s,...o}=r.drafts;return{drafts:o}}),getDraft:n=>t().drafts[n]??""}),{name:"chat-input-drafts"}));async function AW(e){const t=await new Promise((n,r)=>{const s=new FileReader;s.onload=()=>{if(typeof s.result=="string"){n(s.result);return}r(new Error("Failed to read image attachment"))},s.onerror=()=>r(s.error??new Error("Failed to read image attachment")),s.readAsDataURL(e)});return{type:"image",name:e.name,mimeType:e.type,sizeBytes:e.size,dataUrl:t}}function j2(e,t){if(t===void 0){console.info(`[ChatInput] ${e}`);return}console.info(`[ChatInput] ${e}`,t)}function Zs(e,t,n,r,s){return e==="claude"?t.provider==="claude"?{provider:"claude",model:r??t.model,modelOptions:{...t.modelOptions},planMode:s??t.planMode}:{provider:"claude",model:r??n.claude.model,modelOptions:{...n.claude.modelOptions},planMode:s??n.claude.planMode}:e==="gemini"?t.provider==="gemini"?{provider:"gemini",model:r??t.model,modelOptions:{...t.modelOptions},planMode:s??t.planMode}:{provider:"gemini",model:r??n.gemini.model,modelOptions:{...n.gemini.modelOptions},planMode:s??n.gemini.planMode}:e==="cursor"?t.provider==="cursor"?{provider:"cursor",model:r??t.model,modelOptions:{...t.modelOptions},planMode:s??t.planMode}:{provider:"cursor",model:r??n.cursor.model,modelOptions:{...n.cursor.modelOptions},planMode:s??n.cursor.planMode}:t.provider==="codex"?{provider:"codex",model:r??t.model,modelOptions:{...t.modelOptions},planMode:s??t.planMode}:{provider:"codex",model:r??n.codex.model,modelOptions:{...n.codex.modelOptions},planMode:s??n.codex.planMode}}function DW(e,t,n,r){return r&&e.key==="Enter"?!1:Ia(t,"submitChatMessage",e)&&!n&&!e.isComposing}function jW(e){if(!e.providerLocked)return{composerPlanMode:e.planMode,lockedComposerState:e.lockedComposerState};const t=e.lockedComposerState??Zs(e.selectedProvider,e.composerState,e.providerDefaults);return{composerPlanMode:e.composerState.planMode,lockedComposerState:{...t,planMode:e.planMode}}}const OW=b.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:s,chatId:o,activeProvider:l,activeModel:u,activePlanMode:h,availableProviders:d,keybindings:g},p){const{getDraft:v,setDraft:y,clearDraft:w}=MW(),{composerState:S,providerDefaults:C,setComposerModel:k,setComposerModelOptions:R,setComposerPlanMode:E,resetComposerFromProvider:N}=Ei(),[L,D]=b.useState(()=>o?v(o):""),[j,H]=b.useState([]),[G,B]=b.useState(null),[q,I]=b.useState(!1),V=b.useRef(null),F=b.useRef(null),W=NW(),O=Qd("(pointer: coarse)"),[$,U]=b.useState(()=>l?Zs(l,S,C,u,h):null),X=l!==null,M=!X&&d.length===0,P=X?$??Zs(l,S,C,u,h):S,Z=X?l:S.provider,A=d.find(fe=>fe.id===Z)??tn(Z),ie=(A==null?void 0:A.supportsPlanMode)??!1,J=r||M,ee=b.useCallback(()=>{const fe=V.current;fe&&(fe.style.height="auto",fe.style.height=`${fe.scrollHeight}px`)},[]),re=b.useCallback(fe=>{if(V.current=fe,!!p){if(typeof p=="function"){p(fe);return}p.current=fe}},[p]);b.useEffect(()=>{ee()},[L,ee]),b.useEffect(()=>(window.addEventListener("resize",ee),()=>window.removeEventListener("resize",ee)),[ee]),b.useEffect(()=>{var fe;(fe=V.current)==null||fe.focus()},[o]),b.useEffect(()=>()=>{for(const fe of j)URL.revokeObjectURL(fe.previewUrl)},[j]),b.useEffect(()=>{if(l===null){U(null);return}U(Zs(l,S,C,u,h))},[u,h,l,o,S,C]),b.useEffect(()=>{X||d.length!==0&&(d.some(fe=>fe.id===S.provider)||N(d[0].id))},[d,S.provider,X,N]),b.useEffect(()=>{j2("resolved provider state",{chatId:o??null,activeProvider:l,composerProvider:S.provider,composerModel:S.model,effectiveProvider:P.provider,effectiveModel:P.model,selectedProvider:Z,providerLocked:X,lockedComposerProvider:($==null?void 0:$.provider)??null})},[l,o,S.model,S.provider,$==null?void 0:$.provider,X,P.model,P.provider,Z]);function ce(fe){if(X){U(Ie=>{const De=Ie??Zs(Z,S,C);return De.provider==="claude"?{...De,modelOptions:{...De.modelOptions,reasoningEffort:fe}}:De.provider==="gemini"?De:{...De,modelOptions:{...De.modelOptions,reasoningEffort:fe}}});return}if(Z==="claude"){R({reasoningEffort:fe});return}R({reasoningEffort:fe})}function he(fe){if(X){U(Ie=>{const De=Ie??Zs(Z,S,C);return De.provider!=="gemini"?De:{...De,modelOptions:{...De.modelOptions,thinkingMode:fe}}});return}Z==="gemini"&&R({thinkingMode:fe})}function pe(fe){if(X){U(Ie=>{const De=Ie??Zs(Z,S,C);return De.provider!=="claude"?De:{...De,modelOptions:{...De.modelOptions,contextWindow:fe}}});return}Z==="claude"&&R({contextWindow:fe})}function Se(fe){const Ie=jW({providerLocked:X,planMode:fe,selectedProvider:Z,composerState:S,providerDefaults:C,lockedComposerState:$});Ie.lockedComposerState!==$&&U(Ie.lockedComposerState),Ie.composerPlanMode!==S.planMode&&E(Ie.composerPlanMode)}function Re(){Se(!P.planMode)}async function Ae(){if(J||!L.trim()&&j.length===0)return;const fe=L,Ie=j;let De;P.provider==="claude"?De={claude:{...P.modelOptions}}:P.provider==="gemini"?De={gemini:{...P.modelOptions}}:De={codex:{...P.modelOptions}};const lt={provider:Z,model:P.model,modelOptions:De,planMode:ie?P.planMode:!1};j2("submit settings",{chatId:o??null,activeProvider:l,composerProvider:P.provider,submitOptions:lt}),D(""),B(null),o&&w(o),V.current&&(V.current.style.height="auto");try{await t({text:fe.trim(),attachments:Ie.length?await Promise.all(Ie.map(st=>AW(st.file))):void 0},lt);for(const st of Ie)URL.revokeObjectURL(st.previewUrl);H([])}catch(st){console.error("[ChatInput] Submit failed:",st),D(fe),o&&y(o,fe)}}const Ke=b.useCallback(fe=>{if(J)return;const Ie=fe.filter(De=>De.type.startsWith("image/"));if(Ie.length===0){B("Only PNG, JPEG, WEBP, and GIF images are supported.");return}H(De=>{const lt=[...De];let st=null;for(const nt of Ie){if(!Pm.includes(nt.type)){st=`Unsupported image type: ${nt.type||"unknown"}`;continue}if(nt.size<=0||nt.size>SM){st=`${nt.name} is empty or larger than 10 MB.`;continue}if(lt.length>=zm){st=`You can attach up to ${zm} images per message.`;break}lt.push({id:sd(),file:nt,name:nt.name||"image",mimeType:nt.type,sizeBytes:nt.size,previewUrl:URL.createObjectURL(nt)})}return B(st),lt})},[J]),yt=b.useCallback(fe=>{H(Ie=>{const De=Ie.find(lt=>lt.id===fe);return De&&URL.revokeObjectURL(De.previewUrl),Ie.filter(lt=>lt.id!==fe)}),B(null)},[]);function xt(fe){if(fe.key==="Tab"&&!fe.shiftKey){fe.preventDefault(),x8(V.current,document);return}if(fe.key==="Tab"&&fe.shiftKey&&ie){fe.preventDefault(),Re();return}if(fe.key==="Escape"&&s){fe.preventDefault(),n==null||n();return}DW(fe.nativeEvent,g,s,O)&&(fe.preventDefault(),Ae())}return f.jsxs("div",{className:me("p-3 pt-0 px-2 md:px-3 md:pb-2 flex flex-col items-center",W&&"px-3"),style:W?{paddingBottom:"var(--app-composer-bottom-padding)"}:void 0,children:[f.jsxs("div",{className:"flex flex-col items-center relative z-10 w-full max-w-[840px] mx-auto",children:[f.jsxs("div",{className:me("w-full border dark:bg-card/40 bg-background/95 backdrop-blur-lg border-border rounded-[29px] px-2 pb-2 transition-colors relative z-10",q&&"border-foreground/40 bg-muted/30"),onDragEnter:fe=>{r||!fe.dataTransfer.types.includes("Files")||(fe.preventDefault(),I(!0))},onDragOver:fe=>{r||!fe.dataTransfer.types.includes("Files")||(fe.preventDefault(),fe.dataTransfer.dropEffect="copy",I(!0))},onDragLeave:fe=>{if(!fe.dataTransfer.types.includes("Files"))return;fe.preventDefault();const Ie=fe.relatedTarget;Ie instanceof Node&&fe.currentTarget.contains(Ie)||I(!1)},onDrop:fe=>{var Ie;r||!fe.dataTransfer.types.includes("Files")||(fe.preventDefault(),I(!1),Ke(Array.from(fe.dataTransfer.files)),(Ie=V.current)==null||Ie.focus())},children:[f.jsx("input",{ref:F,type:"file",accept:Pm.join(","),multiple:!0,className:"hidden",onChange:fe=>{Ke(Array.from(fe.target.files??[])),fe.target.value=""}}),j.length?f.jsx("div",{className:"grid grid-cols-2 gap-2 px-2 pt-2 sm:grid-cols-3",children:j.map(fe=>f.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/80 bg-background/80",children:[f.jsx("img",{src:fe.previewUrl,alt:fe.name,className:"h-28 w-full object-cover"}),f.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 px-2 py-1.5",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate text-xs text-foreground",children:fe.name}),f.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[Math.max(1,Math.round(fe.sizeBytes/1024))," KB"]})]}),f.jsx(Xe,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>yt(fe.id),disabled:J,children:f.jsx(ro,{className:"h-3.5 w-3.5"})})]})]},fe.id))}):null,f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsx(Xe,{type:"button",variant:"ghost",size:"icon",className:"mt-1.5 md:mt-0 md:mb-1 h-10 w-10 shrink-0 rounded-full",disabled:J||s,onClick:()=>{var fe;return(fe=F.current)==null?void 0:fe.click()},children:f.jsx(ON,{className:"h-4.5 w-4.5"})}),f.jsx(Hd,{ref:re,placeholder:"Build something...",value:L,autoFocus:!0,[Lx]:"",rows:1,onChange:fe=>{D(fe.target.value),o&&y(o,fe.target.value),ee()},onPaste:fe=>{const Ie=Array.from(fe.clipboardData.files);Ie.some(De=>De.type.startsWith("image/"))&&(fe.preventDefault(),Ke(Ie))},onKeyDown:xt,disabled:J,className:"flex-1 text-base py-2 md:py-3.75 px-1 md:px-2 resize-none max-h-[200px] outline-none bg-transparent border-0 shadow-none"}),f.jsx(Xe,{type:"button",onPointerDown:fe=>{fe.preventDefault(),s?n==null||n():!J&&(L.trim()||j.length>0)&&Ae()},disabled:!s&&(J||!L.trim()&&j.length===0),size:"icon",className:"flex-shrink-0 bg-slate-600 text-white dark:bg-white dark:text-slate-900 rounded-full cursor-pointer h-10 w-10 md:h-11 md:w-11 md:mb-0.5 -mr-0.5 md:mr-0 touch-manipulation disabled:bg-white/60 disabled:text-slate-700",children:s?f.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):f.jsx(NI,{className:"h-5 w-5 md:h-6 md:w-6"})})]})]}),f.jsxs("div",{className:me("border-x border-b border-t-0 border-border rounded-b-[20px] px-3 py-1.5 transition-colors relative z-20 -mt-[1px] flex-shrink-0 shadow-sm","dark:bg-card/40 bg-background/95 backdrop-blur-lg",q&&"border-foreground/40 bg-muted/30"),children:[f.jsx("div",{className:"absolute top-0 left-0 right-0 h-[1px] bg-background"}),f.jsx(Gu,{availableProviders:d,selectedProvider:Z,disabled:J,providerLocked:X,model:P.model,modelOptions:P.modelOptions,onProviderChange:fe=>{X||N(fe)},onModelChange:(fe,Ie)=>{if(X){U(De=>({...De??Zs(Z,S,C),model:Ie}));return}k(Ie)},onClaudeReasoningEffortChange:fe=>ce(fe),onClaudeContextWindowChange:fe=>pe(fe),onCodexReasoningEffortChange:fe=>ce(fe),onGeminiThinkingModeChange:fe=>he(fe),onCodexFastModeChange:fe=>{if(X){U(Ie=>{const De=Ie??Zs(Z,S,C);return De.provider!=="codex"?De:{...De,modelOptions:{...De.modelOptions,fastMode:fe}}});return}R({fastMode:fe})},planMode:P.planMode,onPlanModeChange:Se,includePlanMode:ie,className:"w-full relative z-10"}),M?f.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No active providers are available. Re-enable one in Settings."}):null]})]}),G?f.jsx("div",{className:"max-w-[840px] mx-auto mt-2 px-2 text-xs text-destructive relative z-10",children:G}):null]})}),LW=b.memo(OW);function O2({label:e,isCurrent:t,icon:n,onClick:r,className:s}){return f.jsxs("button",{onClick:r,className:me("w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left text-sm transition-colors hover:bg-muted",s),children:[f.jsx("span",{className:"flex-shrink-0 w-4 flex items-center justify-center",children:n??(t?f.jsx(Xi,{className:"h-3.5 w-3.5 text-muted-foreground"}):null)}),f.jsx("span",{className:"flex-1 min-w-0 truncate",children:e}),t&&f.jsx("span",{className:"flex-shrink-0 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full border border-border",children:"current"})]})}function zW({projectId:e,socket:t}){const[n,r]=b.useState({phase:"loading"}),[s,o]=b.useState(!1),[l,u]=b.useState(""),h=b.useDeferredValue(l),[d,g]=b.useTransition(),p=b.useRef(null),v=b.useCallback(async()=>{try{const R=await t.command({type:"git.getBranches",projectId:e});if(!R.isRepo){r({phase:"not-a-repo"});return}r({phase:"ready",currentBranch:R.currentBranch,branches:R.branches})}catch(R){r({phase:"error",message:R instanceof Error?R.message:String(R)})}},[e,t]);b.useEffect(()=>{v()},[v]),b.useEffect(()=>{s&&(u(""),v())},[s,v]),b.useEffect(()=>{if(s&&n.phase==="ready"){const R=setTimeout(()=>{var E;return(E=p.current)==null?void 0:E.focus()},50);return()=>clearTimeout(R)}},[s,n.phase]);function y(R){n.phase!=="ready"||R===n.currentBranch||(o(!1),g(async()=>{try{await t.command({type:"git.switchBranch",projectId:e,branchName:R}),await v()}catch(E){r({phase:"error",message:E instanceof Error?E.message:String(E)})}}))}function w(R){R.trim()&&(o(!1),g(async()=>{try{await t.command({type:"git.createBranch",projectId:e,branchName:R.trim(),checkout:!0}),await v()}catch(E){r({phase:"error",message:E instanceof Error?E.message:String(E)})}}))}if(n.phase==="not-a-repo")return null;const S=n.phase==="ready"?n.branches.filter(R=>R.toLowerCase().includes(h.toLowerCase())):[],C=n.phase==="ready"&&n.branches.some(R=>R===h.trim()),k=h.trim().length>0&&!C;return f.jsxs(PM,{open:s,onOpenChange:o,children:[f.jsx(BM,{asChild:!0,children:f.jsxs(Xe,{variant:"ghost",size:"icon",className:me("h-10 w-auto max-w-[180px] gap-1.5 rounded-lg border border-border/0 px-3 text-sm text-muted-foreground",n.phase==="error"&&"text-destructive"),children:[d?f.jsx(kr,{className:"h-4.5 w-4.5 flex-shrink-0 animate-spin"}):f.jsx(S6,{className:"h-4.5 w-4.5 flex-shrink-0"}),n.phase==="ready"&&f.jsx("span",{className:"truncate",children:n.currentBranch??"HEAD detached"}),n.phase==="error"&&f.jsx("span",{className:"truncate",children:"git error"})]})}),f.jsxs(Jx,{align:"end",className:"w-64 p-0 overflow-hidden",children:[f.jsx("div",{className:"border-b border-border",children:f.jsx("input",{ref:p,value:l,onChange:R=>u(R.target.value),placeholder:"Search or create branch...",className:"w-full px-3 py-2 text-sm bg-transparent outline-none placeholder:text-muted-foreground",onKeyDown:R=>{R.key==="Enter"&&k&&w(l)}})}),f.jsxs("div",{className:"max-h-[220px] overflow-y-auto p-1",children:[n.phase==="loading"&&f.jsx("div",{className:"flex items-center justify-center py-6 text-muted-foreground",children:f.jsx(kr,{className:"h-4 w-4 animate-spin"})}),n.phase==="error"&&f.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:n.message}),n.phase==="ready"&&f.jsxs(f.Fragment,{children:[S.length===0&&!k&&f.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No branches match"}),S.map(R=>f.jsx(O2,{label:R,isCurrent:R===n.currentBranch,onClick:()=>y(R)},R)),k&&f.jsx(O2,{label:`Create branch "${h.trim()}"`,icon:f.jsx(Dx,{className:"h-3.5 w-3.5 text-muted-foreground"}),onClick:()=>w(l),className:"text-muted-foreground border-t border-border/50 mt-1 pt-2 rounded-none"})]})]})]})]})}const C0=b.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:me("bg-card text-card-foreground",e),...t}));C0.displayName="Card";const IA=b.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-2",e),...t}));IA.displayName="CardHeader";const PW=b.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));PW.displayName="CardTitle";const BW=b.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));BW.displayName="CardDescription";const k0=b.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:me("p-6 pt-0",e),...t}));k0.displayName="CardContent";const IW=b.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));IW.displayName="CardFooter";function FW({sidebarCollapsed:e,hasCompletedChats:t=!1,onOpenSidebar:n,onExpandSidebar:r,usage:s,localPath:o,embeddedTerminalVisible:l=!1,onToggleEmbeddedTerminal:u,rightSidebarVisible:h=!1,onToggleRightSidebar:d,onOpenExternal:g,editorLabel:p="Editor",projectId:v,socket:y,finderShortcut:w,editorShortcut:S,terminalShortcut:C,rightSidebarShortcut:k}){const R=N=>N==null?"Unavailable":`${Math.round(N)}%`,E=s!=null&&s.warnings.includes("context_critical")||s!=null&&s.warnings.includes("rate_critical")?"text-amber-300 bg-amber-500/10":s!=null&&s.warnings.includes("context_warning")||s!=null&&s.warnings.includes("rate_warning")?"text-amber-100 bg-amber-500/5":"text-muted-foreground bg-background/70";return f.jsx(IA,{className:me("absolute top-0 md:top-2 left-0 right-0 z-10 px-2.5 border-border/0 md:pb-0 flex items-center justify-center",e?"md:px-2.5 md:pr-4":"md:px-4 md:pr-4"," bg-gradient-to-b from-background"),children:f.jsxs("div",{className:"relative flex items-center gap-2 w-full",children:[f.jsxs("div",{className:me("flex items-center gap-1 flex-shrink-0","bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1",!e&&"md:bg-transparent md:dark:bg-transparent md:backdrop-blur-none md:border-transparent md:p-0"),children:[f.jsxs(Xe,{variant:"ghost",size:"icon",className:"relative md:hidden",onClick:n,children:[f.jsx(I_,{className:"h-5 w-5"}),t&&f.jsx("span",{className:"absolute top-0.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background"})]}),e&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative flex items-center justify-center w-[40px] h-[40px]",children:[f.jsx(od,{className:"h-4 w-4 sm:h-5 sm:w-5 ml-1 hidden md:block"}),t&&f.jsx("span",{className:"absolute top-1.5 right-0.5 size-2.5 rounded-full bg-emerald-400 ring-2 ring-background hidden md:block"})]}),f.jsx(Xe,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:r,title:"Expand sidebar",children:f.jsx(F_,{className:"size-4.5"})})]})]}),f.jsx("div",{className:"flex-1 min-w-0"}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 bg-background/80 dark:bg-card/40 backdrop-blur-lg border border-border rounded-[20px] p-1",children:[v?f.jsxs("div",{className:"hidden md:flex items-center gap-1 mr-1",children:[f.jsxs(bs,{children:[(s==null?void 0:s.contextUsedPercent)!==null&&(s==null?void 0:s.contextUsedPercent)!==void 0?f.jsx(_s,{asChild:!0,children:f.jsxs("div",{className:me("px-2.5 py-1 rounded-lg text-[14px] font-medium",E),children:["Context: ",R(s.contextUsedPercent)]})}):null,f.jsx(Ki,{side:"bottom",children:(s==null?void 0:s.contextWindowTokens)!==null&&(s==null?void 0:s.contextWindowTokens)!==void 0&&(s==null?void 0:s.threadTokens)!==null&&(s==null?void 0:s.threadTokens)!==void 0?`${Math.round(s.threadTokens).toLocaleString()} of ${Math.round(s.contextWindowTokens).toLocaleString()} tokens`:"Context window unavailable for this chat yet"})]}),((s==null?void 0:s.sessionLimitUsedPercent)??0)>=75?f.jsxs(bs,{children:[f.jsx(_s,{asChild:!0,children:f.jsxs("div",{className:me("px-2.5 py-1 rounded-lg border text-[11px] font-medium",E),children:["Session: ",R(s==null?void 0:s.sessionLimitUsedPercent)]})}),f.jsx(Ki,{side:"bottom",children:s!=null&&s.rateLimitResetAt?`Resets ${new Date(s.rateLimitResetAt).toLocaleString()}`:"No reset time available yet"})]}):null]}):null,v?f.jsx(zW,{projectId:v,socket:y}):null,o&&(g||u)&&f.jsxs(f.Fragment,{children:[g?f.jsxs(qu,{children:[f.jsx(Ku,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",onClick:()=>g("open_finder"),title:"Open in Finder",className:"border border-border/0",children:f.jsx(TN,{className:"h-4.5 w-4.5"})})}),f.jsx(rc,{side:"bottom",shortcut:w})]}):null,u?f.jsxs(qu,{children:[f.jsx(Ku,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",onClick:u,className:me("border border-border/0",l&&"text-white"),children:f.jsx(jx,{className:"h-4.5 w-4.5"})})}),f.jsx(rc,{side:"bottom",shortcut:C})]}):null,g?f.jsxs(qu,{children:[f.jsx(Ku,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",onClick:()=>g("open_editor"),title:`Open in ${p}`,className:"border border-border/0",children:f.jsx(B_,{className:"h-4.5 w-4.5"})})}),f.jsx(rc,{side:"bottom",shortcut:S})]}):null]}),d?f.jsxs(qu,{children:[f.jsx(Ku,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon",onClick:d,className:me("border border-border/0",h&&"text-white"),children:f.jsx(W6,{className:"h-4.5 w-4.5"})})}),f.jsx(rc,{side:"bottom",shortcut:k})]}):null]})]})})}function L2({onClose:e,className:t}){return f.jsx("div",{className:me("h-full min-h-0 bg-background md:min-w-[300px] md:border-l md:border-border",t),children:f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[f.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[f.jsx("div",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:"Diffs"}),f.jsx("button",{type:"button","aria-label":"Close right sidebar",onClick:e,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:f.jsx(ro,{className:"h-4 w-4"})})]}),f.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"diffs coming soon"})})]})})}function HW(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function UW(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function $W(e){return e/100*window.innerHeight}function WW(e){return e/100*window.innerWidth}function VW(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function Zu({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,o]=VW(n);switch(o){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=UW(t,s);break}case"em":{r=HW(t,s);break}case"vh":{r=$W(s);break}case"vw":{r=WW(s);break}}return r}function Yr(e){return parseFloat(e.toFixed(3))}function _c({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,s)=>(r+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,r),0)}function py(e){const{panels:t}=e,n=_c({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:s,panelConstraints:o}=r;let l=0;if(o.collapsedSize!==void 0){const g=Zu({groupSize:n,panelElement:s,styleProp:o.collapsedSize});l=Yr(g/n*100)}let u;if(o.defaultSize!==void 0){const g=Zu({groupSize:n,panelElement:s,styleProp:o.defaultSize});u=Yr(g/n*100)}let h=0;if(o.minSize!==void 0){const g=Zu({groupSize:n,panelElement:s,styleProp:o.minSize});h=Yr(g/n*100)}let d=100;if(o.maxSize!==void 0){const g=Zu({groupSize:n,panelElement:s,styleProp:o.maxSize});d=Yr(g/n*100)}return{groupResizeBehavior:o.groupResizeBehavior,collapsedSize:l,collapsible:o.collapsible===!0,defaultSize:u,disabled:o.disabled,minSize:h,maxSize:d,panelId:r.id}})}function nn(e,t="Assertion error"){if(!e)throw Error(t)}function gy(e,t){return Array.from(t).sort(e==="horizontal"?qW:KW)}function qW(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function KW(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function FA(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function HA(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function GW({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,o=Number.MAX_VALUE;for(const l of t){const{x:u,y:h}=HA(r,l),d=e==="horizontal"?u:h;d<o&&(o=d,s=l)}return nn(s,"No rect found"),s}let Hf;function YW(){return Hf===void 0&&(typeof matchMedia=="function"?Hf=!!matchMedia("(pointer:coarse)").matches:Hf=!1),Hf}function UA(e){const{element:t,orientation:n,panels:r,separators:s}=e,o=gy(n,Array.from(t.children).filter(FA).map(w=>({element:w}))).map(({element:w})=>w),l=[];let u=!1,h=!1,d=-1,g=-1,p=0,v,y=[];{let w=-1;for(const S of o)S.hasAttribute("data-panel")&&(w++,S.hasAttribute("data-disabled")||(p++,d===-1&&(d=w),g=w))}if(p>1){let w=-1;for(const S of o)if(S.hasAttribute("data-panel")){w++;const C=r.find(k=>k.element===S);if(C){if(v){const k=v.element.getBoundingClientRect(),R=S.getBoundingClientRect();let E;if(h){const N=n==="horizontal"?new DOMRect(k.right,k.top,0,k.height):new DOMRect(k.left,k.bottom,k.width,0),L=n==="horizontal"?new DOMRect(R.left,R.top,0,R.height):new DOMRect(R.left,R.top,R.width,0);switch(y.length){case 0:{E=[N,L];break}case 1:{const D=y[0],j=GW({orientation:n,rects:[k,R],targetRect:D.element.getBoundingClientRect()});E=[D,j===k?L:N];break}default:{E=y;break}}}else y.length?E=y:E=[n==="horizontal"?new DOMRect(k.right,R.top,R.left-k.right,R.height):new DOMRect(R.left,k.bottom,R.width,R.top-k.bottom)];for(const N of E){let L="width"in N?N:N.element.getBoundingClientRect();const D=YW()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<D){const H=D-L.width;L=new DOMRect(L.x-H/2,L.y,L.width+H,L.height)}if(L.height<D){const H=D-L.height;L=new DOMRect(L.x,L.y-H/2,L.width,L.height+H)}const j=w<=d||w>g;!u&&!j&&l.push({group:e,groupSize:_c({group:e}),panels:[v,C],separator:"width"in N?void 0:N,rect:L}),u=!1}}h=!1,v=C,y=[]}}else if(S.hasAttribute("data-separator")){S.ariaDisabled!==null&&(u=!0);const C=s.find(k=>k.element===S);C?y.push(C):(v=void 0,y=[])}else h=!0}return l}var Qo,oT;let $A=(oT=class{constructor(){qC(this,Qo,{})}addListener(t,n){const r=Au(this,Qo)[t];return r===void 0?Au(this,Qo)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=Au(this,Qo)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,o=null;const l=Array.from(r);for(let u=0;u<l.length;u++){const h=l[u];try{h.call(null,n)}catch(d){o===null&&(s=!0,o=d)}}if(s)throw o}}removeAllListeners(){KC(this,Qo,{})}removeListener(t,n){const r=Au(this,Qo)[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},Qo=new WeakMap,oT),ys=new Map;const WA=new $A;function XW(e){ys=new Map(ys),ys.delete(e)}function z2(e,t){for(const[n]of ys)if(n.id===e)return n}function ta(e,t){for(const[n,r]of ys)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function al(){return ys}function E0(e,t){return WA.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function oo(e,t){const n=ys.get(e);ys=new Map(ys),ys.set(e,t),WA.emit("groupChange",{group:e,prev:n,next:t})}function ZW(e,t,n){let r,s={x:1/0,y:1/0};for(const o of t){const l=HA(n,o.rect);switch(e){case"horizontal":{l.x<=s.x&&(r=o,s=l);break}case"vertical":{l.y<=s.y&&(r=o,s=l);break}}}return r?{distance:s,hitRegion:r}:void 0}function QW(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function JW(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:I2(e),b:I2(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();nn(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:B2(P2(n.a)),b:B2(P2(n.b))};if(s.a===s.b){const o=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let u=o.length;for(;u--;){const h=o[u];if(h===l.a)return 1;if(h===l.b)return-1}}return Math.sign(s.a-s.b)}const eV=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function tV(e){const t=getComputedStyle(VA(e)??e).display;return t==="flex"||t==="inline-flex"}function nV(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||tV(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||eV.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function P2(e){let t=e.length;for(;t--;){const n=e[t];if(nn(n,"Missing node"),nV(n))return n}return null}function B2(e){return e&&Number(getComputedStyle(e).zIndex)||0}function I2(e){const t=[];for(;e;)t.push(e),e=VA(e);return t}function VA(e){const{parentNode:t}=e;return QW(t)?t.host:t}function rV(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function iV({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!FA(n)||n.contains(e)||e.contains(n))return!0;if(JW(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(rV(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function R0(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const o=UA(s),l=ZW(s.orientation,o,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&iV({groupElement:s.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function sV(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Dr(e,t,n=0){return Math.abs(Yr(e)-Yr(t))<=n}function ms(e,t){return Dr(e,t)?0:e>t?1:-1}function sc({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:o,disabled:l,maxSize:u=100,minSize:h=0}=t;if(l&&!e)return n;if(ms(r,h)<0)if(o){const d=(s+h)/2;ms(r,d)<0?r=s:r=h}else r=h;return r=Math.min(u,r),r=Yr(r),r}function Td({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:o}){if(Dr(e,0))return t;const l=o==="imperative-api",u=Object.values(t),h=Object.values(s),d=[...u],[g,p]=r;nn(g!=null,"Invalid first pivot index"),nn(p!=null,"Invalid second pivot index");let v=0;switch(o){case"keyboard":{{const S=e<0?p:g,C=n[S];nn(C,`Panel constraints not found for index ${S}`);const{collapsedSize:k=0,collapsible:R,minSize:E=0}=C;if(R){const N=u[S];if(nn(N!=null,`Previous layout not found for panel index ${S}`),Dr(N,k)){const L=E-N;ms(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const S=e<0?g:p,C=n[S];nn(C,`No panel constraints found for index ${S}`);const{collapsedSize:k=0,collapsible:R,minSize:E=0}=C;if(R){const N=u[S];if(nn(N!=null,`Previous layout not found for panel index ${S}`),Dr(N,E)){const L=N-k;ms(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const S=e<0?p:g,C=n[S];nn(C,`Panel constraints not found for index ${S}`);const k=u[S],{collapsible:R,collapsedSize:E,minSize:N}=C;if(R&&ms(k,N)<0)if(e>0){const L=N-E,D=L/2,j=k+e;ms(j,N)<0&&(e=ms(e,D)<=0?0:L)}else{const L=N-E,D=100-L/2,j=k-e;ms(j,N)<0&&(e=ms(100+e,D)>0?0:-L)}break}}{const S=e<0?1:-1;let C=e<0?p:g,k=0;for(;;){const E=u[C];nn(E!=null,`Previous layout not found for panel index ${C}`);const N=sc({overrideDisabledPanels:l,panelConstraints:n[C],prevSize:E,size:100})-E;if(k+=N,C+=S,C<0||C>=n.length)break}const R=Math.min(Math.abs(e),Math.abs(k));e=e<0?0-R:R}{let S=e<0?g:p;for(;S>=0&&S<n.length;){const C=Math.abs(e)-Math.abs(v),k=u[S];nn(k!=null,`Previous layout not found for panel index ${S}`);const R=k-C,E=sc({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:k,size:R});if(!Dr(k,E)&&(v+=k-E,d[S]=E,v.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?S--:S++}}if(sV(h,d))return s;{const S=e<0?p:g,C=u[S];nn(C!=null,`Previous layout not found for panel index ${S}`);const k=C+v,R=sc({overrideDisabledPanels:l,panelConstraints:n[S],prevSize:C,size:k});if(d[S]=R,!Dr(R,k)){let E=k-R,N=e<0?p:g;for(;N>=0&&N<n.length;){const L=d[N];nn(L!=null,`Previous layout not found for panel index ${N}`);const D=L+E,j=sc({overrideDisabledPanels:l,panelConstraints:n[N],prevSize:L,size:D});if(Dr(L,j)||(E-=j-L,d[N]=j),Dr(E,0))break;e>0?N--:N++}}}const y=Object.values(d).reduce((S,C)=>C+S,0);if(!Dr(y,100,.1))return s;const w=Object.keys(s);return d.reduce((S,C,k)=>(S[w[k]]=C,S),{})}function Za(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||ms(e[n],t[n])!==0)return!1;return!0}function Qa({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((u,h)=>u+h,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!Dr(s,100)&&r.length>0)for(let u=0;u<t.length;u++){const h=r[u];nn(h!=null,`No layout data found for index ${u}`);const d=100/s*h;r[u]=d}let o=0;for(let u=0;u<t.length;u++){const h=n[u];nn(h!=null,`No layout data found for index ${u}`);const d=r[u];nn(d!=null,`No layout data found for index ${u}`);const g=sc({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});d!=g&&(o+=d-g,r[u]=g)}if(!Dr(o,0))for(let u=0;u<t.length;u++){const h=r[u];nn(h!=null,`No layout data found for index ${u}`);const d=h+o,g=sc({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});if(h!==g&&(o-=g-h,r[u]=g,Dr(o,0)))break}const l=Object.keys(e);return r.reduce((u,h,d)=>(u[l[d]]=h,u),{})}function qA({groupId:e,panelId:t}){const n=()=>{const u=al();for(const[h,{defaultLayoutDeferred:d,derivedPanelConstraints:g,layout:p,groupSize:v,separatorToPanels:y}]of u)if(h.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:g,group:h,groupSize:v,layout:p,separatorToPanels:y};throw Error(`Group ${e} not found`)},r=()=>{const u=n().derivedPanelConstraints.find(h=>h.panelId===t);if(u!==void 0)return u;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const u=n().group.panels.find(h=>h.id===t);if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},o=()=>{const u=n().layout[t];if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},l=u=>{const h=o();if(u===h)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:g,group:p,groupSize:v,layout:y,separatorToPanels:w}=n(),S=p.panels.findIndex(E=>E.id===t),C=S===p.panels.length-1,k=Td({delta:C?h-u:u-h,initialLayout:y,panelConstraints:g,pivotIndices:C?[S-1,S]:[S,S+1],prevLayout:y,trigger:"imperative-api"}),R=Qa({layout:k,panelConstraints:g});Za(y,R)||oo(p,{defaultLayoutDeferred:d,derivedPanelConstraints:g,groupSize:v,layout:R,separatorToPanels:w})};return{collapse:()=>{const{collapsible:u,collapsedSize:h}=r(),{mutableValues:d}=s(),g=o();u&&g!==h&&(d.expandToSize=g,l(h))},expand:()=>{const{collapsible:u,collapsedSize:h,minSize:d}=r(),{mutableValues:g}=s(),p=o();if(u&&p===h){let v=g.expandToSize??d;v===0&&(v=1),l(v)}},getSize:()=>{const{group:u}=n(),h=o(),{element:d}=s(),g=u.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:h,inPixels:g}},isCollapsed:()=>{const{collapsible:u,collapsedSize:h}=r(),d=o();return u&&Dr(h,d)},resize:u=>{const{group:h}=n(),{element:d}=s(),g=_c({group:h}),p=Zu({groupSize:g,panelElement:d,styleProp:u}),v=Yr(p/g*100);l(v)}}}function F2(e){if(e.defaultPrevented)return;const t=al();R0(e,t).forEach(n=>{if(n.separator){const r=n.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(r){const s=r.panelConstraints.defaultSize,o=qA({groupId:n.group.id,panelId:r.id});o&&s!==void 0&&(o.resize(s),e.preventDefault())}}})}function mm(e){const t=al();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function KA({groupId:e}){const t=()=>{const n=al();for(const[r,s]of n)if(r.id===e)return{group:r,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:s,group:o,groupSize:l,layout:u,separatorToPanels:h}=t(),d=Qa({layout:n,panelConstraints:s});return r?u:(Za(u,d)||oo(o,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:l,layout:d,separatorToPanels:h}),d)}}}function Aa(e,t){const n=mm(e),r=ta(n.id,!0),s=n.separators.find(g=>g.element===e);nn(s,"Matching separator not found");const o=r.separatorToPanels.get(s);nn(o,"Matching panels not found");const l=o.map(g=>n.panels.indexOf(g)),u=KA({groupId:n.id}).getLayout(),h=Td({delta:t,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:l,prevLayout:u,trigger:"keyboard"}),d=Qa({layout:h,panelConstraints:r.derivedPanelConstraints});Za(u,d)||oo(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels})}function H2(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=mm(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Aa(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Aa(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Aa(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Aa(t,-5);break}case"End":{e.preventDefault(),Aa(t,100);break}case"Enter":{e.preventDefault();const r=mm(t),s=ta(r.id,!0),{derivedPanelConstraints:o,layout:l,separatorToPanels:u}=s,h=r.separators.find(v=>v.element===t);nn(h,"Matching separator not found");const d=u.get(h);nn(d,"Matching panels not found");const g=d[0],p=o.find(v=>v.panelId===g.id);if(nn(p,"Panel metadata not found"),p.collapsible){const v=l[g.id],y=p.collapsedSize===v?r.mutableState.expandedPanelSizes[g.id]??p.minSize:p.collapsedSize;Aa(t,y-v)}break}case"F6":{e.preventDefault();const r=mm(t).separators.map(l=>l.element),s=Array.from(r).findIndex(l=>l===e.currentTarget);nn(s!==null,"Index not found");const o=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[o].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Aa(t,-100);break}}}let dc={cursorFlags:0,state:"inactive"};const T0=new $A;function Ja(){return dc}function oV(e){return T0.addListener("change",e)}function aV(e){const t=dc,n={...dc};n.cursorFlags=e,dc=n,T0.emit("change",{prev:t,next:n})}function hc(e){const t=dc;dc=e,T0.emit("change",{prev:t,next:e})}function U2(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=al(),n=R0(e,t),r=new Map;let s=!1;n.forEach(o=>{o.separator&&(s||(s=!0,o.separator.element.focus({preventScroll:!0})));const l=t.get(o.group);l&&r.set(o.group,l.layout)}),hc({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const lV=e=>e,$b=()=>{},GA=1,YA=2,XA=4,ZA=8,$2=3,W2=12;let Uf;function V2(){return Uf===void 0&&(Uf=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Uf=!0)),Uf}function cV({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(o=>{if(!o.mutableState.disableCursor)switch(o.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&V2()){const o=(e&GA)!==0,l=(e&YA)!==0,u=(e&XA)!==0,h=(e&ZA)!==0;if(o)return u?"se-resize":h?"ne-resize":"e-resize";if(l)return u?"sw-resize":h?"nw-resize":"w-resize";if(u)return"s-resize";if(h)return"n-resize"}break}}return V2()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const q2=new WeakMap;function N0(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=q2.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=Ja();switch(r.state){case"active":case"hover":{const s=cV({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(l=>l.group),state:r.state}),o=`*, *:hover {cursor: ${s} !important; }`;if(t===o)return;t=o,s?n.cssRules.length===0?n.insertRule(o):n.replaceSync(o):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}q2.set(e,{prevStyle:t,styleSheet:n})}function QA({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:o,prevCursorFlags:l}){let u=0;n.forEach(d=>{const{group:g,groupSize:p}=d,{orientation:v,panels:y}=g,{disableCursor:w}=g.mutableState;let S=0;o?v==="horizontal"?S=(t.clientX-o.x)/p*100:S=(t.clientY-o.y)/p*100:v==="horizontal"?S=t.clientX<0?-100:100:S=t.clientY<0?-100:100;const C=r.get(g),k=s.get(g);if(!C||!k)return;const{defaultLayoutDeferred:R,derivedPanelConstraints:E,groupSize:N,layout:L,separatorToPanels:D}=k;if(E&&L&&D){const j=Td({delta:S,initialLayout:C,panelConstraints:E,pivotIndices:d.panels.map(H=>y.indexOf(H)),prevLayout:L,trigger:"mouse-or-touch"});if(Za(j,L)){if(S!==0&&!w)switch(v){case"horizontal":{u|=S<0?GA:YA;break}case"vertical":{u|=S<0?XA:ZA;break}}}else oo(d.group,{defaultLayoutDeferred:R,derivedPanelConstraints:E,groupSize:N,layout:j,separatorToPanels:D})}});let h=0;t.movementX===0?h|=l&$2:h|=u&$2,t.movementY===0?h|=l&W2:h|=u&W2,aV(h),N0(e)}function K2(e){const t=al(),n=Ja();switch(n.state){case"active":QA({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function G2(e){var r,s;if(e.defaultPrevented)return;const t=Ja(),n=al();switch(t.state){case"active":{if(e.buttons===0){hc({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{const l=ta(o.group.id,!0);oo(o.group,l)});return}for(const o of t.hitRegions)if(o.separator){const{element:l}=o.separator;(r=l.hasPointerCapture)!=null&&r.call(l,e.pointerId)||((s=l.setPointerCapture)==null||s.call(l,e.pointerId))}QA({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const o=R0(e,n);o.length===0?t.state!=="inactive"&&hc({cursorFlags:0,state:"inactive"}):hc({cursorFlags:0,hitRegions:o,state:"hover"}),N0(e.currentTarget);break}}}function Y2(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Ja().state){case"hover":hc({cursorFlags:0,state:"inactive"})}}function X2(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Ja();switch(t.state){case"active":hc({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(N0(e.currentTarget),t.hitRegions.forEach(n=>{const r=ta(n.group.id,!0);oo(n.group,r)}),e.preventDefault())}}function Z2(e){let t=0,n=0;const r={};for(const o of e)if(o.defaultSize!==void 0){t++;const l=Yr(o.defaultSize);n+=l,r[o.panelId]=l}else r[o.panelId]=void 0;const s=e.length-t;if(s!==0){const o=Yr((100-n)/s);for(const l of e)l.defaultSize===void 0&&(r[l.panelId]=o)}return r}function uV(e,t,n){if(!n[0])return;const r=e.panels.find(h=>h.element===t);if(!r||!r.onResize)return;const s=_c({group:e}),o=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,l=r.mutableValues.prevSize,u={asPercentage:Yr(o/s*100),inPixels:o};r.mutableValues.prevSize=u,r.onResize(u,r.id,l)}function dV(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function hV({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,o=0,l=!1;const u=new Map,h=[];for(const p of e.panels){const v=r[p.id]??0;switch(p.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{l=!0;const y=v/100*n,w=Yr(y/t*100);u.set(p.id,w),s+=w;break}case"preserve-relative-size":default:{h.push(p.id),o+=v;break}}}if(!l||h.length===0)return r;const d=100-s,g={...r};if(u.forEach((p,v)=>{g[v]=p}),o>0)for(const p of h){const v=r[p]??0;g[p]=Yr(v/o*d)}else{const p=Yr(d/h.length);for(const v of h)g[v]=p}return g}function fV(e,t){const n=e.map(s=>s.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!r.includes(s))return!1;return!0}const Gl=new Map;function mV(e){let t=!0;nn(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,o=new n(w=>{for(const S of w){const{borderBoxSize:C,target:k}=S;if(k===e.element){if(t){const R=_c({group:e});if(R===0)return;const E=ta(e.id);if(!E)return;const N=py(e),L=E.defaultLayoutDeferred?Z2(N):E.layout,D=hV({group:e,nextGroupSize:R,prevGroupSize:E.groupSize,prevLayout:L}),j=Qa({layout:D,panelConstraints:N});if(!E.defaultLayoutDeferred&&Za(E.layout,j)&&dV(E.derivedPanelConstraints,N)&&E.groupSize===R)return;oo(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:N,groupSize:R,layout:j,separatorToPanels:E.separatorToPanels})}}else uV(e,k,C)}});o.observe(e.element),e.panels.forEach(w=>{nn(!r.has(w.id),`Panel ids must be unique; id "${w.id}" was used more than once`),r.add(w.id),w.onResize&&o.observe(w.element)});const l=_c({group:e}),u=py(e),h=e.panels.map(({id:w})=>w).join(",");let d=e.mutableState.defaultLayout;d&&(fV(e.panels,d)||(d=void 0));const g=e.mutableState.layouts[h]??d??Z2(u),p=Qa({layout:g,panelConstraints:u}),v=e.element.ownerDocument;Gl.set(v,(Gl.get(v)??0)+1);const y=new Map;return UA(e).forEach(w=>{w.separator&&y.set(w.separator,w.panels)}),oo(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:u,groupSize:l,layout:p,separatorToPanels:y}),e.separators.forEach(w=>{nn(!s.has(w.id),`Separator ids must be unique; id "${w.id}" was used more than once`),s.add(w.id),w.element.addEventListener("keydown",H2)}),Gl.get(v)===1&&(v.addEventListener("dblclick",F2,!0),v.addEventListener("pointerdown",U2,!0),v.addEventListener("pointerleave",K2),v.addEventListener("pointermove",G2),v.addEventListener("pointerout",Y2),v.addEventListener("pointerup",X2,!0)),function(){t=!1,Gl.set(v,Math.max(0,(Gl.get(v)??0)-1)),XW(e),e.separators.forEach(w=>{w.element.removeEventListener("keydown",H2)}),Gl.get(v)||(v.removeEventListener("dblclick",F2,!0),v.removeEventListener("pointerdown",U2,!0),v.removeEventListener("pointerleave",K2),v.removeEventListener("pointermove",G2),v.removeEventListener("pointerout",Y2),v.removeEventListener("pointerup",X2,!0)),o.disconnect()}}function pV(){const[e,t]=b.useState({}),n=b.useCallback(()=>t({}),[]);return[e,n]}function M0(e){const t=b.useId();return`${e??t}`}const ll=typeof window<"u"?b.useLayoutEffect:b.useEffect;function ud(e){const t=b.useRef(e);return ll(()=>{t.current=e},[e]),b.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function A0(...e){return ud(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function D0(e){const t=b.useRef({...e});return ll(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const JA=b.createContext(null);function gV(e,t){const n=b.useRef({getLayout:()=>({}),setLayout:lV});b.useImperativeHandle(t,()=>n.current,[]),ll(()=>{Object.assign(n.current,KA({groupId:e}))})}function eD({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:o,groupRef:l,id:u,onLayoutChange:h,onLayoutChanged:d,orientation:g="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:v,...y}){const w=b.useRef({onLayoutChange:{},onLayoutChanged:{}}),S=ud(q=>{Za(w.current.onLayoutChange,q)||(w.current.onLayoutChange=q,h==null||h(q))}),C=ud(q=>{Za(w.current.onLayoutChanged,q)||(w.current.onLayoutChanged=q,d==null||d(q))}),k=M0(u),R=b.useRef(null),[E,N]=pV(),L=b.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),D=A0(R,o);gV(k,l);const j=ud((q,I)=>{const V=Ja(),F=z2(q),W=ta(q);if(W){let O=!1;switch(V.state){case"active":{O=V.hitRegions.some($=>$.group===F);break}}return{flexGrow:W.layout[I]??1,pointerEvents:O?"none":void 0}}if(n!=null&&n[I])return{flexGrow:n==null?void 0:n[I]}}),H=D0({defaultLayout:n,disableCursor:r}),G=b.useMemo(()=>({get disableCursor(){return!!H.disableCursor},getPanelStyles:j,id:k,orientation:g,registerPanel:q=>{const I=L.current;return I.panels=gy(g,[...I.panels,q]),N(),()=>{I.panels=I.panels.filter(V=>V!==q),N()}},registerSeparator:q=>{const I=L.current;return I.separators=gy(g,[...I.separators,q]),N(),()=>{I.separators=I.separators.filter(V=>V!==q),N()}},togglePanelDisabled:(q,I)=>{const V=L.current.panels.find(O=>O.id===q);V&&(V.panelConstraints.disabled=I);const F=z2(k),W=ta(k);F&&W&&oo(F,{...W,derivedPanelConstraints:py(F)})},toggleSeparatorDisabled:(q,I)=>{const V=L.current.separators.find(F=>F.id===q);V&&(V.disabled=I)}}),[j,k,N,g,H]),B=b.useRef(null);return ll(()=>{const q=R.current;if(q===null)return;const I=L.current;let V;if(H.defaultLayout!==void 0&&Object.keys(H.defaultLayout).length===I.panels.length){V={};for(const M of I.panels){const P=H.defaultLayout[M.id];P!==void 0&&(V[M.id]=P)}}const F={disabled:!!s,element:q,id:k,mutableState:{defaultLayout:V,disableCursor:!!H.disableCursor,expandedPanelSizes:L.current.lastExpandedPanelSizes,layouts:L.current.layouts},orientation:g,panels:I.panels,resizeTargetMinimumSize:I.resizeTargetMinimumSize,separators:I.separators};B.current=F;const W=mV(F),{defaultLayoutDeferred:O,derivedPanelConstraints:$,layout:U}=ta(F.id,!0);!O&&$.length>0&&(S(U),C(U));const X=E0(k,M=>{const{defaultLayoutDeferred:P,derivedPanelConstraints:Z,layout:A}=M.next;if(P||Z.length===0)return;const ie=F.panels.map(({id:ee})=>ee).join(",");F.mutableState.layouts[ie]=A,Z.forEach(ee=>{if(ee.collapsible){const{layout:re}=M.prev??{};if(re){const ce=Dr(ee.collapsedSize,A[ee.panelId]),he=Dr(ee.collapsedSize,re[ee.panelId]);ce&&!he&&(F.mutableState.expandedPanelSizes[ee.panelId]=re[ee.panelId])}}});const J=Ja().state!=="active";S(A),J&&C(A)});return()=>{B.current=null,W(),X()}},[s,k,C,S,g,E,H]),b.useEffect(()=>{const q=B.current;q&&(q.mutableState.defaultLayout=n,q.mutableState.disableCursor=!!r)}),f.jsx(JA.Provider,{value:G,children:f.jsx("div",{...y,className:t,"data-group":!0,"data-testid":k,id:k,ref:D,style:{height:"100%",width:"100%",overflow:"hidden",...v,display:"flex",flexDirection:g==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:g==="horizontal"?"pan-y":"pan-x"},children:e})})}eD.displayName="Group";function j0(){const e=b.useContext(JA);return nn(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function vV(e,t){const{id:n}=j0(),r=b.useRef({collapse:$b,expand:$b,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:$b});b.useImperativeHandle(t,()=>r.current,[]),ll(()=>{Object.assign(r.current,qA({groupId:n,panelId:e}))})}function tD({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:o,elementRef:l,groupResizeBehavior:u="preserve-relative-size",id:h,maxSize:d="100%",minSize:g="0%",onResize:p,panelRef:v,style:y,...w}){const S=!!h,C=M0(h),k=D0({disabled:o}),R=b.useRef(null),E=A0(R,l),{getPanelStyles:N,id:L,orientation:D,registerPanel:j,togglePanelDisabled:H}=j0(),G=p!==null,B=ud((F,W,O)=>{p==null||p(F,h,O)});ll(()=>{const F=R.current;if(F!==null){const W={element:F,id:C,idIsStable:S,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:G?B:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:s,disabled:k.disabled,maxSize:d,minSize:g}};return j(W)}},[u,n,r,s,G,C,S,d,g,B,j,k]),b.useEffect(()=>{H(C,!!o)},[o,C,H]),vV(C,v);const q=()=>{const F=N(L,C);if(F)return JSON.stringify(F)},I=b.useSyncExternalStore(F=>E0(L,F),q,q);let V;return I?V=JSON.parse(I):s?V={flexGrow:void 0,flexShrink:void 0,flexBasis:s}:V={flexGrow:1},f.jsx("div",{...w,"data-disabled":o||void 0,"data-panel":!0,"data-testid":C,id:C,ref:E,style:{...bV,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...V},children:f.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:D==="horizontal"?"pan-y":"pan-x"},children:e})})}tD.displayName="Panel";const bV={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function _V({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,o;const l=e[n],u=t.find(h=>h.panelId===n);if(u){const h=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,g=[r,r+1];o=Qa({layout:Td({delta:d-l,initialLayout:e,panelConstraints:t,pivotIndices:g,prevLayout:e}),panelConstraints:t})[n],s=Qa({layout:Td({delta:h-l,initialLayout:e,panelConstraints:t,pivotIndices:g,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:o,valueNow:l}}function nD({children:e,className:t,disabled:n,elementRef:r,id:s,style:o,...l}){const u=M0(s),h=D0({disabled:n}),[d,g]=b.useState({}),[p,v]=b.useState("inactive"),y=b.useRef(null),w=A0(y,r),{disableCursor:S,id:C,orientation:k,registerSeparator:R,toggleSeparatorDisabled:E}=j0(),N=k==="horizontal"?"vertical":"horizontal";ll(()=>{const D=y.current;if(D!==null){const j={disabled:h.disabled,element:D,id:u},H=R(j),G=oV(q=>{v(q.next.state!=="inactive"&&q.next.hitRegions.some(I=>I.separator===j)?q.next.state:"inactive")}),B=E0(C,q=>{const{derivedPanelConstraints:I,layout:V,separatorToPanels:F}=q.next,W=F.get(j);if(W){const O=W[0],$=W.indexOf(O);g(_V({layout:V,panelConstraints:I,panelId:O.id,panelIndex:$}))}});return()=>{G(),B(),H()}}},[C,u,R,h]),b.useEffect(()=>{E(u,!!n)},[n,u,E]);let L;return n&&!S&&(L="not-allowed"),f.jsx("div",{...l,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":N,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":n?"disabled":p,"data-testid":u,id:u,ref:w,role:"separator",style:{flexBasis:"auto",cursor:L,...o,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}nD.displayName="Separator";const dd=({className:e,...t})=>f.jsx(eD,{className:me("flex h-full w-full",e),...t}),Js=e=>f.jsx(tD,{...e}),hd=({withHandle:e,orientation:t,disabled:n,className:r,...s})=>f.jsx(nD,{disabled:n,className:me("relative flex items-center justify-center bg-transparent focus-visible:outline-none",t==="vertical"?"h-2 w-full -my-1 cursor-row-resize before:absolute before:inset-x-0 before:top-1/2 before:h-0.5 before:-translate-y-1/2 before:bg-border":"h-full w-2 -mx-1 cursor-col-resize before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-border",r),...s,children:f.jsx("span",{className:"sr-only",children:t==="vertical"?"Resize rows":"Resize columns"})});/**
|
|
499
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
500
|
+
* @license MIT
|
|
501
|
+
*
|
|
502
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
503
|
+
* @license MIT
|
|
504
|
+
*
|
|
505
|
+
* Originally forked from (with the author's permission):
|
|
506
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
507
|
+
* http://bellard.org/jslinux/
|
|
508
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
509
|
+
*/var rr=0,ir=0,sr=0,kn=0,Cr;(e=>{function t(s,o,l,u){return u!==void 0?`#${Da(s)}${Da(o)}${Da(l)}${Da(u)}`:`#${Da(s)}${Da(o)}${Da(l)}`}e.toCss=t;function n(s,o,l,u=255){return(s<<24|o<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,o,l,u){return{css:e.toCss(s,o,l,u),rgba:e.toRgba(s,o,l,u)}}e.toColor=r})(Cr||(Cr={}));var yV;(e=>{function t(h,d){if(kn=(d.rgba&255)/255,kn===1)return{css:d.css,rgba:d.rgba};let g=d.rgba>>24&255,p=d.rgba>>16&255,v=d.rgba>>8&255,y=h.rgba>>24&255,w=h.rgba>>16&255,S=h.rgba>>8&255;rr=y+Math.round((g-y)*kn),ir=w+Math.round((p-w)*kn),sr=S+Math.round((v-S)*kn);let C=Cr.toCss(rr,ir,sr),k=Cr.toRgba(rr,ir,sr);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,g){let p=pm.ensureContrastRatio(h.rgba,d.rgba,g);if(p)return Cr.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[rr,ir,sr]=pm.toChannels(d),{css:Cr.toCss(rr,ir,sr),rgba:d}}e.opaque=s;function o(h,d){return kn=Math.round(d*255),[rr,ir,sr]=pm.toChannels(h.rgba),{css:Cr.toCss(rr,ir,sr,kn),rgba:Cr.toRgba(rr,ir,sr,kn)}}e.opacity=o;function l(h,d){return kn=h.rgba&255,o(h,kn*d/255)}e.multiplyOpacity=l;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(yV||(yV={}));var vr;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let o=s.getContext("2d",{willReadFrequently:!0});o&&(t=o,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return rr=parseInt(s.slice(1,2).repeat(2),16),ir=parseInt(s.slice(2,3).repeat(2),16),sr=parseInt(s.slice(3,4).repeat(2),16),Cr.toColor(rr,ir,sr);case 5:return rr=parseInt(s.slice(1,2).repeat(2),16),ir=parseInt(s.slice(2,3).repeat(2),16),sr=parseInt(s.slice(3,4).repeat(2),16),kn=parseInt(s.slice(4,5).repeat(2),16),Cr.toColor(rr,ir,sr,kn);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let o=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(o)return rr=parseInt(o[1]),ir=parseInt(o[2]),sr=parseInt(o[3]),kn=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),Cr.toColor(rr,ir,sr,kn);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[rr,ir,sr,kn]=t.getImageData(0,0,1,1).data,kn!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Cr.toRgba(rr,ir,sr,kn),css:s}}e.toColor=r})(vr||(vr={}));var Mr;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,o){let l=r/255,u=s/255,h=o/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),g=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+g*.7152+p*.0722}e.relativeLuminance2=n})(Mr||(Mr={}));var pm;(e=>{function t(l,u){if(kn=(u&255)/255,kn===1)return u;let h=u>>24&255,d=u>>16&255,g=u>>8&255,p=l>>24&255,v=l>>16&255,y=l>>8&255;return rr=p+Math.round((h-p)*kn),ir=v+Math.round((d-v)*kn),sr=y+Math.round((g-y)*kn),Cr.toRgba(rr,ir,sr)}e.blend=t;function n(l,u,h){let d=Mr.relativeLuminance(l>>8),g=Mr.relativeLuminance(u>>8);if(Ys(d,g)<h){if(g<d){let y=r(l,u,h),w=Ys(d,Mr.relativeLuminance(y>>8));if(w<h){let S=s(l,u,h),C=Ys(d,Mr.relativeLuminance(S>>8));return w>C?y:S}return y}let p=s(l,u,h),v=Ys(d,Mr.relativeLuminance(p>>8));if(v<h){let y=r(l,u,h),w=Ys(d,Mr.relativeLuminance(y>>8));return v>w?p:y}return p}}e.ensureContrastRatio=n;function r(l,u,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,w=u>>8&255,S=Ys(Mr.relativeLuminance2(v,y,w),Mr.relativeLuminance2(d,g,p));for(;S<h&&(v>0||y>0||w>0);)v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),w-=Math.max(0,Math.ceil(w*.1)),S=Ys(Mr.relativeLuminance2(v,y,w),Mr.relativeLuminance2(d,g,p));return(v<<24|y<<16|w<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,w=u>>8&255,S=Ys(Mr.relativeLuminance2(v,y,w),Mr.relativeLuminance2(d,g,p));for(;S<h&&(v<255||y<255||w<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),S=Ys(Mr.relativeLuminance2(v,y,w),Mr.relativeLuminance2(d,g,p));return(v<<24|y<<16|w<<8|255)>>>0}e.increaseLuminance=s;function o(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=o})(pm||(pm={}));function Da(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Ys(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var xV=Object.freeze((()=>{let e=[vr.toColor("#2e3436"),vr.toColor("#cc0000"),vr.toColor("#4e9a06"),vr.toColor("#c4a000"),vr.toColor("#3465a4"),vr.toColor("#75507b"),vr.toColor("#06989a"),vr.toColor("#d3d7cf"),vr.toColor("#555753"),vr.toColor("#ef2929"),vr.toColor("#8ae234"),vr.toColor("#fce94f"),vr.toColor("#729fcf"),vr.toColor("#ad7fa8"),vr.toColor("#34e2e2"),vr.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],o=t[n%6];e.push({css:Cr.toCss(r,s,o),rgba:Cr.toRgba(r,s,o)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Cr.toCss(r,r,r),rgba:Cr.toRgba(r,r,r)})}return e})());function Q2(e,t,n){return Math.max(t,Math.min(e,n))}function wV(e){switch(e){case"&":return"&";case"<":return"<"}return e}var rD=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),o=r,l=t.start.y,u=t.end.y,h=t.start.x,d=t.end.x;this._beforeSerialize(u-l,l,u);for(let g=l;g<=u;g++){let p=this._buffer.getLine(g);if(p){let v=g===t.start.y?h:0,y=g===t.end.y?d:p.length;for(let w=v;w<y;w++){let S=p.getCell(w,o===r?s:r);if(!S){console.warn(`Can't get cell at row=${g}, col=${w}`);continue}this._nextCell(S,o,g,w),o=S}}this._rowEnd(g,g===u)}return this._afterSerialize(),this._serializeString(n)}_nextCell(t,n,r,s){}_rowEnd(t,n){}_beforeSerialize(t,n,r){}_afterSerialize(){}_serializeString(t){return""}};function iD(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function Qs(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function sD(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var SV=class extends rD{constructor(t,n){super(t),this._terminal=n,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,n,r){this._allRows=new Array(t),this._lastContentCursorRow=n,this._lastCursorRow=n,this._firstRow=n}_rowEnd(t,n){var s;this._nullCellCount>0&&!Qs(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!n){t-this._firstRow>=this._terminal.rows&&((s=this._buffer.getLine(this._cursorStyleRow))==null||s.getCell(this._cursorStyleCol,this._backgroundCell));let o=this._buffer.getLine(t),l=this._buffer.getLine(t+1);if(!l.isWrapped)r=`\r
|
|
510
|
+
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{r="";let u=o.getCell(o.length-1,this._thisRowLastChar),h=o.getCell(o.length-2,this._thisRowLastSecondChar),d=l.getCell(0,this._nextRowFirstChar),g=d.getWidth()>1,p=!1;(d.getChars()&&g?this._nullCellCount<=1:this._nullCellCount<=0)&&((u.getChars()||u.getWidth()===0)&&Qs(u,d)&&(p=!0),g&&(h.getChars()||h.getWidth()===0)&&Qs(u,d)&&Qs(h,d)&&(p=!0)),p||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${o.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${o.length-this._nullCellCount}D`,r+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=r,this._currentRow="",this._nullCellCount=0}_diffStyle(t,n){let r=[],s=!iD(t,n),o=!Qs(t,n),l=!sD(t,n);if(s||o||l)if(t.isAttributeDefault())n.isAttributeDefault()||r.push(0);else{if(s){let u=t.getFgColor();t.isFgRGB()?r.push(38,2,u>>>16&255,u>>>8&255,u&255):t.isFgPalette()?u>=16?r.push(38,5,u):r.push(u&8?90+(u&7):30+(u&7)):r.push(39)}if(o){let u=t.getBgColor();t.isBgRGB()?r.push(48,2,u>>>16&255,u>>>8&255,u&255):t.isBgPalette()?u>=16?r.push(48,5,u):r.push(u&8?100+(u&7):40+(u&7)):r.push(49)}l&&(t.isInverse()!==n.isInverse()&&r.push(t.isInverse()?7:27),t.isBold()!==n.isBold()&&r.push(t.isBold()?1:22),t.isUnderline()!==n.isUnderline()&&r.push(t.isUnderline()?4:24),t.isOverline()!==n.isOverline()&&r.push(t.isOverline()?53:55),t.isBlink()!==n.isBlink()&&r.push(t.isBlink()?5:25),t.isInvisible()!==n.isInvisible()&&r.push(t.isInvisible()?8:28),t.isItalic()!==n.isItalic()&&r.push(t.isItalic()?3:23),t.isDim()!==n.isDim()&&r.push(t.isDim()?2:22),t.isStrikethrough()!==n.isStrikethrough()&&r.push(t.isStrikethrough()?9:29))}return r}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let o=t.getChars()==="",l=this._diffStyle(t,this._cursorStyle);if(o?!Qs(this._cursorStyle,t):l.length>0){this._nullCellCount>0&&(Qs(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s,this._currentRow+=`\x1B[${l.join(";")}m`;let u=this._buffer.getLine(r);u!==void 0&&(u.getCell(s,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=s)}o?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(Qs(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=s+t.getWidth())}_serializeString(t){let n=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(n=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let r="";for(let l=0;l<n;l++)r+=this._allRows[l],l+1<n&&(r+=this._allRowSeparators[l]);if(!t){let l=this._buffer.baseY+this._buffer.cursorY,u=this._buffer.cursorX,h=l!==this._lastCursorRow||u!==this._lastCursorCol,d=g=>{g>0?r+=`\x1B[${g}C`:g<0&&(r+=`\x1B[${-g}D`)};h&&((g=>{g>0?r+=`\x1B[${g}B`:g<0&&(r+=`\x1B[${-g}A`)})(l-this._lastCursorRow),d(u-this._lastCursorCol))}let s=this._terminal._core._inputHandler._curAttrData,o=this._diffStyle(s,this._cursorStyle);return o.length>0&&(r+=`\x1B[${o.join(";")}m`),r}},CV=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let s=n.length,o=r===void 0?s:Q2(r+t.rows,0,s);return this._serializeBufferByRange(t,n,{start:s-o,end:s-1},!1)}_serializeBufferByRange(t,n,r,s){return new SV(n,t).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:t.cols,y:typeof r.end=="number"?r.end:r.end.line}},s)}_serializeBufferAsHTML(t,n){var h;let r=t.buffer.active,s=new kV(r,t,n),o=n.onlySelection??!1,l=n.range;if(l)return s.serialize({start:{x:l.startCol,y:(l.startLine,l.startLine)},end:{x:t.cols,y:(l.endLine,l.endLine)}});if(!o){let d=r.length,g=n.scrollback,p=g===void 0?d:Q2(g+t.rows,0,d);return s.serialize({start:{x:0,y:d-p},end:{x:t.cols,y:d-1}})}let u=(h=this._terminal)==null?void 0:h.getSelectionPosition();return u!==void 0?s.serialize({start:{x:u.start.x,y:u.start.y},end:{x:u.end.x,y:u.end.y}}):""}_serializeModes(t){let n="",r=t.modes;if(r.applicationCursorKeysMode&&(n+="\x1B[?1h"),r.applicationKeypadMode&&(n+="\x1B[?66h"),r.bracketedPasteMode&&(n+="\x1B[?2004h"),r.insertMode&&(n+="\x1B[4h"),r.originMode&&(n+="\x1B[?6h"),r.reverseWraparoundMode&&(n+="\x1B[?45h"),r.sendFocusMode&&(n+="\x1B[?1004h"),r.wraparoundMode===!1&&(n+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":n+="\x1B[?9h";break;case"vt200":n+="\x1B[?1000h";break;case"drag":n+="\x1B[?1002h";break;case"any":n+="\x1B[?1003h";break}return n}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let n=t!=null&&t.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t==null?void 0:t.scrollback);if(!(t!=null&&t.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);n+=`\x1B[?1049h\x1B[H${r}`}return t!=null&&t.excludeModes||(n+=this._serializeModes(this._terminal)),n}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},kV=class extends rD{constructor(t,n,r){super(t),this._terminal=n,this._options=r,this._currentRow="",this._htmlContent="",n._core._themeService?this._ansiColors=n._core._themeService.colors.ansi:this._ansiColors=xV}_padStart(t,n,r){return n=n>>0,r=r??" ",t.length>n?t:(n-=t.length,n>r.length&&(r+=r.repeat(n/r.length)),r.slice(0,n)+t)}_beforeSerialize(t,n,r){var u,h;this._htmlContent+="<html><body><!--StartFragment--><pre>";let s="#000000",o="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((u=this._terminal.options.theme)==null?void 0:u.foreground)??"#ffffff",o=((h=this._terminal.options.theme)==null?void 0:h.background)??"#000000");let l=[];l.push("color: "+s+";"),l.push("background-color: "+o+";"),l.push("font-family: "+this._terminal.options.fontFamily+";"),l.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+l.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,n){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,n){let r=n?t.getFgColor():t.getBgColor();if(n?t.isFgRGB():t.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(s=>this._padStart(s.toString(16),2,"0")).join("");if(n?t.isFgPalette():t.isBgPalette())return this._ansiColors[r].css}_diffStyle(t,n){let r=[],s=!iD(t,n),o=!Qs(t,n),l=!sD(t,n);if(s||o||l){let u=this._getHexColor(t,!0);u&&r.push("color: "+u+";");let h=this._getHexColor(t,!1);return h&&r.push("background-color: "+h+";"),t.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&r.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?r.push("text-decoration: overline underline;"):t.isUnderline()?r.push("text-decoration: underline;"):t.isOverline()&&r.push("text-decoration: overline;"),t.isBlink()&&r.push("text-decoration: blink;"),t.isInvisible()&&r.push("visibility: hidden;"),t.isItalic()&&r.push("font-style: italic;"),t.isDim()&&r.push("opacity: 0.5;"),t.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let o=t.getChars()==="",l=this._diffStyle(t,n);l&&(this._currentRow+=l.length===0?"</span><span>":"</span><span style='"+l.join(" ")+"'>"),o?this._currentRow+=" ":this._currentRow+=wV(t.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
511
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
512
|
+
* @license MIT
|
|
513
|
+
*
|
|
514
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
515
|
+
* @license MIT
|
|
516
|
+
*
|
|
517
|
+
* Originally forked from (with the author's permission):
|
|
518
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
519
|
+
* http://bellard.org/jslinux/
|
|
520
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
521
|
+
*/var EV=class{constructor(t,n,r,s={}){this._terminal=t,this._regex=n,this._handler=r,this._options=s}provideLinks(t,n){let r=TV.computeLink(t,this._regex,this._terminal,this._handler);n(this._addCallbacks(r))}_addCallbacks(t){return t.map(n=>(n.leave=this._options.leave,n.hover=(r,s)=>{if(this._options.hover){let{range:o}=n;this._options.hover(r,s,o)}},n))}};function RV(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var TV=class gm{static computeLink(t,n,r,s){let o=new RegExp(n.source,(n.flags||"")+"g"),[l,u]=gm._getWindowedLineStrings(t-1,r),h=l.join(""),d,g=[];for(;d=o.exec(h);){let p=d[0];if(!RV(p))continue;let[v,y]=gm._mapStrIdx(r,u,0,d.index),[w,S]=gm._mapStrIdx(r,v,y,p.length);if(v===-1||y===-1||w===-1||S===-1)continue;let C={start:{x:y+1,y:v+1},end:{x:S,y:w+1}};g.push({range:C,text:p,activate:s})}return g}static _getWindowedLineStrings(t,n){let r,s=t,o=t,l=0,u="",h=[];if(r=n.buffer.active.getLine(t)){let d=r.translateToString(!0);if(r.isWrapped&&d[0]!==" "){for(l=0;(r=n.buffer.active.getLine(--s))&&l<2048&&(u=r.translateToString(!0),l+=u.length,h.push(u),!(!r.isWrapped||u.indexOf(" ")!==-1)););h.reverse()}for(h.push(d),l=0;(r=n.buffer.active.getLine(++o))&&r.isWrapped&&l<2048&&(u=r.translateToString(!0),l+=u.length,h.push(u),u.indexOf(" ")===-1););}return[h,s]}static _mapStrIdx(t,n,r,s){let o=t.buffer.active,l=o.getNullCell(),u=r;for(;s;){let h=o.getLine(n);if(!h)return[-1,-1];for(let d=u;d<h.length;++d){h.getCell(d,l);let g=l.getChars();if(l.getWidth()&&(s-=g.length||1,d===h.length-1&&g==="")){let p=o.getLine(n+1);p&&p.isWrapped&&(p.getCell(0,l),l.getWidth()===2&&(s+=1))}if(s<0)return[n,d]}n++,u=0}return[n,u]}},NV=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function MV(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var AV=class{constructor(t=MV,n={}){this._handler=t,this._options=n}activate(t){this._terminal=t;let n=this._options,r=n.urlRegex||NV;this._linkProvider=this._terminal.registerLinkProvider(new EV(this._terminal,r,this._handler,n))}dispose(){var t;(t=this._linkProvider)==null||t.dispose()}};/**
|
|
522
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
523
|
+
* @license MIT
|
|
524
|
+
*
|
|
525
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
526
|
+
* @license MIT
|
|
527
|
+
*
|
|
528
|
+
* Originally forked from (with the author's permission):
|
|
529
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
530
|
+
* http://bellard.org/jslinux/
|
|
531
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
532
|
+
*/var oD=Object.defineProperty,DV=Object.getOwnPropertyDescriptor,jV=(e,t)=>{for(var n in t)oD(e,n,{get:t[n],enumerable:!0})},Rn=(e,t,n,r)=>{for(var s=r>1?void 0:r?DV(t,n):t,o=e.length-1,l;o>=0;o--)(l=e[o])&&(s=(r?l(t,n,s):l(s))||s);return r&&s&&oD(t,n,s),s},ze=(e,t)=>(n,r)=>t(n,r,e),J2="Terminal input",vy={get:()=>J2,set:e=>J2=e},eE="Too much output to announce, navigate to rows manually to read",by={get:()=>eE,set:e=>eE=e};function OV(e){return e.replace(/\r?\n/g,"\r")}function LV(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function zV(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function PV(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");aD(s,t,n,r)}}function aD(e,t,n,r){e=OV(e),e=LV(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function lD(e,t,n){let r=n.getBoundingClientRect(),s=e.clientX-r.left-10,o=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${o}px`,t.style.zIndex="1000",t.focus()}function tE(e,t,n,r,s){lD(e,t,n),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Zo(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Vp(e,t=0,n=e.length){let r="";for(let s=t;s<n;++s){let o=e[s];o>65535?(o-=65536,r+=String.fromCharCode((o>>10)+55296)+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r}var BV=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s=0;if(this._interim){let o=e.charCodeAt(s++);56320<=o&&o<=57343?t[r++]=(this._interim-55296)*1024+o-56320+65536:(t[r++]=this._interim,t[r++]=o),this._interim=0}for(let o=s;o<n;++o){let l=e.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=n)return this._interim=l,r;let u=e.charCodeAt(o);56320<=u&&u<=57343?t[r++]=(l-55296)*1024+u-56320+65536:(t[r++]=l,t[r++]=u);continue}l!==65279&&(t[r++]=l)}return r}},IV=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s,o,l,u,h=0,d=0;if(this.interim[0]){let v=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let w=0,S;for(;(S=this.interim[++w]&63)&&w<4;)y<<=6,y|=S;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-w;for(;d<k;){if(d>=n)return 0;if(S=e[d++],(S&192)!==128){d--,v=!0;break}else this.interim[w++]=S,y<<=6,y|=S&63}v||(C===2?y<128?d--:t[r++]=y:C===3?y<2048||y>=55296&&y<=57343||y===65279||(t[r++]=y):y<65536||y>1114111||(t[r++]=y)),this.interim.fill(0)}let g=n-4,p=d;for(;p<n;){for(;p<g&&!((s=e[p])&128)&&!((o=e[p+1])&128)&&!((l=e[p+2])&128)&&!((u=e[p+3])&128);)t[r++]=s,t[r++]=o,t[r++]=l,t[r++]=u,p+=4;if(s=e[p++],s<128)t[r++]=s;else if((s&224)===192){if(p>=n)return this.interim[0]=s,r;if(o=e[p++],(o&192)!==128){p--;continue}if(h=(s&31)<<6|o&63,h<128){p--;continue}t[r++]=h}else if((s&240)===224){if(p>=n)return this.interim[0]=s,r;if(o=e[p++],(o&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=o,r;if(l=e[p++],(l&192)!==128){p--;continue}if(h=(s&15)<<12|(o&63)<<6|l&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[r++]=h}else if((s&248)===240){if(p>=n)return this.interim[0]=s,r;if(o=e[p++],(o&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=o,r;if(l=e[p++],(l&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=l,r;if(u=e[p++],(u&192)!==128){p--;continue}if(h=(s&7)<<18|(o&63)<<12|(l&63)<<6|u&63,h<65536||h>1114111)continue;t[r++]=h}}return r}},cD="",ea=" ",Jd=class uD{constructor(){this.fg=0,this.bg=0,this.extended=new Ym}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new uD;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ym=class dD{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new dD(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Oi=class hD extends Jd{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ym,this.combinedData=""}static fromCharData(t){let n=new hD;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Zo(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let s=t[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(r-55296)*1024+s-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},nE="di$target",_y="di$dependencies",Wb=new Map;function FV(e){return e[_y]||[]}function cr(e){if(Wb.has(e))return Wb.get(e);let t=function(n,r,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");HV(t,n,s)};return t._id=e,Wb.set(e,t),t}function HV(e,t,n){t[nE]===t?t[_y].push({id:e,index:n}):(t[_y]=[{id:e,index:n}],t[nE]=t)}var zr=cr("BufferService"),fD=cr("CoreMouseService"),cl=cr("CoreService"),UV=cr("CharsetService"),O0=cr("InstantiationService"),mD=cr("LogService"),Pr=cr("OptionsService"),pD=cr("OscLinkService"),$V=cr("UnicodeService"),eh=cr("DecorationService"),yy=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var g;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],s=this._optionsService.rawOptions.linkHandler,o=new Oi,l=n.getTrimmedLength(),u=-1,h=-1,d=!1;for(let p=0;p<l;p++)if(!(h===-1&&!n.hasContent(p))){if(n.loadCell(p,o),o.hasExtendedAttrs()&&o.extended.urlId)if(h===-1){h=p,u=o.extended.urlId;continue}else d=o.extended.urlId!==u;else h!==-1&&(d=!0);if(d||h!==-1&&p===l-1){let v=(g=this._oscLinkService.getLinkData(u))==null?void 0:g.uri;if(v){let y={start:{x:h+1,y:e},end:{x:p+(!d&&p===l-1?1:0),y:e}},w=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let S=new URL(v);["http:","https:"].includes(S.protocol)||(w=!0)}catch{w=!0}w||r.push({text:v,range:y,activate:(S,C)=>s?s.activate(S,C,y):WV(S,C),hover:(S,C)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,S,C,y)},leave:(S,C)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,S,C,y)}})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(h=p,u=o.extended.urlId):(h=-1,u=-1)}}t(r)}};yy=Rn([ze(0,zr),ze(1,Pr),ze(2,pD)],yy);function WV(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
533
|
+
|
|
534
|
+
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var qp=cr("CharSizeService"),fo=cr("CoreBrowserService"),L0=cr("MouseService"),mo=cr("RenderService"),VV=cr("SelectionService"),gD=cr("CharacterJoinerService"),Oc=cr("ThemeService"),vD=cr("LinkProviderService"),qV=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?rE.isErrorNoTelemetry(e)?new rE(e.message+`
|
|
535
|
+
|
|
536
|
+
`+e.stack):new Error(e.message+`
|
|
537
|
+
|
|
538
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},KV=new qV;function vm(e){GV(e)||KV.onUnexpectedError(e)}var xy="Canceled";function GV(e){return e instanceof YV?!0:e instanceof Error&&e.name===xy&&e.message===xy}var YV=class extends Error{constructor(){super(xy),this.name=this.message}};function XV(e){return new Error(`Illegal argument: ${e}`)}var rE=class wy extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof wy)return t;let n=new wy;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Sy=class bD extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,bD.prototype)}};function si(e,t=0){return e[e.length-(1+t)]}var ZV;(e=>{function t(o){return o<0}e.isLessThan=t;function n(o){return o<=0}e.isLessThanOrEqual=n;function r(o){return o>0}e.isGreaterThan=r;function s(o){return o===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(ZV||(ZV={}));function QV(e,t){let n=this,r=!1,s;return function(){return r||(r=!0,t||(s=e.apply(n,arguments))),s}}var _D;(e=>{function t(N){return N&&typeof N=="object"&&typeof N[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*s(N){yield N}e.single=s;function o(N){return t(N)?N:s(N)}e.wrap=o;function l(N){return N||n}e.from=l;function*u(N){for(let L=N.length-1;L>=0;L--)yield N[L]}e.reverse=u;function h(N){return!N||N[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(N){return N[Symbol.iterator]().next().value}e.first=d;function g(N,L){let D=0;for(let j of N)if(L(j,D++))return!0;return!1}e.some=g;function p(N,L){for(let D of N)if(L(D))return D}e.find=p;function*v(N,L){for(let D of N)L(D)&&(yield D)}e.filter=v;function*y(N,L){let D=0;for(let j of N)yield L(j,D++)}e.map=y;function*w(N,L){let D=0;for(let j of N)yield*L(j,D++)}e.flatMap=w;function*S(...N){for(let L of N)yield*L}e.concat=S;function C(N,L,D){let j=D;for(let H of N)j=L(j,H);return j}e.reduce=C;function*k(N,L,D=N.length){for(L<0&&(L+=N.length),D<0?D+=N.length:D>N.length&&(D=N.length);L<D;L++)yield N[L]}e.slice=k;function R(N,L=Number.POSITIVE_INFINITY){let D=[];if(L===0)return[D,N];let j=N[Symbol.iterator]();for(let H=0;H<L;H++){let G=j.next();if(G.done)return[D,e.empty()];D.push(G.value)}return[D,{[Symbol.iterator](){return j}}]}e.consume=R;async function E(N){let L=[];for await(let D of N)L.push(D);return Promise.resolve(L)}e.asyncToArray=E})(_D||(_D={}));function el(e){if(_D.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function JV(...e){return _n(()=>el(e))}function _n(e){return{dispose:QV(()=>{e()})}}var yD=class xD{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{el(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?xD.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};yD.DISABLE_DISPOSED_WARNING=!1;var na=yD,_t=class{constructor(){this._store=new na,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};_t.None=Object.freeze({dispose(){}});var yc=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},eo=typeof window=="object"?window:globalThis,Cy=class ky{constructor(t){this.element=t,this.next=ky.Undefined,this.prev=ky.Undefined}};Cy.Undefined=new Cy(void 0);var yn=Cy,iE=class{constructor(){this._first=yn.Undefined,this._last=yn.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===yn.Undefined}clear(){let e=this._first;for(;e!==yn.Undefined;){let t=e.next;e.prev=yn.Undefined,e.next=yn.Undefined,e=t}this._first=yn.Undefined,this._last=yn.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new yn(e);if(this._first===yn.Undefined)this._first=n,this._last=n;else if(t){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==yn.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==yn.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==yn.Undefined&&e.next!==yn.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===yn.Undefined&&e.next===yn.Undefined?(this._first=yn.Undefined,this._last=yn.Undefined):e.next===yn.Undefined?(this._last=this._last.prev,this._last.next=yn.Undefined):e.prev===yn.Undefined&&(this._first=this._first.next,this._first.prev=yn.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==yn.Undefined;)yield e.element,e=e.next}},eq=globalThis.performance&&typeof globalThis.performance.now=="function",tq=class wD{static create(t){return new wD(t)}constructor(t){this._now=eq&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},_r;(e=>{e.None=()=>_t.None;function t(I,V){return p(I,()=>{},0,void 0,!0,void 0,V)}e.defer=t;function n(I){return(V,F=null,W)=>{let O=!1,$;return $=I(U=>{if(!O)return $?$.dispose():O=!0,V.call(F,U)},null,W),O&&$.dispose(),$}}e.once=n;function r(I,V,F){return d((W,O=null,$)=>I(U=>W.call(O,V(U)),null,$),F)}e.map=r;function s(I,V,F){return d((W,O=null,$)=>I(U=>{V(U),W.call(O,U)},null,$),F)}e.forEach=s;function o(I,V,F){return d((W,O=null,$)=>I(U=>V(U)&&W.call(O,U),null,$),F)}e.filter=o;function l(I){return I}e.signal=l;function u(...I){return(V,F=null,W)=>{let O=JV(...I.map($=>$(U=>V.call(F,U))));return g(O,W)}}e.any=u;function h(I,V,F,W){let O=F;return r(I,$=>(O=V(O,$),O),W)}e.reduce=h;function d(I,V){let F,W={onWillAddFirstListener(){F=I(O.fire,O)},onDidRemoveLastListener(){F==null||F.dispose()}},O=new Ne(W);return V==null||V.add(O),O.event}function g(I,V){return V instanceof Array?V.push(I):V&&V.add(I),I}function p(I,V,F=100,W=!1,O=!1,$,U){let X,M,P,Z=0,A,ie={leakWarningThreshold:$,onWillAddFirstListener(){X=I(ee=>{Z++,M=V(M,ee),W&&!P&&(J.fire(M),M=void 0),A=()=>{let re=M;M=void 0,P=void 0,(!W||Z>1)&&J.fire(re),Z=0},typeof F=="number"?(clearTimeout(P),P=setTimeout(A,F)):P===void 0&&(P=0,queueMicrotask(A))})},onWillRemoveListener(){O&&Z>0&&(A==null||A())},onDidRemoveLastListener(){A=void 0,X.dispose()}},J=new Ne(ie);return U==null||U.add(J),J.event}e.debounce=p;function v(I,V=0,F){return e.debounce(I,(W,O)=>W?(W.push(O),W):[O],V,void 0,!0,void 0,F)}e.accumulate=v;function y(I,V=(W,O)=>W===O,F){let W=!0,O;return o(I,$=>{let U=W||!V($,O);return W=!1,O=$,U},F)}e.latch=y;function w(I,V,F){return[e.filter(I,V,F),e.filter(I,W=>!V(W),F)]}e.split=w;function S(I,V=!1,F=[],W){let O=F.slice(),$=I(M=>{O?O.push(M):X.fire(M)});W&&W.add($);let U=()=>{O==null||O.forEach(M=>X.fire(M)),O=null},X=new Ne({onWillAddFirstListener(){$||($=I(M=>X.fire(M)),W&&W.add($))},onDidAddFirstListener(){O&&(V?setTimeout(U):U())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return W&&W.add(X),X.event}e.buffer=S;function C(I,V){return(F,W,O)=>{let $=V(new R);return I(function(U){let X=$.evaluate(U);X!==k&&F.call(W,X)},void 0,O)}}e.chain=C;let k=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(V){return this.steps.push(V),this}forEach(V){return this.steps.push(F=>(V(F),F)),this}filter(V){return this.steps.push(F=>V(F)?F:k),this}reduce(V,F){let W=F;return this.steps.push(O=>(W=V(W,O),W)),this}latch(V=(F,W)=>F===W){let F=!0,W;return this.steps.push(O=>{let $=F||!V(O,W);return F=!1,W=O,$?O:k}),this}evaluate(V){for(let F of this.steps)if(V=F(V),V===k)break;return V}}function E(I,V,F=W=>W){let W=(...X)=>U.fire(F(...X)),O=()=>I.on(V,W),$=()=>I.removeListener(V,W),U=new Ne({onWillAddFirstListener:O,onDidRemoveLastListener:$});return U.event}e.fromNodeEventEmitter=E;function N(I,V,F=W=>W){let W=(...X)=>U.fire(F(...X)),O=()=>I.addEventListener(V,W),$=()=>I.removeEventListener(V,W),U=new Ne({onWillAddFirstListener:O,onDidRemoveLastListener:$});return U.event}e.fromDOMEventEmitter=N;function L(I){return new Promise(V=>n(I)(V))}e.toPromise=L;function D(I){let V=new Ne;return I.then(F=>{V.fire(F)},()=>{V.fire(void 0)}).finally(()=>{V.dispose()}),V.event}e.fromPromise=D;function j(I,V){return I(F=>V.fire(F))}e.forward=j;function H(I,V,F){return V(F),I(W=>V(W))}e.runAndSubscribe=H;class G{constructor(V,F){this._observable=V,this._counter=0,this._hasChanged=!1;let W={onWillAddFirstListener:()=>{V.addObserver(this)},onDidRemoveLastListener:()=>{V.removeObserver(this)}};this.emitter=new Ne(W),F&&F.add(this.emitter)}beginUpdate(V){this._counter++}handlePossibleChange(V){}handleChange(V,F){this._hasChanged=!0}endUpdate(V){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(I,V){return new G(I,V).emitter.event}e.fromObservable=B;function q(I){return(V,F,W)=>{let O=0,$=!1,U={beginUpdate(){O++},endUpdate(){O--,O===0&&(I.reportChanges(),$&&($=!1,V.call(F)))},handlePossibleChange(){},handleChange(){$=!0}};I.addObserver(U),I.reportChanges();let X={dispose(){I.removeObserver(U)}};return W instanceof na?W.add(X):Array.isArray(W)&&W.push(X),X}}e.fromObservableLight=q})(_r||(_r={}));var Ey=class Ry{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Ry._idPool++}`,Ry.all.add(this)}start(t){this._stopWatch=new tq,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Ey.all=new Set,Ey._idPool=0;var nq=Ey,rq=-1,SD=class CD{constructor(t,n,r=(CD._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[o,l]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${l}):`;console.warn(u),console.warn(o);let h=new oq(u,o);this._errorHandler(h)}return()=>{let o=this._stacks.get(t.value)||0;this._stacks.set(t.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,s]of this._stacks)(!t||n<s)&&(t=[r,s],n=s);return t}};SD._idPool=1;var iq=SD,sq=class kD{constructor(t){this.value=t}static create(){let t=new Error;return new kD(t.stack??"")}print(){console.warn(this.value.split(`
|
|
539
|
+
`).slice(2).join(`
|
|
540
|
+
`))}},oq=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},aq=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},lq=0,Vb=class{constructor(e){this.value=e,this.id=lq++}},cq=2,uq,Ne=class{constructor(e){var t,n,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new iq((e==null?void 0:e.onListenerError)??vm,((n=this._options)==null?void 0:n.leakWarningThreshold)??rq):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new nq(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var l,u,h,d,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let p=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(p);let v=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new aq(`${p}. HINT: Stack shows most frequent listener (${v[1]}-times)`,v[0]);return(((l=this._options)==null?void 0:l.onListenerError)||vm)(y),_t.None}if(this._disposed)return _t.None;t&&(e=e.bind(t));let r=new Vb(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=sq.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Vb?(this._deliveryQueue??(this._deliveryQueue=new dq),this._listeners=[this._listeners,r]):this._listeners.push(r):((h=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||h.call(u,this),this._listeners=r,(g=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||g.call(d,this)),this._size++;let o=_n(()=>{s==null||s(),this._removeListener(r)});return n instanceof na?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var s,o,l,u;if((o=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||o.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||u.call(l,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*cq<=t.length){let h=0;for(let d=0;d<t.length;d++)t[d]?t[h++]=t[d]:r&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=h}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||vm;if(!n){e.value(t);return}try{e.value(t)}catch(s){n(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r,s;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof Vb)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},dq=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ty=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Ne,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Ne,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Ty.INSTANCE=new Ty;var z0=Ty;function hq(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}z0.INSTANCE.onDidChangeZoomLevel;function fq(e){return z0.INSTANCE.getZoomFactor(e)}z0.INSTANCE.onDidChangeFullscreen;var Lc=typeof navigator=="object"?navigator.userAgent:"",Ny=Lc.indexOf("Firefox")>=0,mq=Lc.indexOf("AppleWebKit")>=0,P0=Lc.indexOf("Chrome")>=0,pq=!P0&&Lc.indexOf("Safari")>=0;Lc.indexOf("Electron/")>=0;Lc.indexOf("Android")>=0;var qb=!1;if(typeof eo.matchMedia=="function"){let e=eo.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=eo.matchMedia("(display-mode: fullscreen)");qb=e.matches,hq(eo,e,({matches:n})=>{qb&&t.matches||(qb=n)})}var oc="en",My=!1,Ay=!1,bm=!1,ED=!1,$f,_m=oc,sE=oc,gq,Wi,Va=globalThis,br,aT;typeof Va.vscode<"u"&&typeof Va.vscode.process<"u"?br=Va.vscode.process:typeof process<"u"&&typeof((aT=process==null?void 0:process.versions)==null?void 0:aT.node)=="string"&&(br=process);var lT,vq=typeof((lT=br==null?void 0:br.versions)==null?void 0:lT.electron)=="string",bq=vq&&(br==null?void 0:br.type)==="renderer",cT;if(typeof br=="object"){My=br.platform==="win32",Ay=br.platform==="darwin",bm=br.platform==="linux",bm&&br.env.SNAP&&br.env.SNAP_REVISION,br.env.CI||br.env.BUILD_ARTIFACTSTAGINGDIRECTORY,$f=oc,_m=oc;let e=br.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);$f=t.userLocale,sE=t.osLocale,_m=t.resolvedLanguage||oc,gq=(cT=t.languagePack)==null?void 0:cT.translationsConfigFile}catch{}ED=!0}else typeof navigator=="object"&&!bq?(Wi=navigator.userAgent,My=Wi.indexOf("Windows")>=0,Ay=Wi.indexOf("Macintosh")>=0,(Wi.indexOf("Macintosh")>=0||Wi.indexOf("iPad")>=0||Wi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,bm=Wi.indexOf("Linux")>=0,(Wi==null?void 0:Wi.indexOf("Mobi"))>=0,_m=globalThis._VSCODE_NLS_LANGUAGE||oc,$f=navigator.language.toLowerCase(),sE=$f):console.error("Unable to resolve platform.");var RD=My,Cs=Ay,_q=bm,oE=ED,Es=Wi,Wo=_m,yq;(e=>{function t(){return Wo}e.value=t;function n(){return Wo.length===2?Wo==="en":Wo.length>=3?Wo[0]==="e"&&Wo[1]==="n"&&Wo[2]==="-":!1}e.isDefaultVariant=n;function r(){return Wo==="en"}e.isDefault=r})(yq||(yq={}));var xq=typeof Va.postMessage=="function"&&!Va.importScripts;(()=>{if(xq){let e=[];Va.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=e.length;r<s;r++){let o=e[r];if(o.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),o.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Va.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var wq=!!(Es&&Es.indexOf("Chrome")>=0);Es&&Es.indexOf("Firefox")>=0;!wq&&Es&&Es.indexOf("Safari")>=0;Es&&Es.indexOf("Edg/")>=0;Es&&Es.indexOf("Android")>=0;var Yl=typeof navigator=="object"?navigator:{};oE||document.queryCommandSupported&&document.queryCommandSupported("copy")||Yl&&Yl.clipboard&&Yl.clipboard.writeText,oE||Yl&&Yl.clipboard&&Yl.clipboard.readText;var B0=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Kb=new B0,aE=new B0,lE=new B0,Sq=new Array(230),TD;(e=>{function t(u){return Kb.keyCodeToStr(u)}e.toString=t;function n(u){return Kb.strToKeyCode(u)}e.fromString=n;function r(u){return aE.keyCodeToStr(u)}e.toUserSettingsUS=r;function s(u){return lE.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function o(u){return aE.strToKeyCode(u)||lE.strToKeyCode(u)}e.fromUserSettings=o;function l(u){if(u>=98&&u<=113)return null;switch(u){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Kb.keyCodeToStr(u)}e.toElectronAccelerator=l})(TD||(TD={}));var Cq=class ND{constructor(t,n,r,s,o){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=o}equals(t){return t instanceof ND&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",r=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${t}${n}${r}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new kq([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},kq=class{constructor(e){if(e.length===0)throw XV("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function Eq(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return TD.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(Ny)switch(t){case 59:return 85;case 60:if(_q)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Cs)return 57;break}else if(mq&&(Cs&&t===93||!Cs&&t===92))return 57;return Sq[t]||0}var Rq=Cs?256:2048,Tq=512,Nq=1024,Mq=Cs?2048:256,cE=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(n=t.getModifierState)==null?void 0:n.call(t,"AltGraph"),this.keyCode=Eq(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Rq),this.altKey&&(t|=Tq),this.shiftKey&&(t|=Nq),this.metaKey&&(t|=Mq),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Cq(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},uE=new WeakMap;function Aq(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var Dq=class{static getSameOriginWindowChain(e){let t=uE.get(e);if(!t){t=[],uE.set(e,t);let n=e,r;do r=Aq(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,s=this.getSameOriginWindowChain(e);for(let o of s){let l=o.window.deref();if(n+=(l==null?void 0:l.scrollY)??0,r+=(l==null?void 0:l.scrollX)??0,l===t||!o.iframeElement)break;let u=o.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},Wf=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=Dq.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},dE=class{constructor(e,t=0,n=0){var s;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(P0){let o=navigator.userAgent.match(/Chrome\/(\d+)/);r=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,u=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof o.wheelDeltaY<"u")r?this.deltaY=o.wheelDeltaY/(120*u):this.deltaY=o.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?Ny&&!Cs?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")pq&&RD?this.deltaX=-(o.wheelDeltaX/120):r?this.deltaX=o.wheelDeltaX/(120*u):this.deltaX=o.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?Ny&&!Cs?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},MD=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),jq;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof Oq?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:_r.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:MD})})(jq||(jq={}));var Oq=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?MD:(this._emitter||(this._emitter=new Ne),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},I0=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Sy("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Sy("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Lq=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Sy("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=_n(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},zq;(e=>{async function t(r){let s,o=await Promise.all(r.map(l=>l.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return o}e.settled=t;function n(r){return new Promise(async(s,o)=>{try{await r(s,o)}catch(l){o(l)}})}e.withAsyncBody=n})(zq||(zq={}));var hE=class ki{static fromArray(t){return new ki(n=>{n.emitMany(t)})}static fromPromise(t){return new ki(async n=>{n.emitMany(await t)})}static fromPromises(t){return new ki(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new ki(async n=>{await Promise.all(t.map(async r=>{for await(let s of r)n.emitOne(s)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new Ne,queueMicrotask(async()=>{let r={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(t(r)),this.resolve()}catch(s){this.reject(s)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await _r.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(t,n){return new ki(async r=>{for await(let s of t)r.emitOne(n(s))})}map(t){return ki.map(this,t)}static filter(t,n){return new ki(async r=>{for await(let s of t)n(s)&&r.emitOne(s)})}filter(t){return ki.filter(this,t)}static coalesce(t){return ki.filter(t,n=>!!n)}coalesce(){return ki.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return ki.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};hE.EMPTY=hE.fromArray([]);var{getWindow:xs,getWindowId:Pq,onDidRegisterWindow:Bq}=function(){let e=new Map,t={window:eo,disposables:new na};e.set(eo.vscodeWindowId,t);let n=new Ne,r=new Ne,s=new Ne;function o(l,u){return(typeof l=="number"?e.get(l):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:r.event,registerWindow(l){if(e.has(l.vscodeWindowId))return _t.None;let u=new na,h={window:l,disposables:u.add(new na)};return e.set(l.vscodeWindowId,h),u.add(_n(()=>{e.delete(l.vscodeWindowId),r.fire(l)})),u.add(it(l,tr.BEFORE_UNLOAD,()=>{s.fire(l)})),n.fire(h),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:o,getWindow(l){var d;let u=l;if((d=u==null?void 0:u.ownerDocument)!=null&&d.defaultView)return u.ownerDocument.defaultView.window;let h=l;return h!=null&&h.view?h.view.window:eo},getDocument(l){return xs(l).document}}}(),Iq=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function it(e,t,n,r){return new Iq(e,t,n,r)}var fE=function(e,t,n,r){return it(e,t,n,r)},F0,Fq=class extends Lq{constructor(e){super(),this.defaultTarget=e&&xs(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},mE=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){vm(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,s=o=>{n.set(o,!1);let l=e.get(o)??[];for(t.set(o,l),e.set(o,[]),r.set(o,!0);l.length>0;)l.sort(mE.sort),l.shift().execute();r.set(o,!1)};F0=(o,l,u=0)=>{let h=Pq(o),d=new mE(l,u),g=e.get(h);return g||(g=[],e.set(h,g)),g.push(d),n.get(h)||(n.set(h,!0),o.requestAnimationFrame(()=>s(h))),d}})();function Hq(e){let t=e.getBoundingClientRect(),n=xs(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var tr={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Uq=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=qr(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=qr(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=qr(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=qr(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=qr(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=qr(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=qr(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=qr(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=qr(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=qr(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=qr(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=qr(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=qr(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=qr(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function qr(e){return typeof e=="number"?`${e}px`:e}function fd(e){return new Uq(e)}var AD=class{constructor(){this._hooks=new na,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=s;let o=e;try{e.setPointerCapture(t),this._hooks.add(_n(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=xs(e)}this._hooks.add(it(o,tr.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(it(o,tr.POINTER_UP,l=>this.stopMonitoring(!0)))}};function $q(e,t,n){let r=null,s=null;if(typeof n.value=="function"?(r="value",s=n.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",s=n.get),!s)throw new Error("not supported");let o=`$memoize$${t}`;n[r]=function(...l){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,l)}),this[o]}}var ds;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(ds||(ds={}));var Qu=class Sr extends _t{constructor(){super(),this.dispatched=!1,this.targets=new iE,this.ignoreTargets=new iE,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(_r.runAndSubscribe(Bq,({window:t,disposables:n})=>{n.add(it(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(it(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(it(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:eo,disposables:this._store}))}static addTarget(t){if(!Sr.isTouchDevice())return _t.None;Sr.INSTANCE||(Sr.INSTANCE=new Sr);let n=Sr.INSTANCE.targets.push(t);return _n(n)}static ignoreTarget(t){if(!Sr.isTouchDevice())return _t.None;Sr.INSTANCE||(Sr.INSTANCE=new Sr);let n=Sr.INSTANCE.ignoreTargets.push(t);return _n(n)}static isTouchDevice(){return"ontouchstart"in eo||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,s=t.targetTouches.length;r<s;r++){let o=t.targetTouches.item(r);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:n,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[n],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};let l=this.newGestureEvent(ds.Start,o.target);l.pageX=o.pageX,l.pageY=o.pageY,this.dispatchEvent(l)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),s=Object.keys(this.activeTouches).length;for(let o=0,l=n.changedTouches.length;o<l;o++){let u=n.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let h=this.activeTouches[u.identifier],d=Date.now()-h.initialTimeStamp;if(d<Sr.HOLD_DELAY&&Math.abs(h.initialPageX-si(h.rollingPageX))<30&&Math.abs(h.initialPageY-si(h.rollingPageY))<30){let g=this.newGestureEvent(ds.Tap,h.initialTarget);g.pageX=si(h.rollingPageX),g.pageY=si(h.rollingPageY),this.dispatchEvent(g)}else if(d>=Sr.HOLD_DELAY&&Math.abs(h.initialPageX-si(h.rollingPageX))<30&&Math.abs(h.initialPageY-si(h.rollingPageY))<30){let g=this.newGestureEvent(ds.Contextmenu,h.initialTarget);g.pageX=si(h.rollingPageX),g.pageY=si(h.rollingPageY),this.dispatchEvent(g)}else if(s===1){let g=si(h.rollingPageX),p=si(h.rollingPageY),v=si(h.rollingTimestamps)-h.rollingTimestamps[0],y=g-h.rollingPageX[0],w=p-h.rollingPageY[0],S=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,S,r,Math.abs(y)/v,y>0?1:-1,g,Math.abs(w)/v,w>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(ds.End,h.initialTarget)),delete this.activeTouches[u.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(t){if(t.type===ds.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>Sr.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===ds.Change||t.type===ds.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let s=0,o=t.initialTarget;for(;o&&o!==r;)s++,o=o.parentElement;n.push([s,r])}n.sort((r,s)=>r[0]-s[0]);for(let[r,s]of n)s.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,s,o,l,u,h,d){this.handle=F0(t,()=>{let g=Date.now(),p=g-r,v=0,y=0,w=!0;s+=Sr.SCROLL_FRICTION*p,u+=Sr.SCROLL_FRICTION*p,s>0&&(w=!1,v=o*s*p),u>0&&(w=!1,y=h*u*p);let S=this.newGestureEvent(ds.Change);S.translationX=v,S.translationY=y,n.forEach(C=>C.dispatchEvent(S)),w||this.inertia(t,n,g,s,o,l+v,u,h,d+y)})}onTouchMove(t){let n=Date.now();for(let r=0,s=t.changedTouches.length;r<s;r++){let o=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}let l=this.activeTouches[o.identifier],u=this.newGestureEvent(ds.Change,l.initialTarget);u.translationX=o.pageX-si(l.rollingPageX),u.translationY=o.pageY-si(l.rollingPageY),u.pageX=o.pageX,u.pageY=o.pageY,this.dispatchEvent(u),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(o.pageX),l.rollingPageY.push(o.pageY),l.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Qu.SCROLL_FRICTION=-.005,Qu.HOLD_DELAY=700,Qu.CLEAR_TAP_COUNT_TIME=400,Rn([$q],Qu,"isTouchDevice",1);var Wq=Qu,H0=class extends _t{onclick(e,t){this._register(it(e,tr.CLICK,n=>t(new Wf(xs(e),n))))}onmousedown(e,t){this._register(it(e,tr.MOUSE_DOWN,n=>t(new Wf(xs(e),n))))}onmouseover(e,t){this._register(it(e,tr.MOUSE_OVER,n=>t(new Wf(xs(e),n))))}onmouseleave(e,t){this._register(it(e,tr.MOUSE_LEAVE,n=>t(new Wf(xs(e),n))))}onkeydown(e,t){this._register(it(e,tr.KEY_DOWN,n=>t(new cE(n))))}onkeyup(e,t){this._register(it(e,tr.KEY_UP,n=>t(new cE(n))))}oninput(e,t){this._register(it(e,tr.INPUT,t))}onblur(e,t){this._register(it(e,tr.BLUR,t))}onfocus(e,t){this._register(it(e,tr.FOCUS,t))}onchange(e,t){this._register(it(e,tr.CHANGE,t))}ignoreGesture(e){return Wq.ignoreTarget(e)}},pE=11,Vq=class extends H0{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=pE+"px",this.domNode.style.height=pE+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new AD),this._register(fE(this.bgDomNode,tr.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(fE(this.domNode,tr.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Fq),this._pointerdownScheduleRepeatTimer=this._register(new I0)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,xs(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},qq=class Dy{constructor(t,n,r,s,o,l,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,o=o|0,l=l|0,u=u|0),this.rawScrollLeft=s,this.rawScrollTop=u,n<0&&(n=0),s+n>r&&(s=r-n),s<0&&(s=0),o<0&&(o=0),u+o>l&&(u=l-o),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=o,this.scrollHeight=l,this.scrollTop=u}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new Dy(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Dy(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let r=this.width!==t.width,s=this.scrollWidth!==t.scrollWidth,o=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,h=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:s,scrollLeftChanged:o,heightChanged:l,scrollHeightChanged:u,scrollTopChanged:h}}},Kq=class extends _t{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Ne),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new qq(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var r;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new vE(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=vE.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},gE=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Gb(e,t){let n=t-e;return function(r){return e+n*Xq(r)}}function Gq(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var vE=class jy{constructor(t,n,r,s){this.from=t,this.to=n,this.duration=s,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,r){if(Math.abs(t-n)>2.5*r){let s,o;return t<n?(s=t+.75*r,o=n-.75*r):(s=t-.75*r,o=n+.75*r),Gq(Gb(t,s),Gb(o,n),.33)}return Gb(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let r=this.scrollLeft(n),s=this.scrollTop(n);return new gE(r,s,!1)}return new gE(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return jy.start(t,n,r)}static start(t,n,r){r=r+10;let s=Date.now()-10;return new jy(t,n,s,r)}};function Yq(e){return Math.pow(e,3)}function Xq(e){return 1-Yq(1-e)}var Zq=class extends _t{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new I0)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},Qq=140,DD=class extends H0{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Zq(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new AD),this._shouldRender=!0,this.domNode=fd(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(it(this.domNode.domNode,tr.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new Vq(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=fd(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(it(this.slider.domNode,tr.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);n<=s&&s<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let s=Hq(this.domNode.domNode);t=e.pageX-s.left,n=e.pageY-s.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let o=this._sliderOrthogonalPointerPosition(s),l=Math.abs(o-n);if(RD&&l>Qq){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let u=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(u))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},jD=class Oy{constructor(t,n,r,s,o,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Oy(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,r,s,o){let l=Math.max(0,r-t),u=Math.max(0,l-2*n),h=s>0&&s>r;if(!h)return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*u/s))),g=(u-d)/(s-r),p=o*g;return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(d),computedSliderRatio:g,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let t=Oy._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},Jq=class extends DD{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new jD(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,s.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},eK=class extends DD{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new jD(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},tK=500,bE=50,nK=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},Ly=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,r=1,s=this._rear;do{let o=s===this._front?t:Math.pow(2,-r);if(t-=o,n+=this._memory[s].score*o,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(P0){let n=xs(t.browserEvent),r=fq(n);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,r){let s=null,o=new nK(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,s)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),n){let s=Math.abs(t.deltaX),o=Math.abs(t.deltaY),l=Math.abs(n.deltaX),u=Math.abs(n.deltaY),h=Math.max(Math.min(s,l),1),d=Math.max(Math.min(o,u),1),g=Math.max(s,l),p=Math.max(o,u);g%h===0&&p%d===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Ly.INSTANCE=new Ly;var rK=Ly,iK=class extends H0{constructor(e,t,n){super(),this._onScroll=this._register(new Ne),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Ne),this.onWillScroll=this._onWillScroll.event,this._options=oK(t),this._scrollable=n,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let r={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new eK(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Jq(this._scrollable,this._options,r)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=fd(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=fd(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=fd(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new I0),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=el(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Cs&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new dE(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=el(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new dE(n))};this._mouseWheelToDispose.push(it(this._listenOnDomNode,tr.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=rK.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+o===0?l=o=0:Math.abs(o)>=Math.abs(l)?l=0:o=0),this._options.flipAxes&&([o,l]=[l,o]);let u=!Cs&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!l&&(l=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),d={};if(o){let g=bE*o,p=h.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(d,p)}if(l){let g=bE*l,p=h.scrollLeft-(g<0?Math.floor(g):Math.ceil(g));this._horizontalScrollbar.writeScrollPosition(d,p)}d=this._scrollable.validateScrollPosition(d),(h.scrollLeft!==d.scrollLeft||h.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",s=t?" top":"",o=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${s}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),tK)}},sK=class extends iK{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function oK(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Cs&&(t.className+=" mac"),t}var zy=class extends _t{constructor(e,t,n,r,s,o,l,u){super(),this._bufferService=n,this._optionsService=l,this._renderService=u,this._onRequestScrollLines=this._register(new Ne),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new Kq({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>F0(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new sK(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(_r.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(_n(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(_n(()=>this._styleElement.remove())),this._register(_r.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
541
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(d=>this._handleScroll(d)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};zy=Rn([ze(2,zr),ze(3,fo),ze(4,fD),ze(5,Oc),ze(6,Pr),ze(7,mo)],zy);var Py=class extends _t{constructor(e,t,n,r,s){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(o=>this._removeDecoration(o))),this._register(_n(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Py=Rn([ze(1,zr),ze(2,fo),ze(3,eh),ze(4,mo)],Py);var aK=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},cs={full:0,left:0,center:0,right:0},Vo={full:0,left:0,center:0,right:0},zu={full:0,left:0,center:0,right:0},Xm=class extends _t{constructor(e,t,n,r,s,o,l,u){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=o,this._themeService=l,this._coreBrowserService=u,this._colorZoneStore=new aK,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(_n(()=>{var g;return(g=this._canvas)==null?void 0:g.remove()}));let h=this._canvas.getContext("2d");if(h)this._ctx=h;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Vo.full=this._canvas.width,Vo.left=e,Vo.center=t,Vo.right=e,this._refreshDrawHeightConstants(),zu.full=1,zu.left=1,zu.center=1+Vo.left,zu.right=1+Vo.left+Vo.center}_refreshDrawHeightConstants(){cs.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);cs.left=t,cs.center=t,cs.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*cs.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*cs.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*cs.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*cs.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(zu[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-cs[e.position||"full"]/2),Vo[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+cs[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Xm=Rn([ze(2,zr),ze(3,eh),ze(4,mo),ze(5,Pr),ze(6,Oc),ze(7,fo)],Xm);var ye;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
542
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(ye||(ye={}));var ym;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(ym||(ym={}));var OD;(e=>e.ST=`${ye.ESC}\\`)(OD||(OD={}));var By=class{constructor(e,t,n,r,s,o){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ye.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};By=Rn([ze(2,zr),ze(3,Pr),ze(4,cl),ze(5,mo)],By);var or=0,ar=0,lr=0,En=0,_E={css:"#00000000",rgba:0},$n;(e=>{function t(s,o,l,u){return u!==void 0?`#${ja(s)}${ja(o)}${ja(l)}${ja(u)}`:`#${ja(s)}${ja(o)}${ja(l)}`}e.toCss=t;function n(s,o,l,u=255){return(s<<24|o<<16|l<<8|u)>>>0}e.toRgba=n;function r(s,o,l,u){return{css:e.toCss(s,o,l,u),rgba:e.toRgba(s,o,l,u)}}e.toColor=r})($n||($n={}));var mn;(e=>{function t(h,d){if(En=(d.rgba&255)/255,En===1)return{css:d.css,rgba:d.rgba};let g=d.rgba>>24&255,p=d.rgba>>16&255,v=d.rgba>>8&255,y=h.rgba>>24&255,w=h.rgba>>16&255,S=h.rgba>>8&255;or=y+Math.round((g-y)*En),ar=w+Math.round((p-w)*En),lr=S+Math.round((v-S)*En);let C=$n.toCss(or,ar,lr),k=$n.toRgba(or,ar,lr);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,g){let p=xm.ensureContrastRatio(h.rgba,d.rgba,g);if(p)return $n.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[or,ar,lr]=xm.toChannels(d),{css:$n.toCss(or,ar,lr),rgba:d}}e.opaque=s;function o(h,d){return En=Math.round(d*255),[or,ar,lr]=xm.toChannels(h.rgba),{css:$n.toCss(or,ar,lr,En),rgba:$n.toRgba(or,ar,lr,En)}}e.opacity=o;function l(h,d){return En=h.rgba&255,o(h,En*d/255)}e.multiplyOpacity=l;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(mn||(mn={}));var wn;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let o=s.getContext("2d",{willReadFrequently:!0});o&&(t=o,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return or=parseInt(s.slice(1,2).repeat(2),16),ar=parseInt(s.slice(2,3).repeat(2),16),lr=parseInt(s.slice(3,4).repeat(2),16),$n.toColor(or,ar,lr);case 5:return or=parseInt(s.slice(1,2).repeat(2),16),ar=parseInt(s.slice(2,3).repeat(2),16),lr=parseInt(s.slice(3,4).repeat(2),16),En=parseInt(s.slice(4,5).repeat(2),16),$n.toColor(or,ar,lr,En);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let o=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(o)return or=parseInt(o[1]),ar=parseInt(o[2]),lr=parseInt(o[3]),En=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),$n.toColor(or,ar,lr,En);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[or,ar,lr,En]=t.getImageData(0,0,1,1).data,En!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:$n.toRgba(or,ar,lr,En),css:s}}e.toColor=r})(wn||(wn={}));var Ar;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,o){let l=r/255,u=s/255,h=o/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),g=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+g*.7152+p*.0722}e.relativeLuminance2=n})(Ar||(Ar={}));var xm;(e=>{function t(l,u){if(En=(u&255)/255,En===1)return u;let h=u>>24&255,d=u>>16&255,g=u>>8&255,p=l>>24&255,v=l>>16&255,y=l>>8&255;return or=p+Math.round((h-p)*En),ar=v+Math.round((d-v)*En),lr=y+Math.round((g-y)*En),$n.toRgba(or,ar,lr)}e.blend=t;function n(l,u,h){let d=Ar.relativeLuminance(l>>8),g=Ar.relativeLuminance(u>>8);if(Xs(d,g)<h){if(g<d){let y=r(l,u,h),w=Xs(d,Ar.relativeLuminance(y>>8));if(w<h){let S=s(l,u,h),C=Xs(d,Ar.relativeLuminance(S>>8));return w>C?y:S}return y}let p=s(l,u,h),v=Xs(d,Ar.relativeLuminance(p>>8));if(v<h){let y=r(l,u,h),w=Xs(d,Ar.relativeLuminance(y>>8));return v>w?p:y}return p}}e.ensureContrastRatio=n;function r(l,u,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,w=u>>8&255,S=Xs(Ar.relativeLuminance2(v,y,w),Ar.relativeLuminance2(d,g,p));for(;S<h&&(v>0||y>0||w>0);)v-=Math.max(0,Math.ceil(v*.1)),y-=Math.max(0,Math.ceil(y*.1)),w-=Math.max(0,Math.ceil(w*.1)),S=Xs(Ar.relativeLuminance2(v,y,w),Ar.relativeLuminance2(d,g,p));return(v<<24|y<<16|w<<8|255)>>>0}e.reduceLuminance=r;function s(l,u,h){let d=l>>24&255,g=l>>16&255,p=l>>8&255,v=u>>24&255,y=u>>16&255,w=u>>8&255,S=Xs(Ar.relativeLuminance2(v,y,w),Ar.relativeLuminance2(d,g,p));for(;S<h&&(v<255||y<255||w<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),S=Xs(Ar.relativeLuminance2(v,y,w),Ar.relativeLuminance2(d,g,p));return(v<<24|y<<16|w<<8|255)>>>0}e.increaseLuminance=s;function o(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=o})(xm||(xm={}));function ja(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Xs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var lK=class extends Jd{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Zm=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Oi}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),s=0,o=0,l=0,u=t.getFg(0),h=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==u||this._workCell.bg!==h){if(d-s>1){let g=this._getJoinedRanges(r,l,o,t,s);for(let p=0;p<g.length;p++)n.push(g[p])}s=d,l=o,u=this._workCell.fg,h=this._workCell.bg}o+=this._workCell.getChars().length||ea.length}if(this._bufferService.cols-s>1){let d=this._getJoinedRanges(r,l,o,t,s);for(let g=0;g<d.length;g++)n.push(d[g])}return n}_getJoinedRanges(e,t,n,r,s){let o=e.substring(t,n),l=[];try{l=this._characterJoiners[0].handler(o)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let h=this._characterJoiners[u].handler(o);for(let d=0;d<h.length;d++)Zm._mergeRanges(l,h[d])}catch(h){console.error(h)}return this._stringRangesToCellRanges(l,r,s),l}_stringRangesToCellRanges(e,t,n){let r=0,s=!1,o=0,l=e[r];if(l){for(let u=n;u<this._bufferService.cols;u++){let h=t.getWidth(u),d=t.getString(u).length||ea.length;if(h!==0){if(!s&&l[0]<=o&&(l[0]=u,s=!0),l[1]<=o){if(l[1]=u,l=e[++r],!l)break;l[0]<=o?(l[0]=u,s=!0):s=!1}o+=d}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];if(n){if(t[1]<=s[0])return e[r-1][1]=t[1],e;if(t[1]<=s[1])return e[r-1][1]=Math.max(t[1],s[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=s[0])return e.splice(r,0,t),e;if(t[1]<=s[1])return s[0]=Math.min(t[0],s[0]),e;t[0]<s[1]&&(s[0]=Math.min(t[0],s[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};Zm=Rn([ze(0,zr)],Zm);function cK(e){return 57508<=e&&e<=57558}function uK(e){return 9472<=e&&e<=9631}function dK(e){return cK(e)||uK(e)}function hK(){return{css:{canvas:Vf(),cell:Vf()},device:{canvas:Vf(),cell:Vf(),char:{width:0,height:0,left:0,top:0}}}}function Vf(){return{width:0,height:0}}var Iy=class{constructor(e,t,n,r,s,o,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=o,this._themeService=l,this._workCell=new Oi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,s,o,l,u,h,d,g){let p=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,w=e.getNoBgTrimmedLength();n&&w<o+1&&(w=o+1);let S,C=0,k="",R=0,E=0,N=0,L=0,D=!1,j=0,H=!1,G=0,B=0,q=[],I=d!==-1&&g!==-1;for(let V=0;V<w;V++){e.loadCell(V,this._workCell);let F=this._workCell.getWidth();if(F===0)continue;let W=!1,O=V>=B,$=V,U=this._workCell;if(v.length>0&&V===v[0][0]&&O){let Ae=v.shift(),Ke=this._isCellInSelection(Ae[0],t);for(R=Ae[0]+1;R<Ae[1];R++)O&&(O=Ke===this._isCellInSelection(R,t));O&&(O=!n||o<Ae[0]||o>=Ae[1]),O?(W=!0,U=new lK(this._workCell,e.translateToString(!0,Ae[0],Ae[1]),Ae[1]-Ae[0]),$=Ae[1]-1,F=U.getWidth()):B=Ae[1]}let X=this._isCellInSelection(V,t),M=n&&V===o,P=I&&V>=d&&V<=g,Z=!1;this._decorationService.forEachDecorationAtCell(V,t,void 0,Ae=>{Z=!0});let A=U.getChars()||ea;if(A===" "&&(U.isUnderline()||U.isOverline())&&(A=" "),G=F*u-h.get(A,U.isBold(),U.isItalic()),!S)S=this._document.createElement("span");else if(C&&(X&&H||!X&&!H&&U.bg===E)&&(X&&H&&y.selectionForeground||U.fg===N)&&U.extended.ext===L&&P===D&&G===j&&!M&&!W&&!Z&&O){U.isInvisible()?k+=ea:k+=A,C++;continue}else C&&(S.textContent=k),S=this._document.createElement("span"),C=0,k="";if(E=U.bg,N=U.fg,L=U.extended.ext,D=P,j=G,H=X,W&&o>=V&&o<=$&&(o=V),!this._coreService.isCursorHidden&&M&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&q.push("xterm-cursor-blink"),q.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline");break}}if(U.isBold()&&q.push("xterm-bold"),U.isItalic()&&q.push("xterm-italic"),U.isDim()&&q.push("xterm-dim"),U.isInvisible()?k=ea:k=U.getChars()||ea,U.isUnderline()&&(q.push(`xterm-underline-${U.extended.underlineStyle}`),k===" "&&(k=" "),!U.isUnderlineColorDefault()))if(U.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${Jd.toColorRGB(U.getUnderlineColor()).join(",")})`;else{let Ae=U.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&U.isBold()&&Ae<8&&(Ae+=8),S.style.textDecorationColor=y.ansi[Ae].css}U.isOverline()&&(q.push("xterm-overline"),k===" "&&(k=" ")),U.isStrikethrough()&&q.push("xterm-strikethrough"),P&&(S.style.textDecoration="underline");let ie=U.getFgColor(),J=U.getFgColorMode(),ee=U.getBgColor(),re=U.getBgColorMode(),ce=!!U.isInverse();if(ce){let Ae=ie;ie=ee,ee=Ae;let Ke=J;J=re,re=Ke}let he,pe,Se=!1;this._decorationService.forEachDecorationAtCell(V,t,void 0,Ae=>{Ae.options.layer!=="top"&&Se||(Ae.backgroundColorRGB&&(re=50331648,ee=Ae.backgroundColorRGB.rgba>>8&16777215,he=Ae.backgroundColorRGB),Ae.foregroundColorRGB&&(J=50331648,ie=Ae.foregroundColorRGB.rgba>>8&16777215,pe=Ae.foregroundColorRGB),Se=Ae.options.layer==="top")}),!Se&&X&&(he=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,ee=he.rgba>>8&16777215,re=50331648,Se=!0,y.selectionForeground&&(J=50331648,ie=y.selectionForeground.rgba>>8&16777215,pe=y.selectionForeground)),Se&&q.push("xterm-decoration-top");let Re;switch(re){case 16777216:case 33554432:Re=y.ansi[ee],q.push(`xterm-bg-${ee}`);break;case 50331648:Re=$n.toColor(ee>>16,ee>>8&255,ee&255),this._addStyle(S,`background-color:#${yE((ee>>>0).toString(16),"0",6)}`);break;case 0:default:ce?(Re=y.foreground,q.push("xterm-bg-257")):Re=y.background}switch(he||U.isDim()&&(he=mn.multiplyOpacity(Re,.5)),J){case 16777216:case 33554432:U.isBold()&&ie<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ie+=8),this._applyMinimumContrast(S,Re,y.ansi[ie],U,he,void 0)||q.push(`xterm-fg-${ie}`);break;case 50331648:let Ae=$n.toColor(ie>>16&255,ie>>8&255,ie&255);this._applyMinimumContrast(S,Re,Ae,U,he,pe)||this._addStyle(S,`color:#${yE(ie.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(S,Re,y.foreground,U,he,pe)||ce&&q.push("xterm-fg-257")}q.length&&(S.className=q.join(" "),q.length=0),!M&&!W&&!Z&&O?C++:S.textContent=k,G!==this.defaultSpacing&&(S.style.letterSpacing=`${G}px`),p.push(S),V=$}return S&&C&&(S.textContent=k),p}_applyMinimumContrast(e,t,n,r,s,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||dK(r.getCode()))return!1;let l=this._getContrastCache(r),u;if(!s&&!o&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=mn.ensureContrastRatio(s||t,o||n,h),l.setColor((s||t).rgba,(o||n).rgba,u??null)}return u?(this._addStyle(e,`color:${u.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};Iy=Rn([ze(1,gD),ze(2,Pr),ze(3,fo),ze(4,cl),ze(5,eh),ze(6,Oc)],Iy);function yE(e,t,n){for(;e.length<n;)e=t+e;return e}var fK=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[n,r,s,o],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(o),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let l=this._measure(e,0);return l>0&&(this._flat[r]=l),l}let s=e;t&&(s+="B"),n&&(s+="I");let o=this._holey.get(s);if(o===void 0){let l=0;t&&(l|=1),n&&(l|=2),o=this._measure(e,l),o>0&&this._holey.set(s,o)}return o}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},mK=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let s=e.buffers.active.ydisp,o=t[1]-s,l=n[1]-s,u=Math.max(o,0),h=Math.min(l,e.rows-1);if(u>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=o,this.viewportEndRow=l,this.viewportCappedStartRow=u,this.viewportCappedEndRow=h,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function pK(){return new mK}var Yb="xterm-dom-renderer-owner-",Si="xterm-rows",qf="xterm-fg-",xE="xterm-bg-",Pu="xterm-focus",Kf="xterm-selection",gK=1,Fy=class extends _t{constructor(e,t,n,r,s,o,l,u,h,d,g,p,v,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=o,this._linkifier2=l,this._charSizeService=h,this._optionsService=d,this._bufferService=g,this._coreService=p,this._coreBrowserService=v,this._themeService=y,this._terminalClass=gK++,this._rowElements=[],this._selectionRenderModel=pK(),this.onRequestRedraw=this._register(new Ne).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Si),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(Kf),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=hK(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(w=>this._injectCss(w))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(Iy,document),this._element.classList.add(Yb+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(w=>this._handleLinkHover(w))),this._register(this._linkifier2.onHideLinkUnderline(w=>this._handleLinkLeave(w))),this._register(_n(()=>{this._element.classList.remove(Yb+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new fK(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Si} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Si} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Si} .xterm-dim { color: ${mn.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Si}.${Pu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Si}.${Pu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Si}.${Pu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Si} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Si} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Si} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Si} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Si} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Kf} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Kf} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Kf} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,l]of e.ansi.entries())t+=`${this._terminalSelector} .${qf}${o} { color: ${l.css}; }${this._terminalSelector} .${qf}${o}.xterm-dim { color: ${mn.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${xE}${o} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${qf}257 { color: ${mn.opaque(e.background).css}; }${this._terminalSelector} .${qf}257.xterm-dim { color: ${mn.multiplyOpacity(mn.opaque(e.background),.5).css}; }${this._terminalSelector} .${xE}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let n=this._rowElements.length;n<=t;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Pu),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Pu),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let h=e[0]>t[0];u.appendChild(this._createSelectionElement(o,h?t[0]:e[0],h?e[0]:t[0],l-o+1))}else{let h=r===o?e[0]:0,d=o===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(o,h,d));let g=l-o-1;if(u.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,g)),o!==l){let p=s===l?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,0,p))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let s=this._document.createElement("div"),o=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-t);return o+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-o),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${o}px`,s.style.width=`${l}px`,s}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,s=Math.min(n.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){let d=h+n.ydisp,g=this._rowElements[h],p=n.lines.get(d);if(!g||!p)break;g.replaceChildren(...this._rowFactory.createRow(p,d,d===r,l,u,s,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Yb}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,s,o){n<0&&(e=0),r<0&&(t=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),r=Math.max(Math.min(r,l),0),s=Math.min(s,this._bufferService.cols);let u=this._bufferService.buffer,h=u.ybase+u.y,d=Math.min(u.x,s-1),g=this._optionsService.rawOptions.cursorBlink,p=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=r;++y){let w=y+u.ydisp,S=this._rowElements[y],C=u.lines.get(w);if(!S||!C)break;S.replaceChildren(...this._rowFactory.createRow(C,w,w===h,p,v,d,g,this.dimensions.css.cell.width,this._widthCache,o?y===n?e:0:-1,o?(y===r?t:s)-1:-1))}}};Fy=Rn([ze(7,O0),ze(8,qp),ze(9,Pr),ze(10,zr),ze(11,cl),ze(12,fo),ze(13,Oc)],Fy);var Hy=class extends _t{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Ne),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new bK(this._optionsService))}catch{this._measureStrategy=this._register(new vK(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Hy=Rn([ze(2,Pr)],Hy);var LD=class extends _t{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},vK=class extends LD{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},bK=class extends LD{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},_K=class extends _t{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new yK(this._window)),this._onDprChange=this._register(new Ne),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Ne),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(_r.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(it(this._textarea,"focus",()=>this._isFocused=!0)),this._register(it(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},yK=class extends _t{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new yc),this._onDprChange=this._register(new Ne),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(_n(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=it(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},xK=class extends _t{constructor(){super(),this.linkProviders=[],this._register(_n(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function U0(e,t,n){let r=n.getBoundingClientRect(),s=e.getComputedStyle(n),o=parseInt(s.getPropertyValue("padding-left")),l=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-r.left-o,t.clientY-r.top-l]}function wK(e,t,n,r,s,o,l,u,h){if(!o)return;let d=U0(e,t,n);if(d)return d[0]=Math.ceil((d[0]+(h?l/2:0))/l),d[1]=Math.ceil(d[1]/u),d[0]=Math.min(Math.max(d[0],1),r+(h?1:0)),d[1]=Math.min(Math.max(d[1],1),s),d}var Uy=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,s){return wK(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,t){let n=U0(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Uy=Rn([ze(0,mo),ze(1,qp)],Uy);var SK=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},zD={};jV(zD,{getSafariVersion:()=>kK,isChromeOS:()=>FD,isFirefox:()=>PD,isIpad:()=>EK,isIphone:()=>RK,isLegacyEdge:()=>CK,isLinux:()=>$0,isMac:()=>Qm,isNode:()=>Kp,isSafari:()=>BD,isWindows:()=>ID});var Kp=typeof process<"u"&&"title"in process,th=Kp?"node":navigator.userAgent,nh=Kp?"node":navigator.platform,PD=th.includes("Firefox"),CK=th.includes("Edge"),BD=/^((?!chrome|android).)*safari/i.test(th);function kK(){if(!BD)return 0;let e=th.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Qm=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(nh),EK=nh==="iPad",RK=nh==="iPhone",ID=["Windows","Win16","Win32","WinCE"].includes(nh),$0=nh.indexOf("Linux")>=0,FD=/\bCrOS\b/.test(th),HD=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),s=e.timeRemaining(),n*1.5>s){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=s}this.clear()}},TK=class extends HD{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},NK=class extends HD{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Jm=!Kp&&"requestIdleCallback"in window?NK:TK,MK=class{constructor(){this._queue=new Jm}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},$y=class extends _t{constructor(e,t,n,r,s,o,l,u,h){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new yc),this._pausedResizeTask=new MK,this._observerDisposable=this._register(new yc),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new Ne),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Ne),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Ne),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Ne),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new SK((d,g)=>this._renderRows(d,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new AK(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(_n(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(h.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=_n(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};$y=Rn([ze(2,Pr),ze(3,qp),ze(4,cl),ze(5,eh),ze(6,zr),ze(7,fo),ze(8,Oc)],$y);var AK=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function DK(e,t,n,r){let s=n.buffer.x,o=n.buffer.y;if(!n.buffer.hasScrollback)return LK(s,o,e,t,n,r)+Gp(o,t,n,r)+zK(s,o,e,t,n,r);let l;if(o===t)return l=s>e?"D":"C",Md(Math.abs(s-e),Nd(l,r));l=o>t?"D":"C";let u=Math.abs(o-t),h=OK(o>t?e:s,n)+(u-1)*n.cols+1+jK(o>t?s:e);return Md(h,Nd(l,r))}function jK(e,t){return e-1}function OK(e,t){return t.cols-e}function LK(e,t,n,r,s,o){return Gp(t,r,s,o).length===0?"":Md($D(e,t,e,t-tl(t,s),!1,s).length,Nd("D",o))}function Gp(e,t,n,r){let s=e-tl(e,n),o=t-tl(t,n),l=Math.abs(s-o)-PK(e,t,n);return Md(l,Nd(UD(e,t),r))}function zK(e,t,n,r,s,o){let l;Gp(t,r,s,o).length>0?l=r-tl(r,s):l=t;let u=r,h=BK(e,t,n,r,s,o);return Md($D(e,l,n,u,h==="C",s).length,Nd(h,o))}function PK(e,t,n){var l;let r=0,s=e-tl(e,n),o=t-tl(t,n);for(let u=0;u<Math.abs(s-o);u++){let h=UD(e,t)==="A"?-1:1;(l=n.buffer.lines.get(s+h*u))!=null&&l.isWrapped&&r++}return r}function tl(e,t){let n=0,r=t.buffer.lines.get(e),s=r==null?void 0:r.isWrapped;for(;s&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),s=r==null?void 0:r.isWrapped;return n}function BK(e,t,n,r,s,o){let l;return Gp(n,r,s,o).length>0?l=r-tl(r,s):l=t,e<n&&l<=r||e>=n&&l<r?"C":"D"}function UD(e,t){return e>t?"A":"B"}function $D(e,t,n,r,s,o){let l=e,u=t,h="";for(;(l!==n||u!==r)&&u>=0&&u<o.buffer.lines.length;)l+=s?1:-1,s&&l>o.cols-1?(h+=o.buffer.translateBufferLineToString(u,!1,e,l),l=0,e=0,u++):!s&&l<0&&(h+=o.buffer.translateBufferLineToString(u,!1,0,e+1),l=o.cols-1,e=l,u--);return h+o.buffer.translateBufferLineToString(u,!1,e,l)}function Nd(e,t){let n=t?"O":"[";return ye.ESC+n+e}function Md(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var IK=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function wE(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Xb=50,FK=15,HK=50,UK=500,$K=" ",WK=new RegExp($K,"g"),Wy=class extends _t{constructor(e,t,n,r,s,o,l,u,h){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=o,this._optionsService=l,this._renderService=u,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Oi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Ne),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Ne),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Ne),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Ne),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new IK(this._bufferService),this._activeSelectionMode=0,this._register(_n(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let s=e[0]<t[0]?e[0]:t[0],o=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let u=n.translateBufferLineToString(l,!0,s,o);r.push(u)}}else{let s=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],s));for(let o=e[1]+1;o<=t[1]-1;o++){let l=n.lines.get(o),u=n.translateBufferLineToString(o,!0);l!=null&&l.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let o=n.lines.get(t[1]),l=n.translateBufferLineToString(t[1],!0,0,t[0]);o&&o.isWrapped?r[r.length-1]+=l:r.push(l)}}return r.map(s=>s.replace(WK," ")).join(ID?`\r
|
|
543
|
+
`:`
|
|
544
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),$0&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var s,o;let n=(o=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:o.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=wE(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=U0(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-Xb),Xb),t/=Xb,t/Math.abs(t)+Math.round(t*(FK-1)))}shouldForceSelection(e){return Qm?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),HK)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Qm&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let r=n.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<UK&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=DK(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let s=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:s>1&&t!==r&&(n+=s-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,o=s.lines.get(e[1]);if(!o)return;let l=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(o,e[0]),h=u,d=e[0]-u,g=0,p=0,v=0,y=0;if(l.charAt(u)===" "){for(;u>0&&l.charAt(u-1)===" ";)u--;for(;h<l.length&&l.charAt(h+1)===" ";)h++}else{let C=e[0],k=e[0];o.getWidth(C)===0&&(g++,C--),o.getWidth(k)===2&&(p++,k++);let R=o.getString(k).length;for(R>1&&(y+=R-1,h+=R-1);C>0&&u>0&&!this._isCharWordSeparator(o.loadCell(C-1,this._workCell));){o.loadCell(C-1,this._workCell);let E=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,C--):E>1&&(v+=E-1,u-=E-1),u--,C--}for(;k<o.length&&h+1<l.length&&!this._isCharWordSeparator(o.loadCell(k+1,this._workCell));){o.loadCell(k+1,this._workCell);let E=this._workCell.getChars().length;this._workCell.getWidth()===2?(p++,k++):E>1&&(y+=E-1,h+=E-1),h++,k++}}h++;let w=u+d-g+v,S=Math.min(this._bufferService.cols,h-u+g+p-v-y);if(!(!t&&l.slice(u,h).trim()==="")){if(n&&w===0&&o.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&o.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let R=this._bufferService.cols-k.start;w-=R,S+=R}}}if(r&&w+S===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let C=s.lines.get(e[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(S+=k.length)}}return{start:w,length:S}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=wE(n,this._bufferService.cols)}};Wy=Rn([ze(3,zr),ze(4,cl),ze(5,L0),ze(6,Pr),ze(7,mo),ze(8,fo)],Wy);var SE=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},CE=class{constructor(){this._color=new SE,this._css=new SE}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Kn=Object.freeze((()=>{let e=[wn.toColor("#2e3436"),wn.toColor("#cc0000"),wn.toColor("#4e9a06"),wn.toColor("#c4a000"),wn.toColor("#3465a4"),wn.toColor("#75507b"),wn.toColor("#06989a"),wn.toColor("#d3d7cf"),wn.toColor("#555753"),wn.toColor("#ef2929"),wn.toColor("#8ae234"),wn.toColor("#fce94f"),wn.toColor("#729fcf"),wn.toColor("#ad7fa8"),wn.toColor("#34e2e2"),wn.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],o=t[n%6];e.push({css:$n.toCss(r,s,o),rgba:$n.toRgba(r,s,o)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:$n.toCss(r,r,r),rgba:$n.toRgba(r,r,r)})}return e})()),za=wn.toColor("#ffffff"),Ju=wn.toColor("#000000"),kE=wn.toColor("#ffffff"),EE=Ju,Bu={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},VK=za,Vy=class extends _t{constructor(e){super(),this._optionsService=e,this._contrastCache=new CE,this._halfContrastCache=new CE,this._onChangeColors=this._register(new Ne),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:za,background:Ju,cursor:kE,cursorAccent:EE,selectionForeground:void 0,selectionBackgroundTransparent:Bu,selectionBackgroundOpaque:mn.blend(Ju,Bu),selectionInactiveBackgroundTransparent:Bu,selectionInactiveBackgroundOpaque:mn.blend(Ju,Bu),scrollbarSliderBackground:mn.opacity(za,.2),scrollbarSliderHoverBackground:mn.opacity(za,.4),scrollbarSliderActiveBackground:mn.opacity(za,.5),overviewRulerBorder:za,ansi:Kn.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=en(e.foreground,za),t.background=en(e.background,Ju),t.cursor=mn.blend(t.background,en(e.cursor,kE)),t.cursorAccent=mn.blend(t.background,en(e.cursorAccent,EE)),t.selectionBackgroundTransparent=en(e.selectionBackground,Bu),t.selectionBackgroundOpaque=mn.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=en(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=mn.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?en(e.selectionForeground,_E):void 0,t.selectionForeground===_E&&(t.selectionForeground=void 0),mn.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=mn.opacity(t.selectionBackgroundTransparent,.3)),mn.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=mn.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=en(e.scrollbarSliderBackground,mn.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=en(e.scrollbarSliderHoverBackground,mn.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=en(e.scrollbarSliderActiveBackground,mn.opacity(t.foreground,.5)),t.overviewRulerBorder=en(e.overviewRulerBorder,VK),t.ansi=Kn.slice(),t.ansi[0]=en(e.black,Kn[0]),t.ansi[1]=en(e.red,Kn[1]),t.ansi[2]=en(e.green,Kn[2]),t.ansi[3]=en(e.yellow,Kn[3]),t.ansi[4]=en(e.blue,Kn[4]),t.ansi[5]=en(e.magenta,Kn[5]),t.ansi[6]=en(e.cyan,Kn[6]),t.ansi[7]=en(e.white,Kn[7]),t.ansi[8]=en(e.brightBlack,Kn[8]),t.ansi[9]=en(e.brightRed,Kn[9]),t.ansi[10]=en(e.brightGreen,Kn[10]),t.ansi[11]=en(e.brightYellow,Kn[11]),t.ansi[12]=en(e.brightBlue,Kn[12]),t.ansi[13]=en(e.brightMagenta,Kn[13]),t.ansi[14]=en(e.brightCyan,Kn[14]),t.ansi[15]=en(e.brightWhite,Kn[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=en(e.extendedAnsi[r],Kn[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Vy=Rn([ze(0,Pr)],Vy);function en(e,t){if(e!==void 0)try{return wn.toColor(e)}catch{}return t}var qK=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},KK=class{constructor(){this._services=new qK,this._services.set(O0,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=FV(e).sort((o,l)=>o.index-l.index),r=[];for(let o of n){let l=this._services.get(o.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${o.id._id}.`);r.push(l)}let s=n.length>0?n[0].index:t.length;if(t.length!==s)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},GK={trace:0,debug:1,info:2,warn:3,error:4,off:5},YK="xterm.js: ",qy=class extends _t{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=GK[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":YK)+t,...n)}trace(e,...t){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,t)}};qy=Rn([ze(0,Pr)],qy);var RE=class extends _t{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Ne),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Ne),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Ne),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+n.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<n.length;r++)this._array[this._getCyclicIndex(e+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let r=this._length+n.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let s=t-1;s>=0;s--)this.set(e+s+n,this.get(e+s));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},vt=3,Hn=Object.freeze(new Jd),Gf=0,Zb=2,ed=class WD{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*vt);let s=n||Oi.fromCharData([0,cD,1,0]);for(let o=0;o<t;++o)this.setCell(o,s);this.length=t}get(t){let n=this._data[t*vt+0],r=n&2097151;return[this._data[t*vt+1],n&2097152?this._combined[t]:r?Zo(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*vt+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*vt+0]=t|2097152|n[2]<<22):this._data[t*vt+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*vt+0]>>22}hasWidth(t){return this._data[t*vt+0]&12582912}getFg(t){return this._data[t*vt+1]}getBg(t){return this._data[t*vt+2]}hasContent(t){return this._data[t*vt+0]&4194303}getCodePoint(t){let n=this._data[t*vt+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*vt+0]&2097152}getString(t){let n=this._data[t*vt+0];return n&2097152?this._combined[t]:n&2097151?Zo(n&2097151):""}isProtected(t){return this._data[t*vt+2]&536870912}loadCell(t,n){return Gf=t*vt,n.content=this._data[Gf+0],n.fg=this._data[Gf+1],n.bg=this._data[Gf+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*vt+0]=n.content,this._data[t*vt+1]=n.fg,this._data[t*vt+2]=n.bg}setCellFromCodepoint(t,n,r,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*vt+0]=n|r<<22,this._data[t*vt+1]=s.fg,this._data[t*vt+2]=s.bg}addCodepointToCell(t,n,r){let s=this._data[t*vt+0];s&2097152?this._combined[t]+=Zo(n):s&2097151?(this._combined[t]=Zo(s&2097151)+Zo(n),s&=-2097152,s|=2097152):s=n|1<<22,r&&(s&=-12582913,s|=r<<22),this._data[t*vt+0]=s}insertCells(t,n,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length-t){let s=new Oi;for(let o=this.length-t-n-1;o>=0;--o)this.setCell(t+n+o,this.loadCell(t+o,s));for(let o=0;o<n;++o)this.setCell(t+o,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,n,r){if(t%=this.length,n<this.length-t){let s=new Oi;for(let o=0;o<this.length-t-n;++o)this.setCell(t+o,this.loadCell(t+n+o,s));for(let o=this.length-n;o<this.length;++o)this.setCell(o,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,n,r,s=!1){if(s){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.setCell(t++,r)}resize(t,n){if(t===this.length)return this._data.length*4*Zb<this._data.buffer.byteLength;let r=t*vt;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let s=new Uint32Array(r);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,r);let s=Object.keys(this._combined);for(let l=0;l<s.length;l++){let u=parseInt(s[l],10);u>=t&&delete this._combined[u]}let o=Object.keys(this._extendedAttrs);for(let l=0;l<o.length;l++){let u=parseInt(o[l],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*Zb<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Zb<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new WD(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*vt+0]&4194303)return t+(this._data[t*vt+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*vt+0]&4194303||this._data[t*vt+2]&50331648)return t+(this._data[t*vt+0]>>22);return 0}copyCellsFrom(t,n,r,s,o){let l=t._data;if(o)for(let h=s-1;h>=0;h--){for(let d=0;d<vt;d++)this._data[(r+h)*vt+d]=l[(n+h)*vt+d];l[(n+h)*vt+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}else for(let h=0;h<s;h++){for(let d=0;d<vt;d++)this._data[(r+h)*vt+d]=l[(n+h)*vt+d];l[(n+h)*vt+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}let u=Object.keys(t._combined);for(let h=0;h<u.length;h++){let d=parseInt(u[h],10);d>=n&&(this._combined[d-n+r]=t._combined[d])}}translateToString(t,n,r,s){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),s&&(s.length=0);let o="";for(;n<r;){let l=this._data[n*vt+0],u=l&2097151,h=l&2097152?this._combined[n]:u?Zo(u):ea;if(o+=h,s)for(let d=0;d<h.length;++d)s.push(n);n+=l>>22||1}return s&&s.push(n),o}};function XK(e,t,n,r,s,o){let l=[];for(let u=0;u<e.length-1;u++){let h=u,d=e.get(++h);if(!d.isWrapped)continue;let g=[e.get(u)];for(;h<e.length&&d.isWrapped;)g.push(d),d=e.get(++h);if(!o&&r>=u&&r<h){u+=g.length-1;continue}let p=0,v=Ad(g,p,t),y=1,w=0;for(;y<g.length;){let C=Ad(g,y,t),k=C-w,R=n-v,E=Math.min(k,R);g[p].copyCellsFrom(g[y],w,v,E,!1),v+=E,v===n&&(p++,v=0),w+=E,w===C&&(y++,w=0),v===0&&p!==0&&g[p-1].getWidth(n-1)===2&&(g[p].copyCellsFrom(g[p-1],n-1,v++,1,!1),g[p-1].setCell(n-1,s))}g[p].replaceCells(v,n,s);let S=0;for(let C=g.length-1;C>0&&(C>p||g[C].getTrimmedLength()===0);C--)S++;S>0&&(l.push(u+g.length-S),l.push(S)),u+=g.length-1}return l}function ZK(e,t){let n=[],r=0,s=t[r],o=0;for(let l=0;l<e.length;l++)if(s===l){let u=t[++r];e.onDeleteEmitter.fire({index:l-o,amount:u}),l+=u-1,o+=u,s=t[++r]}else n.push(l);return{layout:n,countRemoved:o}}function QK(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let r=0;r<n.length;r++)e.set(r,n[r]);e.length=t.length}function JK(e,t,n){let r=[],s=e.map((h,d)=>Ad(e,d,t)).reduce((h,d)=>h+d),o=0,l=0,u=0;for(;u<s;){if(s-u<n){r.push(s-u);break}o+=n;let h=Ad(e,l,t);o>h&&(o-=h,l++);let d=e[l].getWidth(o-1)===2;d&&o--;let g=d?n-1:n;r.push(g),u+=g}return r}function Ad(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,s=e[t+1].getWidth(0)===2;return r&&s?n-1:n}var VD=class qD{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=qD._nextId++,this._onDispose=this.register(new Ne),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),el(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};VD._nextId=1;var eG=VD,Zn={},Pa=Zn.B;Zn[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};Zn.A={"#":"£"};Zn.B=void 0;Zn[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Zn.C=Zn[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Zn.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Zn.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Zn.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Zn.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Zn.E=Zn[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Zn.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Zn.H=Zn[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Zn["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var TE=4294967295,NE=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Hn.clone(),this.savedCharset=Pa,this.markers=[],this._nullCell=Oi.fromCharData([0,cD,1,0]),this._whitespaceCell=Oi.fromCharData([0,ea,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Jm,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new RE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Ym),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Ym),this._whitespaceCell}getBlankLine(e,t){return new ed(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>TE?TE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Hn);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new RE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Hn),r=0,s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)r+=+this.lines.get(l).resize(e,n);let o=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new ed(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new ed(e,n)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let l=this.lines.length-s;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),o&&(this.y+=o),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let o=0;o<this.lines.length;o++)r+=+this.lines.get(o).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=XK(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Hn),n);if(r.length>0){let s=ZK(this.lines,r);QK(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(Hn),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new ed(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(Hn),s=[],o=0;for(let l=this.lines.length-1;l>=0;l--){let u=this.lines.get(l);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let h=[u];for(;u.isWrapped&&l>0;)u=this.lines.get(--l),h.unshift(u);if(!n){let E=this.ybase+this.y;if(E>=l&&E<l+h.length)continue}let d=h[h.length-1].getTrimmedLength(),g=JK(h,this._cols,e),p=g.length-h.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+p):v=Math.max(0,this.lines.length-this.lines.maxLength+p);let y=[];for(let E=0;E<p;E++){let N=this.getBlankLine(Hn,!0);y.push(N)}y.length>0&&(s.push({start:l+h.length+o,newLines:y}),o+=y.length),h.push(...y);let w=g.length-1,S=g[w];S===0&&(w--,S=g[w]);let C=h.length-p-1,k=d;for(;C>=0;){let E=Math.min(k,S);if(h[w]===void 0)break;if(h[w].copyCellsFrom(h[C],k-E,S-E,E,!0),S-=E,S===0&&(w--,S=g[w]),k-=E,k===0){C--;let N=Math.max(C,0);k=Ad(h,N,this._cols)}}for(let E=0;E<h.length;E++)g[E]<e&&h[E].setCell(g[E],r);let R=p-v;for(;R-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+o)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(s.length>0){let l=[],u=[];for(let S=0;S<this.lines.length;S++)u.push(this.lines.get(S));let h=this.lines.length,d=h-1,g=0,p=s[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let v=0;for(let S=Math.min(this.lines.maxLength-1,h+o-1);S>=0;S--)if(p&&p.start>d+v){for(let C=p.newLines.length-1;C>=0;C--)this.lines.set(S--,p.newLines[C]);S++,l.push({index:d+1,amount:p.newLines.length}),v+=p.newLines.length,p=s[++g]}else this.lines.set(S,u[d--]);let y=0;for(let S=l.length-1;S>=0;S--)l[S].index+=y,this.lines.onInsertEmitter.fire(l[S]),y+=l[S].amount;let w=Math.max(0,h+o-this.lines.maxLength);w>0&&this.lines.onTrimEmitter.fire(w)}}translateBufferLineToString(e,t,n=0,r){let s=this.lines.get(e);return s?s.translateToString(t,n,r):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new eG(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},tG=class extends _t{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new Ne),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new NE(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new NE(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},KD=2,GD=1,Ky=class extends _t{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Ne),this.onResize=this._onResize.event,this._onScroll=this._register(new Ne),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,KD),this.rows=Math.max(e.rawOptions.rows||0,GD),this.buffers=this._register(new tG(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let s=n.ybase+n.scrollTop,o=n.ybase+n.scrollBottom;if(n.scrollTop===0){let l=n.lines.isFull;o===n.lines.length-1?l?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(o+1,0,r.clone()),l?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let l=o-s+1;n.lines.shiftElements(s+1,l-1,-1),n.lines.set(o,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Ky=Rn([ze(0,Pr)],Ky);var Xl={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Qm,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},nG=["normal","bold","100","200","300","400","500","600","700","800","900"],rG=class extends _t{constructor(e){super(),this._onOptionChange=this._register(new Ne),this.onOptionChange=this._onOptionChange.event;let t={...Xl};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(_n(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in Xl))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in Xl))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Xl[e]),!iG(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Xl[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=nG.includes(t)?t:Xl[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function iG(e){return e==="block"||e==="underline"||e==="bar"}function td(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&td(e[r],t-1);return n}var ME=Object.freeze({insertMode:!1}),AE=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Gy=class extends _t{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Ne),this.onData=this._onData.event,this._onUserInput=this._register(new Ne),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Ne),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Ne),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=td(ME),this.decPrivateModes=td(AE)}reset(){this.modes=td(ME),this.decPrivateModes=td(AE)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Gy=Rn([ze(0,zr),ze(1,mD),ze(2,Pr)],Gy);var DE={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Qb(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var Jb=String.fromCharCode,jE={DEFAULT:e=>{let t=[Qb(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Jb(t[0])}${Jb(t[1])}${Jb(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Qb(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Qb(e,!0)};${e.x};${e.y}${t}`}},Yy=class extends _t{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Ne),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(DE))this.addProtocol(r,DE[r]);for(let r of Object.keys(jE))this.addEncoding(r,jE[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=r+0,Math.abs(e.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Yy=Rn([ze(0,zr),ze(1,cl),ze(2,Pr)],Yy);var e_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],sG=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Gn;function oG(e,t){let n=0,r=t.length-1,s;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(s=n+r>>1,e>t[s][1])n=s+1;else if(e<t[s][0])r=s-1;else return!0;return!1}var aG=class{constructor(){if(this.version="6",!Gn){Gn=new Uint8Array(65536),Gn.fill(1),Gn[0]=0,Gn.fill(0,1,32),Gn.fill(0,127,160),Gn.fill(2,4352,4448),Gn[9001]=2,Gn[9002]=2,Gn.fill(2,11904,42192),Gn[12351]=1,Gn.fill(2,44032,55204),Gn.fill(2,63744,64256),Gn.fill(2,65040,65050),Gn.fill(2,65072,65136),Gn.fill(2,65280,65377),Gn.fill(2,65504,65511);for(let e=0;e<e_.length;++e)Gn.fill(0,e_[e][0],e_[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Gn[e]:oG(e,sG)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let s=Wa.extractWidth(t);s===0?r=!1:s>n&&(n=s)}return Wa.createPropertyValue(0,n,r)}},Wa=class wm{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Ne,this.onChange=this._onChange.event;let t=new aG;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,s=t.length;for(let o=0;o<s;++o){let l=t.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=s)return n+this.wcwidth(l);let d=t.charCodeAt(o);56320<=d&&d<=57343?l=(l-55296)*1024+d-56320+65536:n+=this.wcwidth(d)}let u=this.charProperties(l,r),h=wm.extractWidth(u);wm.extractShouldJoin(u)&&(h-=wm.extractWidth(r)),n+=h,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},lG=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function OE(e){var r;let t=(r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:r.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var Iu=2147483647,cG=256,YD=class Xy{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>cG)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new Xy;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let s=t[r];if(Array.isArray(s))for(let o=0;o<s.length;++o)n.addSubParam(s[o]);else n.addParam(s)}return n}clone(){let t=new Xy(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,s))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Iu?Iu:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Iu?Iu:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-n>0?this._subParams.subarray(n,r):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&(t[n]=this._subParams.slice(r,s))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,s=r[n-1];r[n-1]=~s?Math.min(s*10+t,Iu):t}},Fu=[],uG=class{constructor(){this._state=0,this._active=Fu,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Fu}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Fu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Fu,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",Vp(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Fu,this._id=-1,this._state=0}}},oi=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Vp(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},Hu=[],dG=class{constructor(){this._handlers=Object.create(null),this._active=Hu,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Hu}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Hu,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Hu,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",Vp(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Hu,this._ident=0}},nd=new YD;nd.addParam(0);var LE=class{constructor(e){this._handler=e,this._data="",this._params=nd,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():nd,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Vp(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=nd,this._data="",this._hitLimit=!1,n));return this._params=nd,this._data="",this._hitLimit=!1,t}},hG=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let s=0;s<e.length;s++)this.table[t<<8|e[s]]=n<<4|r}},Mi=160,fG=function(){let e=new hG(4095),t=Array.apply(null,Array(256)).map((u,h)=>h),n=(u,h)=>t.slice(u,h),r=n(32,127),s=n(0,24);s.push(25),s.push.apply(s,n(28,32));let o=n(0,14),l;e.setDefault(1,0),e.addMany(r,0,2,0);for(l in o)e.addMany([24,26,153,154],l,3,0),e.addMany(n(128,144),l,3,0),e.addMany(n(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Mi,0,2,0),e.add(Mi,8,5,8),e.add(Mi,6,0,6),e.add(Mi,11,0,11),e.add(Mi,13,13,13),e}(),mG=class extends _t{constructor(e=fG){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new YD,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(_n(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new uG),this._dcsParser=this._register(new dG),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let s=0;s<e.intermediates.length;++s){let o=e.intermediates.charCodeAt(s);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(e,t,n){let r=0,s=0,o=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,l}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],l=this._oscParser.end(r!==24&&r!==26,n),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=o;u<t;++u){switch(r=e[u],s=this._transitions.table[this.currentState<<8|(r<160?r:Mi)],s>>4){case 2:for(let v=u+1;;++v){if(v>=t||(r=e[v])<32||r>126&&r<Mi){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Mi){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Mi){this._printHandler(e,u,v),u=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Mi){this._printHandler(e,u,v),u=v-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let h=this._csiHandlers[this._collect<<8|r],d=h?h.length-1:-1;for(;d>=0&&(l=h[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._preserveStack(3,h,d,s,u),l;d<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++u<t&&(r=e[u])>47&&r<60);u--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let g=this._escHandlers[this._collect<<8|r],p=g?g.length-1:-1;for(;p>=0&&(l=g[p](),l!==!0);p--)if(l instanceof Promise)return this._preserveStack(4,g,p,s,u),l;p<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let v=u+1;;++v)if(v>=t||(r=e[v])===24||r===26||r===27||r>127&&r<Mi){this._dcsParser.put(e,u,v),u=v-1;break}break;case 14:if(l=this._dcsParser.unhook(r!==24&&r!==26),l)return this._preserveStack(6,[],0,s,u),l;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let v=u+1;;v++)if(v>=t||(r=e[v])<32||r>127&&r<Mi){this._oscParser.put(e,u,v),u=v-1;break}break;case 6:if(l=this._oscParser.end(r!==24&&r!==26),l)return this._preserveStack(5,[],0,s,u),l;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},pG=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,gG=/^[\da-f]+$/;function zE(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=pG.exec(t);if(n){let r=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/r*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/r*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),gG.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let s=0;s<3;++s){let o=parseInt(t.slice(n*s,n*s+n),16);r[s]=n===1?o<<4:n===2?o:n===3?o>>4:o>>8}return r}}function t_(e,t){let n=e.toString(16),r=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function vG(e,t=16){let[n,r,s]=e;return`rgb:${t_(n,t)}/${t_(r,t)}/${t_(s,t)}`}var bG={"(":0,")":1,"*":2,"+":3,"-":1,".":2},qo=131072,PE=10;function BE(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var IE=5e3,FE=0,_G=class extends _t{constructor(e,t,n,r,s,o,l,u,h=new mG){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=s,this._oscLinkService=o,this._coreMouseService=l,this._unicodeService=u,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new BV,this._utf8Decoder=new IV,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Hn.clone(),this._eraseAttrDataInternal=Hn.clone(),this._onRequestBell=this._register(new Ne),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Ne),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Ne),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Ne),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Ne),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Ne),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Ne),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Ne),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Ne),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Ne),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Ne),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Ne),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Ne),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Zy(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:g.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,g,p)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:g,data:p})}),this._parser.setDcsHandlerFallback((d,g,p)=>{g==="HOOK"&&(p=p.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:g,payload:p})}),this._parser.setPrintHandler((d,g,p)=>this.print(d,g,p)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(ye.BEL,()=>this.bell()),this._parser.setExecuteHandler(ye.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ye.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ye.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ye.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ye.BS,()=>this.backspace()),this._parser.setExecuteHandler(ye.HT,()=>this.tab()),this._parser.setExecuteHandler(ye.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ye.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ym.IND,()=>this.index()),this._parser.setExecuteHandler(ym.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ym.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new oi(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new oi(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new oi(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new oi(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new oi(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new oi(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new oi(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new oi(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new oi(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new oi(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new oi(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new oi(d=>this.restoreCursorColor(d))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let d in Zn)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new LE((d,g)=>this.requestStatusString(d,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),IE))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${IE} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,s=this._activeBuffer.y,o=0,l=this._parseStack.paused;if(l){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>qo&&(o=this._parseStack.position+qo)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<qo&&(this._parseBuffer=new Uint32Array(Math.min(e.length,qo))),l||this._dirtyRowTracker.clearRange(),e.length>qo)for(let d=o;d<e.length;d+=qo){let g=d+qo<e.length?d+qo:e.length,p=typeof e=="string"?this._stringDecoder.decode(e.substring(d,g),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,g),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,p))return this._preserveStack(r,s,p,d),this._logSlowResolvingAsync(n),n}else if(!l){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,d))return this._preserveStack(r,s,d,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let u=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),h=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,t,n){let r,s,o=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,g=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let v=this._parser.precedingJoinState;for(let y=t;y<n;++y){if(r=e[y],r<127&&o){let k=o[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let w=this._unicodeService.charProperties(r,v);s=Wa.extractWidth(w);let S=Wa.extractShouldJoin(w),C=S?Wa.extractWidth(v):0;if(v=w,l&&this._onA11yChar.fire(Zo(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(h){let k=p,R=this._activeBuffer.x-C;for(this._activeBuffer.x=C,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&p instanceof ed&&p.copyCellsFrom(k,R,0,C,!1);R<u;)k.setCellFromCodepoint(R++,0,1,g)}else if(this._activeBuffer.x=u-1,s===2)continue}if(S&&this._activeBuffer.x){let k=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-k,r,s);for(let R=s-C;--R>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(d&&(p.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(g)),p.getWidth(u-1)===2&&p.setCellFromCodepoint(u-1,0,1,g)),p.setCellFromCodepoint(this._activeBuffer.x++,r,s,g),s>0)for(;--s;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=v,this._activeBuffer.x<u&&n-t>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>BE(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new LE(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new oi(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,s=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),r&&(o.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&r.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(Hn));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=Wa.extractWidth(t),s=this._activeBuffer.x-r,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),l=new Uint32Array(o.length*n),u=0;for(let d=0;d<o.length;){let g=o.codePointAt(d)||0;l[u++]=g,d+=g>65535?2:1}let h=u;for(let d=1;d<n;++d)l.copyWithin(h,0,u),h+=u;return this.print(l,0,h),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ye.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ye.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ye.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ye.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ye.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Pa),this._charsetService.setgCharset(1,Pa),this._charsetService.setgCharset(2,Pa),this._charsetService.setgCharset(3,Pa);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:o}=this._coreMouseService,l=this._coreService,{buffers:u,cols:h}=this._bufferService,{active:d,alt:g}=u,p=this._optionsService.rawOptions,v=(S,C)=>(l.triggerDataEvent(`${ye.ESC}[${t?"":"?"}${S};${C}$y`),!0),y=S=>S?1:2,w=e.params[0];return t?w===2?v(w,4):w===4?v(w,y(l.modes.insertMode)):w===12?v(w,3):w===20?v(w,y(p.convertEol)):v(w,0):w===1?v(w,y(r.applicationCursorKeys)):w===3?v(w,p.windowOptions.setWinLines?h===80?2:h===132?1:0:0):w===6?v(w,y(r.origin)):w===7?v(w,y(r.wraparound)):w===8?v(w,3):w===9?v(w,y(s==="X10")):w===12?v(w,y(p.cursorBlink)):w===25?v(w,y(!l.isCursorHidden)):w===45?v(w,y(r.reverseWraparound)):w===66?v(w,y(r.applicationKeypad)):w===67?v(w,4):w===1e3?v(w,y(s==="VT200")):w===1002?v(w,y(s==="DRAG")):w===1003?v(w,y(s==="ANY")):w===1004?v(w,y(r.sendFocus)):w===1005?v(w,4):w===1006?v(w,y(o==="SGR")):w===1015?v(w,4):w===1016?v(w,y(o==="SGR_PIXELS")):w===1048?v(w,1):w===47||w===1047||w===1049?v(w,y(d===g)):w===2004?v(w,y(r.bracketedPasteMode)):w===2026?v(w,y(r.synchronizedOutput)):v(w,0)}_updateAttrColor(e,t,n,r,s){return t===2?(e|=50331648,e&=-16777216,e|=Jd.fromColorRGB([n,r,s])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],s=0,o=0;do{if(r[o+s]=e.params[t+o],e.hasSubParams(t+o)){let l=e.getSubParams(t+o),u=0;do r[1]===5&&(s=1),r[o+u+1+s]=l[u];while(++u<l.length&&u+o+1+s<r.length);break}if(r[1]===5&&o+s>=2||r[1]===2&&o+s>=5)break;r[1]&&(s=1)}while(++o+t<e.length&&o+s<r.length);for(let l=2;l<r.length;++l)r[l]===-1&&(r[l]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return o}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Hn.fg,e.bg=Hn.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let s=0;s<t;s++)n=e.params[s],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777216|n-90|8):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777216|n-100|8):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=Hn.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=Hn.bg&16777215):n===38||n===48||n===58?s+=this._extractColor(e,s,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=Hn.fg&16777215,r.bg&=-67108864,r.bg|=Hn.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ye.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ye.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ye.ESC}[?${t};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Hn.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!BE(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ye.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>PE&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>PE&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let r=n.shift(),s=n.shift();if(/^\d+$/.exec(r)){let o=parseInt(r);if(HE(o))if(s==="?")t.push({type:0,index:o});else{let l=zE(s);l&&t.push({type:1,index:o,color:l})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),r,s=n.findIndex(o=>o.startsWith("id="));return s!==-1&&(r=n[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let r=0;r<n.length&&!(t>=this._specialColors.length);++r,++t)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let s=zE(n[r]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let r=0;r<n.length;++r)if(/^\d+$/.exec(n[r])){let s=parseInt(n[r]);HE(s)&&t.push({type:2,index:s})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Pa),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(bG[e[0]],Zn[e[1]]||Pa),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Hn.clone(),this._eraseAttrDataInternal=Hn.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Oi;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=l=>(this._coreService.triggerDataEvent(`${ye.ESC}${l}${ye.ESC}\\`),!0),r=this._bufferService.buffer,s=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Zy=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(FE=e,e=t,t=FE),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Zy=Rn([ze(0,zr)],Zy);function HE(e){return 0<=e&&e<256}var yG=5e7,UE=12,xG=50,wG=class extends _t{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Ne),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>yG)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],s=this._action(r,t);if(s){let l=u=>performance.now()-n>=UE?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(l);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=UE)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>xG&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},Qy=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let u=t.addMarker(t.ybase+t.y),h={data:e,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(h,u)),this._dataByLinkId.set(h.id,h),h.id}let n=e,r=this._getEntryIdKey(n),s=this._entriesWithId.get(r);if(s)return this.addLineToLink(s.id,t.ybase+t.y),s.id;let o=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(l,o)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Qy=Rn([ze(0,zr)],Qy);var $E=!1,SG=class extends _t{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new yc),this._onBinary=this._register(new Ne),this.onBinary=this._onBinary.event,this._onData=this._register(new Ne),this.onData=this._onData.event,this._onLineFeed=this._register(new Ne),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Ne),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Ne),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Ne),this._instantiationService=new KK,this.optionsService=this._register(new rG(e)),this._instantiationService.setService(Pr,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Ky)),this._instantiationService.setService(zr,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(qy)),this._instantiationService.setService(mD,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Gy)),this._instantiationService.setService(cl,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Yy)),this._instantiationService.setService(fD,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Wa)),this._instantiationService.setService($V,this.unicodeService),this._charsetService=this._instantiationService.createInstance(lG),this._instantiationService.setService(UV,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Qy),this._instantiationService.setService(pD,this._oscLinkService),this._inputHandler=this._register(new _G(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(_r.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(_r.forward(this._bufferService.onResize,this._onResize)),this._register(_r.forward(this.coreService.onData,this._onData)),this._register(_r.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new wG((t,n)=>this._inputHandler.parse(t,n))),this._register(_r.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Ne),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!$E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),$E=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,KD),t=Math.max(t,GD),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(OE.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(OE(this._bufferService),!1))),this._windowsWrappingHeuristics.value=_n(()=>{for(let t of e)t.dispose()})}}},CG={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function kG(e,t,n,r){var l;let s={type:0,cancel:!1,key:void 0},o=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?s.key=ye.ESC+"OA":s.key=ye.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=ye.ESC+"OD":s.key=ye.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=ye.ESC+"OC":s.key=ye.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=ye.ESC+"OB":s.key=ye.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":ye.DEL,e.altKey&&(s.key=ye.ESC+s.key);break;case 9:if(e.shiftKey){s.key=ye.ESC+"[Z";break}s.key=ye.HT,s.cancel=!0;break;case 13:s.key=e.altKey?ye.ESC+ye.CR:ye.CR,s.cancel=!0;break;case 27:s.key=ye.ESC,e.altKey&&(s.key=ye.ESC+ye.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;o?s.key=ye.ESC+"[1;"+(o+1)+"D":t?s.key=ye.ESC+"OD":s.key=ye.ESC+"[D";break;case 39:if(e.metaKey)break;o?s.key=ye.ESC+"[1;"+(o+1)+"C":t?s.key=ye.ESC+"OC":s.key=ye.ESC+"[C";break;case 38:if(e.metaKey)break;o?s.key=ye.ESC+"[1;"+(o+1)+"A":t?s.key=ye.ESC+"OA":s.key=ye.ESC+"[A";break;case 40:if(e.metaKey)break;o?s.key=ye.ESC+"[1;"+(o+1)+"B":t?s.key=ye.ESC+"OB":s.key=ye.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=ye.ESC+"[2~");break;case 46:o?s.key=ye.ESC+"[3;"+(o+1)+"~":s.key=ye.ESC+"[3~";break;case 36:o?s.key=ye.ESC+"[1;"+(o+1)+"H":t?s.key=ye.ESC+"OH":s.key=ye.ESC+"[H";break;case 35:o?s.key=ye.ESC+"[1;"+(o+1)+"F":t?s.key=ye.ESC+"OF":s.key=ye.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=ye.ESC+"[5;"+(o+1)+"~":s.key=ye.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=ye.ESC+"[6;"+(o+1)+"~":s.key=ye.ESC+"[6~";break;case 112:o?s.key=ye.ESC+"[1;"+(o+1)+"P":s.key=ye.ESC+"OP";break;case 113:o?s.key=ye.ESC+"[1;"+(o+1)+"Q":s.key=ye.ESC+"OQ";break;case 114:o?s.key=ye.ESC+"[1;"+(o+1)+"R":s.key=ye.ESC+"OR";break;case 115:o?s.key=ye.ESC+"[1;"+(o+1)+"S":s.key=ye.ESC+"OS";break;case 116:o?s.key=ye.ESC+"[15;"+(o+1)+"~":s.key=ye.ESC+"[15~";break;case 117:o?s.key=ye.ESC+"[17;"+(o+1)+"~":s.key=ye.ESC+"[17~";break;case 118:o?s.key=ye.ESC+"[18;"+(o+1)+"~":s.key=ye.ESC+"[18~";break;case 119:o?s.key=ye.ESC+"[19;"+(o+1)+"~":s.key=ye.ESC+"[19~";break;case 120:o?s.key=ye.ESC+"[20;"+(o+1)+"~":s.key=ye.ESC+"[20~";break;case 121:o?s.key=ye.ESC+"[21;"+(o+1)+"~":s.key=ye.ESC+"[21~";break;case 122:o?s.key=ye.ESC+"[23;"+(o+1)+"~":s.key=ye.ESC+"[23~";break;case 123:o?s.key=ye.ESC+"[24;"+(o+1)+"~":s.key=ye.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?s.key=ye.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=ye.DEL:e.keyCode===219?s.key=ye.ESC:e.keyCode===220?s.key=ye.FS:e.keyCode===221&&(s.key=ye.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(l=CG[e.keyCode])==null?void 0:l[e.shiftKey?1:0];if(u)s.key=ye.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,d=String.fromCharCode(h);e.shiftKey&&(d=d.toUpperCase()),s.key=ye.ESC+d}else if(e.keyCode===32)s.key=ye.ESC+(e.ctrlKey?ye.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),s.key=ye.ESC+h,s.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?s.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(s.key=ye.US),e.key==="@"&&(s.key=ye.NUL));break}return s}var An=0,EG=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Jm,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Jm,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((s,o)=>this._getKey(s)-this._getKey(o)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<r.length;s++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[s]=e[t],t++):r[s]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(An=this._search(t),An===-1)||this._getKey(this._array[An])!==t)return!1;do if(this._array[An]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(An),!0;while(++An<this._array.length&&this._getKey(this._array[An])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,o)=>s-o),t=0,n=new Array(this._array.length-e.length),r=0;for(let s=0;s<this._array.length;s++)e[t]===s?t++:n[r++]=this._array[s];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(An=this._search(e),!(An<0||An>=this._array.length)&&this._getKey(this._array[An])===e))do yield this._array[An];while(++An<this._array.length&&this._getKey(this._array[An])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(An=this._search(e),!(An<0||An>=this._array.length)&&this._getKey(this._array[An])===e))do t(this._array[An]);while(++An<this._array.length&&this._getKey(this._array[An])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,s=this._getKey(this._array[r]);if(s>e)n=r-1;else if(s<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},n_=0,WE=0,RG=class extends _t{constructor(){super(),this._decorations=new EG(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new Ne),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Ne),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(_n(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new TG(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,s=0;for(let o of this._decorations.getKeyIterator(t))r=o.options.x??0,s=r+(o.options.width??1),e>=r&&e<s&&(!n||(o.options.layer??"bottom")===n)&&(yield o)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,s=>{n_=s.options.x??0,WE=n_+(s.options.width??1),e>=n_&&e<WE&&(!n||(s.options.layer??"bottom")===n)&&r(s)})}},TG=class extends na{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Ne),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Ne),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=wn.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=wn.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},NG=1e3,MG=class{constructor(e,t=NG){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=r-this._lastRefreshMs,o=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},VE=20,ep=class extends _t{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let o=0;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);if(this._topBoundaryFocusListener=o=>this._handleBoundaryFocus(o,0),this._bottomBoundaryFocusListener=o=>this._handleBoundaryFocus(o,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new MG(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(o=>this._handleResize(o.rows))),this._register(this._terminal.onRender(o=>this._refreshRows(o.start,o.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(o=>this._handleChar(o))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
545
|
+
`))),this._register(this._terminal.onA11yTab(o=>this._handleTab(o))),this._register(this._terminal.onKey(o=>this._handleKey(o.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(it(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(_n(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<VE+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
546
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===VE+1&&(this._liveRegion.textContent+=by.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let s=e;s<=t;s++){let o=n.lines.get(n.ydisp+s),l=[],u=(o==null?void 0:o.translateToString(!0,void 0,void 0,l))||"",h=(n.ydisp+s+1).toString(),d=this._rowElements[s];d&&(u.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=u,this._rowColumns.set(d,l)),d.setAttribute("aria-posinset",h),d.setAttribute("aria-setsize",r),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],s=n.getAttribute("aria-posinset"),o=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===o||e.relatedTarget!==r)return;let l,u;if(t===0?(l=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(l=this._rowElements.shift(),u=n,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var u;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:((u=r.textContent)==null?void 0:u.length)??0}),!this._rowContainer.contains(n.node))return;let s=({node:h,offset:d})=>{let g=h instanceof Text?h.parentNode:h,p=parseInt(g==null?void 0:g.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(g);if(!v)return console.warn("columns is null. Race condition?"),null;let y=d<v.length?v[d]:v.slice(-1)[0]+1;return y>=this._terminal.cols&&(++p,y=0),{row:p,column:y}},o=s(t),l=s(n);if(!(!o||!l)){if(o.row>l.row||o.row===l.row&&o.column>=l.column)throw new Error("invalid range");this._terminal.select(o.column,o.row,(l.row-o.row)*this._terminal.cols-o.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var s,o;e.style.transform="";let t=e.getBoundingClientRect().width,n=(o=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:o[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};ep=Rn([ze(1,O0),ze(2,fo),ze(3,mo)],ep);var Jy=class extends _t{constructor(e,t,n,r,s){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new Ne),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Ne),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(_n(()=>{var o;el(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(o=this._activeProviderReplies)==null||o.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(it(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(it(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(it(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(it(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let r=0;r<n.length;r++){let s=n[r];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var r,s;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(o=>{o==null||o.forEach(l=>{l.link.dispose&&l.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[o,l]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(o)&&(n=this._checkLinkProviderResult(o,e,n)):l.provideLinks(e.y,u=>{var d,g;if(this._isMouseOut)return;let h=u==null?void 0:u.map(p=>({link:p}));(d=this._activeProviderReplies)==null||d.set(o,h),n=this._checkLinkProviderResult(o,e,n),((g=this._activeProviderReplies)==null?void 0:g.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let s=t.get(r);if(s)for(let o=0;o<s.length;o++){let l=s[o],u=l.link.range.start.y<e?0:l.link.range.start.x,h=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let d=u;d<=h;d++){if(n.has(d)){s.splice(o--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,t,n){var o;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),s=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(s=!0);if(!s&&r){let l=r.find(u=>this._linkAtPosition(u.link,t));l&&(n=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let l=0;l<this._activeProviderReplies.size;l++){let u=(o=this._activeProviderReplies.get(l))==null?void 0:o.find(h=>this._linkAtPosition(h.link,t));if(u){n=!0,this._handleNewLink(u);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&AG(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,el(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.pointerCursor},set:n=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.underline},set:n=>{var r,s,o;(r=this._currentLink)!=null&&r.state&&((o=(s=this._currentLink)==null?void 0:s.state)==null?void 0:o.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let r=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(r,s),this._lastMouseEvent)){let o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._askForLink(o,!1)}})))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,s=t.y*this._bufferService.cols+t.x;return n<=s&&s<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,s){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:s}}};Jy=Rn([ze(1,L0),ze(2,mo),ze(3,zr),ze(4,vD)],Jy);function AG(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var DG=class extends SG{constructor(e={}){super(e),this._linkifier=this._register(new yc),this.browser=zD,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new yc),this._onCursorMove=this._register(new Ne),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Ne),this.onKey=this._onKey.event,this._onRender=this._register(new Ne),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Ne),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Ne),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Ne),this.onBell=this._onBell.event,this._onFocus=this._register(new Ne),this._onBlur=this._register(new Ne),this._onA11yCharEmitter=this._register(new Ne),this._onA11yTabEmitter=this._register(new Ne),this._onWillOpen=this._register(new Ne),this._setup(),this._decorationService=this._instantiationService.createInstance(RG),this._instantiationService.setService(eh,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(xK),this._instantiationService.setService(vD,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(yy)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(_r.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(_r.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(_r.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(_r.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(_n(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,r="";switch(t.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+t.index}switch(t.type){case 0:let s=mn.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ye.ESC}]${r};${vG(s)}${OD.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(o=>o.ansi[t.index]=$n.toColor(...t.color));else{let o=n;this._themeService.modifyColors(l=>l[o]=$n.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ep,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ye.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ye.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,s=t.getWidth(n),o=this._renderService.dimensions.css.cell.width*s,l=this.buffer.y*this._renderService.dimensions.css.cell.height,u=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=l+"px",this.textarea.style.width=o+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(it(this.element,"copy",t=>{this.hasSelection()&&zV(t,this._selectionService)}));let e=t=>PV(t,this.textarea,this.coreService,this.optionsService);this._register(it(this.textarea,"paste",e)),this._register(it(this.element,"paste",e)),PD?this._register(it(this.element,"mousedown",t=>{t.button===2&&tE(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(it(this.element,"contextmenu",t=>{tE(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),$0&&this._register(it(this.element,"auxclick",t=>{t.button===1&&lD(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(it(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(it(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(it(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(it(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(it(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(it(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(it(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var s;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((s=this.element)==null?void 0:s.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(it(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",vy.get()),FD||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(_K,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(fo,this._coreBrowserService),this._register(it(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(it(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Hy,this._document,this._helperContainer),this._instantiationService.setService(qp,this._charSizeService),this._themeService=this._instantiationService.createInstance(Vy),this._instantiationService.setService(Oc,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Zm),this._instantiationService.setService(gD,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance($y,this.rows,this.screenElement)),this._instantiationService.setService(mo,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(By,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Uy),this._instantiationService.setService(L0,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Jy,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(zy,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Wy,this.element,this.screenElement,r)),this._instantiationService.setService(VV,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(_r.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var o;this._selectionService.refresh(),(o=this._viewport)==null||o.queueSync()})),this._register(this._instantiationService.createInstance(Py,this.screenElement)),this._register(it(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(ep,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Xm,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Xm,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Fy,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(o){var d,g,p,v,y;let l=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!l)return!1;let u,h;switch(o.overrideType||o.type){case"mousemove":h=32,o.buttons===void 0?(u=3,o.button!==void 0&&(u=o.button<3?o.button:3)):u=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":h=0,u=o.button<3?o.button:3;break;case"mousedown":h=1,u=o.button<3?o.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(o)===!1)return!1;let w=o.deltaY;if(w===0||e.coreMouseService.consumeWheelEvent(o,(v=(p=(g=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:g.device)==null?void 0:p.cell)==null?void 0:v.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;h=w<0?0:1,u=4;break;default:return!1}return h===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:u,action:h,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:o=>(n(o),o.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(o)),wheel:o=>(n(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&n(o)},mousemove:o=>{o.buttons||n(o)}};this._register(this.coreMouseService.onProtocolChange(o=>{o?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(o)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),o&8?r.mousemove||(t.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),o&16?r.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),o&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),o&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(it(t,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return n(o),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(o)})),this._register(it(t,"wheel",o=>{var l,u,h,d,g;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(o)===!1)return!1;if(!this.buffer.hasScrollback){if(o.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(o,(d=(h=(u=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:u.device)==null?void 0:h.cell)==null?void 0:d.height,(g=e._coreBrowserService)==null?void 0:g.dpr)===0)return this.cancel(o,!0);let p=ye.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(o.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(p,!0),this.cancel(o,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){aD(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=kG(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===ye.ETX||n.key===ye.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(jG(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var n;(n=this._charSizeService)==null||n.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Hn));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(ye.ESC+"[I"):this.coreService.triggerDataEvent(ye.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ye.ESC}[4;${n};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ye.ESC}[6;${s};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function jG(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var OG=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},LG=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Oi)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},qE=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new LG(t)}getNullCell(){return new Oi}},zG=class extends _t{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Ne),this.onBufferChange=this._onBufferChange.event,this._normal=new qE(this._core.buffers.normal,"normal"),this._alternate=new qE(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},PG=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,r)=>t(n,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},BG=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},IG=["cols","rows"],us=0,FG=class extends _t{constructor(e){super(),this._core=this._register(new DG(e)),this._addonManager=this._register(new OG),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],n=(r,s)=>{this._checkReadonlyOptions(r),this._core.options[r]=s};for(let r in this._core.options){let s={get:t.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,s)}}_checkReadonlyOptions(e){if(IG.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new PG(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new BG(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new zG(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
547
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return vy.get()},set promptLabel(e){vy.set(e)},get tooMuchOutput(){return by.get()},set tooMuchOutput(e){by.set(e)}}}_verifyIntegers(...e){for(us of e)if(us===1/0||isNaN(us)||us%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(us of e)if(us&&(us===1/0||isNaN(us)||us%1!==0||us<0))throw new Error("This API only accepts positive integers")}};const KE="lever-theme",r_="20260329-iconpad",HG={light:`/manifest.webmanifest?v=${r_}`,dark:`/manifest-dark.webmanifest?v=${r_}`,custom:`/manifest-dark.webmanifest?v=${r_}`},XD=b.createContext(void 0),UG=e=>e==="light"||e==="dark"||e==="system"||e==="custom",Fa=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",GE=(e,t)=>{if(typeof document>"u")return;let n;e==="custom"?n=t==="system"||!t?Fa():t:n=e==="system"?Fa():e,document.documentElement.classList.toggle("dark",n==="dark")},YE=e=>{if(typeof document>"u")return;document.documentElement.style.colorScheme=e;const t=document.querySelector('meta[name="theme-color"]');if(t){const s=getComputedStyle(document.body).backgroundColor;s&&s!=="rgba(0, 0, 0, 0)"&&s!=="transparent"&&t.setAttribute("content",s)}const n=document.querySelector('link[rel="manifest"]#app-manifest'),r=HG[e];n&&n.getAttribute("href")!==r&&n.setAttribute("href",r)};function $G({children:e}){const t=un(p=>p.themePreference),n=un(p=>p.setThemePreference),r=un(p=>p.themeId),s=un(p=>p.customAppearance),o=un(p=>p.backgroundImage),l=un(p=>p.backgroundOpacity),u=un(p=>p.backgroundBlur),h=un(p=>p.themeCssText);b.useEffect(()=>{if(typeof window>"u")return;const p=window.localStorage.getItem(KE);UG(p)&&(un.getState().themePreference==="system"&&p!=="system"&&n(p),window.localStorage.removeItem(KE))},[]),b.useEffect(()=>{GE(t,s);const p=t==="custom"?s==="system"?Fa():s:t==="system"?Fa():t;YE(p)},[t,s]),b.useEffect(()=>{if(t!=="system"&&(t!=="custom"||s!=="system"))return;const p=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{GE(t,s),YE(Fa())};return p.addEventListener?(p.addEventListener("change",v),()=>p.removeEventListener("change",v)):(p.addListener(v),()=>p.removeListener(v))},[t,s]),b.useEffect(()=>{if(typeof document>"u")return;let p=document.getElementById("kaizen-theme-registry-styles");p||(p=document.createElement("style"),p.id="kaizen-theme-registry-styles",document.head.appendChild(p)),p.textContent=h},[h]),b.useEffect(()=>{typeof document>"u"||(t==="custom"?document.documentElement.setAttribute("data-theme",r):document.documentElement.removeAttribute("data-theme"))},[t,r]),b.useEffect(()=>{if(typeof document>"u")return;let p=document.getElementById("kaizen-custom-theme-styles");p||(p=document.createElement("style"),p.id="kaizen-custom-theme-styles",document.head.appendChild(p));const v=t==="custom"&&o&&o.trim()!=="",y=[];if(v){const w=u?u*2:0;y.push(`
|
|
548
|
+
body {
|
|
549
|
+
background-image: none !important;
|
|
550
|
+
background-color: transparent !important;
|
|
551
|
+
}
|
|
552
|
+
body::before {
|
|
553
|
+
content: "";
|
|
554
|
+
position: fixed;
|
|
555
|
+
top: -${w}px;
|
|
556
|
+
left: -${w}px;
|
|
557
|
+
right: -${w}px;
|
|
558
|
+
bottom: -${w}px;
|
|
559
|
+
background-image: url("${o}");
|
|
560
|
+
background-size: cover;
|
|
561
|
+
background-position: center;
|
|
562
|
+
filter: blur(${u}px);
|
|
563
|
+
z-index: -2;
|
|
564
|
+
pointer-events: none;
|
|
565
|
+
}
|
|
566
|
+
body::after {
|
|
567
|
+
content: "";
|
|
568
|
+
position: fixed;
|
|
569
|
+
inset: 0;
|
|
570
|
+
background-color: hsl(var(--background) / ${l});
|
|
571
|
+
z-index: -1;
|
|
572
|
+
pointer-events: none;
|
|
573
|
+
}
|
|
574
|
+
#root {
|
|
575
|
+
background-color: transparent !important;
|
|
576
|
+
}
|
|
577
|
+
:root {
|
|
578
|
+
--color-background: transparent !important;
|
|
579
|
+
--color-card: hsl(var(--card) / 0.15) !important;
|
|
580
|
+
--color-popover: hsl(var(--popover) / 0.8) !important;
|
|
581
|
+
--color-muted: hsl(var(--muted) / 0.25) !important;
|
|
582
|
+
}
|
|
583
|
+
.kaizen-terminal, .xterm-viewport, .xterm-screen {
|
|
584
|
+
background-color: transparent !important;
|
|
585
|
+
}
|
|
586
|
+
`)}else y.push(`
|
|
587
|
+
body {
|
|
588
|
+
background-image: none !important;
|
|
589
|
+
}
|
|
590
|
+
body::before {
|
|
591
|
+
display: none;
|
|
592
|
+
}
|
|
593
|
+
#root {
|
|
594
|
+
background-color: transparent;
|
|
595
|
+
}
|
|
596
|
+
`);p.textContent=y.join(`
|
|
597
|
+
`)},[t,o,l,u]);const d=p=>{n(p)},g=b.useMemo(()=>{const p=t==="custom"?s==="system"?Fa():s:t==="system"?Fa():t;return{theme:t,resolvedTheme:p,setTheme:d}},[t,s,n]);return f.jsx(XD.Provider,{value:g,children:e})}function ZD(){const e=b.useContext(XD);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const WG={foreground:"#0f172a",background:"transparent",cursor:"#000000",cursorAccent:"#ffffff",selectionBackground:"rgba(221,228,236,0.55)",selectionInactiveBackground:"rgba(221,228,236,0.38)",black:"#0f172a",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#94a3b8",brightBlack:"#475569",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#e2e8f0"},VG={foreground:"#f8fafc",background:"transparent",cursor:"#ffffff",cursorAccent:"#000000",selectionBackground:"rgba(248,250,252,0.28)",selectionInactiveBackground:"rgba(248,250,252,0.18)",black:"#0f172a",red:"#f87171",green:"#4ade80",yellow:"#facc15",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#cbd5e1",brightBlack:"#64748b",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#f8fafc"};function QD(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function JD(e,t){var w,S,C,k,R;const n=e.element,r=(k=(C=(S=(w=e._core)==null?void 0:w._renderService)==null?void 0:S.dimensions)==null?void 0:C.css)==null?void 0:k.cell,s=(r==null?void 0:r.width)??0,o=(r==null?void 0:r.height)??0;if(!n||!Number.isFinite(s)||!Number.isFinite(o)||s<=0||o<=0)return null;const l=t.getBoundingClientRect(),u=window.getComputedStyle(t),h=window.getComputedStyle(n),d=e.options.scrollback===0?0:((R=e.options.overviewRuler)==null?void 0:R.width)??14,g=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight)+parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),p=parseFloat(u.paddingTop)+parseFloat(u.paddingBottom)+parseFloat(h.paddingTop)+parseFloat(h.paddingBottom),v=Math.max(0,l.width-g-d-1),y=Math.max(0,l.height-p);return{cols:Math.max(2,Math.floor(v/s)),rows:Math.max(1,Math.floor(y/o))}}function Yf(e){e.refresh(0,Math.max(0,e.rows-1))}function Xf(e,t,n,r,s){const o=JD(e,t)??QD(e);return n.current&&n.current.cols===o.cols&&n.current.rows===o.rows||(e.resize(o.cols,o.rows),n.current=o,r&&s(o.cols,o.rows)),o}function qG({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:s,clearVersion:o=0,focusRequestVersion:l=0,onPathChange:u}){const{resolvedTheme:h}=ZD(),d=b.useRef(null),g=b.useRef(null),p=b.useRef(null),v=b.useRef(!1),y=b.useRef(0),w=b.useRef(null),S=b.useRef(null),[C,k]=b.useState(null),[R,E]=b.useState(null),N=h==="dark"?VG:WG,L=(j,H)=>{n.command({type:"terminal.resize",terminalId:t,cols:j,rows:H}).catch(()=>{})},D=()=>{const j=()=>{const H=g.current,G=d.current;!H||!G||!v.current||Xf(H,G,S,!0,L)};requestAnimationFrame(()=>{j(),setTimeout(j,0)})};return b.useEffect(()=>{const j=new FG({scrollback:r,cursorBlink:!0,cursorStyle:"bar",cursorWidth:1,lineHeight:1.1,convertEol:!1,allowTransparency:!0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,theme:N}),H=new CV;j.loadAddon(H),j.loadAddon(new AV),g.current=j;const G=d.current;G&&(j.open(G),p.current&&j.write(p.current),Xf(j,G,S,!1,()=>{}),Yf(j),D());const B=j.onData(V=>{n.command({type:"terminal.input",terminalId:t,data:V}).catch(F=>{E(F instanceof Error?F.message:String(F))})}),q=j.onResize(({cols:V,rows:F})=>{if(!v.current)return;const W={cols:V,rows:F};S.current&&S.current.cols===V&&S.current.rows===F||(S.current=W,L(V,F))}),I=new ResizeObserver(()=>{const V=g.current,F=d.current;!V||!F||Xf(V,F,S,v.current,(W,O)=>{n.command({type:"terminal.resize",terminalId:t,cols:W,rows:O}).catch(()=>{})})});return G&&I.observe(G),()=>{I.disconnect(),q.dispose(),B.dispose(),p.current=H.serialize(),j.dispose(),g.current=null}},[r,n,t,N]),b.useEffect(()=>{const j=g.current;j&&(j.options.scrollback=r)},[r]),b.useEffect(()=>{const j=g.current;j&&(j.options.theme=N,Yf(j))},[N]),b.useEffect(()=>{if(l===0)return;const j=g.current;j&&requestAnimationFrame(()=>{j.focus()})},[l]),b.useEffect(()=>{if(o===0)return;const j=g.current;j&&(v.current=!1,y.current+=1,w.current=null,p.current=null,k(null),E(null),j.reset(),Yf(j),n.command({type:"terminal.close",terminalId:t}).catch(H=>{E(H instanceof Error?H.message:String(H))}))},[o,n,t]),b.useEffect(()=>{u==null||u((C==null?void 0:C.cwd)??null)},[C==null?void 0:C.cwd,u]),b.useEffect(()=>{const j=B=>{const q=g.current;if(!q)return;const I=JSON.stringify({cwd:B.cwd,shell:B.shell,cols:B.cols,rows:B.rows,scrollback:B.scrollback,status:B.status,exitCode:B.exitCode,serializedState:B.serializedState});if(w.current===I){k({cwd:B.cwd,shell:B.shell,status:B.status,exitCode:B.exitCode}),p.current=B.serializedState||null;return}w.current=I,k({cwd:B.cwd,shell:B.shell,status:B.status,exitCode:B.exitCode}),p.current=B.serializedState||null,q.options.scrollback=B.scrollback,q.reset(),B.serializedState&&q.write(B.serializedState),Yf(q)},H=()=>{const B=g.current,q=d.current;if(!B||!q)return;const I=JD(B,q)??QD(B);B.resize(I.cols,I.rows),S.current=I,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:I.cols,rows:I.rows,scrollback:r}).then(V=>{v.current=!0,E(null),V&&j(V),D()}).catch(V=>{E(V instanceof Error?V.message:String(V))})},G=()=>{const B=++y.current,q=()=>{if(y.current!==B)return;const I=g.current,V=d.current;if(!I||!V)return;Xf(I,V,S,!1,()=>{});const F=V.getBoundingClientRect();if(F.width<=0||F.height<=0){requestAnimationFrame(q);return}H()};requestAnimationFrame(()=>{requestAnimationFrame(q)})};return G(),n.subscribeTerminal(t,{onSnapshot:B=>{if(!B){v.current=!1,w.current=null,s==="connected"&&G();return}v.current=!0,E(null),j(B),D()},onEvent:B=>{const q=g.current;if(q){if(B.type==="terminal.output"){q.write(B.data);return}B.type==="terminal.exit"&&k(I=>({cwd:(I==null?void 0:I.cwd)??"",shell:(I==null?void 0:I.shell)??"",status:"exited",exitCode:B.exitCode}))}}})},[s,e,r,n,t]),f.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden pb-4",children:[f.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden px-3 py-1",children:f.jsx("div",{ref:d,className:"kaizen-terminal min-h-0 min-w-0 flex-1 overflow-hidden w-full"})}),R?f.jsxs("div",{className:"px-3 py-1 text-xs text-destructive",children:["Terminal error: ",R]}):null]})}const KG=24;function ej(e){return e+KG}function GG(e,t){return Math.max(1,e)*ej(t)}function XE({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:s,minColumnWidth:o,focusRequestVersion:l=0,splitTerminalShortcut:u,onAddTerminal:h,onRemoveTerminal:d,onTerminalLayout:g}){const p=b.useRef(null),v=b.useRef({}),y=b.useRef([]),[w,S]=b.useState(0),[C,k]=b.useState({}),[R,E]=b.useState({});b.useLayoutEffect(()=>{const G=p.current;if(!G)return;const B=()=>{S(G.getBoundingClientRect().width)},q=new ResizeObserver(B);return q.observe(G),B(),()=>q.disconnect()},[]);const N=t.terminals.length,L=ej(o),D=GG(N,o),j=Math.max(w,D),H=b.useMemo(()=>t.terminals.map(G=>G.id).join(":"),[t.terminals]);return b.useLayoutEffect(()=>{const G=y.current,B=t.terminals.map(V=>V.id),q=B.find(V=>!G.includes(V));if(y.current=B,!q||G.length===0)return;const I=v.current[q];I&&I.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t.terminals]),f.jsx("div",{className:"flex h-full min-h-0 flex-col",children:f.jsx("div",{ref:p,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:f.jsx("div",{className:"h-full min-h-0",style:{width:j||"100%"},children:f.jsx(dd,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:G=>g(e,t.terminals.map(B=>G[B.id]??B.size)),children:t.terminals.map((G,B)=>f.jsxs(b.Fragment,{children:[f.jsx(Js,{id:G.id,defaultSize:`${G.size}%`,minSize:`${L}px`,className:"min-h-0 overflow-hidden",style:{minWidth:L},children:f.jsxs("div",{ref:q=>{v.current[G.id]=q},className:"flex h-full min-h-0 min-w-0 flex-col border-r border-border bg-transparent last:border-r-0",style:{minWidth:L},children:[f.jsxs("div",{className:"flex items-center gap-2 px-3 pr-2 pt-2 pb-1",children:[f.jsx("div",{className:"min-w-0 flex-1 text-left",children:f.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("div",{className:"shrink-0 text-sm font-medium",children:"Terminal"}),f.jsx("div",{className:"min-w-0 truncate text-xs text-muted-foreground",children:C[G.id]??""})]})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Xe,{variant:"ghost",size:"icon-sm",className:"md:hidden","aria-label":"Send Ctrl+C",onClick:()=>{n.command({type:"terminal.input",terminalId:G.id,data:""}).catch(()=>{})},title:"Send Ctrl+C",children:f.jsx(d8,{className:"size-3.5"})}),f.jsx(Xe,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>E(q=>({...q,[G.id]:(q[G.id]??0)+1})),children:f.jsx(s6,{className:"size-3.5"})}),f.jsxs(qu,{children:[f.jsx(Ku,{asChild:!0,children:f.jsx(Xe,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>h(e,G.id),children:f.jsx(Dx,{className:"size-3.5"})})}),f.jsx(rc,{side:"bottom",shortcut:u})]}),f.jsx(Xe,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>d(e,G.id),children:f.jsx(ro,{className:"size-3.5"})})]})]}),f.jsx(qG,{projectId:e,terminalId:G.id,socket:n,scrollback:s,connectionStatus:r,clearVersion:R[G.id]??0,focusRequestVersion:B===0?l:0,onPathChange:q=>k(I=>I[G.id]===q?I:{...I,[G.id]:q})})]})}),B<t.terminals.length-1?f.jsx(hd,{withHandle:!0,orientation:"horizontal"}):null]},G.id))},H)})})})}function ZE(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function YG(e){var r;if(!e)return null;const t=e.trim();if(!t||/^(https?:|mailto:|ftp:|file:)/i.test(t)||!t.startsWith("/"))return null;const n=/^(?<path>\/.+?)#L(?<line>\d+)(?:C(?<column>\d+))?$/.exec(t);return(r=n==null?void 0:n.groups)!=null&&r.path?{path:n.groups.path,line:ZE(n.groups.line),column:ZE(n.groups.column)}:{path:t}}function i_(e,t){if(!e)return"";if(t){const n=t.endsWith("/")?t:`${t}/`;if(e.startsWith(n))return e.slice(n.length);if(e===t)return""}return e.replace(/^\/home\/user\/workspace\//,"")}const W0=()=>{},tj=b.createContext(W0);function XG({children:e,onOpenLocalLink:t}){return f.jsx(tj.Provider,{value:t??W0,children:e})}const ex={Task:Rm,TaskOutput:Rm,Bash:jx,Glob:Rb,Grep:Rb,ExitPlanMode:Ik,Read:g6,Edit:u6,Write:h6,NotebookEdit:pc,WebFetch:xI,TodoWrite:zI,WebSearch:Rb,KillShell:c8,AskUserQuestion:AN,Skill:Dn,EnterPlanMode:Ik},nj=m8;function rj(e){return ex[e]?ex[e]:nj}function po({children:e,className:t}){return f.jsx("div",{className:me("flex gap-3 justify-start items-center",t),children:e})}function ZG({children:e,className:t}){return f.jsx("div",{className:me("flex items-center gap-1.5 text-xs",t),children:e})}function ao({children:e,className:t}){return f.jsx("span",{className:me("font-medium text-foreground/80",t),children:e})}function QG({children:e}){return f.jsx("span",{className:"text-muted-foreground",children:e})}function rh({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,s]=b.useState(n);return f.jsxs("div",{className:"flex flex-col w-full",children:[f.jsxs("button",{onClick:()=>s(!r),className:`group/expandable-row cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${r?"":"hover:opacity-60 transition-opacity"}`,children:[f.jsx("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:e}),f.jsx(Or,{className:`h-4.5 w-4.5 text-muted-icon translate-y-[0.5px] transition-all duration-200 opacity-0 group-hover/expandable-row:opacity-100 ${r?"rotate-90 opacity-100":""}`})]}),r&&t]})}function s_({label:e,children:t,copyText:n}){const[r,s]=b.useState(!1),o=n??tp(t),l=b.useCallback(async()=>{await navigator.clipboard.writeText(o),s(!0),setTimeout(()=>s(!1),2e3)},[o]);return f.jsxs("div",{children:[f.jsx("span",{className:"font-medium text-muted-foreground",children:e}),f.jsxs("div",{className:"relative group/codeblock",children:[f.jsx("pre",{className:"my-1 text-xs font-mono whitespace-no-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto w-full",children:t}),f.jsx(Xe,{variant:"ghost",size:"icon",className:me("absolute top-[4px] right-[4px] z-10 h-6.5 w-6.5 rounded-sm text-muted-foreground opacity-0 group-hover/codeblock:opacity-100 transition-opacity",!r&&"hover:text-foreground",r&&"hover:!bg-transparent hover:!border-transparent"),onClick:l,children:r?f.jsx(Xi,{className:"h-3.5 w-3.5 text-green-400"}):f.jsx(Id,{className:"h-4 w-4"})})]})]})}function ij({children:e,icon:t,className:n}){return f.jsxs("span",{className:me("inline-flex items-center gap-1 px-2 py-1 bg-muted border border-border rounded-full",n),children:[t&&f.jsx(t,{className:"h-3 w-3 text-muted-foreground"}),e]})}function ih({children:e,className:t}){return f.jsxs("div",{className:me("grid grid-cols-[auto_1fr] gap-2 min-w-0",t),children:[f.jsx("div",{className:" min-w-5 flex flex-col relative items-center justify-center",children:f.jsx("div",{className:"min-h-full w-[1px] bg-muted-foreground/20"})}),f.jsx("div",{className:"-ml-[1px] min-w-0 overflow-hidden",children:e})]})}function tp(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(tp).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return tp(t.children)}return""}function QE(e,t){return b.isValidElement(e)?b.cloneElement(e,{className:me(e.props.className,t)}):e}const JG={h1:({children:e})=>f.jsx("h1",{className:"text-[20px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h2:({children:e})=>f.jsx("h2",{className:"text-[18px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h3:({children:e})=>f.jsx("h3",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h4:({children:e})=>f.jsx("h4",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h5:({children:e})=>f.jsx("h5",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h6:({children:e})=>f.jsx("h6",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),pre:({children:e,...t})=>{const[n,r]=b.useState(!1),s=tp(e),o=async()=>{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)};return f.jsxs("div",{className:"relative overflow-x-auto max-w-full min-w-0 no-code-highlight group/pre",children:[f.jsx("pre",{className:"min-w-0 rounded-xl py-2.5 px-3.5 [.no-pre-highlight_&]:bg-background",...t,children:e}),f.jsx(Xe,{variant:"ghost",size:"icon",className:me("absolute top-[35px] -translate-y-[50%] -translate-x-[1px] rounded-md right-1.5 h-8 w-8 text-muted-foreground opacity-0 group-hover/pre:opacity-100 transition-opacity",!n&&"hover:text-foreground",n&&"hover:!bg-transparent hover:!border-transparent"),onClick:o,children:n?f.jsx(Xi,{className:"h-4 w-4 text-green-400"}):f.jsx(Id,{className:"h-4 w-4"})})]})},code:({children:e,className:t,...n})=>t?f.jsx("code",{className:"block text-xs whitespace-pre",...n,children:e}):f.jsx("code",{className:"break-all px-1 bg-border/60 dark:[.no-pre-highlight_&]:bg-background dark:[.text-pretty_&]:bg-neutral [.no-code-highlight_&]:!bg-transparent py-0.5 rounded text-sm whitespace-wrap",...n,children:e}),table:({children:e,...t})=>f.jsx("div",{className:"border border-border rounded-xl overflow-x-auto",children:f.jsx("table",{className:"table-auto min-w-full divide-y divide-border bg-background",...t,children:e})}),tbody:({children:e,...t})=>f.jsx("tbody",{className:"divide-y divide-border",...t,children:e}),th:({children:e,...t})=>f.jsx("th",{className:"text-left text-xs uppercase text-muted-foreground tracking-wider p-2 pl-0 first:pl-3 bg-muted dark:bg-card [&_*]:font-semibold",...t,children:e}),td:({children:e,...t})=>f.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal ",...t,children:e}),p:({children:e,...t})=>f.jsx("p",{className:"break-words mt-5 mb-3 first:mt-0 last:mb-0",...t,children:e}),blockquote:({children:e,...t})=>(()=>{const n=b.Children.toArray(e),r=n[0];r!==void 0&&(n[0]=QE(r,"mt-0"));const s=n.length-1,o=n[s];return o!==void 0&&(n[s]=QE(o,"mb-0")),f.jsx("blockquote",{className:"my-2 mt-5 mb-3 first:mt-0 last:mb-0 border-l-2 border-border/80 pl-2 text-muted-foreground",...t,children:n})})(),a:({children:e,...t})=>f.jsx("a",{className:"transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40 ",target:"_blank",rel:"noopener noreferrer",...t,children:e})};function zc(e){return{...JG,a:({children:t,href:n,onClick:r,...s})=>{const o=(e==null?void 0:e.onOpenLocalLink)??b.useContext(tj),l=YG(n);return f.jsx("a",{className:"transition-all underline decoration-2 text-logo decoration-logo/50 hover:text-logo/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40 ",href:n,target:l?void 0:"_blank",rel:l?void 0:"noopener noreferrer",onClick:u=>{r==null||r(u),!(u.defaultPrevented||!l||o===W0)&&(u.preventDefault(),o(l))},...s,children:t})}}}const eY={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function tY({status:e}){const t=(e?eY[e]:void 0)||"Processing...",n=e==="failed";return f.jsx(po,{className:"ml-[1px]",children:f.jsxs(ZG,{children:[n?f.jsx(ro,{className:"size-4.5 text-red-500"}):f.jsx(kr,{className:"size-4.5 animate-spin text-muted-icon"}),f.jsx(Op,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const Yp=b.forwardRef(({className:e,children:t,...n},r)=>f.jsx("div",{ref:r,className:me("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));Yp.displayName="ScrollArea";function sj(e){return e==="localhost"||e==="127.0.0.1"||e==="::1"}const Xp=20,tx=50,oj=30;function aj(e){return Number.isFinite(e)?Math.min(tx,Math.max(Xp,e)):oj}function nY(){return{isVisible:!1,size:Xp}}function Zf(e,t){return e[t]??nY()}function rY(e){return!e||typeof e!="object"?{projects:{}}:{projects:Object.fromEntries(Object.entries(e.projects??{}).map(([r,s])=>[r,{isVisible:!1,size:aj(s.size??oj)}]))}}const md=uo()(ho(e=>({projects:{},toggleVisibility:t=>e(n=>({projects:{...n.projects,[t]:{...Zf(n.projects,t),isVisible:!Zf(n.projects,t).isVisible}}})),setVisibility:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...Zf(r.projects,t),isVisible:n}}})),setSize:(t,n)=>e(r=>({projects:{...r.projects,[t]:{...Zf(r.projects,t),size:aj(n)}}})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"right-sidebar-layouts",version:2,migrate:rY})),iY={isVisible:!1,size:Xp},V0=[68,32];function sY(){return{isVisible:!1,mainSizes:[...V0],terminals:[],nextTerminalIndex:0}}function oY(e,t){return e[t]??sY()}function o_(e){if(e.length===0)return[];const t=e.reduce((n,r)=>n+Math.max(r,0),0);return!Number.isFinite(t)||t<=0?Array.from({length:e.length},()=>100/e.length):e.map(n=>Math.max(n,0)/t*100)}function aY(e){let t=e,n="";do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return`Terminal ${n}`}function lY(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function Zl(e,t,n){return{...e,[t]:n(oY(e,t))}}const Yo=uo()(ho(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:Zl(r.projects,t,s=>{var h,d;const o=lY(s.terminals),l={id:((d=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:d.call(h))??`terminal-${Date.now()}-${s.nextTerminalIndex}`,title:aY(s.nextTerminalIndex),size:100/(o.length+1)},u=n?Math.max(o.findIndex(g=>g.id===n)+1,0):o.length;return{...s,isVisible:!0,nextTerminalIndex:s.nextTerminalIndex+1,terminals:[...o.slice(0,u),l,...o.slice(u)]}})})),removeTerminal:(t,n)=>e(r=>({projects:Zl(r.projects,t,s=>{const o=s.terminals.filter(u=>u.id!==n);if(o.length===0)return{...s,isVisible:!1,terminals:[]};const l=o_(o.map(u=>u.size));return{...s,terminals:o.map((u,h)=>({...u,size:l[h]??100/o.length}))}})})),toggleVisibility:t=>e(n=>({projects:Zl(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),resetMainSizes:t=>e(n=>({projects:Zl(n.projects,t,r=>({...r,mainSizes:[...V0]}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const s=o_(n);return{projects:Zl(r.projects,t,o=>({...o,mainSizes:s}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:Zl(r.projects,t,s=>{if(n.length!==s.terminals.length)return s;const o=o_(n);return{...s,terminals:s.terminals.map((l,u)=>({...l,size:o[u]??l.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"terminal-layouts",version:1})),cY={isVisible:!1,mainSizes:[...V0],terminals:[],nextTerminalIndex:0},np=1e3,nx=500,rx=5e3,rp=450,ix=250,sx=900,ox="cursor";function ax(e){switch(e){case"vscode":return"code {path}";case"windsurf":return"windsurf {path}";case"custom":return"cursor {path}";case"cursor":default:return"cursor {path}"}}function uY(e){switch(e){case"vscode":return"VS Code";case"windsurf":return"Windsurf";case"custom":return"Custom";case"cursor":default:return"Cursor"}}function JE(e){return Number.isFinite(e)?Math.min(rx,Math.max(nx,Math.round(e))):np}function eR(e){return Number.isFinite(e)?Math.min(sx,Math.max(ix,Math.round(e))):rp}function tR(e){switch(e){case"vscode":case"windsurf":case"custom":case"cursor":return e;default:return ox}}function a_(e,t){const n=e==null?void 0:e.trim();return n&&n.length>0?n:ax(t)}const Ri=uo()(ho(e=>({scrollbackLines:np,minColumnWidth:rp,editorPreset:ox,editorCommandTemplate:ax(ox),setScrollbackLines:t=>e({scrollbackLines:JE(t)}),setMinColumnWidth:t=>e({minColumnWidth:eR(t)}),setEditorPreset:t=>e(n=>{const r=tR(t);return{editorPreset:r,editorCommandTemplate:r==="custom"?a_(n.editorCommandTemplate,r):ax(r)}}),setEditorCommandTemplate:t=>e(n=>({editorCommandTemplate:a_(t,n.editorPreset)}))}),{name:"terminal-preferences",version:3,migrate:e=>{const t=e,n=tR(t==null?void 0:t.editorPreset);return{scrollbackLines:JE((t==null?void 0:t.scrollbackLines)??np),minColumnWidth:eR((t==null?void 0:t.minColumnWidth)??rp),editorPreset:n,editorCommandTemplate:a_(t==null?void 0:t.editorCommandTemplate,n)}}})),dY=35;function hY(e,t){return!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0?0:e*(t/100)}function fY(e,t){const n=hY(e,t);return n>=0&&n<dY}const ac=350,mY=[.4,0,.2,1],pY=8,nR=1e-6;function gY(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function vY(e,t,n){const r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function bY(e,t,n){const r=1-e;return 3*r*r*t+6*r*e*(n-t)+3*e*e*(1-n)}function _Y(e,t,n){let r=e;for(let s=0;s<pY;s+=1){const o=gY(r,t,n)-e;if(Math.abs(o)<nR)return r;const l=bY(r,t,n);if(Math.abs(l)<nR)break;r-=o/l}return r}function yY(e){if(e<=0)return 0;if(e>=1)return 1;const[t,n,r,s]=mY,o=_Y(e,t,r);return vY(o,n,s)}function lj(e,t,n){const r=yY(n);return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function xY({projectId:e,shouldRenderRightSidebarLayout:t,showRightSidebar:n,rightSidebarSize:r}){const s=b.useRef(null),o=b.useRef(null),l=b.useRef(null),u=b.useRef(null),h=b.useRef(null),d=b.useRef(!1),g=b.useRef(null),p=b.useRef(!1),v=b.useRef(!1);return b.useEffect(()=>()=>{u.current!==null&&window.cancelAnimationFrame(u.current),h.current!==null&&window.clearTimeout(h.current)},[]),b.useLayoutEffect(()=>{var j,H,G,B,q,I;if(!t){u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null),d.current=!1;return}const y=s.current;if(!y)return;u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null),h.current!==null&&(window.clearTimeout(h.current),h.current=null);const w=g.current,S=w!==null&&w!==e,C=n&&!v.current,k=!p.current,R=n?[100-r,r]:[100,0],E=S||k&&n,N=C||k?[100,0]:[y.getLayout().workspace??R[0],y.getLayout().rightSidebar??R[1]];if(g.current=e,p.current=t,v.current=n,E||Math.abs(N[0]-R[0])<.1&&Math.abs(N[1]-R[1])<.1){y.setLayout({workspace:R[0],rightSidebar:R[1]}),(j=o.current)==null||j.setAttribute("data-right-sidebar-open",n?"true":"false"),(H=l.current)==null||H.setAttribute("data-right-sidebar-open",n?"true":"false"),(G=l.current)==null||G.setAttribute("data-right-sidebar-animated","false");return}d.current=!0,(B=o.current)==null||B.setAttribute("data-right-sidebar-open",n?"true":"false"),(q=l.current)==null||q.setAttribute("data-right-sidebar-open",n?"true":"false"),(I=l.current)==null||I.setAttribute("data-right-sidebar-animated","true"),y.setLayout({workspace:N[0],rightSidebar:N[1]});const L=performance.now(),D=V=>{const F=Math.min(1,(V-L)/ac),W=lj(N,R,F);if(y.setLayout({workspace:W[0],rightSidebar:W[1]}),F<1){u.current=window.requestAnimationFrame(D);return}y.setLayout({workspace:R[0],rightSidebar:R[1]}),u.current=null,h.current=window.setTimeout(()=>{d.current=!1,h.current=null},0)};u.current=window.requestAnimationFrame(D)},[e,r,t,n]),b.useEffect(()=>{t||(p.current=!1,v.current=!1)},[t]),{isAnimating:d,panelGroupRef:s,sidebarPanelRef:o,sidebarVisualRef:l}}function wY(e){const t=e.previousProjectId!==null&&e.previousProjectId!==e.projectId,n=e.previousProjectId===null&&e.projectId!==null;return!t&&!n&&e.showTerminalPane&&!e.wasTerminalVisible}function SY({previousProjectId:e,projectId:t,previousShouldRenderTerminalLayout:n,previousShowTerminalPane:r,showTerminalPane:s,terminalLayout:o,liveLayout:l}){const u=e!==null&&e!==t,h=s&&!r,d=!n,g=e===null&&t!==null,p=s?o.mainSizes:[100,0];return{currentLayout:h||d?[100,0]:l,shouldSkipAnimation:u||g&&d,targetLayout:p}}function CY({chatInputRef:e,projectId:t,shouldRenderTerminalLayout:n,showTerminalPane:r,terminalLayout:s}){const o=b.useRef(null),l=b.useRef(null),u=b.useRef(null),h=b.useRef(null),d=b.useRef(null),g=b.useRef(!1),p=b.useRef(null),v=b.useRef(!1),y=b.useRef(!1),w=b.useRef(!1),[S,C]=b.useState(0);return b.useEffect(()=>{var E;const k=p.current,R=w.current;wY({previousProjectId:k,projectId:t,showTerminalPane:r,wasTerminalVisible:R})&&C(N=>N+1),k!==null&&k===t&&!r&&R&&((E=e.current)==null||E.focus({preventScroll:!0})),w.current=r,p.current=t},[e,t,r]),b.useEffect(()=>()=>{h.current!==null&&window.cancelAnimationFrame(h.current),d.current!==null&&window.clearTimeout(d.current)},[]),b.useLayoutEffect(()=>{var H,G,B,q,I,V;if(!n){h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null),g.current=!1;return}const k=o.current;if(!k)return;h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null);const R=p.current,{currentLayout:E,shouldSkipAnimation:N,targetLayout:L}=SY({previousProjectId:R,projectId:t,previousShouldRenderTerminalLayout:v.current,previousShowTerminalPane:y.current,showTerminalPane:r,terminalLayout:s,liveLayout:[k.getLayout().chat??s.mainSizes[0],k.getLayout().terminal??s.mainSizes[1]]});if(v.current=n,y.current=r,N||Math.abs(E[0]-L[0])<.1&&Math.abs(E[1]-L[1])<.1){k.setLayout({chat:L[0],terminal:L[1]}),(H=l.current)==null||H.setAttribute("data-terminal-open",r?"true":"false"),(G=u.current)==null||G.setAttribute("data-terminal-open",r?"true":"false"),(B=u.current)==null||B.setAttribute("data-terminal-animated","false");return}g.current=!0,(q=l.current)==null||q.setAttribute("data-terminal-open",r?"true":"false"),(I=u.current)==null||I.setAttribute("data-terminal-open",r?"true":"false"),(V=u.current)==null||V.setAttribute("data-terminal-animated","true"),k.setLayout({chat:E[0],terminal:E[1]});const D=performance.now(),j=F=>{const W=Math.min(1,(F-D)/ac),O=lj(E,L,W);if(k.setLayout({chat:O[0],terminal:O[1]}),W<1){h.current=window.requestAnimationFrame(j);return}k.setLayout({chat:L[0],terminal:L[1]}),h.current=null,d.current=window.setTimeout(()=>{g.current=!1,d.current=null},0)};h.current=window.requestAnimationFrame(j)},[t,n,r,s.mainSizes]),b.useEffect(()=>{n||(v.current=!1,y.current=!1)},[n]),{isAnimating:g,mainPanelGroupRef:o,terminalFocusRequestVersion:S,terminalPanelRef:l,terminalVisualRef:u}}const ci=uo()(ho(e=>({folderGroupsEnabled:!1,showFeatureOverviewInSidebar:!0,kanbanStatusesEnabled:!0,commitProjectMetadataDirectory:!0,setFolderGroupsEnabled:t=>e({folderGroupsEnabled:t}),setShowFeatureOverviewInSidebar:t=>e({showFeatureOverviewInSidebar:t}),setKanbanStatusesEnabled:t=>e({kanbanStatusesEnabled:t}),setCommitProjectMetadataDirectory:t=>e({commitProjectMetadataDirectory:t})}),{name:"feature-settings"}));function Qf(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function kY(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function EY(e,t){const n=kY(t);switch(e.toolKind){case"ask_user_question":{const s=Qf(n),o=Qf(s==null?void 0:s.answers)??(s||{});return{answers:Object.fromEntries(Object.entries(o).map(([l,u])=>Array.isArray(u)?[l,u.map(h=>String(h))]:u&&typeof u=="object"&&Array.isArray(u.answers)?[l,u.answers.map(h=>String(h))]:u==null||u===""?[l,[]]:[l,[String(u)]])),...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const s=Qf(n);return{confirmed:typeof(s==null?void 0:s.confirmed)=="boolean"?s.confirmed:void 0,clearContext:typeof(s==null?void 0:s.clearContext)=="boolean"?s.clearContext:void 0,message:typeof(s==null?void 0:s.message)=="string"?s.message:void 0,...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"read_file":if(typeof n=="string")return n;const r=Qf(n);return{content:typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(n,null,2)};default:return n}}function cj(e){return new Date(e).toISOString()}function Ci(e){return{id:e._id,messageId:e.messageId,timestamp:cj(e.createdAt),hidden:e.hidden}}function RY(e){return{id:e._id,messageId:e.messageId,hidden:e.hidden,kind:"tool",toolKind:e.tool.toolKind,toolName:e.tool.toolName,toolId:e.tool.toolId,input:e.tool.input,timestamp:cj(e.createdAt)}}function TY(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function NY(e){if(e!=null&&e.length)return e.map(t=>({...t,previewUrl:`/attachments/${t.relativePath.split("/").map(encodeURIComponent).join("/")}`}))}function rR(e,t){const n=e.at(-1);if((n==null?void 0:n.kind)===t.kind&&n.hidden===t.hidden&&n.messageId===t.messageId){n.text+=t.text;return}e.push(t)}function MY(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...Ci(r),kind:"user_prompt",content:r.content,attachments:NY(r.attachments)});break;case"system_init":n.push({...Ci(r),kind:"system_init",provider:r.provider,model:r.model,tools:r.tools,agents:r.agents,slashCommands:r.slashCommands,mcpServers:r.mcpServers,debugRaw:r.debugRaw});break;case"account_info":n.push({...Ci(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":rR(n,{...Ci(r),kind:"assistant_text",text:r.text});break;case"assistant_thought":rR(n,{...Ci(r),kind:"assistant_thought",text:r.text});break;case"tool_call":{const s=RY(r);t.set(r.tool.toolId,{hydrated:s,normalized:r.tool}),n.push(s);break}case"tool_result":{const s=t.get(r.toolId);if(s){const o=s.normalized.toolKind==="ask_user_question"||s.normalized.toolKind==="exit_plan_mode"?TY(r)??r.content:r.content;s.hydrated.result=EY(s.normalized,o),s.hydrated.rawResult=o,s.hydrated.isError=r.isError}break}case"result":n.push({...Ci(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...Ci(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...Ci(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...Ci(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...Ci(r),kind:"context_cleared"});break;case"interrupted":n.push({...Ci(r),kind:"interrupted"});break;default:n.push({...Ci(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const AY=["AskUserQuestion","ExitPlanMode","TodoWrite"],DY=new Set(["TodoWrite"]);function jY(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t&&!s.result)return s.id}return null}function OY(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t)return s.id}return null}function LY(e){const t={};for(const n of AY)t[n]=DY.has(n)?OY(e,n):jY(e,n);return t}function zY(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function l_(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const PY=25e3,BY=15e3,IY=4e3;class FY{constructor(t){Vn(this,"url");Vn(this,"ws",null);Vn(this,"started",!1);Vn(this,"reconnectTimer",null);Vn(this,"reconnectDelayMs",750);Vn(this,"subscriptions",new Map);Vn(this,"pending",new Map);Vn(this,"outboundQueue",[]);Vn(this,"statusListeners",new Set);Vn(this,"heartbeatTimer",null);Vn(this,"pingTimeoutTimer",null);Vn(this,"pingPromise",null);Vn(this,"lastOpenAt",0);Vn(this,"lastMessageAt",0);Vn(this,"reconnectImmediatelyOnClose",!1);Vn(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});Vn(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});Vn(this,"handleOnline",()=>{this.ensureHealthyConnection()});this.url=t}start(){this.started||(this.started=!0,window.addEventListener("focus",this.handleWindowFocus),window.addEventListener("online",this.handleOnline),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.connect())}dispose(){var t;this.started=!1,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat(),this.clearPingState(),window.removeEventListener("focus",this.handleWindowFocus),window.removeEventListener("online",this.handleOnline),document.removeEventListener("visibilitychange",this.handleVisibilityChange),(t=this.ws)==null||t.close(),this.ws=null;for(const n of this.pending.values())n.reject(new Error("Socket disposed"));this.pending.clear()}onStatus(t){return this.statusListeners.add(t),t(this.getStatus()),()=>{this.statusListeners.delete(t)}}subscribe(t,n,r){const s=sd();return this.subscriptions.set(s,{topic:t,listener:n,eventListener:r}),this.enqueue({v:1,type:"subscribe",id:s,topic:t}),()=>{this.subscriptions.delete(s),this.enqueue({v:1,type:"unsubscribe",id:s})}}subscribeTerminal(t,n){const r=sd(),s={type:"terminal",terminalId:t};return this.subscriptions.set(r,{topic:s,listener:n.onSnapshot,eventListener:n.onEvent}),this.enqueue({v:1,type:"subscribe",id:r,topic:s}),()=>{this.subscriptions.delete(r),this.enqueue({v:1,type:"unsubscribe",id:r})}}command(t){const n=sd(),r={v:1,type:"command",id:n,command:t};return new Promise((s,o)=>{this.pending.set(n,{resolve:s,reject:o}),this.enqueue(r)})}ensureHealthyConnection(){return!this.ws||this.ws.readyState===WebSocket.CLOSED||this.ws.readyState===WebSocket.CLOSING?(this.reconnectNow(),Promise.resolve()):this.ws.readyState===WebSocket.CONNECTING||!this.isConnectionStale()?Promise.resolve():this.sendPing()}connect(){if(!this.started)return;this.emitStatus("connecting");const t=new WebSocket(this.url);this.ws=t,t.addEventListener("open",()=>{if(this.ws===t){this.reconnectDelayMs=750,this.reconnectImmediatelyOnClose=!1,this.lastOpenAt=Date.now(),this.lastMessageAt=this.lastOpenAt,this.emitStatus("connected"),this.startHeartbeat();for(const[n,r]of this.subscriptions.entries())this.sendNow({v:1,type:"subscribe",id:n,topic:r.topic},t);for(;this.outboundQueue.length>0;){const n=this.outboundQueue.shift();n&&this.sendNow(n,t)}}}),t.addEventListener("message",n=>{var s;if(this.ws!==t)return;this.lastMessageAt=Date.now();let r;try{r=JSON.parse(String(n.data))}catch{return}if(r.type==="snapshot"){const o=this.subscriptions.get(r.id);o==null||o.listener(r.snapshot.data);return}if(r.type==="event"){const o=this.subscriptions.get(r.id);(s=o==null?void 0:o.eventListener)==null||s.call(o,r.event);return}if(r.type==="ack"){const o=this.pending.get(r.id);if(!o)return;this.pending.delete(r.id),o.resolve(r.result);return}if(r.type==="error"){if(!r.id){console.error(v7,r.message);return}const o=this.pending.get(r.id);if(!o)return;this.pending.delete(r.id),o.reject(new Error(r.message))}}),t.addEventListener("close",()=>{if(this.ws!==t||!this.started)return;const n=this.reconnectImmediatelyOnClose;this.reconnectImmediatelyOnClose=!1,this.stopHeartbeat(),this.clearPingState(),this.emitStatus("disconnected");for(const r of this.pending.values())r.reject(new Error("Disconnected"));if(this.pending.clear(),n){this.connect();return}this.scheduleReconnect()})}scheduleReconnect(){this.reconnectTimer===null&&(this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect(),this.reconnectDelayMs=Math.min(this.reconnectDelayMs*2,5e3)},this.reconnectDelayMs))}getStatus(){var t,n;return((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN?"connected":((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING?"connecting":"disconnected"}emitStatus(t){for(const n of this.statusListeners)n(t)}isConnectionStale(){const t=Math.max(this.lastMessageAt,this.lastOpenAt);return t>0&&Date.now()-t>=PY}sendPing(){if(this.pingPromise)return this.pingPromise;const t=this.command({type:"system.ping"}).then(()=>{this.clearPingState()}).catch(n=>{throw this.clearPingState(),this.reconnectNow(),n});return this.pingTimeoutTimer=window.setTimeout(()=>{this.clearPingState(),this.reconnectNow()},IY),this.pingPromise=t,t}reconnectNow(){if(this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),!this.ws||this.ws.readyState===WebSocket.CLOSED){this.connect();return}this.ws.readyState!==WebSocket.CONNECTING&&(this.reconnectImmediatelyOnClose=!0,this.ws.close())}startHeartbeat(){document.visibilityState==="visible"&&this.heartbeatTimer===null&&(this.heartbeatTimer=window.setInterval(()=>{var t;if(document.visibilityState!=="visible"){this.stopHeartbeat();return}((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN&&this.ensureHealthyConnection()},BY))}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}clearPingState(){this.pingTimeoutTimer!==null&&(window.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=null),this.pingPromise=null}enqueue(t){var n;if(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.sendNow(t,this.ws);return}this.outboundQueue.push(t)}sendNow(t,n){if(n.readyState!==WebSocket.OPEN){this.outboundQueue.unshift(t);return}n.send(JSON.stringify(t))}}function HY(e,t){var r;const n=e.find(s=>Dd(s).some(o=>o.chatId===t));return n?((r=Dd(n).find(s=>s.chatId!==t))==null?void 0:r.chatId)??null:null}function iR(e,t){var n;return((n=e.find(r=>Dd(r).some(s=>s.chatId===t)))==null?void 0:n.groupKey)??null}function UY(e,t){for(const n of e){const r=Dd(n).find(s=>s.chatId===t);if(r)return r}return null}function $Y(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function WY(){const e=b.useRef(null);return e.current||(e.current=new FY($Y())),b.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function rd(e,t){if(t===void 0){console.info(`[useKaizenState] ${e}`);return}console.info(`[useKaizenState] ${e}`,t)}function uj(e){return e<24}function VY(e){return Math.max(136,Math.round(e+24))}function qY(e,t){return e==="awaiting_disconnect"&&t==="disconnected"?"awaiting_reconnect":e==="awaiting_reconnect"&&t==="connected"?"clear_phase":"none"}const dj=8e3;function KY(e,t,n){return e==="awaiting_reconnect"&&t==="disconnected"&&n>=dj}const q0=`${Dp}ui-update-restart`;function c_(){return window.sessionStorage.getItem(q0)}function sR(e){window.sessionStorage.setItem(q0,e)}function Jf(){window.sessionStorage.removeItem(q0)}function GY(e){const t=e.selectedProjectId??e.sidebarProjectId??null;return t?{kind:"project_id",projectId:t}:e.fallbackLocalProjectPath?{kind:"local_path",localPath:e.fallbackLocalProjectPath}:null}function YY(e,t){return!e||!t?null:e.runtime.chatId!==t?(rd("stale snapshot masked",{routeChatId:t,snapshotChatId:e.runtime.chatId,snapshotProvider:e.runtime.provider}),null):e}function XY(e){var Uc,da,fh;const{activeChatId:t,activeOverviewFeatureId:n}=e,r=rl(),s=WY(),o=k8(),[l,u]=b.useState({projectGroups:[]}),[h,d]=b.useState(null),[g,p]=b.useState(null),[v,y]=b.useState(null),[w,S]=b.useState(null),[C,k]=b.useState(null),[R,E]=b.useState(null),[N,L]=b.useState(null),[D,j]=b.useState("connecting"),[H,G]=b.useState(!1),[B,q]=b.useState(!1),[I,V]=b.useState(!1),[F,W]=b.useState(null),[O,$]=b.useState(!1),[U,X]=b.useState(!1),[M,P]=b.useState(148),[Z,A]=b.useState(!0),[ie,J]=b.useState(null),[ee,re]=b.useState(null),[ce,he]=b.useState(null),[pe,Se]=b.useState(null),[Re,Ae]=b.useState(!1),Ke=ci(Y=>Y.folderGroupsEnabled),yt=ci(Y=>Y.showFeatureOverviewInSidebar),xt=ci(Y=>Y.kanbanStatusesEnabled),fe=uY(Ri(Y=>Y.editorPreset)),Ie=b.useRef(null),De=b.useRef(null),lt=md(Y=>Y.setVisibility),[st,nt]=b.useState(new Set),rn=b.useRef(new Map),Ce=b.useRef(t),Ze=b.useRef(typeof document<"u"?document.visibilityState==="visible":!0),oe=b.useRef(!1),ve=b.useRef(null),Te=b.useRef(new Map);b.useEffect(()=>s.onStatus(j),[s]),b.useEffect(()=>{Ce.current=t},[t]),b.useEffect(()=>{function Y(){const ne=document.visibilityState==="visible";if(Ze.current=ne,ne){const we=Ce.current;we&&nt(Fe=>{if(!Fe.has(we))return Fe;const Dt=new Set(Fe);return Dt.delete(we),Dt})}}return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)},[]),b.useEffect(()=>s.subscribe({type:"sidebar"},Y=>{const ne=new Map;for(const gn of Y.projectGroups)for(const dr of[...gn.generalChats,...gn.features.flatMap(Br=>Br.chats)])ne.set(dr.chatId,dr.status);const we=rn.current,Fe=Ce.current,Dt=Ze.current;nt(gn=>{let dr=gn;for(const[Br,mh]of ne){const $c=we.get(Br);l_(mh)&&dr.has(Br)&&(dr===gn&&(dr=new Set(gn)),dr.delete(Br)),$c&&l_($c)&&mh==="idle"&&(Br!==Fe||!Dt)&&(dr===gn&&(dr=new Set(gn)),dr.add(Br))}return dr}),rn.current=ne,u(Y),G(!0),J(null)}),[s]),b.useEffect(()=>s.subscribe({type:"local-projects"},Y=>{d(Y),q(!0),J(null)}),[s]),b.useEffect(()=>s.subscribe({type:"update"},Y=>{p(Y),J(null)}),[s]),b.useEffect(()=>{D==="connected"&&s.command({type:"update.check",force:!0}).catch(Y=>{J(Y instanceof Error?Y.message:String(Y))})},[D,s]),b.useEffect(()=>{const Y=c_(),ne=qY(Y,D);if(ne==="awaiting_reconnect"){sR("awaiting_reconnect");return}ne==="clear_phase"&&Jf()},[D,r]),b.useEffect(()=>{if(c_()!=="awaiting_reconnect"||D!=="disconnected")return;const ne=Date.now(),we=window.setTimeout(()=>{KY(c_(),D,Date.now()-ne)&&Jf()},dj);return()=>{window.clearTimeout(we)}},[D]),b.useEffect(()=>{function Y(){g!=null&&g.lastCheckedAt&&(Date.now()-g.lastCheckedAt<=3600*1e3||s.command({type:"update.check"}).catch(ne=>{J(ne instanceof Error?ne.message:String(ne))}))}return window.addEventListener("focus",Y),()=>{window.removeEventListener("focus",Y)}},[s,g==null?void 0:g.lastCheckedAt]),b.useEffect(()=>s.subscribe({type:"keybindings"},Y=>{k(Y),J(null)}),[s]),b.useEffect(()=>s.subscribe({type:"theme-settings"},Y=>{E(Y),un.setState({themePreference:Y.settings.themePreference,themeId:Y.settings.themeId,customAppearance:Y.settings.customAppearance,backgroundImage:Y.settings.backgroundImage,backgroundOpacity:Y.settings.backgroundOpacity,backgroundBlur:Y.settings.backgroundBlur,showProjectIconsInSidebar:Y.settings.showProjectIconsInSidebar,availableThemes:Y.availableThemes,themeCssText:Y.themeCssText})}),[s]),b.useEffect(()=>s.subscribe({type:"provider-settings"},Y=>{L(Y),J(null)}),[s]),b.useEffect(()=>{if(!t){rd("clearing chat snapshot for non-chat route"),y(null),V(!0);return}return rd("subscribing to chat",{activeChatId:t}),y(null),V(!1),s.subscribe({type:"chat",chatId:t},Y=>{rd("chat snapshot received",{activeChatId:t,snapshotChatId:(Y==null?void 0:Y.runtime.chatId)??null,snapshotProvider:(Y==null?void 0:Y.runtime.provider)??null,snapshotStatus:(Y==null?void 0:Y.runtime.status)??null}),y(Y),V(!0),J(null)})},[t,s]),b.useEffect(()=>{if(!n){S(null);return}return S(null),s.subscribe({type:"feature-overview",featureId:n},Y=>{S(Y),J(null)})},[n,s]),b.useEffect(()=>{t&&nt(Y=>{if(!Y.has(t))return Y;const ne=new Set(Y);return ne.delete(t),ne})},[t]),b.useEffect(()=>{if(!t)return;const Y=iR(l.projectGroups,t);Y&<(Y,!1)},[t,lt,l.projectGroups]),b.useEffect(()=>{n&&w&&W(w.projectId)},[n,w]),b.useEffect(()=>{if(F)return;const Y=l.projectGroups[0];Y&&W(Y.groupKey)},[F,l.projectGroups]),b.useEffect(()=>{if(!t||!H||!I)return;if(l.projectGroups.some(ne=>Dd(ne).some(we=>we.chatId===t))){ce===t&&he(null);return}ce!==t&&r("/")},[t,I,r,ce,l.projectGroups,H]),b.useEffect(()=>{v&&(W(v.runtime.projectId),ce===v.runtime.chatId&&he(null))},[v,ce]),b.useEffect(()=>{oe.current=!1,ve.current!==null&&(window.cancelAnimationFrame(ve.current),ve.current=null),A(!0)},[t]),b.useEffect(()=>()=>{ve.current!==null&&window.cancelAnimationFrame(ve.current)},[]),b.useLayoutEffect(()=>{const Y=De.current;if(!Y)return;const ne=new ResizeObserver(()=>{P(Y.getBoundingClientRect().height)});return ne.observe(Y),P(Y.getBoundingClientRect().height),()=>ne.disconnect()},[]);const Me=b.useMemo(()=>YY(v,t),[t,v]);b.useEffect(()=>{rd("active snapshot resolved",{routeChatId:t,rawSnapshotChatId:(v==null?void 0:v.runtime.chatId)??null,rawSnapshotProvider:(v==null?void 0:v.runtime.provider)??null,activeSnapshotChatId:(Me==null?void 0:Me.runtime.chatId)??null,activeSnapshotProvider:(Me==null?void 0:Me.runtime.provider)??null,pendingChatId:ce})},[t,Me,v,ce]);const Ge=b.useMemo(()=>{const Y=Me;if(!Y)return[];const ne=Y.messages,we=Y.runtime.chatId,Fe=ne.at(-1),Dt=`${ne.length}:${(Fe==null?void 0:Fe._id)??""}:${(Fe==null?void 0:Fe.createdAt)??0}`,gn=Te.current.get(we);if((gn==null?void 0:gn.signature)===Dt)return gn.messages;const dr=MY(ne);return Te.current.set(we,{signature:Dt,messages:dr}),dr},[Me]),Ct=b.useMemo(()=>LY(Ge),[Ge]),Je=(Me==null?void 0:Me.runtime)??null,je=(Me==null?void 0:Me.usage)??null,We=(Me==null?void 0:Me.availableProviders)??Xx((N==null?void 0:N.settings)??Yn),ut=l_(Je==null?void 0:Je.status),Ue=zY(Je==null?void 0:Je.status),sn=VY(M),Yt=!Z&&Ge.length>0,Ye=((Uc=h==null?void 0:h.projects[0])==null?void 0:Uc.localPath)??null,qt=(w==null?void 0:w.localPath)??(Je==null?void 0:Je.localPath)??Ye??((da=l.projectGroups[0])==null?void 0:da.localPath),jn=(w==null?void 0:w.projectId)??(Je==null?void 0:Je.projectId)??null,Wt=!!(F??jn??((fh=l.projectGroups[0])==null?void 0:fh.groupKey)??Ye);b.useLayoutEffect(()=>{if(oe.current)return;const Y=Ie.current;Y&&(t&&!Je||(Y.scrollTo({top:Y.scrollHeight,behavior:"auto"}),ve.current!==null&&window.cancelAnimationFrame(ve.current),ve.current=window.requestAnimationFrame(()=>{const ne=Ie.current;ne&&(ne.scrollTo({top:ne.scrollHeight,behavior:"auto"}),ve.current=null)}),oe.current=!0))},[t,M,Ge.length,Je]),b.useEffect(()=>{if(!oe.current||!Z)return;const Y=window.requestAnimationFrame(()=>{const ne=Ie.current;!ne||!Z||ne.scrollTo({top:ne.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(Y)},[t,M,Z,Ge.length,Je==null?void 0:Je.status]);function Bt(){const Y=Ie.current;if(!Y)return;const ne=Y.scrollHeight-Y.scrollTop-Y.clientHeight;A(uj(ne))}function Pe(Y){const ne=Ie.current;A(!0),ne&&ne.scrollTo({top:ne.scrollHeight,behavior:Y})}function dt(){Pe("smooth")}async function gt(Y,ne){Ei.getState().initializeComposerForNewChat();const we=await s.command({type:"chat.create",projectId:Y,featureId:ne});W(Y),he(we.chatId),r(`/chat/${we.chatId}`),$(!1),J(null)}async function wt(Y,ne=ci.getState().commitProjectMetadataDirectory){await s.command({type:"project.setProjectMetadataDirectoryCommitMode",projectId:Y.projectId,localPath:Y.localPath,commitProjectMetadata:ne})}async function Vt(Y){return Y.kind==="project_id"?{projectId:Y.projectId}:Y.kind==="local_path"?{projectId:(await s.command({type:"project.open",localPath:Y.localPath})).projectId,localPath:Y.localPath}:{projectId:(await s.command(Y.project.mode==="new"?{type:"project.create",localPath:Y.project.localPath,title:Y.project.title}:{type:"project.open",localPath:Y.project.localPath})).projectId,localPath:Y.project.localPath}}async function ht(Y){try{const ne=Y.kind==="project_id"?null:Y.kind==="local_path"?Y.localPath:Y.project.localPath;ne&&re(ne);const{projectId:we}=await Vt(Y);await wt({projectId:we}),await gt(we)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}finally{re(null)}}async function ft(Y){const ne=Y.split("/").filter(Boolean).pop()??Y;if(await o.confirm({title:"Hide Project",description:`Hide "${ne}" from ${Un}? This only removes it from ${Un} until you re-add it or reset local state.`,confirmLabel:"Hide",confirmVariant:"destructive"}))try{await s.command({type:"project.hide",localPath:Y}),J(null)}catch(Fe){J(Fe instanceof Error?Fe.message:String(Fe))}}async function pn(Y,ne){try{await gt(Y,ne)}catch(we){J(we instanceof Error?we.message:String(we))}}function ke(Y){Se(Y)}function Oe(Y){r(`/overview/${Y}`),$(!1),J(null)}function St(){Se(null)}async function ot(Y){const ne=pe;if(ne)try{const we=await s.command({type:"feature.create",projectId:ne,title:Y.title,description:Y.description,generateOverview:ci.getState().showFeatureOverviewInSidebar});Se(null),await gt(ne,we.featureId)}catch(we){J(we instanceof Error?we.message:String(we))}}async function on(Y){const ne=l.projectGroups.flatMap(Fe=>Fe.features).find(Fe=>Fe.featureId===Y);if(!ne)return;const we=await o.prompt({title:"Rename Feature",placeholder:"Feature name",initialValue:ne.title,confirmLabel:"Rename"});if(!(!we||we===ne.title))try{await s.command({type:"feature.rename",featureId:Y,title:we}),J(null)}catch(Fe){J(Fe instanceof Error?Fe.message:String(Fe))}}async function dn(Y){const ne=l.projectGroups.flatMap(Fe=>Fe.features).find(Fe=>Fe.featureId===Y);if(!(!ne||!await o.confirm({title:"Delete Feature",description:`Delete "${ne.title}"? Its chats will move to General and the feature folder will be removed.`,confirmLabel:"Delete",confirmVariant:"destructive"})))try{await s.command({type:"feature.delete",featureId:Y}),n===Y&&r("/"),J(null)}catch(Fe){J(Fe instanceof Error?Fe.message:String(Fe))}}async function Xt(Y,ne){try{await s.command({type:"feature.setBrowserState",featureId:Y,browserState:ne}),J(null)}catch(we){J(we instanceof Error?we.message:String(we))}}async function It(Y,ne){try{await s.command({type:"project.setBrowserState",projectId:Y,browserState:ne}),J(null)}catch(we){J(we instanceof Error?we.message:String(we))}}async function Ft(Y,ne){try{await s.command({type:"project.setGeneralChatsBrowserState",projectId:Y,browserState:ne}),J(null)}catch(we){J(we instanceof Error?we.message:String(we))}}async function yr(Y,ne){try{await s.command({type:"feature.setStage",featureId:Y,stage:ne}),J(null)}catch(we){J(we instanceof Error?we.message:String(we))}}async function ts(Y,ne){try{const we=await s.command({type:"feature.updateOverview",featureId:Y,content:ne});return J(null),we}catch(we){const Fe=we instanceof Error?we.message:String(we);throw J(Fe),we}}async function dl(Y){try{await s.command({type:"provider.refreshUsage",provider:Y}),J(null)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function K(Y){if(Y==="cursor")try{const ne=await s.command({type:"provider.browserLogin",provider:Y});if(ne.availability==="login_required"){ne.statusDetail==="browser_launch_failed"&&Ae(!0),J(ne.statusDetail==="browser_launch_failed"?"Could not launch a Chromium browser for Cursor sign-in. Paste a copied cURL command instead.":"Cursor sign-in did not complete. Try again and finish login in the opened browser.");return}J(null)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function rt(Y){try{const ne=await s.command({type:"provider.importUsageCurl",provider:"cursor",curlCommand:Y});if(ne.availability==="login_required"&&ne.statusDetail==="invalid_curl_import"){J("Could not import that cURL command. Copy the get-current-period-usage request as cURL and paste it here.");return}Ae(!1),J(null)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function On(Y,ne){try{await s.command({type:"chat.setFeature",chatId:Y,featureId:ne}),J(null)}catch(we){J(we instanceof Error?we.message:String(we))}}async function ns(Y,ne){try{await s.command({type:"feature.reorder",projectId:Y,orderedFeatureIds:ne}),J(null)}catch(we){J(we instanceof Error?we.message:String(we))}}async function mi(Y){await ht({kind:"local_path",localPath:Y})}async function Ot(Y){await ht({kind:"project_request",project:Y})}async function Tn(Y){try{await Promise.all(ZY((h==null?void 0:h.projects.map(ne=>({localPath:ne.localPath})))??l.projectGroups.map(ne=>({projectId:ne.groupKey,localPath:ne.localPath}))).map(ne=>wt(ne,Y))),J(null)}catch(ne){throw J(ne instanceof Error?ne.message:String(ne)),ne}}async function rs(Y){const ne=new URL("/api/directories",window.location.origin);Y&&ne.searchParams.set("path",Y);const we=await fetch(ne.toString());if(!we.ok){let Dt="Failed to load directories";try{const gn=await we.json();gn.error&&(Dt=gn.error)}catch{}throw new Error(Dt)}const Fe=await we.json();return J(null),Fe}async function Ln(Y){try{await s.command({type:"update.check",force:Y==null?void 0:Y.force}),J(null)}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function lh(){try{const Y=await s.command({type:"update.install"});if(!Y.ok){Jf(),J(null),await o.alert({title:Y.userTitle??"Update failed",description:Y.userMessage??`${Un} could not install the update. Try again later.`,closeLabel:"OK"});return}if(Y.ok&&Y.action==="reload"){window.location.reload();return}Y.ok&&Y.action==="restart"&&sR("awaiting_disconnect"),J(null)}catch(Y){Jf(),J(Y instanceof Error?Y.message:String(Y))}}async function ch(Y,ne){var we;try{let Fe=F??((we=l.projectGroups[0])==null?void 0:we.groupKey)??null;if(!t&&!Fe&&Ye&&(Fe=(await s.command({type:"project.open",localPath:Ye})).projectId,W(Fe)),!t&&!Fe)throw new Error("Open a project first");if(ne!=null&&ne.provider&&!o2(ne.provider,(N==null?void 0:N.settings)??Yn))throw new Error(`${ne.provider} is inactive.`);if(Pe("auto"),ne!=null&&ne.provider&&!o2(ne.provider,(N==null?void 0:N.settings)??Yn))throw new Error(`${ne.provider} is inactive.`);Pe("auto");const Dt=await s.command({type:"chat.send",chatId:t??void 0,projectId:t?void 0:Fe??void 0,provider:ne==null?void 0:ne.provider,message:Y,model:ne==null?void 0:ne.model,modelOptions:ne==null?void 0:ne.modelOptions,planMode:ne==null?void 0:ne.planMode});!t&&Dt.chatId&&(he(Dt.chatId),r(`/chat/${Dt.chatId}`)),J(null)}catch(Fe){throw J(Fe instanceof Error?Fe.message:String(Fe)),Fe}}async function Ns(){if(t)try{await s.command({type:"chat.cancel",chatId:t})}catch(Y){J(Y instanceof Error?Y.message:String(Y))}}async function vo(Y){if(await o.confirm({title:"Delete Chat",description:`Delete "${Y.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await s.command({type:"chat.delete",chatId:Y.chatId}),Y.chatId===t){const we=HY(l.projectGroups,Y.chatId);r(we?`/chat/${we}`:"/")}}catch(we){J(we instanceof Error?we.message:String(we))}}async function ng(Y){const ne=l.projectGroups.find(Dt=>Dt.groupKey===Y);if(!ne)return;const we=ne.localPath.split("/").filter(Boolean).pop()??ne.localPath;if(await o.confirm({title:"Hide Project",description:`Hide "${we}" from ${Un}? Existing chats for this project will be removed from ${Un}, but the project itself is not deleted.`,confirmLabel:"Hide",confirmVariant:"destructive"}))try{await s.command({type:"project.remove",projectId:Y}),Yo.getState().clearProject(Y),md.getState().clearProject(Y),((Je==null?void 0:Je.projectId)??(w==null?void 0:w.projectId))===Y&&r("/"),J(null)}catch(Dt){J(Dt instanceof Error?Dt.message:String(Dt))}}async function uh(Y){var we,Fe;const ne=(Je==null?void 0:Je.localPath)??((we=h==null?void 0:h.projects[0])==null?void 0:we.localPath)??((Fe=l.projectGroups[0])==null?void 0:Fe.localPath);if(ne)try{await ur({action:Y,localPath:ne})}catch(Dt){J(Dt instanceof Error?Dt.message:String(Dt))}}async function dh(Y){try{await ur({action:"open_editor",localPath:Y.path,line:Y.line,column:Y.column})}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}async function rg(Y,ne){try{await ur({action:Y,localPath:ne})}catch(we){J(we instanceof Error?we.message:String(we))}}async function hl(){var Y;try{J(null);const ne=await s.command({type:"settings.bootstrapCustomThemes"}),we=(R==null?void 0:R.themesReadmeFileDisplay)??((Y=ne==null?void 0:ne.localPath)==null?void 0:Y.replace(/[/\\][^/\\]+$/,`${fl(ne==null?void 0:ne.localPath)??"/"}THEME_README.md`))??S7();await ur({action:"open_editor",localPath:we})}catch(ne){J(ne instanceof Error?ne.message:String(ne))}}function fl(Y){return Y?Y.includes("\\")?"\\":"/":null}async function Ii(){try{J(null);const Y=await s.command({type:"settings.reloadThemeSettings"});Y&&(E(Y),un.setState({themePreference:Y.settings.themePreference,themeId:Y.settings.themeId,customAppearance:Y.settings.customAppearance,backgroundImage:Y.settings.backgroundImage,backgroundOpacity:Y.settings.backgroundOpacity,backgroundBlur:Y.settings.backgroundBlur,showProjectIconsInSidebar:Y.settings.showProjectIconsInSidebar,availableThemes:Y.availableThemes,themeCssText:Y.themeCssText}))}catch(Y){J(Y instanceof Error?Y.message:String(Y))}}async function ur(Y){const ne=Ri.getState();J(null),await s.command({type:"system.openExternal",...Y,editor:Y.action==="open_editor"?{preset:ne.editorPreset,commandTemplate:ne.editorCommandTemplate}:void 0})}function hh(){var Fe;const Y=t?UY(l.projectGroups,t):null,ne=t?iR(l.projectGroups,t):null;if(Y&&ne){J(null),pn(ne,Y.featureId??void 0);return}const we=GY({selectedProjectId:F,sidebarProjectId:(Fe=l.projectGroups[0])==null?void 0:Fe.groupKey,fallbackLocalProjectPath:Ye});if(we){J(null),ht(we);return}J("Open a project first")}async function ig(Y,ne,we){if(t)try{await s.command({type:"chat.respondTool",chatId:t,toolUseId:Y,result:{questions:ne,answers:we}})}catch(Fe){J(Fe instanceof Error?Fe.message:String(Fe))}}async function Hc(Y,ne,we,Fe,Dt){if(t){ne&&Ei.getState().setComposerPlanMode(!1);try{await s.command({type:"chat.respondTool",chatId:t,toolUseId:Y,result:{confirmed:ne,...we?{clearContext:!0}:{},...Fe?{message:Fe}:{},...Dt?{attachments:Dt}:{}}})}catch(gn){J(gn instanceof Error?gn.message:String(gn))}}}return{socket:s,activeChatId:t,activeOverviewFeatureId:n,sidebarData:l,completedChatIds:st,localProjects:h,updateSnapshot:g,chatSnapshot:v,featureOverviewSnapshot:w,keybindings:C,themeSettings:R,providerSettings:N,connectionStatus:D,sidebarReady:H,localProjectsReady:B,commandError:ie,startingLocalPath:ee,folderGroupsEnabled:Ke,showFeatureOverviewInSidebar:yt,kanbanStatusesEnabled:xt,sidebarOpen:O,sidebarCollapsed:U,scrollRef:Ie,inputRef:De,messages:Ge,latestToolIds:Ct,runtime:Je,usage:je,availableProviders:We,isProcessing:ut,canCancel:Ue,transcriptPaddingBottom:sn,showScrollButton:Yt,navbarLocalPath:qt,editorLabel:fe,hasSelectedProject:Wt,createFeatureModalProjectId:pe,cursorCurlImportOpen:Re,openSidebar:()=>$(!0),closeSidebar:()=>$(!1),collapseSidebar:()=>X(!0),expandSidebar:()=>X(!1),toggleProjectsSidebar:Y=>{if(Y){$(!1),X(ne=>!ne);return}$(ne=>!ne)},updateScrollState:Bt,scrollToBottom:dt,handleCreateChat:pn,handleCreateFeature:ke,handleOpenFeatureOverview:Oe,handleCloseCreateFeatureModal:St,handleConfirmCreateFeature:ot,handleRenameFeature:on,handleDeleteFeature:dn,handleSetProjectBrowserState:It,handleSetProjectGeneralChatsBrowserState:Ft,handleSetFeatureBrowserState:Xt,handleSetFeatureStage:yr,handleSetChatFeature:On,handleReorderFeatures:ns,handleOpenLocalProject:mi,handleHideLocalProject:ft,handleListDirectories:rs,handleCreateProject:Ot,handleCheckForUpdates:Ln,handleInstallUpdate:lh,handleRefreshProviderUsage:dl,handleOpenProviderLogin:K,handleCloseCursorCurlImport:()=>Ae(!1),handleSubmitCursorCurlImport:rt,handleSetCommitProjectMetadataDirectory:Tn,handleSend:ch,handleCancel:Ns,handleDeleteChat:vo,handleRemoveProject:ng,handleUpdateFeatureOverview:ts,handleOpenExternal:uh,handleOpenExternalPath:rg,handleOpenCustomThemes:hl,handleRefreshThemeSettings:Ii,handleOpenLocalLink:dh,handleCompose:hh,handleAskUserQuestion:ig,handleExitPlanMode:Hc}}function Dd(e){return[...e.features.flatMap(t=>t.chats),...e.generalChats]}function ZY(e){const t=new Set;return e.filter(n=>{const r=n.localPath??n.projectId;return!r||t.has(r)?!1:(t.add(r),!0)})}function QY(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const JY=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eX=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tX={};function oR(e,t){return(tX.jsx?eX:JY).test(e)}const nX=/[ \t\n\f\r]/g;function rX(e){return typeof e=="object"?e.type==="text"?aR(e.value):!1:aR(e)}function aR(e){return e.replace(nX,"")===""}class sh{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}sh.prototype.normal={};sh.prototype.property={};sh.prototype.space=void 0;function hj(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new sh(n,r,t)}function lx(e){return e.toLowerCase()}class Zr{constructor(t,n){this.attribute=n,this.property=t}}Zr.prototype.attribute="";Zr.prototype.booleanish=!1;Zr.prototype.boolean=!1;Zr.prototype.commaOrSpaceSeparated=!1;Zr.prototype.commaSeparated=!1;Zr.prototype.defined=!1;Zr.prototype.mustUseProperty=!1;Zr.prototype.number=!1;Zr.prototype.overloadedBoolean=!1;Zr.prototype.property="";Zr.prototype.spaceSeparated=!1;Zr.prototype.space=void 0;let iX=0;const pt=ul(),Fn=ul(),cx=ul(),Ee=ul(),cn=ul(),fc=ul(),li=ul();function ul(){return 2**++iX}const ux=Object.freeze(Object.defineProperty({__proto__:null,boolean:pt,booleanish:Fn,commaOrSpaceSeparated:li,commaSeparated:fc,number:Ee,overloadedBoolean:cx,spaceSeparated:cn},Symbol.toStringTag,{value:"Module"})),u_=Object.keys(ux);class K0 extends Zr{constructor(t,n,r,s){let o=-1;if(super(t,n),lR(this,"space",s),typeof r=="number")for(;++o<u_.length;){const l=u_[o];lR(this,u_[o],(r&ux[l])===ux[l])}}}K0.prototype.defined=!0;function lR(e,t,n){n&&(e[t]=n)}function Pc(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const o=new K0(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[lx(r)]=r,n[lx(o.attribute)]=r}return new sh(t,n,e.space)}const fj=Pc({properties:{ariaActiveDescendant:null,ariaAtomic:Fn,ariaAutoComplete:null,ariaBusy:Fn,ariaChecked:Fn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:cn,ariaCurrent:null,ariaDescribedBy:cn,ariaDetails:null,ariaDisabled:Fn,ariaDropEffect:cn,ariaErrorMessage:null,ariaExpanded:Fn,ariaFlowTo:cn,ariaGrabbed:Fn,ariaHasPopup:null,ariaHidden:Fn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:cn,ariaLevel:Ee,ariaLive:null,ariaModal:Fn,ariaMultiLine:Fn,ariaMultiSelectable:Fn,ariaOrientation:null,ariaOwns:cn,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:Fn,ariaReadOnly:Fn,ariaRelevant:null,ariaRequired:Fn,ariaRoleDescription:cn,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:Fn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function mj(e,t){return t in e?e[t]:t}function pj(e,t){return mj(e,t.toLowerCase())}const sX=Pc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fc,acceptCharset:cn,accessKey:cn,action:null,allow:null,allowFullScreen:pt,allowPaymentRequest:pt,allowUserMedia:pt,alt:null,as:null,async:pt,autoCapitalize:null,autoComplete:cn,autoFocus:pt,autoPlay:pt,blocking:cn,capture:null,charSet:null,checked:pt,cite:null,className:cn,cols:Ee,colSpan:null,content:null,contentEditable:Fn,controls:pt,controlsList:cn,coords:Ee|fc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pt,defer:pt,dir:null,dirName:null,disabled:pt,download:cx,draggable:Fn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pt,formTarget:null,headers:cn,height:Ee,hidden:cx,high:Ee,href:null,hrefLang:null,htmlFor:cn,httpEquiv:cn,id:null,imageSizes:null,imageSrcSet:null,inert:pt,inputMode:null,integrity:null,is:null,isMap:pt,itemId:null,itemProp:cn,itemRef:cn,itemScope:pt,itemType:cn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pt,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:pt,muted:pt,name:null,nonce:null,noModule:pt,noValidate:pt,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:pt,optimum:Ee,pattern:null,ping:cn,placeholder:null,playsInline:pt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pt,referrerPolicy:null,rel:cn,required:pt,reversed:pt,rows:Ee,rowSpan:Ee,sandbox:cn,scope:null,scoped:pt,seamless:pt,selected:pt,shadowRootClonable:pt,shadowRootDelegatesFocus:pt,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:Fn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:pt,useMap:null,value:Fn,width:Ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:cn,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pt,declare:pt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:pt,noHref:pt,noShade:pt,noWrap:pt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:Fn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:pt,disableRemotePlayback:pt,prefix:null,property:null,results:Ee,security:null,unselectable:null},space:"html",transform:pj}),oX=Pc({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",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:li,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:cn,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:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:pt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,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:fc,g2:fc,glyphName:fc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:li,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ee,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:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:cn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:li,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:li,rev:li,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:li,requiredFeatures:li,requiredFonts:li,requiredFormats:li,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:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:li,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:li,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:li,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mj}),gj=Pc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),vj=Pc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pj}),bj=Pc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),aX={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"},lX=/[A-Z]/g,cR=/-[a-z]/g,cX=/^data[-\w.:]+$/i;function uX(e,t){const n=lx(t);let r=t,s=Zr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cX.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(cR,hX);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!cR.test(o)){let l=o.replace(lX,dX);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=K0}return new s(r,t)}function dX(e){return"-"+e.toLowerCase()}function hX(e){return e.charAt(1).toUpperCase()}const fX=hj([fj,sX,gj,vj,bj],"html"),G0=hj([fj,oX,gj,vj,bj],"svg");function mX(e){return e.join(" ").trim()}var Ql={},d_,uR;function pX(){if(uR)return d_;uR=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,h=`
|
|
598
|
+
`,d="/",g="*",p="",v="comment",y="declaration";function w(C,k){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];k=k||{};var R=1,E=1;function N(F){var W=F.match(t);W&&(R+=W.length);var O=F.lastIndexOf(h);E=~O?F.length-O:E+F.length}function L(){var F={line:R,column:E};return function(W){return W.position=new D(F),G(),W}}function D(F){this.start=F,this.end={line:R,column:E},this.source=k.source}D.prototype.content=C;function j(F){var W=new Error(k.source+":"+R+":"+E+": "+F);if(W.reason=F,W.filename=k.source,W.line=R,W.column=E,W.source=C,!k.silent)throw W}function H(F){var W=F.exec(C);if(W){var O=W[0];return N(O),C=C.slice(O.length),W}}function G(){H(n)}function B(F){var W;for(F=F||[];W=q();)W!==!1&&F.push(W);return F}function q(){var F=L();if(!(d!=C.charAt(0)||g!=C.charAt(1))){for(var W=2;p!=C.charAt(W)&&(g!=C.charAt(W)||d!=C.charAt(W+1));)++W;if(W+=2,p===C.charAt(W-1))return j("End of comment missing");var O=C.slice(2,W-2);return E+=2,N(O),C=C.slice(W),E+=2,F({type:v,comment:O})}}function I(){var F=L(),W=H(r);if(W){if(q(),!H(s))return j("property missing ':'");var O=H(o),$=F({type:y,property:S(W[0].replace(e,p)),value:O?S(O[0].replace(e,p)):p});return H(l),$}}function V(){var F=[];B(F);for(var W;W=I();)W!==!1&&(F.push(W),B(F));return F}return G(),V()}function S(C){return C?C.replace(u,p):p}return d_=w,d_}var dR;function gX(){if(dR)return Ql;dR=1;var e=Ql&&Ql.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ql,"__esModule",{value:!0}),Ql.default=n;const t=e(pX());function n(r,s){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:g}=h;u?s(d,g,h):g&&(o=o||{},o[d]=g)}),o}return Ql}var Uu={},hR;function vX(){if(hR)return Uu;hR=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},l=function(d,g){return g.toUpperCase()},u=function(d,g){return"".concat(g,"-")},h=function(d,g){return g===void 0&&(g={}),o(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(s,u):d=d.replace(r,u),d.replace(t,l))};return Uu.camelCase=h,Uu}var $u,fR;function bX(){if(fR)return $u;fR=1;var e=$u&&$u.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(gX()),n=vX();function r(s,o){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,h){u&&h&&(l[(0,n.camelCase)(u,o)]=h)}),l}return r.default=r,$u=r,$u}var _X=bX();const yX=cp(_X),_j=yj("end"),Y0=yj("start");function yj(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function xX(e){const t=Y0(e),n=_j(e);if(t&&n)return{start:t,end:n}}function pd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?mR(e.position):"start"in e||"end"in e?mR(e):"line"in e||"column"in e?dx(e):""}function dx(e){return pR(e&&e.line)+":"+pR(e&&e.column)}function mR(e){return dx(e&&e.start)+"-"+dx(e&&e.end)}function pR(e){return e&&typeof e=="number"?e:1}class Tr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(l=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?o.ruleId=r:(o.source=r.slice(0,h),o.ruleId=r.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=pd(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Tr.prototype.file="";Tr.prototype.name="";Tr.prototype.reason="";Tr.prototype.message="";Tr.prototype.stack="";Tr.prototype.column=void 0;Tr.prototype.line=void 0;Tr.prototype.ancestors=void 0;Tr.prototype.cause=void 0;Tr.prototype.fatal=void 0;Tr.prototype.place=void 0;Tr.prototype.ruleId=void 0;Tr.prototype.source=void 0;const X0={}.hasOwnProperty,wX=new Map,SX=/[A-Z]/g,CX=new Set(["table","tbody","thead","tfoot","tr"]),kX=new Set(["td","th"]),xj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function EX(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=OX(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=jX(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?G0:fX,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=wj(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function wj(e,t,n){if(t.type==="element")return RX(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return TX(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return MX(e,t,n);if(t.type==="mdxjsEsm")return NX(e,t);if(t.type==="root")return AX(e,t,n);if(t.type==="text")return DX(e,t)}function RX(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=G0,e.schema=s),e.ancestors.push(t);const o=Cj(e,t.tagName,!1),l=LX(e,t);let u=Q0(e,t);return CX.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!rX(h):!0})),Sj(e,l,o,t),Z0(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function TX(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}jd(e,t.position)}function NX(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);jd(e,t.position)}function MX(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=G0,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:Cj(e,t.name,!0),l=zX(e,t),u=Q0(e,t);return Sj(e,l,o,t),Z0(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function AX(e,t,n){const r={};return Z0(r,Q0(e,t)),e.create(t,e.Fragment,r,n)}function DX(e,t){return t.value}function Sj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Z0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function jX(e,t,n){return r;function r(s,o,l,u){const d=Array.isArray(l.children)?n:t;return u?d(o,l,u):d(o,l)}}function OX(e,t){return n;function n(r,s,o,l){const u=Array.isArray(o.children),h=Y0(r);return t(s,o,l,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function LX(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&X0.call(t.properties,s)){const o=PX(e,s,t.properties[s]);if(o){const[l,u]=o;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&kX.has(t.tagName)?r=u:n[l]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function zX(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else jd(e,t.position);else{const s=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else jd(e,t.position);else o=r.value===null?!0:r.value;n[s]=o}return n}function Q0(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:wX;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const d=s.get(h)||0;l=h+"-"+d,s.set(h,d+1)}}const u=wj(e,o,l);u!==void 0&&n.push(u)}return n}function PX(e,t,n){const r=uX(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?QY(n):mX(n)),r.property==="style"){let s=typeof n=="object"?n:BX(e,String(n));return e.stylePropertyNameCase==="css"&&(s=IX(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?aX[r.property]||r.property:r.attribute,n]}}function BX(e,t){try{return yX(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Tr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=xj+"#cannot-parse-style-attribute",s}}function Cj(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,l;for(;++o<s.length;){const u=oR(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(o&&u.type==="Literal"),optional:!1}:u}r=l}else r=oR(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return X0.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);jd(e)}function jd(e,t){const n=new Tr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=xj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function IX(e){const t={};let n;for(n in e)X0.call(e,n)&&(t[FX(n)]=e[n]);return t}function FX(e){let t=e.replace(SX,HX);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function HX(e){return"-"+e.toLowerCase()}const h_={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"]},UX={};function J0(e,t){const n=UX,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return kj(e,r,s)}function kj(e,t,n){if($X(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return gR(e.children,t,n)}return Array.isArray(e)?gR(e,t,n):""}function gR(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=kj(e[s],t,n);return r.join("")}function $X(e){return!!(e&&typeof e=="object")}const vR=document.createElement("i");function e1(e){const t="&"+e+";";vR.innerHTML=t;const n=vR.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function hi(e,t,n,r){const s=e.length;let o=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function Ai(e,t){return e.length>0?(hi(e,e.length,0,t),e):t}const bR={}.hasOwnProperty;function Ej(e){const t={};let n=-1;for(;++n<e.length;)WX(t,e[n]);return t}function WX(e,t){let n;for(n in t){const s=(bR.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){bR.call(s,l)||(s[l]=[]);const u=o[l];VX(s[l],Array.isArray(u)?u:u?[u]:[])}}}function VX(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);hi(e,0,0,r)}function Rj(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Gi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const jr=ua(/[A-Za-z]/),Er=ua(/[\dA-Za-z]/),qX=ua(/[#-'*+\--9=?A-Z^-~]/);function ip(e){return e!==null&&(e<32||e===127)}const hx=ua(/\d/),KX=ua(/[\dA-Fa-f]/),GX=ua(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function ln(e){return e!==null&&(e<0||e===32)}function Rt(e){return e===-2||e===-1||e===32}const Zp=ua(new RegExp("\\p{P}|\\p{S}","u")),nl=ua(/\s/);function ua(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Bc(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&Er(e.charCodeAt(n+1))&&Er(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(l=String.fromCharCode(o,u),s=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function jt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(h){return Rt(h)?(e.enter(n),u(h)):t(h)}function u(h){return Rt(h)&&o++<s?(e.consume(h),u):(e.exit(n),t(h))}}const YX={tokenize:XX};function XX(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),jt(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),o(u)}function o(u){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return et(u)?(e.consume(u),e.exit("chunkText"),o):(e.consume(u),l)}}const ZX={tokenize:QX},_R={tokenize:JX};function QX(e){const t=this,n=[];let r=0,s,o,l;return u;function u(E){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,h,d)(E)}return d(E)}function h(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&R();const N=t.events.length;let L=N,D;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){D=t.events[L][1].end;break}k(r);let j=N;for(;j<t.events.length;)t.events[j][1].end={...D},j++;return hi(t.events,L+1,0,t.events.slice(N)),t.events.length=j,d(E)}return u(E)}function d(E){if(r===n.length){if(!s)return v(E);if(s.currentConstruct&&s.currentConstruct.concrete)return w(E);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_R,g,p)(E)}function g(E){return s&&R(),k(r),v(E)}function p(E){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(E)}function v(E){return t.containerState={},e.attempt(_R,y,w)(E)}function y(E){return r++,n.push([t.currentConstruct,t.containerState]),v(E)}function w(E){if(E===null){s&&R(),k(0),e.consume(E);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),S(E)}function S(E){if(E===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(E);return}return et(E)?(e.consume(E),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(E),S)}function C(E,N){const L=t.sliceStream(E);if(N&&L.push(null),E.previous=o,o&&(o.next=E),o=E,s.defineSkip(E.start),s.write(L),t.parser.lazy[E.start.line]){let D=s.events.length;for(;D--;)if(s.events[D][1].start.offset<l&&(!s.events[D][1].end||s.events[D][1].end.offset>l))return;const j=t.events.length;let H=j,G,B;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(G){B=t.events[H][1].end;break}G=!0}for(k(r),D=j;D<t.events.length;)t.events[D][1].end={...B},D++;hi(t.events,H+1,0,t.events.slice(j)),t.events.length=D}}function k(E){let N=n.length;for(;N-- >E;){const L=n[N];t.containerState=L[1],L[0].exit.call(t,e)}n.length=E}function R(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function JX(e,t,n){return jt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function xc(e){if(e===null||ln(e)||nl(e))return 1;if(Zp(e))return 2}function Qp(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const fx={name:"attention",resolveAll:eZ,tokenize:tZ};function eZ(e,t){let n=-1,r,s,o,l,u,h,d,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},v={...e[n][1].start};yR(p,-h),yR(v,h),l={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},u={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Ai(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Ai(d,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=Ai(d,Qp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Ai(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,d=Ai(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,hi(e,r-1,n-r+3,d),n=r+d.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function tZ(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=xc(r);let o;return l;function l(h){return o=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===o)return e.consume(h),u;const d=e.exit("attentionSequence"),g=xc(h),p=!g||g===2&&s||n.includes(h),v=!s||s===2&&g||n.includes(r);return d._open=!!(o===42?p:p&&(s||!v)),d._close=!!(o===42?v:v&&(g||!p)),t(h)}}function yR(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const nZ={name:"autolink",tokenize:rZ};function rZ(e,t,n){let r=0;return s;function s(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return jr(y)?(e.consume(y),l):y===64?n(y):d(y)}function l(y){return y===43||y===45||y===46||Er(y)?(r=1,u(y)):d(y)}function u(y){return y===58?(e.consume(y),r=0,h):(y===43||y===45||y===46||Er(y))&&r++<32?(e.consume(y),u):(r=0,d(y))}function h(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||ip(y)?n(y):(e.consume(y),h)}function d(y){return y===64?(e.consume(y),g):qX(y)?(e.consume(y),d):n(y)}function g(y){return Er(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,g):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):v(y)}function v(y){if((y===45||Er(y))&&r++<63){const w=y===45?v:p;return e.consume(y),w}return n(y)}}const oh={partial:!0,tokenize:iZ};function iZ(e,t,n){return r;function r(o){return Rt(o)?jt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||et(o)?t(o):n(o)}}const Tj={continuation:{tokenize:oZ},exit:aZ,name:"blockQuote",tokenize:sZ};function sZ(e,t,n){const r=this;return s;function s(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return Rt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function oZ(e,t,n){const r=this;return s;function s(l){return Rt(l)?jt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Tj,t,n)(l)}}function aZ(e){e.exit("blockQuote")}const Nj={name:"characterEscape",tokenize:lZ};function lZ(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return GX(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Mj={name:"characterReference",tokenize:cZ};function cZ(e,t,n){const r=this;let s=0,o,l;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,l=Er,g(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=KX,g):(e.enter("characterReferenceValue"),o=7,l=hx,g(p))}function g(p){if(p===59&&s){const v=e.exit("characterReferenceValue");return l===Er&&!e1(r.sliceSerialize(v))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&s++<o?(e.consume(p),g):n(p)}}const xR={partial:!0,tokenize:dZ},wR={concrete:!0,name:"codeFenced",tokenize:uZ};function uZ(e,t,n){const r=this,s={partial:!0,tokenize:L};let o=0,l=0,u;return h;function h(D){return d(D)}function d(D){const j=r.events[r.events.length-1];return o=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,u=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(D)}function g(D){return D===u?(l++,e.consume(D),g):l<3?n(D):(e.exit("codeFencedFenceSequence"),Rt(D)?jt(e,p,"whitespace")(D):p(D))}function p(D){return D===null||et(D)?(e.exit("codeFencedFence"),r.interrupt?t(D):e.check(xR,S,N)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||et(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):Rt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),jt(e,y,"whitespace")(D)):D===96&&D===u?n(D):(e.consume(D),v)}function y(D){return D===null||et(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(D))}function w(D){return D===null||et(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===u?n(D):(e.consume(D),w)}function S(D){return e.attempt(s,N,C)(D)}function C(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),k}function k(D){return o>0&&Rt(D)?jt(e,R,"linePrefix",o+1)(D):R(D)}function R(D){return D===null||et(D)?e.check(xR,S,N)(D):(e.enter("codeFlowValue"),E(D))}function E(D){return D===null||et(D)?(e.exit("codeFlowValue"),R(D)):(e.consume(D),E)}function N(D){return e.exit("codeFenced"),t(D)}function L(D,j,H){let G=0;return B;function B(W){return D.enter("lineEnding"),D.consume(W),D.exit("lineEnding"),q}function q(W){return D.enter("codeFencedFence"),Rt(W)?jt(D,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):I(W)}function I(W){return W===u?(D.enter("codeFencedFenceSequence"),V(W)):H(W)}function V(W){return W===u?(G++,D.consume(W),V):G>=l?(D.exit("codeFencedFenceSequence"),Rt(W)?jt(D,F,"whitespace")(W):F(W)):H(W)}function F(W){return W===null||et(W)?(D.exit("codeFencedFence"),j(W)):H(W)}}}function dZ(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const f_={name:"codeIndented",tokenize:fZ},hZ={partial:!0,tokenize:mZ};function fZ(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),jt(e,o,"linePrefix",5)(d)}function o(d){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?h(d):et(d)?e.attempt(hZ,l,h)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||et(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),u)}function h(d){return e.exit("codeIndented"),t(d)}}function mZ(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):jt(e,o,"linePrefix",5)(l)}function o(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):et(l)?s(l):n(l)}}const pZ={name:"codeText",previous:vZ,resolve:gZ,tokenize:bZ};function gZ(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function vZ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bZ(e,t,n){let r=0,s,o;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),r++,u):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(o=e.enter("codeTextSequence"),s=0,g(p)):et(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||et(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),d)}function g(p){return p===96?(e.consume(p),s++,g):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(o.type="codeTextData",d(p))}}class _Z{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Wu(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Wu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Wu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Wu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Wu(this.left,n.reverse())}}}function Wu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Aj(e){const t={};let n=-1,r,s,o,l,u,h,d;const g=new _Z(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(r=g.get(n),n&&r[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,yZ(g,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,s=void 0;o--;)if(l=g.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...g.get(s)[1].start},u=g.slice(s,n),u.unshift(r),g.splice(s,n-s+1,u))}}return hi(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function yZ(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,h=[],d={};let g,p,v=-1,y=n,w=0,S=0;const C=[S];for(;y;){for(;e.get(++s)[1]!==y;);o.push(s),y._tokenizer||(g=r.sliceStream(y),y.next||g.push(null),p&&l.defineSkip(y.start),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),y._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++v<u.length;)u[v][0]==="exit"&&u[v-1][0]==="enter"&&u[v][1].type===u[v-1][1].type&&u[v][1].start.line!==u[v][1].end.line&&(S=v+1,C.push(S),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(l.events=[],y?(y._tokenizer=void 0,y.previous=void 0):C.pop(),v=C.length;v--;){const k=u.slice(C[v],C[v+1]),R=o.pop();h.push([R,R+k.length-1]),e.splice(R,2,k)}for(h.reverse(),v=-1;++v<h.length;)d[w+h[v][0]]=w+h[v][1],w+=h[v][1]-h[v][0]-1;return d}const xZ={resolve:SZ,tokenize:CZ},wZ={partial:!0,tokenize:kZ};function SZ(e){return Aj(e),e}function CZ(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?o(u):et(u)?e.check(wZ,l,o)(u):(e.consume(u),s)}function o(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function kZ(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),jt(e,o,"linePrefix")}function o(l){if(l===null||et(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Dj(e,t,n,r,s,o,l,u,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return p;function p(k){return k===60?(e.enter(r),e.enter(s),e.enter(o),e.consume(k),e.exit(o),v):k===null||k===32||k===41||ip(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(k))}function v(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===62?(e.exit("chunkString"),e.exit(u),v(k)):k===null||k===60||et(k)?n(k):(e.consume(k),k===92?w:y)}function w(k){return k===60||k===62||k===92?(e.consume(k),y):y(k)}function S(k){return!g&&(k===null||k===41||ln(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(k)):g<d&&k===40?(e.consume(k),g++,S):k===41?(e.consume(k),g--,S):k===null||k===32||k===40||ip(k)?n(k):(e.consume(k),k===92?C:S)}function C(k){return k===40||k===41||k===92?(e.consume(k),S):S(k)}}function jj(e,t,n,r,s,o){const l=this;let u=0,h;return d;function d(y){return e.enter(r),e.enter(s),e.consume(y),e.exit(s),e.enter(o),g}function g(y){return u>999||y===null||y===91||y===93&&!h||y===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(y):y===93?(e.exit(o),e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):et(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||et(y)||u++>999?(e.exit("chunkString"),g(y)):(e.consume(y),h||(h=!Rt(y)),y===92?v:p)}function v(y){return y===91||y===92||y===93?(e.consume(y),u++,p):p(y)}}function Oj(e,t,n,r,s,o){let l;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(s),e.consume(v),e.exit(s),l=v===40?41:v,h):n(v)}function h(v){return v===l?(e.enter(s),e.consume(v),e.exit(s),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===l?(e.exit(o),h(l)):v===null?n(v):et(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),jt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===l||v===null||et(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?p:g)}function p(v){return v===l||v===92?(e.consume(v),g):g(v)}}function gd(e,t){let n;return r;function r(s){return et(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Rt(s)?jt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const EZ={name:"definition",tokenize:TZ},RZ={partial:!0,tokenize:NZ};function TZ(e,t,n){const r=this;let s;return o;function o(y){return e.enter("definition"),l(y)}function l(y){return jj.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function u(y){return s=Gi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),h):n(y)}function h(y){return ln(y)?gd(e,d)(y):d(y)}function d(y){return Dj(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(RZ,p,p)(y)}function p(y){return Rt(y)?jt(e,v,"whitespace")(y):v(y)}function v(y){return y===null||et(y)?(e.exit("definition"),r.parser.defined.push(s),t(y)):n(y)}}function NZ(e,t,n){return r;function r(u){return ln(u)?gd(e,s)(u):n(u)}function s(u){return Oj(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return Rt(u)?jt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||et(u)?t(u):n(u)}}const MZ={name:"hardBreakEscape",tokenize:AZ};function AZ(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return et(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const DZ={name:"headingAtx",resolve:jZ,tokenize:OZ};function jZ(e,t){let n=e.length-2,r=3,s,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},hi(e,r,n-r+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function OZ(e,t,n){let r=0;return s;function s(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&r++<6?(e.consume(g),l):g===null||ln(g)?(e.exit("atxHeadingSequence"),u(g)):n(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||et(g)?(e.exit("atxHeading"),t(g)):Rt(g)?jt(e,u,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),u(g))}function d(g){return g===null||g===35||ln(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),d)}}const LZ=["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"],SR=["pre","script","style","textarea"],zZ={concrete:!0,name:"htmlFlow",resolveTo:IZ,tokenize:FZ},PZ={partial:!0,tokenize:UZ},BZ={partial:!0,tokenize:HZ};function IZ(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function FZ(e,t,n){const r=this;let s,o,l,u,h;return d;function d(A){return g(A)}function g(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),p}function p(A){return A===33?(e.consume(A),v):A===47?(e.consume(A),o=!0,S):A===63?(e.consume(A),s=3,r.interrupt?t:M):jr(A)?(e.consume(A),l=String.fromCharCode(A),C):n(A)}function v(A){return A===45?(e.consume(A),s=2,y):A===91?(e.consume(A),s=5,u=0,w):jr(A)?(e.consume(A),s=4,r.interrupt?t:M):n(A)}function y(A){return A===45?(e.consume(A),r.interrupt?t:M):n(A)}function w(A){const ie="CDATA[";return A===ie.charCodeAt(u++)?(e.consume(A),u===ie.length?r.interrupt?t:I:w):n(A)}function S(A){return jr(A)?(e.consume(A),l=String.fromCharCode(A),C):n(A)}function C(A){if(A===null||A===47||A===62||ln(A)){const ie=A===47,J=l.toLowerCase();return!ie&&!o&&SR.includes(J)?(s=1,r.interrupt?t(A):I(A)):LZ.includes(l.toLowerCase())?(s=6,ie?(e.consume(A),k):r.interrupt?t(A):I(A)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?R(A):E(A))}return A===45||Er(A)?(e.consume(A),l+=String.fromCharCode(A),C):n(A)}function k(A){return A===62?(e.consume(A),r.interrupt?t:I):n(A)}function R(A){return Rt(A)?(e.consume(A),R):B(A)}function E(A){return A===47?(e.consume(A),B):A===58||A===95||jr(A)?(e.consume(A),N):Rt(A)?(e.consume(A),E):B(A)}function N(A){return A===45||A===46||A===58||A===95||Er(A)?(e.consume(A),N):L(A)}function L(A){return A===61?(e.consume(A),D):Rt(A)?(e.consume(A),L):E(A)}function D(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),h=A,j):Rt(A)?(e.consume(A),D):H(A)}function j(A){return A===h?(e.consume(A),h=null,G):A===null||et(A)?n(A):(e.consume(A),j)}function H(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||ln(A)?L(A):(e.consume(A),H)}function G(A){return A===47||A===62||Rt(A)?E(A):n(A)}function B(A){return A===62?(e.consume(A),q):n(A)}function q(A){return A===null||et(A)?I(A):Rt(A)?(e.consume(A),q):n(A)}function I(A){return A===45&&s===2?(e.consume(A),O):A===60&&s===1?(e.consume(A),$):A===62&&s===4?(e.consume(A),P):A===63&&s===3?(e.consume(A),M):A===93&&s===5?(e.consume(A),X):et(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(PZ,Z,V)(A)):A===null||et(A)?(e.exit("htmlFlowData"),V(A)):(e.consume(A),I)}function V(A){return e.check(BZ,F,Z)(A)}function F(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),W}function W(A){return A===null||et(A)?V(A):(e.enter("htmlFlowData"),I(A))}function O(A){return A===45?(e.consume(A),M):I(A)}function $(A){return A===47?(e.consume(A),l="",U):I(A)}function U(A){if(A===62){const ie=l.toLowerCase();return SR.includes(ie)?(e.consume(A),P):I(A)}return jr(A)&&l.length<8?(e.consume(A),l+=String.fromCharCode(A),U):I(A)}function X(A){return A===93?(e.consume(A),M):I(A)}function M(A){return A===62?(e.consume(A),P):A===45&&s===2?(e.consume(A),M):I(A)}function P(A){return A===null||et(A)?(e.exit("htmlFlowData"),Z(A)):(e.consume(A),P)}function Z(A){return e.exit("htmlFlow"),t(A)}}function HZ(e,t,n){const r=this;return s;function s(l){return et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function UZ(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(oh,t,n)}}const $Z={name:"htmlText",tokenize:WZ};function WZ(e,t,n){const r=this;let s,o,l;return u;function u(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),h}function h(M){return M===33?(e.consume(M),d):M===47?(e.consume(M),L):M===63?(e.consume(M),E):jr(M)?(e.consume(M),H):n(M)}function d(M){return M===45?(e.consume(M),g):M===91?(e.consume(M),o=0,w):jr(M)?(e.consume(M),R):n(M)}function g(M){return M===45?(e.consume(M),y):n(M)}function p(M){return M===null?n(M):M===45?(e.consume(M),v):et(M)?(l=p,$(M)):(e.consume(M),p)}function v(M){return M===45?(e.consume(M),y):p(M)}function y(M){return M===62?O(M):M===45?v(M):p(M)}function w(M){const P="CDATA[";return M===P.charCodeAt(o++)?(e.consume(M),o===P.length?S:w):n(M)}function S(M){return M===null?n(M):M===93?(e.consume(M),C):et(M)?(l=S,$(M)):(e.consume(M),S)}function C(M){return M===93?(e.consume(M),k):S(M)}function k(M){return M===62?O(M):M===93?(e.consume(M),k):S(M)}function R(M){return M===null||M===62?O(M):et(M)?(l=R,$(M)):(e.consume(M),R)}function E(M){return M===null?n(M):M===63?(e.consume(M),N):et(M)?(l=E,$(M)):(e.consume(M),E)}function N(M){return M===62?O(M):E(M)}function L(M){return jr(M)?(e.consume(M),D):n(M)}function D(M){return M===45||Er(M)?(e.consume(M),D):j(M)}function j(M){return et(M)?(l=j,$(M)):Rt(M)?(e.consume(M),j):O(M)}function H(M){return M===45||Er(M)?(e.consume(M),H):M===47||M===62||ln(M)?G(M):n(M)}function G(M){return M===47?(e.consume(M),O):M===58||M===95||jr(M)?(e.consume(M),B):et(M)?(l=G,$(M)):Rt(M)?(e.consume(M),G):O(M)}function B(M){return M===45||M===46||M===58||M===95||Er(M)?(e.consume(M),B):q(M)}function q(M){return M===61?(e.consume(M),I):et(M)?(l=q,$(M)):Rt(M)?(e.consume(M),q):G(M)}function I(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),s=M,V):et(M)?(l=I,$(M)):Rt(M)?(e.consume(M),I):(e.consume(M),F)}function V(M){return M===s?(e.consume(M),s=void 0,W):M===null?n(M):et(M)?(l=V,$(M)):(e.consume(M),V)}function F(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||ln(M)?G(M):(e.consume(M),F)}function W(M){return M===47||M===62||ln(M)?G(M):n(M)}function O(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function $(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),U}function U(M){return Rt(M)?jt(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):X(M)}function X(M){return e.enter("htmlTextData"),l(M)}}const t1={name:"labelEnd",resolveAll:GZ,resolveTo:YZ,tokenize:XZ},VZ={tokenize:ZZ},qZ={tokenize:QZ},KZ={tokenize:JZ};function GZ(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&hi(e,0,e.length,n),e}function YZ(e,t){let n=e.length,r=0,s,o,l,u;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",h,t],["enter",d,t]],u=Ai(u,e.slice(o+1,o+r+3)),u=Ai(u,[["enter",g,t]]),u=Ai(u,Qp(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),u=Ai(u,[["exit",g,t],e[l-2],e[l-1],["exit",d,t]]),u=Ai(u,e.slice(l+1)),u=Ai(u,[["exit",h,t]]),hi(e,o,e.length,u),e}function XZ(e,t,n){const r=this;let s=r.events.length,o,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){o=r.events[s][1];break}return u;function u(v){return o?o._inactive?p(v):(l=r.parser.defined.includes(Gi(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):n(v)}function h(v){return v===40?e.attempt(VZ,g,l?g:p)(v):v===91?e.attempt(qZ,g,l?d:p)(v):l?g(v):p(v)}function d(v){return e.attempt(KZ,g,p)(v)}function g(v){return t(v)}function p(v){return o._balanced=!0,n(v)}}function ZZ(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return ln(p)?gd(e,o)(p):o(p)}function o(p){return p===41?g(p):Dj(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return ln(p)?gd(e,h)(p):g(p)}function u(p){return n(p)}function h(p){return p===34||p===39||p===40?Oj(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function d(p){return ln(p)?gd(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function QZ(e,t,n){const r=this;return s;function s(u){return jj.call(r,e,o,l,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(Gi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function JZ(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const eQ={name:"labelStartImage",resolveAll:t1.resolveAll,tokenize:tQ};function tQ(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const nQ={name:"labelStartLink",resolveAll:t1.resolveAll,tokenize:rQ};function rQ(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const m_={name:"lineEnding",tokenize:iQ};function iQ(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),jt(e,t,"linePrefix")}}const Sm={name:"thematicBreak",tokenize:sQ};function sQ(e,t,n){let r=0,s;return o;function o(d){return e.enter("thematicBreak"),l(d)}function l(d){return s=d,u(d)}function u(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):r>=3&&(d===null||et(d))?(e.exit("thematicBreak"),t(d)):n(d)}function h(d){return d===s?(e.consume(d),r++,h):(e.exit("thematicBreakSequence"),Rt(d)?jt(e,u,"whitespace")(d):u(d))}}const Kr={continuation:{tokenize:cQ},exit:dQ,name:"list",tokenize:lQ},oQ={partial:!0,tokenize:hQ},aQ={partial:!0,tokenize:uQ};function lQ(e,t,n){const r=this,s=r.events[r.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(y){const w=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:hx(y)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Sm,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(y)}return n(y)}function h(y){return hx(y)&&++l<10?(e.consume(y),h):(!r.interrupt||l<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(oh,r.interrupt?n:g,e.attempt(oQ,v,p))}function g(y){return r.containerState.initialBlankLine=!0,o++,v(y)}function p(y){return Rt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function cQ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(oh,s,o);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,jt(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!Rt(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(aQ,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,jt(e,e.attempt(Kr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function uQ(e,t,n){const r=this;return jt(e,s,"listItemIndent",r.containerState.size+1);function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function dQ(e){e.exit(this.containerState.type)}function hQ(e,t,n){const r=this;return jt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const l=r.events[r.events.length-1];return!Rt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const CR={name:"setextUnderline",resolveTo:fQ,tokenize:mQ};function fQ(e,t){let n=e.length,r,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function mQ(e,t,n){const r=this;let s;return o;function o(d){let g=r.events.length,p;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){p=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===s?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),Rt(d)?jt(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||et(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const pQ={tokenize:gQ};function gQ(e){const t=this,n=e.attempt(oh,r,e.attempt(this.parser.constructs.flowInitial,s,jt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(xZ,s)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vQ={resolveAll:zj()},bQ=Lj("string"),_Q=Lj("text");function Lj(e){return{resolveAll:zj(e==="text"?yQ:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],o=n.attempt(s,l,u);return l;function l(g){return d(g)?o(g):u(g)}function u(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return d(g)?(n.exit("data"),o(g)):(n.consume(g),h)}function d(g){if(g===null)return!0;const p=s[g];let v=-1;if(p)for(;++v<p.length;){const y=p[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function zj(e){return t;function t(n,r){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,r):n}}function yQ(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let o=s.length,l=-1,u=0,h;for(;o--;){const d=s[o];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(d===-2)h=!0,u++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const xQ={42:Kr,43:Kr,45:Kr,48:Kr,49:Kr,50:Kr,51:Kr,52:Kr,53:Kr,54:Kr,55:Kr,56:Kr,57:Kr,62:Tj},wQ={91:EZ},SQ={[-2]:f_,[-1]:f_,32:f_},CQ={35:DZ,42:Sm,45:[CR,Sm],60:zZ,61:CR,95:Sm,96:wR,126:wR},kQ={38:Mj,92:Nj},EQ={[-5]:m_,[-4]:m_,[-3]:m_,33:eQ,38:Mj,42:fx,60:[nZ,$Z],91:nQ,92:[MZ,Nj],93:t1,95:fx,96:pZ},RQ={null:[fx,vQ]},TQ={null:[42,95]},NQ={null:[]},MQ=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:TQ,contentInitial:wQ,disable:NQ,document:xQ,flow:CQ,flowInitial:SQ,insideSpan:RQ,string:kQ,text:EQ},Symbol.toStringTag,{value:"Module"}));function AQ(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},o=[];let l=[],u=[];const h={attempt:j(L),check:j(D),consume:R,enter:E,exit:N,interrupt:j(D,{interrupt:!0})},d={code:null,containerState:{},defineSkip:S,events:[],now:w,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:p};let g=t.tokenize.call(d,h);return t.resolveAll&&o.push(t),d;function p(q){return l=Ai(l,q),C(),l[l.length-1]!==null?[]:(H(t,0),d.events=Qp(o,d.events,d),d.events)}function v(q,I){return jQ(y(q),I)}function y(q){return DQ(l,q)}function w(){const{_bufferIndex:q,_index:I,line:V,column:F,offset:W}=r;return{_bufferIndex:q,_index:I,line:V,column:F,offset:W}}function S(q){s[q.line]=q.column,B()}function C(){let q;for(;r._index<l.length;){const I=l[r._index];if(typeof I=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<I.length;)k(I.charCodeAt(r._bufferIndex));else k(I)}}function k(q){g=g(q)}function R(q){et(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,B()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=q}function E(q,I){const V=I||{};return V.type=q,V.start=w(),d.events.push(["enter",V,d]),u.push(V),V}function N(q){const I=u.pop();return I.end=w(),d.events.push(["exit",I,d]),I}function L(q,I){H(q,I.from)}function D(q,I){I.restore()}function j(q,I){return V;function V(F,W,O){let $,U,X,M;return Array.isArray(F)?Z(F):"tokenize"in F?Z([F]):P(F);function P(ee){return re;function re(ce){const he=ce!==null&&ee[ce],pe=ce!==null&&ee.null,Se=[...Array.isArray(he)?he:he?[he]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return Z(Se)(ce)}}function Z(ee){return $=ee,U=0,ee.length===0?O:A(ee[U])}function A(ee){return re;function re(ce){return M=G(),X=ee,ee.partial||(d.currentConstruct=ee),ee.name&&d.parser.constructs.disable.null.includes(ee.name)?J():ee.tokenize.call(I?Object.assign(Object.create(d),I):d,h,ie,J)(ce)}}function ie(ee){return q(X,M),W}function J(ee){return M.restore(),++U<$.length?A($[U]):O}}}function H(q,I){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&hi(d.events,I,d.events.length-I,q.resolve(d.events.slice(I),d)),q.resolveTo&&(d.events=q.resolveTo(d.events,d))}function G(){const q=w(),I=d.previous,V=d.currentConstruct,F=d.events.length,W=Array.from(u);return{from:F,restore:O};function O(){r=q,d.previous=I,d.currentConstruct=V,d.events.length=F,u=W,B()}}function B(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function DQ(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,o)];else{if(l=e.slice(n,s),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}o>0&&l.push(e[s].slice(0,o))}return l}function jQ(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
599
|
+
`;break}case-3:{l=`\r
|
|
600
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(o)}s=o===-2,r.push(l)}return r.join("")}function OQ(e){const r={constructs:Ej([MQ,...(e||{}).extensions||[]]),content:s(YX),defined:[],document:s(ZX),flow:s(pQ),lazy:{},string:s(bQ),text:s(_Q)};return r;function s(o){return l;function l(u){return AQ(r,o,u)}}}function LQ(e){for(;!Aj(e););return e}const kR=/[\0\t\n\r]/g;function zQ(){let e=1,t="",n=!0,r;return s;function s(o,l,u){const h=[];let d,g,p,v,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),p=0,t="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p<o.length;){if(kR.lastIndex=p,d=kR.exec(o),v=d&&d.index!==void 0?d.index:o.length,y=o.charCodeAt(v),!d){t=o.slice(p);break}if(y===10&&p===v&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),p<v&&(h.push(o.slice(p,v)),e+=v-p),y){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}p=v+1}return u&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const PQ=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BQ(e){return e.replace(PQ,IQ)}function IQ(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return Rj(n.slice(o?2:1),o?16:10)}return e1(n)||e}const Pj={}.hasOwnProperty;function FQ(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),HQ(n)(LQ(OQ(n).document().write(zQ()(e,t,!0))))}function HQ(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(De),autolinkProtocol:G,autolinkEmail:G,atxHeading:o(yt),blockQuote:o(pe),characterEscape:G,characterReference:G,codeFenced:o(Se),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Se,l),codeText:o(Re,l),codeTextData:G,data:G,codeFlowValue:G,definition:o(Ae),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Ke),hardBreakEscape:o(xt),hardBreakTrailing:o(xt),htmlFlow:o(fe,l),htmlFlowData:G,htmlText:o(fe,l),htmlTextData:G,image:o(Ie),label:l,link:o(De),listItem:o(st),listItemValue:v,listOrdered:o(lt,p),listUnordered:o(lt),paragraph:o(nt),reference:A,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(yt),strong:o(rn),thematicBreak:o(Ze)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:he,autolinkProtocol:ce,blockQuote:h(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ee,characterReference:re,codeFenced:h(C),codeFencedFence:S,codeFencedFenceInfo:y,codeFencedFenceMeta:w,codeFlowValue:B,codeIndented:h(k),codeText:h(W),codeTextData:B,data:B,definition:h(),definitionDestinationString:N,definitionLabelString:R,definitionTitleString:E,emphasis:h(),hardBreakEscape:h(I),hardBreakTrailing:h(I),htmlFlow:h(V),htmlFlowData:B,htmlText:h(F),htmlTextData:B,image:h($),label:X,labelText:U,lineEnding:q,link:h(O),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:M,resourceTitleString:P,resource:Z,setextHeading:h(H),setextHeadingLineSequence:j,setextHeadingText:D,strong:h(),thematicBreak:h()}};Bj(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(oe){let ve={type:"root",children:[]};const Te={stack:[ve],tokenStack:[],config:t,enter:u,exit:d,buffer:l,resume:g,data:n},Me=[];let Ge=-1;for(;++Ge<oe.length;)if(oe[Ge][1].type==="listOrdered"||oe[Ge][1].type==="listUnordered")if(oe[Ge][0]==="enter")Me.push(Ge);else{const Ct=Me.pop();Ge=s(oe,Ct,Ge)}for(Ge=-1;++Ge<oe.length;){const Ct=t[oe[Ge][0]];Pj.call(Ct,oe[Ge][1].type)&&Ct[oe[Ge][1].type].call(Object.assign({sliceSerialize:oe[Ge][2].sliceSerialize},Te),oe[Ge][1])}if(Te.tokenStack.length>0){const Ct=Te.tokenStack[Te.tokenStack.length-1];(Ct[1]||ER).call(Te,void 0,Ct[0])}for(ve.position={start:Ko(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Ko(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<t.transforms.length;)ve=t.transforms[Ge](ve)||ve;return ve}function s(oe,ve,Te){let Me=ve-1,Ge=-1,Ct=!1,Je,je,We,ut;for(;++Me<=Te;){const Ue=oe[Me];switch(Ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ue[0]==="enter"?Ge++:Ge--,ut=void 0;break}case"lineEndingBlank":{Ue[0]==="enter"&&(Je&&!ut&&!Ge&&!We&&(We=Me),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!Ge&&Ue[0]==="enter"&&Ue[1].type==="listItemPrefix"||Ge===-1&&Ue[0]==="exit"&&(Ue[1].type==="listUnordered"||Ue[1].type==="listOrdered")){if(Je){let sn=Me;for(je=void 0;sn--;){const Yt=oe[sn];if(Yt[1].type==="lineEnding"||Yt[1].type==="lineEndingBlank"){if(Yt[0]==="exit")continue;je&&(oe[je][1].type="lineEndingBlank",Ct=!0),Yt[1].type="lineEnding",je=sn}else if(!(Yt[1].type==="linePrefix"||Yt[1].type==="blockQuotePrefix"||Yt[1].type==="blockQuotePrefixWhitespace"||Yt[1].type==="blockQuoteMarker"||Yt[1].type==="listItemIndent"))break}We&&(!je||We<je)&&(Je._spread=!0),Je.end=Object.assign({},je?oe[je][1].start:Ue[1].end),oe.splice(je||Me,0,["exit",Je,Ue[2]]),Me++,Te++}if(Ue[1].type==="listItemPrefix"){const sn={type:"listItem",_spread:!1,start:Object.assign({},Ue[1].start),end:void 0};Je=sn,oe.splice(Me,0,["enter",sn,Ue[2]]),Me++,Te++,We=void 0,ut=!0}}}return oe[ve][1]._spread=Ct,Te}function o(oe,ve){return Te;function Te(Me){u.call(this,oe(Me),Me),ve&&ve.call(this,Me)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(oe,ve,Te){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ve,Te||void 0]),oe.position={start:Ko(ve.start),end:void 0}}function h(oe){return ve;function ve(Te){oe&&oe.call(this,Te),d.call(this,Te)}}function d(oe,ve){const Te=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==oe.type&&(ve?ve.call(this,oe,Me[0]):(Me[1]||ER).call(this,oe,Me[0]));else throw new Error("Cannot close `"+oe.type+"` ("+pd({start:oe.start,end:oe.end})+"): it’s not open");Te.position.end=Ko(oe.end)}function g(){return J0(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function v(oe){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function y(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=oe}function w(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=oe}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.value=oe.replace(/(\r?\n|\r)$/g,"")}function R(oe){const ve=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ve,Te.identifier=Gi(this.sliceSerialize(oe)).toLowerCase()}function E(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.title=oe}function N(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.url=oe}function L(oe){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Te=this.sliceSerialize(oe).length;ve.depth=Te}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function j(oe){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function G(oe){const Te=this.stack[this.stack.length-1].children;let Me=Te[Te.length-1];(!Me||Me.type!=="text")&&(Me=Ce(),Me.position={start:Ko(oe.start),end:void 0},Te.push(Me)),this.stack.push(Me)}function B(oe){const ve=this.stack.pop();ve.value+=this.sliceSerialize(oe),ve.position.end=Ko(oe.end)}function q(oe){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ve.children[ve.children.length-1];Te.position.end=Ko(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(G.call(this,oe),B.call(this,oe))}function I(){this.data.atHardBreak=!0}function V(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.value=oe}function F(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.value=oe}function W(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.value=oe}function O(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ve,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function $(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ve,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function U(oe){const ve=this.sliceSerialize(oe),Te=this.stack[this.stack.length-2];Te.label=BQ(ve),Te.identifier=Gi(ve).toLowerCase()}function X(){const oe=this.stack[this.stack.length-1],ve=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Me=oe.children;Te.children=Me}else Te.alt=ve}function M(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.url=oe}function P(){const oe=this.resume(),ve=this.stack[this.stack.length-1];ve.title=oe}function Z(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ie(oe){const ve=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ve,Te.identifier=Gi(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function J(oe){this.data.characterReferenceType=oe.type}function ee(oe){const ve=this.sliceSerialize(oe),Te=this.data.characterReferenceType;let Me;Te?(Me=Rj(ve,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=e1(ve);const Ge=this.stack[this.stack.length-1];Ge.value+=Me}function re(oe){const ve=this.stack.pop();ve.position.end=Ko(oe.end)}function ce(oe){B.call(this,oe);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(oe)}function he(oe){B.call(this,oe);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(oe)}function pe(){return{type:"blockquote",children:[]}}function Se(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function Ae(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ke(){return{type:"emphasis",children:[]}}function yt(){return{type:"heading",depth:0,children:[]}}function xt(){return{type:"break"}}function fe(){return{type:"html",value:""}}function Ie(){return{type:"image",title:null,url:"",alt:null}}function De(){return{type:"link",title:null,url:"",children:[]}}function lt(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function st(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function nt(){return{type:"paragraph",children:[]}}function rn(){return{type:"strong",children:[]}}function Ce(){return{type:"text",value:""}}function Ze(){return{type:"thematicBreak"}}}function Ko(e){return{line:e.line,column:e.column,offset:e.offset}}function Bj(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Bj(e,r):UQ(e,r)}}function UQ(e,t){let n;for(n in t)if(Pj.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function ER(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pd({start:t.start,end:t.end})+") is still open")}function $Q(e){const t=this;t.parser=n;function n(r){return FQ(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function WQ(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function VQ(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
601
|
+
`}]}function qQ(e,t){const n=t.value?t.value+`
|
|
602
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function KQ(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GQ(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YQ(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Bc(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,u+=1,e.footnoteCounts.set(r,u);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function XQ(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZQ(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ij(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function QQ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ij(e,t);const s={src:Bc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function JQ(e,t){const n={src:Bc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function eJ(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function tJ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ij(e,t);const s={href:Bc(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function nJ(e,t){const n={href:Bc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rJ(e,t,n){const r=e.all(t),s=n?iJ(n):Fj(t),o={},l=[];if(typeof t.checked=="boolean"){const g=r[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const g=r[u];(s||u!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
|
|
603
|
+
`}),g.type==="element"&&g.tagName==="p"&&!s?l.push(...g.children):l.push(g)}const h=r[r.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
|
604
|
+
`});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function iJ(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Fj(n[r])}return t}function Fj(e){const t=e.spread;return t??e.children.length>1}function sJ(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function oJ(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aJ(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function lJ(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cJ(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=Y0(t.children[1]),h=_j(t.children[t.children.length-1]);u&&h&&(l.position={start:u,end:h}),s.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function uJ(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let h=-1;const d=[];for(;++h<u;){const p=t.children[h],v={},y=l?l[h]:void 0;y&&(v.align=y);let w={type:"element",tagName:o,properties:v,children:[]};p&&(w.children=e.all(p),e.patch(p,w),w=e.applyData(p,w)),d.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,g),e.applyData(t,g)}function dJ(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const RR=9,TR=32;function hJ(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const o=[];for(;r;)o.push(NR(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return o.push(NR(t.slice(s),s>0,!1)),o.join("")}function NR(e,t,n){let r=0,s=e.length;if(t){let o=e.codePointAt(r);for(;o===RR||o===TR;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(s-1);for(;o===RR||o===TR;)s--,o=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function fJ(e,t){const n={type:"text",value:hJ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function mJ(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const pJ={blockquote:WQ,break:VQ,code:qQ,delete:KQ,emphasis:GQ,footnoteReference:YQ,heading:XQ,html:ZQ,imageReference:QQ,image:JQ,inlineCode:eJ,linkReference:tJ,link:nJ,listItem:rJ,list:sJ,paragraph:oJ,root:aJ,strong:lJ,table:cJ,tableCell:dJ,tableRow:uJ,text:fJ,thematicBreak:mJ,toml:em,yaml:em,definition:em,footnoteDefinition:em};function em(){}const Hj=-1,Jp=0,vd=1,sp=2,n1=3,r1=4,i1=5,s1=6,Uj=7,$j=8,MR=typeof self=="object"?self:globalThis,gJ=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),r=s=>{if(e.has(s))return e.get(s);const[o,l]=t[s];switch(o){case Jp:case Hj:return n(l,s);case vd:{const u=n([],s);for(const h of l)u.push(r(h));return u}case sp:{const u=n({},s);for(const[h,d]of l)u[r(h)]=r(d);return u}case n1:return n(new Date(l),s);case r1:{const{source:u,flags:h}=l;return n(new RegExp(u,h),s)}case i1:{const u=n(new Map,s);for(const[h,d]of l)u.set(r(h),r(d));return u}case s1:{const u=n(new Set,s);for(const h of l)u.add(r(h));return u}case Uj:{const{name:u,message:h}=l;return n(new MR[u](h),s)}case $j:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new MR[o](l),s)};return r},AR=e=>gJ(new Map,e)(0),Jl="",{toString:vJ}={},{keys:bJ}=Object,Vu=e=>{const t=typeof e;if(t!=="object"||!e)return[Jp,t];const n=vJ.call(e).slice(8,-1);switch(n){case"Array":return[vd,Jl];case"Object":return[sp,Jl];case"Date":return[n1,Jl];case"RegExp":return[r1,Jl];case"Map":return[i1,Jl];case"Set":return[s1,Jl];case"DataView":return[vd,n]}return n.includes("Array")?[vd,n]:n.includes("Error")?[Uj,n]:[sp,n]},tm=([e,t])=>e===Jp&&(t==="function"||t==="symbol"),_J=(e,t,n,r)=>{const s=(l,u)=>{const h=r.push(l)-1;return n.set(u,h),h},o=l=>{if(n.has(l))return n.get(l);let[u,h]=Vu(l);switch(u){case Jp:{let g=l;switch(h){case"bigint":u=$j,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([Hj],l)}return s([u,g],l)}case vd:{if(h){let v=l;return h==="DataView"?v=new Uint8Array(l.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(l)),s([h,[...v]],l)}const g=[],p=s([u,g],l);for(const v of l)g.push(o(v));return p}case sp:{if(h)switch(h){case"BigInt":return s([h,l.toString()],l);case"Boolean":case"Number":case"String":return s([h,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const g=[],p=s([u,g],l);for(const v of bJ(l))(e||!tm(Vu(l[v])))&&g.push([o(v),o(l[v])]);return p}case n1:return s([u,l.toISOString()],l);case r1:{const{source:g,flags:p}=l;return s([u,{source:g,flags:p}],l)}case i1:{const g=[],p=s([u,g],l);for(const[v,y]of l)(e||!(tm(Vu(v))||tm(Vu(y))))&&g.push([o(v),o(y)]);return p}case s1:{const g=[],p=s([u,g],l);for(const v of l)(e||!tm(Vu(v)))&&g.push(o(v));return p}}const{message:d}=l;return s([u,{name:h,message:d}],l)};return o},DR=(e,{json:t,lossy:n}={})=>{const r=[];return _J(!(t||n),!!t,new Map,r)(e),r},op=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?AR(DR(e,t)):structuredClone(e):(e,t)=>AR(DR(e,t));function yJ(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function xJ(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function wJ(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||yJ,r=e.options.footnoteBackLabel||xJ,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const g=e.all(d),p=String(d.identifier).toUpperCase(),v=Bc(p.toLowerCase());let y=0;const w=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++y<=S;){w.length>0&&w.push({type:"text",value:" "});let R=typeof n=="string"?n:n(h,y);typeof R=="string"&&(R={type:"text",value:R}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,y),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const C=g[g.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const R=C.children[C.children.length-1];R&&R.type==="text"?R.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...w)}else g.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(g,!0)};e.patch(d,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...op(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
605
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
606
|
+
`}]}}const eg=function(e){if(e==null)return EJ;if(typeof e=="function")return tg(e);if(typeof e=="object")return Array.isArray(e)?SJ(e):CJ(e);if(typeof e=="string")return kJ(e);throw new Error("Expected function, string, or object as test")};function SJ(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=eg(e[n]);return tg(r);function r(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function CJ(e){const t=e;return tg(n);function n(r){const s=r;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function kJ(e){return tg(t);function t(n){return n&&n.type===e}}function tg(e){return t;function t(n,r,s){return!!(RJ(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function EJ(){return!0}function RJ(e){return e!==null&&typeof e=="object"&&"type"in e}const Wj=[],TJ=!0,mx=!1,NJ="skip";function Vj(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const o=eg(s),l=r?-1:1;u(e,void 0,[])();function u(h,d,g){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=Wj,w,S,C;if((!t||o(h,d,g[g.length-1]||void 0))&&(y=MJ(n(h,g)),y[0]===mx))return y;if("children"in h&&h.children){const k=h;if(k.children&&y[0]!==NJ)for(S=(r?k.children.length:-1)+l,C=g.concat(k);S>-1&&S<k.children.length;){const R=k.children[S];if(w=u(R,S,C)(),w[0]===mx)return w;S=typeof w[1]=="number"?w[1]:S+l}}return y}}}function MJ(e){return Array.isArray(e)?e:typeof e=="number"?[TJ,e]:e==null?Wj:[e]}function o1(e,t,n,r){let s,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,s=n):(o=t,l=n,s=r),Vj(e,o,u,s);function u(h,d){const g=d[d.length-1],p=g?g.children.indexOf(h):void 0;return l(h,p,g)}}const px={}.hasOwnProperty,AJ={};function DJ(e,t){const n=t||AJ,r=new Map,s=new Map,o=new Map,l={...pJ,...n.handlers},u={all:d,applyData:OJ,definitionById:r,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:l,one:h,options:n,patch:jJ,wrap:zJ};return o1(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?r:s,v=String(g.identifier).toUpperCase();p.has(v)||p.set(v,g)}}),u;function h(g,p){const v=g.type,y=u.handlers[v];if(px.call(u.handlers,v)&&y)return y(u,g,p);if(u.options.passThrough&&u.options.passThrough.includes(v)){if("children"in g){const{children:S,...C}=g,k=op(C);return k.children=u.all(g),k}return op(g)}return(u.options.unknownHandler||LJ)(u,g,p)}function d(g){const p=[];if("children"in g){const v=g.children;let y=-1;for(;++y<v.length;){const w=u.one(v[y],g);if(w){if(y&&v[y-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=jR(w.value)),!Array.isArray(w)&&w.type==="element")){const S=w.children[0];S&&S.type==="text"&&(S.value=jR(S.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function jJ(e,t){e.position&&(t.position=xX(e))}function OJ(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,op(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function LJ(e,t){const n=t.data||{},r="value"in t&&!(px.call(n,"hProperties")||px.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zJ(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
607
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
608
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
609
|
+
`}),n}function jR(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function OR(e,t){const n=DJ(e,t),r=n.one(e,void 0),s=wJ(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
610
|
+
`},s),o}function PJ(e,t){return e&&"run"in e?async function(n,r){const s=OR(n,{file:r,...t});await e.run(s,r)}:function(n,r){return OR(n,{file:r,...e||t})}}function LR(e){if(e)throw e}var p_,zR;function BJ(){if(zR)return p_;zR=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!p)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},l=function(d,g){n&&g.name==="__proto__"?n(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},u=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(r)return r(d,g).value}else return;return d[g]};return p_=function h(){var d,g,p,v,y,w,S=arguments[0],C=1,k=arguments.length,R=!1;for(typeof S=="boolean"&&(R=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<k;++C)if(d=arguments[C],d!=null)for(g in d)p=u(S,g),v=u(d,g),S!==v&&(R&&v&&(o(v)||(y=s(v)))?(y?(y=!1,w=p&&s(p)?p:[]):w=p&&o(p)?p:{},l(S,{name:g,newValue:h(R,w,v)})):typeof v<"u"&&l(S,{name:g,newValue:v}));return S},p_}var IJ=BJ();const g_=cp(IJ);function gx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function FJ(){const e=[],t={run:n,use:r};return t;function n(...s){let o=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(h,...d){const g=e[++o];let p=-1;if(h){l(h);return}for(;++p<s.length;)(d[p]===null||d[p]===void 0)&&(d[p]=s[p]);s=d,g?HJ(g,u)(...d):l(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function HJ(e,t){let n;return r;function r(...l){const u=e.length>l.length;let h;u&&l.push(s);try{h=e.apply(this,l)}catch(d){const g=d;if(u&&n)throw g;return s(g)}u||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(l,...u){n||(n=!0,t(l,...u))}function o(l){s(null,l)}}const hs={basename:UJ,dirname:$J,extname:WJ,join:VJ,sep:"/"};function UJ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ah(e);let n=0,r=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else r<0&&(o=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else l<0&&(o=!0,l=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function $J(e){if(ah(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function WJ(e){ah(e);let t=e.length,n=-1,r=0,s=-1,o=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function VJ(...e){let t=-1,n;for(;++t<e.length;)ah(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":qJ(n)}function qJ(e){ah(e);const t=e.codePointAt(0)===47;let n=KJ(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function KJ(e,t){let n="",r=0,s=-1,o=0,l=-1,u,h;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(s===l-1||o===1))if(s!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",r=0):(n=n.slice(0,h),r=n.length-1-n.lastIndexOf("/")),s=l,o=0;continue}}else if(n.length>0){n="",r=0,s=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,o=0}else u===46&&o>-1?o++:o=-1}return n}function ah(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GJ={cwd:YJ};function YJ(){return"/"}function vx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function XJ(e){if(typeof e=="string")e=new URL(e);else if(!vx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return ZJ(e)}function ZJ(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const v_=["history","path","basename","stem","extname","dirname"];class qj{constructor(t){let n;t?vx(t)?n={path:t}:typeof t=="string"||QJ(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":GJ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<v_.length;){const o=v_[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)v_.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?hs.basename(this.path):void 0}set basename(t){__(t,"basename"),b_(t,"basename"),this.path=hs.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?hs.dirname(this.path):void 0}set dirname(t){PR(this.basename,"dirname"),this.path=hs.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?hs.extname(this.path):void 0}set extname(t){if(b_(t,"extname"),PR(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=hs.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){vx(t)&&(t=XJ(t)),__(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?hs.basename(this.path,this.extname):void 0}set stem(t){__(t,"stem"),b_(t,"stem"),this.path=hs.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Tr(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function b_(e,t){if(e&&e.includes(hs.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+hs.sep+"`")}function __(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function PR(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function QJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JJ=function(e){const r=this.constructor.prototype,s=r[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},eee={}.hasOwnProperty;class a1 extends JJ{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=FJ()}copy(){const t=new a1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(g_(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(w_("data",this.frozen),this.namespace[t]=n,this):eee.call(this.namespace,t)&&this.namespace[t]||void 0:t?(w_("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=nm(t),r=this.parser||this.Parser;return y_("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),y_("process",this.parser||this.Parser),x_("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,l){const u=nm(t),h=r.parse(u);r.run(h,u,function(g,p,v){if(g||!p||!v)return d(g);const y=p,w=r.stringify(y,v);ree(w)?v.value=w:v.result=w,d(g,v)});function d(g,p){g||!p?l(g):o?o(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),y_("processSync",this.parser||this.Parser),x_("processSync",this.compiler||this.Compiler),this.process(t,s),IR("processSync","process",n),r;function s(o,l){n=!0,LR(o),r=l}}run(t,n,r){BR(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,u){const h=nm(n);s.run(t,h,d);function d(g,p,v){const y=p||t;g?u(g):l?l(y):r(void 0,y,v)}}}runSync(t,n){let r=!1,s;return this.run(t,n,o),IR("runSync","run",r),s;function o(l,u){LR(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=nm(n),s=this.compiler||this.Compiler;return x_("stringify",s),BR(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(w_("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...p]=d;h(g,p)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))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");u(d.plugins),d.settings&&(s.settings=g_(!0,s.settings,d.settings))}function u(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const p=d[g];o(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,g){let p=-1,v=-1;for(;++p<r.length;)if(r[p][0]===d){v=p;break}if(v===-1)r.push([d,...g]);else if(g.length>0){let[y,...w]=g;const S=r[v][1];gx(S)&&gx(y)&&(y=g_(!0,S,y)),r[v]=[d,y,...w]}}}}const tee=new a1().freeze();function y_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function x_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function w_(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function BR(e){if(!gx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function IR(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function nm(e){return nee(e)?e:new qj(e)}function nee(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ree(e){return typeof e=="string"||iee(e)}function iee(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const see="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",FR=[],HR={allowDangerousHtml:!0},oee=/^(https?|ircs?|mailto|xmpp)$/i,aee=[{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 Ic(e){const t=lee(e),n=cee(e);return uee(t.runSync(t.parse(n),n),e)}function lee(e){const t=e.rehypePlugins||FR,n=e.remarkPlugins||FR,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...HR}:HR;return tee().use($Q).use(n).use(PJ,r).use(t)}function cee(e){const t=e.children||"",n=new qj;return typeof t=="string"&&(n.value=t),n}function uee(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,o=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||dee;for(const g of aee)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+see+g.id,void 0);return o1(e,d),EX(e,{Fragment:f.Fragment,components:s,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function d(g,p,v){if(g.type==="raw"&&v&&typeof p=="number")return l?v.children.splice(p,1):v.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let y;for(y in h_)if(Object.hasOwn(h_,y)&&Object.hasOwn(g.properties,y)){const w=g.properties[y],S=h_[y];(S===null||S.includes(g.tagName))&&(g.properties[y]=h(String(w||""),y,g))}}if(g.type==="element"){let y=n?!n.includes(g.tagName):o?o.includes(g.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(g,p,v)),y&&v&&typeof p=="number")return u&&g.children?v.children.splice(p,1,...g.children):v.children.splice(p,1),p}}}function dee(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||oee.test(e.slice(0,t))?e:""}function UR(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function hee(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function fee(e,t,n){const s=eg((n||{}).ignore||[]),o=mee(t);let l=-1;for(;++l<o.length;)Vj(e,"text",u);function u(d,g){let p=-1,v;for(;++p<g.length;){const y=g[p],w=v?v.children:void 0;if(s(y,w?w.indexOf(y):void 0,v))return;v=y}if(v)return h(d,g)}function h(d,g){const p=g[g.length-1],v=o[l][0],y=o[l][1];let w=0;const C=p.children.indexOf(d);let k=!1,R=[];v.lastIndex=0;let E=v.exec(d.value);for(;E;){const N=E.index,L={index:E.index,input:E.input,stack:[...g,d]};let D=y(...E,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=N+1:(w!==N&&R.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(D)?R.push(...D):D&&R.push(D),w=N+E[0].length,k=!0),!v.global)break;E=v.exec(d.value)}return k?(w<d.value.length&&R.push({type:"text",value:d.value.slice(w)}),p.children.splice(C,1,...R)):R=[d],C+R.length}}function mee(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([pee(s[0]),gee(s[1])])}return t}function pee(e){return typeof e=="string"?new RegExp(hee(e),"g"):e}function gee(e){return typeof e=="function"?e:function(){return e}}const S_="phrasing",C_=["autolink","link","image","label"];function vee(){return{transforms:[Cee],enter:{literalAutolink:_ee,literalAutolinkEmail:k_,literalAutolinkHttp:k_,literalAutolinkWww:k_},exit:{literalAutolink:See,literalAutolinkEmail:wee,literalAutolinkHttp:yee,literalAutolinkWww:xee}}}function bee(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:S_,notInConstruct:C_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:S_,notInConstruct:C_},{character:":",before:"[ps]",after:"\\/",inConstruct:S_,notInConstruct:C_}]}}function _ee(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function k_(e){this.config.enter.autolinkProtocol.call(this,e)}function yee(e){this.config.exit.autolinkProtocol.call(this,e)}function xee(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function wee(e){this.config.exit.autolinkEmail.call(this,e)}function See(e){this.exit(e)}function Cee(e){fee(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,kee],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Eee]],{ignore:["link","linkReference"]})}function kee(e,t,n,r,s){let o="";if(!Kj(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!Ree(n)))return!1;const l=Tee(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function Eee(e,t,n,r){return!Kj(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Ree(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Tee(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=UR(e,"(");let o=UR(e,")");for(;r!==-1&&s>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Kj(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||nl(n)||Zp(n))&&(!t||n!==47)}Gj.peek=Pee;function Nee(){this.buffer()}function Mee(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Aee(){this.buffer()}function Dee(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function jee(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Oee(e){this.exit(e)}function Lee(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zee(e){this.exit(e)}function Pee(){return"["}function Gj(e,t,n,r){const s=n.createTracker(r);let o=s.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),l(),o+=s.move("]"),o}function Bee(){return{enter:{gfmFootnoteCallString:Nee,gfmFootnoteCall:Mee,gfmFootnoteDefinitionLabelString:Aee,gfmFootnoteDefinition:Dee},exit:{gfmFootnoteCallString:jee,gfmFootnoteCall:Oee,gfmFootnoteDefinitionLabelString:Lee,gfmFootnoteDefinition:zee}}}function Iee(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Gj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,o,l){const u=o.createTracker(l);let h=u.move("[^");const d=o.enter("footnoteDefinition"),g=o.enter("label");return h+=u.move(o.safe(o.associationId(r),{before:h,after:"]"})),g(),h+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),h+=u.move((t?`
|
|
611
|
+
`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?Yj:Fee))),d(),h}}function Fee(e,t,n){return t===0?e:Yj(e,t,n)}function Yj(e,t,n){return(n?"":" ")+e}const Hee=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Xj.peek=qee;function Uee(){return{canContainEols:["delete"],enter:{strikethrough:Wee},exit:{strikethrough:Vee}}}function $ee(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Hee}],handlers:{delete:Xj}}}function Wee(e){this.enter({type:"delete",children:[]},e)}function Vee(e){this.exit(e)}function Xj(e,t,n,r){const s=n.createTracker(r),o=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),o(),l}function qee(){return"~"}function Kee(e){return e.length}function Gee(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||Kee,o=[],l=[],u=[],h=[];let d=0,g=-1;for(;++g<e.length;){const S=[],C=[];let k=-1;for(e[g].length>d&&(d=e[g].length);++k<e[g].length;){const R=Yee(e[g][k]);if(n.alignDelimiters!==!1){const E=s(R);C[k]=E,(h[k]===void 0||E>h[k])&&(h[k]=E)}S.push(R)}l[g]=S,u[g]=C}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)o[p]=$R(r[p]);else{const S=$R(r);for(;++p<d;)o[p]=S}p=-1;const v=[],y=[];for(;++p<d;){const S=o[p];let C="",k="";S===99?(C=":",k=":"):S===108?C=":":S===114&&(k=":");let R=n.alignDelimiters===!1?1:Math.max(1,h[p]-C.length-k.length);const E=C+"-".repeat(R)+k;n.alignDelimiters!==!1&&(R=C.length+R+k.length,R>h[p]&&(h[p]=R),y[p]=R),v[p]=E}l.splice(1,0,v),u.splice(1,0,y),g=-1;const w=[];for(;++g<l.length;){const S=l[g],C=u[g];p=-1;const k=[];for(;++p<d;){const R=S[p]||"";let E="",N="";if(n.alignDelimiters!==!1){const L=h[p]-(C[p]||0),D=o[p];D===114?E=" ".repeat(L):D===99?L%2?(E=" ".repeat(L/2+.5),N=" ".repeat(L/2-.5)):(E=" ".repeat(L/2),N=E):N=" ".repeat(L)}n.delimiterStart!==!1&&!p&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||p)&&k.push(" "),n.alignDelimiters!==!1&&k.push(E),k.push(R),n.alignDelimiters!==!1&&k.push(N),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&k.push("|")}w.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return w.join(`
|
|
612
|
+
`)}function Yee(e){return e==null?"":String(e)}function $R(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Xee(e,t,n,r){const s=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),Zee);return s(),l}function Zee(e,t,n){return">"+(n?"":" ")+e}function Qee(e,t){return WR(e,t.inConstruct,!0)&&!WR(e,t.notInConstruct,!1)}function WR(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function VR(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
613
|
+
`&&Qee(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
614
|
+
`}function Jee(e,t){const n=String(e);let r=n.indexOf(t),s=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++o>l&&(l=o):o=1,s=r+t.length,r=n.indexOf(t,s);return l}function ete(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function tte(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function nte(e,t,n,r){const s=tte(n),o=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(ete(e,n)){const p=n.enter("codeIndented"),v=n.indentLines(o,rte);return p(),v}const u=n.createTracker(r),h=s.repeat(Math.max(Jee(o,s)+1,3)),d=n.enter("codeFenced");let g=u.move(h);if(e.lang){const p=n.enter(`codeFencedLang${l}`);g+=u.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);g+=u.move(" "),g+=u.move(n.safe(e.meta,{before:g,after:`
|
|
615
|
+
`,encode:["`"],...u.current()})),p()}return g+=u.move(`
|
|
616
|
+
`),o&&(g+=u.move(o+`
|
|
617
|
+
`)),g+=u.move(h),d(),g}function rte(e,t,n){return(n?"":" ")+e}function l1(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ite(e,t,n,r){const s=l1(n),o=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("[");return d+=h.move(n.safe(n.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
618
|
+
`,...h.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),l(),d}function ste(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Od(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ap(e,t,n){const r=xc(e),s=xc(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===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}}Zj.peek=ote;function Zj(e,t,n,r){const s=ste(n),o=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s);let h=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const d=h.charCodeAt(0),g=ap(r.before.charCodeAt(r.before.length-1),d,s);g.inside&&(h=Od(d)+h.slice(1));const p=h.charCodeAt(h.length-1),v=ap(r.after.charCodeAt(0),p,s);v.inside&&(h=h.slice(0,-1)+Od(p));const y=l.move(s);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+h+y}function ote(e,t,n){return n.options.emphasis||"*"}function ate(e,t){let n=!1;return o1(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,mx}),!!((!e.depth||e.depth<3)&&J0(e)&&(t.options.setext||n))}function lte(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(ate(e,n)){const g=n.enter("headingSetext"),p=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:`
|
|
619
|
+
`,after:`
|
|
620
|
+
`});return p(),g(),v+`
|
|
621
|
+
`+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
622
|
+
`))+1))}const l="#".repeat(s),u=n.enter("headingAtx"),h=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
623
|
+
`,...o.current()});return/^[\t ]/.test(d)&&(d=Od(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),h(),u(),d}Qj.peek=cte;function Qj(e){return e.value||""}function cte(){return"<"}Jj.peek=ute;function Jj(e,t,n,r){const s=l1(n),o=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("![");return d+=h.move(n.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),d+=h.move(")"),l(),d}function ute(){return"!"}e3.peek=dte;function e3(e,t,n,r){const s=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let h=u.move("![");const d=n.safe(e.alt,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return l(),n.stack=g,o(),s==="full"||!d||d!==p?h+=u.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function dte(){return"!"}t3.peek=hte;function t3(e,t,n){let r=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],u=n.compilePattern(l);let h;if(l.atBreak)for(;h=u.exec(r);){let d=h.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(h.index+1)}}return s+r+s}function hte(){return"`"}function n3(e,t){const n=J0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}r3.peek=fte;function r3(e,t,n,r){const s=l1(n),o=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,h;if(n3(e,n)){const g=n.stack;n.stack=[],u=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),u(),n.stack=g,p}u=n.enter("link"),h=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(h=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),h(),e.title&&(h=n.enter(`title${o}`),d+=l.move(" "+s),d+=l.move(n.safe(e.title,{before:d,after:s,...l.current()})),d+=l.move(s),h()),d+=l.move(")"),u(),d}function fte(e,t,n){return n3(e,n)?"<":"["}i3.peek=mte;function i3(e,t,n,r){const s=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let h=u.move("[");const d=n.containerPhrasing(e,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return l(),n.stack=g,o(),s==="full"||!d||d!==p?h+=u.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function mte(){return"["}function c1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function pte(e){const t=c1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gte(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function s3(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vte(e,t,n,r){const s=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?gte(n):c1(n);const u=e.ordered?l==="."?")":".":pte(n);let h=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),s3(n)===l&&g){let p=-1;for(;++p<e.children.length;){const v=e.children[p];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(l=u),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,s(),d}function bte(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function _te(e,t,n,r){const s=bte(n);let o=n.bulletCurrent||c1(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(l-o.length)),u.shift(l);const h=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),g);return h(),d;function g(p,v,y){return v?(y?"":" ".repeat(l))+p:(y?o:o+" ".repeat(l-o.length))+p}}function yte(e,t,n,r){const s=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),s(),l}const xte=eg(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function wte(e,t,n,r){return(e.children.some(function(l){return xte(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ste(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}o3.peek=Cte;function o3(e,t,n,r){const s=Ste(n),o=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s);let h=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const d=h.charCodeAt(0),g=ap(r.before.charCodeAt(r.before.length-1),d,s);g.inside&&(h=Od(d)+h.slice(1));const p=h.charCodeAt(h.length-1),v=ap(r.after.charCodeAt(0),p,s);v.inside&&(h=h.slice(0,-1)+Od(p));const y=l.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},u+h+y}function Cte(e,t,n){return n.options.strong||"*"}function kte(e,t,n,r){return n.safe(e.value,r)}function Ete(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Rte(e,t,n){const r=(s3(n)+(n.options.ruleSpaces?" ":"")).repeat(Ete(n));return n.options.ruleSpaces?r.slice(0,-1):r}const a3={blockquote:Xee,break:VR,code:nte,definition:ite,emphasis:Zj,hardBreak:VR,heading:lte,html:Qj,image:Jj,imageReference:e3,inlineCode:t3,link:r3,linkReference:i3,list:vte,listItem:_te,paragraph:yte,root:wte,strong:o3,text:kte,thematicBreak:Rte};function Tte(){return{enter:{table:Nte,tableData:qR,tableHeader:qR,tableRow:Ate},exit:{codeText:Dte,table:Mte,tableData:E_,tableHeader:E_,tableRow:E_}}}function Nte(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Mte(e){this.exit(e),this.data.inTable=void 0}function Ate(e){this.enter({type:"tableRow",children:[]},e)}function E_(e){this.exit(e)}function qR(e){this.enter({type:"tableCell",children:[]},e)}function Dte(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,jte));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function jte(e,t){return t==="|"?t:e}function Ote(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
624
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:l,tableCell:h,tableRow:u}};function l(y,w,S,C){return d(g(y,S,C),y.align)}function u(y,w,S,C){const k=p(y,S,C),R=d([k]);return R.slice(0,R.indexOf(`
|
|
625
|
+
`))}function h(y,w,S,C){const k=S.enter("tableCell"),R=S.enter("phrasing"),E=S.containerPhrasing(y,{...C,before:o,after:o});return R(),k(),E}function d(y,w){return Gee(y,{align:w,alignDelimiters:r,padding:n,stringLength:s})}function g(y,w,S){const C=y.children;let k=-1;const R=[],E=w.enter("table");for(;++k<C.length;)R[k]=p(C[k],w,S);return E(),R}function p(y,w,S){const C=y.children;let k=-1;const R=[],E=w.enter("tableRow");for(;++k<C.length;)R[k]=h(C[k],y,w,S);return E(),R}function v(y,w,S){let C=a3.inlineCode(y,w,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function Lte(){return{exit:{taskListCheckValueChecked:KR,taskListCheckValueUnchecked:KR,paragraph:Pte}}}function zte(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Bte}}}function KR(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Pte(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let o=-1,l;for(;++o<s.length;){const u=s[o];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Bte(e,t,n,r){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);o&&u.move(l);let h=a3.listItem(e,t,n,{...r,...u.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+l}}function Ite(){return[vee(),Bee(),Uee(),Tte(),Lte()]}function Fte(e){return{extensions:[bee(),Iee(e),$ee(),Ote(e),zte()]}}const Hte={tokenize:Kte,partial:!0},l3={tokenize:Gte,partial:!0},c3={tokenize:Yte,partial:!0},u3={tokenize:Xte,partial:!0},Ute={tokenize:Zte,partial:!0},d3={name:"wwwAutolink",tokenize:Vte,previous:f3},h3={name:"protocolAutolink",tokenize:qte,previous:m3},go={name:"emailAutolink",tokenize:Wte,previous:p3},Ts={};function $te(){return{text:Ts}}let Oa=48;for(;Oa<123;)Ts[Oa]=go,Oa++,Oa===58?Oa=65:Oa===91&&(Oa=97);Ts[43]=go;Ts[45]=go;Ts[46]=go;Ts[95]=go;Ts[72]=[go,h3];Ts[104]=[go,h3];Ts[87]=[go,d3];Ts[119]=[go,d3];function Wte(e,t,n){const r=this;let s,o;return l;function l(p){return!bx(p)||!p3.call(r,r.previous)||u1(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return bx(p)?(e.consume(p),u):p===64?(e.consume(p),h):n(p)}function h(p){return p===46?e.check(Ute,g,d)(p):p===45||p===95||Er(p)?(o=!0,e.consume(p),h):g(p)}function d(p){return e.consume(p),s=!0,h}function g(p){return o&&s&&jr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function Vte(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!f3.call(r,r.previous)||u1(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Hte,e.attempt(l3,e.attempt(c3,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function qte(e,t,n){const r=this;let s="",o=!1;return l;function l(p){return(p===72||p===104)&&m3.call(r,r.previous)&&!u1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(jr(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const v=s.toLowerCase();if(v==="http"||v==="https")return e.consume(p),h}return n(p)}function h(p){return p===47?(e.consume(p),o?d:(o=!0,h)):n(p)}function d(p){return p===null||ip(p)||ln(p)||nl(p)||Zp(p)?n(p):e.attempt(l3,e.attempt(c3,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function Kte(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function Gte(e,t,n){let r,s,o;return l;function l(d){return d===46||d===95?e.check(u3,h,u)(d):d===null||ln(d)||nl(d)||d!==45&&Zp(d)?h(d):(o=!0,e.consume(d),l)}function u(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),l}function h(d){return s||r||!o?n(d):t(d)}}function Yte(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(u3,t,o)(l):l===null||ln(l)||nl(l)?t(l):(e.consume(l),s)}function o(l){return l===41&&r++,e.consume(l),s}}function Xte(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),o):u===93?(e.consume(u),s):u===60||u===null||ln(u)||nl(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||ln(u)||nl(u)?t(u):r(u)}function o(u){return jr(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):jr(u)?(e.consume(u),l):n(u)}}function Zte(e,t,n){return r;function r(o){return e.consume(o),s}function s(o){return Er(o)?n(o):t(o)}}function f3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ln(e)}function m3(e){return!jr(e)}function p3(e){return!(e===47||bx(e))}function bx(e){return e===43||e===45||e===46||e===95||Er(e)}function u1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Qte={tokenize:one,partial:!0};function Jte(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rne,continuation:{tokenize:ine},exit:sne}},text:{91:{name:"gfmFootnoteCall",tokenize:nne},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ene,resolveTo:tne}}}}function ene(e,t,n){const r=this;let s=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const h=r.events[s][1];if(h.type==="labelImage"){l=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return u;function u(h){if(!l||!l._balanced)return n(h);const d=Gi(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function tne(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function nne(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(o>999||p===93&&!l||p===null||p===91||ln(p))return n(p);if(p===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return s.includes(Gi(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return ln(p)||(l=!0),o++,e.consume(p),p===92?g:d}function g(p){return p===91||p===92||p===93?(e.consume(p),o++,d):d(p)}}function rne(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,u;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(w)}function g(w){if(l>999||w===93&&!u||w===null||w===91||ln(w))return n(w);if(w===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return o=Gi(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return ln(w)||(u=!0),l++,e.consume(w),w===92?p:g}function p(w){return w===91||w===92||w===93?(e.consume(w),l++,g):g(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(o)||s.push(o),jt(e,y,"gfmFootnoteDefinitionWhitespace")):n(w)}function y(w){return t(w)}}function ine(e,t,n){return e.check(oh,t,e.attempt(Qte,t,n))}function sne(e){e.exit("gfmFootnoteDefinition")}function one(e,t,n){const r=this;return jt(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function ane(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,u){let h=-1;for(;++h<l.length;)if(l[h][0]==="enter"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._close){let d=h;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[h][1].end.offset-l[h][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[h][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[h][1].end)},p={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[h][1].start)},v=[["enter",g,u],["enter",l[d][1],u],["exit",l[d][1],u],["enter",p,u]],y=u.parser.constructs.insideSpan.null;y&&hi(v,v.length,0,Qp(y,l.slice(d+1,h),u)),hi(v,v.length,0,[["exit",p,u],["enter",l[h][1],u],["exit",l[h][1],u],["exit",g,u]]),hi(l,d-1,h-d+3,v),h=d+v.length-2;break}}for(h=-1;++h<l.length;)l[h][1].type==="strikethroughSequenceTemporary"&&(l[h][1].type="data");return l}function o(l,u,h){const d=this.previous,g=this.events;let p=0;return v;function v(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(l.enter("strikethroughSequenceTemporary"),y(w))}function y(w){const S=xc(d);if(w===126)return p>1?h(w):(l.consume(w),p++,y);if(p<2&&!n)return h(w);const C=l.exit("strikethroughSequenceTemporary"),k=xc(w);return C._open=!k||k===2&&!!S,C._close=!S||S===2&&!!k,u(w)}}}class lne{constructor(){this.map=[]}add(t,n,r){cne(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const o of s)t.push(o);s=r.pop()}this.map.length=0}}function cne(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function une(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function dne(){return{flow:{null:{name:"table",tokenize:hne,resolveAll:fne}}}}function hne(e,t,n){const r=this;let s=0,o=0,l;return u;function u(B){let q=r.events.length-1;for(;q>-1;){const F=r.events[q][1].type;if(F==="lineEnding"||F==="linePrefix")q--;else break}const I=q>-1?r.events[q][1].type:null,V=I==="tableHead"||I==="tableRow"?D:h;return V===D&&r.parser.lazy[r.now().line]?n(B):V(B)}function h(B){return e.enter("tableHead"),e.enter("tableRow"),d(B)}function d(B){return B===124||(l=!0,o+=1),g(B)}function g(B){return B===null?n(B):et(B)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),y):n(B):Rt(B)?jt(e,g,"whitespace")(B):(o+=1,l&&(l=!1,s+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),l=!0,g):(e.enter("data"),p(B)))}function p(B){return B===null||B===124||ln(B)?(e.exit("data"),g(B)):(e.consume(B),B===92?v:p)}function v(B){return B===92||B===124?(e.consume(B),p):p(B)}function y(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),l=!1,Rt(B)?jt(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):w(B))}function w(B){return B===45||B===58?C(B):B===124?(l=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),S):L(B)}function S(B){return Rt(B)?jt(e,C,"whitespace")(B):C(B)}function C(B){return B===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),k):B===45?(o+=1,k(B)):B===null||et(B)?N(B):L(B)}function k(B){return B===45?(e.enter("tableDelimiterFiller"),R(B)):L(B)}function R(B){return B===45?(e.consume(B),R):B===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(B))}function E(B){return Rt(B)?jt(e,N,"whitespace")(B):N(B)}function N(B){return B===124?w(B):B===null||et(B)?!l||s!==o?L(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):L(B)}function L(B){return n(B)}function D(B){return e.enter("tableRow"),j(B)}function j(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),j):B===null||et(B)?(e.exit("tableRow"),t(B)):Rt(B)?jt(e,j,"whitespace")(B):(e.enter("data"),H(B))}function H(B){return B===null||B===124||ln(B)?(e.exit("data"),j(B)):(e.consume(B),B===92?G:H)}function G(B){return B===92||B===124?(e.consume(B),H):H(B)}}function fne(e,t){let n=-1,r=!0,s=0,o=[0,0,0,0],l=[0,0,0,0],u=!1,h=0,d,g,p;const v=new lne;for(;++n<e.length;){const y=e[n],w=y[1];y[0]==="enter"?w.type==="tableHead"?(u=!1,h!==0&&(GR(v,t,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,p=void 0,o=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(n,0,[["enter",g,t]])),s=w.type==="tableDelimiterRow"?2:g?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],p=rm(v,t,o,s,void 0,p),o=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],p=rm(v,t,o,s,void 0,p)),o=l,l=[o[1],n,0,0])):w.type==="tableHead"?(u=!0,h=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=n,o[1]!==0?(l[0]=l[1],p=rm(v,t,o,s,n,p)):l[1]!==0&&(p=rm(v,t,l,s,n,p)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(h!==0&&GR(v,t,h,d,g),v.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=une(t.events,n))}return e}function rm(e,t,n,r,s,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(o.end=Object.assign({},nc(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const h=nc(t.events,n[1]);if(o={type:l,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=nc(t.events,n[2]),g=nc(t.events,n[3]),p={type:u,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const v=t.events[n[2]],y=t.events[n[3]];if(v[1].end=Object.assign({},y[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,S=n[3]-n[2]-1;e.add(w,S,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(o.end=Object.assign({},nc(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function GR(e,t,n,r,s){const o=[],l=nc(t.events,n);s&&(s.end=Object.assign({},l),o.push(["exit",s,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function nc(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const mne={name:"tasklistCheck",tokenize:gne};function pne(){return{text:{91:mne}}}function gne(e,t,n){const r=this;return s;function s(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return ln(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),l):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),l):n(h)}function l(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(h)}function u(h){return et(h)?t(h):Rt(h)?e.check({tokenize:vne},t,n)(h):n(h)}}function vne(e,t,n){return jt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function bne(e){return Ej([$te(),Jte(),ane(e),dne(),pne()])}const _ne={};function Fc(e){const t=this,n=e||_ne,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(bne(n)),o.push(Ite()),l.push(Fte(n))}function yne({content:e,attachments:t}){const[n,r]=b.useState(null),s=(t==null?void 0:t.find(o=>o.id===n))??null;return b.useEffect(()=>{s||r(null)},[s]),f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex gap-2 justify-end",children:f.jsxs("div",{className:"max-w-[85%] sm:max-w-[80%] rounded-[20px] py-1.5 px-3.5 bg-muted text-primary border border-border prose prose-sm prose-invert [&_p]:whitespace-pre-line",children:[t!=null&&t.length?f.jsx("div",{className:"mb-2 grid max-w-[420px] grid-cols-2 gap-2",children:t.map(o=>f.jsxs("button",{type:"button",className:"overflow-hidden rounded-lg border border-border/80 bg-background/70 text-left cursor-zoom-in",onClick:()=>r(o.id),children:[f.jsx("img",{src:o.previewUrl,alt:o.name,className:"h-full max-h-[220px] w-full object-cover"}),f.jsx("div",{className:"border-t border-border/60 px-2 py-1 text-[11px] text-muted-foreground",children:o.name})]},o.id))}):null,e.trim()?f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:e}):null]})}),s?f.jsx("button",{type:"button",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4 cursor-zoom-out",onClick:()=>r(null),children:f.jsx("img",{src:s.previewUrl,alt:s.name,className:"max-h-full max-w-full rounded-xl shadow-2xl"})}):null]})}function xne({json:e}){return f.jsx("div",{className:"flex gap-3 justify-start",children:f.jsx("div",{className:"flex-1 max-w-[90%]",children:f.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words bg-muted rounded-lg p-3 overflow-auto max-h-96",children:e})})})}function g3({title:e,count:t,children:n,badge:r}){const[s,o]=b.useState(!1);return t===0?null:f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("button",{onClick:()=>o(!s),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[f.jsx(Or,{className:me("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",s&&"rotate-90")}),f.jsx("span",{className:"text-muted-foreground font-medium",children:e}),f.jsx("span",{className:"text-muted-foreground/60",children:t}),r]}),s&&f.jsx("div",{className:"ml-5",children:n})]})}function R_({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:f.jsx(g3,{title:e,count:t.length,children:f.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>f.jsx(ij,{icon:r?r(s):n,children:s},s))})})}function wne(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function v3({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return f.jsx("span",{className:me("inline-block h-2 w-2 rounded-full shrink-0",t)})}function Sne(e){switch(e){case"connected":return"Connected";case"failed":return"Failed";case"needs-auth":return"Needs auth";case"pending":return"Connecting...";case"disabled":return"Disabled";default:return e}}function YR({server:e}){const[t,n]=b.useState(!1),r=e.status==="connected";return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("button",{onClick:()=>r&&e.tools.length>0&&n(!t),className:me("flex items-center gap-1.5",r&&e.tools.length>0&&"cursor-pointer hover:opacity-60 transition-opacity"),children:[r&&e.tools.length>0&&f.jsx(Or,{className:me("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),f.jsx(v3,{status:e.status}),f.jsx("span",{className:"text-muted-foreground font-medium",children:Z_(e.name)}),r?f.jsxs("span",{className:"text-muted-foreground/50",children:[e.tools.length," tools"]}):f.jsx("span",{className:"text-muted-foreground/50",children:Sne(e.status)})]}),!r&&e.error&&f.jsx("span",{className:"text-destructive ml-5",children:e.error}),t&&e.tools.length>0&&f.jsx("div",{className:"flex flex-wrap gap-1.5 ml-5",children:e.tools.map(s=>f.jsx(ij,{icon:rj(`mcp__${e.name}__${s}`),children:s},s))})]})}function Cne({servers:e}){if(e.length===0)return null;const t=e.filter(s=>s.status==="connected"),n=e.filter(s=>s.status!=="connected"),r=n.length>0?f.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[f.jsx(v3,{status:"failed"}),f.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return f.jsx(g3,{title:"MCP Servers",count:e.length,badge:r,children:f.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(s=>f.jsx(YR,{server:s},s.name)),n.map(s=>f.jsx(YR,{server:s},s.name))]})})}function kne({rawJson:e}){const[t,n]=b.useState(!1);return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[f.jsx(Or,{className:me("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),f.jsx("span",{className:"text-muted-foreground font-medium",children:"Raw Message"})]}),t&&f.jsx("pre",{className:"ml-5 text-xs whitespace-pre-wrap break-all border border-border rounded-md p-3 overflow-x-auto max-h-96 overflow-y-auto",children:e})]})}function Ene({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=b.useMemo(()=>{const s=new Map,o=[];for(const u of e.tools){const h=wne(u);if(h){const d=s.get(h.server)||[];d.push(h.tool),s.set(h.server,d)}else o.push(u)}const l=e.mcpServers.map(u=>({name:u.name,status:u.status,error:u.error,tools:s.get(u.name)||[]}));return{coreTools:o,mcpServersWithTools:l}},[e.tools,e.mcpServers]);return f.jsx(po,{children:f.jsxs(rh,{expandedContent:f.jsx(ih,{className:"my-4 text-xs",children:f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx(QG,{children:e.model}),f.jsx(R_,{title:"Tools",items:n,getIcon:s=>ex[s]??nj}),f.jsx(R_,{title:"Agents",items:e.agents,icon:Ox}),f.jsx(R_,{title:"Commands",items:e.slashCommands,icon:r8}),f.jsx(Cne,{servers:r}),t&&f.jsx(kne,{rawJson:t})]})}),children:[f.jsx(AI,{className:"h-5 w-5 text-logo"}),f.jsx(ao,{children:"Session Started"})]})})}function Rne({message:e}){return f.jsx(po,{className:"hidden",children:f.jsxs(rh,{expandedContent:f.jsx(ih,{className:"my-4 text-xs",children:f.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto",children:JSON.stringify(e.accountInfo,null,2)})}),children:[f.jsx("div",{className:"size-5 flex justify-center items-center ",children:f.jsx(Ox,{className:"h-4 w-4 text-muted-foreground"})}),f.jsx(ao,{children:"Account"})]})})}function Tne({message:e}){return f.jsx("div",{className:"text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-full space-y-4",children:f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:e.text})})}function Nne({message:e}){return f.jsx(po,{className:"w-full",children:f.jsxs(rh,{expandedContent:f.jsx(ih,{className:"my-4 text-sm text-muted-foreground/90",children:f.jsx("div",{className:"text-pretty prose prose-sm max-w-full px-0.5 opacity-90 dark:prose-invert",children:f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:e.text})})}),children:[f.jsx(ai,{className:"h-4 w-4 text-muted-icon"}),f.jsx(ao,{className:"text-left text-muted-foreground",children:"Thinking"})]})})}function Mne({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:s}){const o=r&&t>0;return f.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[f.jsxs("div",{className:"relative",children:[f.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border text-foreground flex flex-row items-center gap-2",children:[o?f.jsx("button",{onClick:r,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:f.jsx(RN,{className:"h-4 w-4 -ml-0.5",strokeWidth:3})}):n>1?f.jsxs("span",{className:"font-bold text-muted-foreground whitespace-nowrap",children:[t+1," of ",n]}):null,e]}),n>1&&f.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-border",children:f.jsx("div",{className:"h-full bg-muted-foreground/40 transition-all duration-300",style:{width:`${t/n*100}%`}})})]}),s]})}function XR({label:e,description:t}){return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-foreground text-sm",children:e}),t&&f.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]})}function b3({selected:e,multiSelect:t,onClick:n}){return f.jsx("button",{type:"button",onClick:n,className:me("flex-shrink-0 w-5 h-5 border-1 flex items-center justify-center",t?"rounded":"rounded-full",e?"border-slate-500/0 bg-foreground":"border-muted-foreground/50 bg-background",n&&e&&"cursor-pointer"),children:e&&f.jsx(Xi,{strokeWidth:3,className:"translate-y-[0.5px] h-3 w-3 text-white dark:text-background"})})}function Ane({option:e,selected:t,multiSelect:n,onClick:r,isLast:s}){const o="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",l=s?"":"border-b border-border";return r?f.jsx("button",{onClick:r,className:me(o,l,"transition-all cursor-pointer"),children:f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("div",{className:"flex-1 min-w-0",children:f.jsx(XR,{label:e.label,description:e.description})}),f.jsx(b3,{selected:t,multiSelect:n})]})}):f.jsx("div",{className:me(o,l),children:f.jsx(XR,{label:e.label,description:e.description})})}function Dne(e){return e==null?void 0:e.answers}function $i(e){return e.id||e.question}function jne({message:e,onSubmit:t,isLatest:n}){var O,$;const r=e.input.questions,s=!!e.result,o=Dne(e.result),l=((O=e.result)==null?void 0:O.discarded)===!0,[u,h]=b.useState(0),[d,g]=b.useState({}),[p,v]=b.useState({}),[y,w]=b.useState(o??null),[S,C]=b.useState(s),k=(U,X)=>{var ie;const M=(ie=p[U])==null?void 0:ie.trim(),P=d[U]||"",Z=X||r.find(J=>$i(J)===U);if(Z!=null&&Z.multiSelect)return[P,M].filter(Boolean).flatMap(J=>J.split(", ").filter(Boolean));const A=M||P;return A?[A]:[]},R=U=>{const X=d[$i(U)]||"";return U.multiSelect?X.split(", ").filter(Boolean):[X]},E=(U,X)=>{const M=$i(U);if(U.multiSelect){const P=d[M]?d[M].split(", ").filter(Boolean):[],Z=P.includes(X)?P.filter(A=>A!==X):[...P,X];g({...d,[M]:Z.join(", ")})}else g({...d,[M]:X}),v({...p,[M]:""}),u<r.length-1&&setTimeout(()=>h(u+1),150)},N=(U,X)=>{const M=$i(U);v({...p,[M]:X}),X&&!U.multiSelect&&g({...d,[M]:""})},L=U=>{const X=$i(U);U.multiSelect&&p[X]&&v({...p,[X]:""})},D=r.every(U=>k($i(U),U).length>0),j=r[u],H=u===r.length-1,G=j&&k($i(j),j).length>0,B=()=>{u<r.length-1&&h(u+1)},q=()=>{u>0&&h(u-1)},I=()=>{if(!D)return;const U={};for(const X of r){const M=$i(X);U[M]=k(M,X)}w(U),C(!0),t(e.toolId,r,U)},V=U=>{if(U.key==="Enter"&&!(!j||!G)){if(U.preventDefault(),H){I();return}B()}};if(S||s){const U=o||y||{};return f.jsx("div",{className:"w-full",children:f.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[f.jsxs("div",{className:"font-medium text-sm p-3 px-4 pr-5 bg-muted border-b border-border flex flex-row items-center justify-between",children:[f.jsxs("p",{children:["Question",r.length!==1?"s":""]}),f.jsx("p",{className:"",children:l?"Discarded":"Answers"})]}),r.map((X,M)=>{const P=U[$i(X)]||U[X.question]||[],Z=M===r.length-1;return f.jsxs("div",{className:me("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!Z&&"border-b border-border"),children:[f.jsx("div",{className:"text-sm text-pretty",children:X.question}),P.length>0&&f.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:P.join(", ")}),P.length===0&&f.jsx("div",{className:"text-sm font-medium text-right italic",children:l?"Discarded":"No Response"})]},$i(X))})]})})}if(!n)return f.jsx("div",{className:"w-full py-2",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(AN,{className:"h-4 w-4 text-muted-foreground"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!j)return null;const F=R(j),W=p[$i(j)]||"";return f.jsxs("div",{className:"w-full space-y-3",children:[f.jsxs(Mne,{question:j.question,currentIndex:u,totalQuestions:r.length,onBack:u>0?q:void 0,children:[($=j.options)==null?void 0:$.map(U=>f.jsx(Ane,{option:U,selected:F.includes(U.label),multiSelect:j.multiSelect,onClick:()=>E(j,U.label)},U.label)),f.jsx("div",{className:"transition-all bg-background",children:f.jsxs("div",{className:"flex pr-5 items-center justify-between gap-3",children:[f.jsx("input",{type:"text",value:W,onChange:U=>N(j,U.target.value),onKeyDown:V,placeholder:"Other...",className:"flex-1 px-3 !py-1 pl-4 min-h-[55px] min-w-0 text-base md:text-sm bg-transparent outline-none text-foreground placeholder:text-muted-foreground"}),f.jsx(b3,{selected:!!W,multiSelect:j.multiSelect,onClick:j.multiSelect&&W?()=>L(j):void 0})]})})]}),f.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!H&&G&&(j.multiSelect||!!W)&&f.jsx(Xe,{size:"sm",onClick:B,children:"Next"}),H&&f.jsx(Xe,{size:"sm",onClick:I,disabled:!D,className:me(!D&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}async function One(e){const t=await new Promise((n,r)=>{const s=new FileReader;s.onload=()=>{if(typeof s.result=="string"){n(s.result);return}r(new Error("Failed to read image attachment"))},s.onerror=()=>r(s.error??new Error("Failed to read image attachment")),s.readAsDataURL(e)});return{type:"image",name:e.name,mimeType:e.type,sizeBytes:e.size,dataUrl:t}}function Lne({message:e,onConfirm:t,isLatest:n,isActionable:r=n}){const s=!!e.result,[o,l]=b.useState(!1),[u,h]=b.useState(!1),[d,g]=b.useState(!1),[p,v]=b.useState(""),[y,w]=b.useState([]),[S,C]=b.useState(null),[k,R]=b.useState(!1),[E,N]=b.useState(!1),L=b.useRef(null),D=b.useRef(null),j=e.input;b.useEffect(()=>{d&&L.current&&L.current.focus()},[d]),b.useEffect(()=>()=>{for(const F of y)URL.revokeObjectURL(F.previewUrl)},[y]);const H=async()=>{j!=null&&j.plan&&(await navigator.clipboard.writeText(j.plan),h(!0),setTimeout(()=>h(!1),2e3))},G=b.useCallback(F=>{const W=F.filter(O=>O.type.startsWith("image/"));if(W.length===0){C("Only PNG, JPEG, WEBP, and GIF images are supported.");return}w(O=>{const $=[...O];let U=null;for(const X of W){if(!Pm.includes(X.type)){U=`Unsupported image type: ${X.type||"unknown"}`;continue}if(X.size<=0||X.size>SM){U=`${X.name} is empty or larger than 10 MB.`;continue}if($.length>=zm){U=`You can attach up to ${zm} images per message.`;break}$.push({id:sd(),file:X,name:X.name||"image",mimeType:X.type,sizeBytes:X.size,previewUrl:URL.createObjectURL(X)})}return C(U),$})},[]),B=b.useCallback(F=>{w(W=>{const O=W.find($=>$.id===F);return O&&URL.revokeObjectURL(O.previewUrl),W.filter($=>$.id!==F)}),C(null)},[]),q=async()=>{if(!(!p.trim()&&y.length===0)){N(!0);try{const F=y.length?await Promise.all(y.map(W=>One(W.file))):void 0;t(e.toolId,!1,void 0,p.trim(),F)}finally{N(!1)}}},I=s?e.result:null,V=(I==null?void 0:I.discarded)===!0;return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"relative rounded-2xl border border-border overflow-hidden group/plan",children:[(j==null?void 0:j.plan)&&f.jsx(Xe,{variant:"ghost",size:"icon",className:me("absolute top-2 right-2 z-10 h-8 w-8 rounded-md text-muted-foreground opacity-0 group-hover/plan:opacity-100 transition-opacity",!u&&"hover:text-foreground",u&&"hover:!bg-transparent hover:!border-transparent"),onClick:H,children:u?f.jsx(Xi,{className:"h-4 w-4 text-green-400"}):f.jsx(Id,{className:"h-4 w-4"})}),f.jsxs("div",{className:me("!pt-5 !pb-0 px-4 md:py-4.5 md:px-5.5 bg-muted dark:bg-card overflow-scroll no-pre-highlight transition-all",s&&!o?"max-h-[min(400px,40vh)] ":"",s?"hover:!pb-[32px]":""),children:[s&&f.jsxs(Xe,{variant:"ghost",className:"absolute z-10 bottom-2 pr-2.5 !pl-3.5 h-[34px] inline-flex gap-1 text-sm left-[50%] -translate-x-[50%] text-muted-foreground backdrop-blur-sm hover:text-foreground opacity-0 group-hover/plan:opacity-100 transition-all rounded-full border border-border",onClick:()=>l(!o),children:[o?"Show Less":"Show More",f.jsx(bp,{className:`size-3.5 transition-transform ${o?"rotate-180":""}`})]}),j!=null&&j.plan?f.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:j.plan}),f.jsx("div",{className:"mt-5"})]}):f.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),s?f.jsx("div",{className:"flex justify-end mx-2",children:f.jsxs("span",{className:"pl-4 inline text-sm font-medium bg-background text-foreground/60 border border-border py-1.5 px-3 rounded-[20px] leading-relaxed max-w-[85%] sm:max-w-[80%]",children:[f.jsx("em",{children:V?"Discarded":I!=null&&I.clearContext?"Approved & Cleared Context":I!=null&&I.confirmed?"Approved":I!=null&&I.message?`Adjusted: "${I.message}"`:"Adjusted Plan"}),f.jsx(r6,{className:"inline h-4 w-4 ml-1.5 -mt-0.5"})]})}):n?r?f.jsxs("div",{className:"flex flex-col gap-3",children:[!d&&f.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2 mx-2",children:[f.jsxs(Xe,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-primary-foreground pr-4 md:order-last",children:[f.jsx(OI,{className:"h-4 w-4 mr-1.5"}),"Approve & Clear"]}),f.jsxs("div",{className:"flex items-stretch md:items-center gap-2 md:contents",children:[f.jsxs(Xe,{size:"sm",variant:"outline",onClick:()=>g(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[f.jsx(pc,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),f.jsxs(Xe,{size:"sm",variant:"outline",onClick:()=>t(e.toolId,!0),className:"rounded-full border-border flex-1 md:flex-initial",children:[f.jsx(Xi,{className:"h-4 w-4 mr-1.5"}),"Approve"]})]})]}),d&&f.jsxs("div",{className:me("flex flex-col gap-2 rounded-2xl border bg-muted dark:bg-card px-4 py-3 transition-colors",k?"border-foreground/40 bg-muted/80":"border-border"),onDragEnter:F=>{F.dataTransfer.types.includes("Files")&&(F.preventDefault(),R(!0))},onDragOver:F=>{F.dataTransfer.types.includes("Files")&&(F.preventDefault(),F.dataTransfer.dropEffect="copy",R(!0))},onDragLeave:F=>{if(!F.dataTransfer.types.includes("Files"))return;F.preventDefault();const W=F.relatedTarget;W instanceof Node&&F.currentTarget.contains(W)||R(!1)},onDrop:F=>{var W;F.dataTransfer.types.includes("Files")&&(F.preventDefault(),R(!1),G(Array.from(F.dataTransfer.files)),(W=L.current)==null||W.focus())},children:[f.jsx("input",{ref:D,type:"file",accept:Pm.join(","),multiple:!0,className:"hidden",onChange:F=>{G(Array.from(F.target.files??[])),F.target.value=""}}),y.length?f.jsx("div",{className:"grid grid-cols-2 gap-2 pt-1 pb-2 sm:grid-cols-3",children:y.map(F=>f.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border/80 bg-background/80",children:[f.jsx("img",{src:F.previewUrl,alt:F.name,className:"h-28 w-full object-cover"}),f.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 px-2 py-1.5",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate text-xs text-foreground",children:F.name}),f.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[Math.max(1,Math.round(F.sizeBytes/1024))," KB"]})]}),f.jsx(Xe,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>B(F.id),disabled:E,children:f.jsx(ro,{className:"h-3.5 w-3.5"})})]})]},F.id))}):null,f.jsx("textarea",{ref:L,value:p,onChange:F=>v(F.target.value),onPaste:F=>{const W=Array.from(F.clipboardData.files);W.some(O=>O.type.startsWith("image/"))&&(F.preventDefault(),G(W))},onKeyDown:F=>{F.key==="Enter"&&!F.shiftKey&&(p.trim()||y.length>0)&&(F.preventDefault(),q()),F.key==="Escape"&&(g(!1),v(""),w([]),C(null))},placeholder:"Describe what you'd like to change...",rows:3,className:"w-full bg-transparent text-[16px] md:text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none"}),S?f.jsx("div",{className:"text-xs text-destructive",children:S}):null,f.jsxs("div",{className:"flex items-center justify-between mt-1",children:[f.jsx(Xe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-full text-muted-foreground hover:text-foreground",onClick:()=>{var F;return(F=D.current)==null?void 0:F.click()},disabled:E,children:f.jsx(ON,{className:"h-4 w-4"})}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Xe,{size:"sm",variant:"ghost",onClick:()=>{g(!1),v(""),w([]),C(null)},className:"rounded-full text-muted-foreground",disabled:E,children:"Cancel"}),f.jsxs(Xe,{size:"sm",disabled:!p.trim()&&y.length===0||E,onClick:()=>void q(),className:"rounded-full bg-primary text-primary-foreground disabled:opacity-50 disabled:pointer-events-none",children:[f.jsx(Z6,{className:"h-4 w-4 mr-1.5"}),E?"Adjusting...":"Adjust Plan"]})]})]})]})]}):f.jsx("div",{className:"flex justify-end mx-2",children:f.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending"})}):f.jsx("div",{className:"flex justify-end mx-2",children:f.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending (newer prompt active)"})})]})}const zne={completed:{Icon:Xi,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:kr,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:GI,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function Pne({message:e}){const t=e.input.todos;return t.length?f.jsx("div",{className:"w-full",children:f.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[f.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border flex items-center gap-2",children:[f.jsx(N6,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),f.jsx("div",{children:t.map((n,r)=>{const s=r===t.length-1,{Icon:o,iconClass:l,textClass:u}=zne[n.status];return f.jsxs("div",{className:me("flex items-center gap-3 px-4 py-2.5 bg-background",!s&&"border-b border-border"),children:[f.jsx(o,{className:me("h-4 w-4 flex-shrink-0",l)}),f.jsx("span",{className:me("text-sm",u),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function Bne(e){const t=e.split(`
|
|
626
|
+
`),n=/^\s*(\d+)→(.*)$/;return t.map(r=>{const s=r.match(n);return s?{lineNumber:parseInt(s[1],10),content:s[2]}:{lineNumber:null,content:r}})}function Ine(e){return e.replace(/<[^>]+>/g,"")}function Fne(e,t){const n=e.split(`
|
|
627
|
+
`),r=t.split(`
|
|
628
|
+
`),s=Hne(n,r),o=Une(n,r,s);return $ne(o)}function Hne(e,t){const n=e.length,r=t.length,s=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let o=1;o<=n;o++)for(let l=1;l<=r;l++)s[o][l]=e[o-1]===t[l-1]?s[o-1][l-1]+1:Math.max(s[o-1][l],s[o][l-1]);return s}function Une(e,t,n){const r=[];let s=e.length,o=t.length;for(;s>0||o>0;)s>0&&o>0&&e[s-1]===t[o-1]?(r.push({type:"context",text:e[s-1],oldIdx:s,newIdx:o}),s--,o--):o>0&&(s===0||n[s][o-1]>=n[s-1][o])?(r.push({type:"added",text:t[o-1],oldIdx:s,newIdx:o}),o--):(r.push({type:"removed",text:e[s-1],oldIdx:s,newIdx:o}),s--);return r.reverse()}function $ne(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function T_({content:e,isDiff:t=!1,oldString:n,newString:r}){const s=b.useMemo(()=>t&&n!==void 0&&r!==void 0?Fne(n,r):[],[t,n,r]),o=b.useMemo(()=>t?[]:Bne(e),[e,t]),l=b.useMemo(()=>o.some(u=>u.lineNumber!==null),[o]);return t&&s.length>0?f.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:f.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:f.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:f.jsx("tbody",{children:s.map((u,h)=>{const d=u.type==="removed"?"bg-red-500/10 dark:bg-red-500/15":u.type==="added"?"bg-green-500/10 dark:bg-green-500/15":"",g=u.type==="removed"?"text-red-700 dark:text-red-400":u.type==="added"?"text-green-700 dark:text-green-400":"text-foreground";return f.jsxs("tr",{className:d,children:[f.jsx("td",{className:`px-2 py-0 select-none w-0 whitespace-nowrap ${u.type==="removed"?"text-red-500/50":u.type==="added"?"text-green-500/50":"text-muted-foreground/50"}`,children:u.type==="removed"?"-":u.type==="added"?"+":" "}),f.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${g}`,children:u.content.slice(1)})]},h)})})})})}):f.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:f.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:f.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:f.jsx("tbody",{children:o.map((u,h)=>f.jsxs("tr",{children:[l&&f.jsx("td",{className:"px-2 py-0 select-none w-0 whitespace-nowrap text-muted-foreground/50 text-right",children:u.lineNumber!==null?u.lineNumber:""}),f.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:Ine(u.content)})]},h))})})})})}function _3({message:e,isLoading:t=!1,localPath:n}){var k;const r=e.result!==void 0,s=!r&&t,o=b.useMemo(()=>{if(typeof e.result=="string")return e.result;if(!e.result)return"";if(typeof e.result=="object"&&e.result!==null&&"content"in e.result){const R=e.result.content;if(typeof R=="string")return R}return JSON.stringify(e.result,null,2)},[e.result]),l=b.useMemo(()=>{if((e.toolKind==="read_file"||e.toolKind==="write_file"||e.toolKind==="edit_file")&&e.input.filePath)return e.input.filePath;if(e.toolKind==="edit_file"){const R=o.match(/^Updated\s+(.+)$/m);if(R!=null&&R[1])return R[1].trim()}return""},[e.input,e.toolKind,o]),u=b.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill;if(e.toolKind==="glob")return`Search files ${e.input.pattern==="**/*"?"in all directories":`matching ${e.input.pattern}`}`;if(e.toolKind==="grep"){const R=e.input.pattern,E=e.input.outputMode;return E==="count"?`Count \`${R}\` occurrences`:E==="content"?`Find \`${R}\` in text`:`Find \`${R}\` in files`}return e.toolKind==="bash"?e.input.description||(e.input.command?J7(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?l?`Read ${i_(l,n)}`:"Read file":e.toolKind==="write_file"?l?`Write ${i_(l,n)}`:"Write file":e.toolKind==="edit_file"?l?`Edit ${i_(l,n)}`:"Edit file":e.toolKind==="mcp_generic"?`${Z_(e.input.tool)} from ${Z_(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[l,e.input,e.toolKind,e.toolName,n]),h=b.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),d=b.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),g=e.toolKind==="bash",p=e.toolKind==="write_file",v=e.toolKind==="edit_file",y=e.toolKind==="read_file",w=y&&!!o.trim(),S=v&&(!!e.input.oldString.trim()||!!e.input.newString.trim()),C=b.useMemo(()=>{switch(e.toolKind){case"bash":return e.input.command;case"write_file":return e.input.content;default:return JSON.stringify(e.input,null,2)}},[e]);return f.jsx(po,{className:"w-full",children:f.jsxs(rh,{expandedContent:f.jsx(ih,{className:"my-4 text-sm",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[v?S?f.jsx(T_,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):o.trim()?f.jsx(s_,{label:e.isError?"Error":"Result",copyText:o,children:o}):f.jsx("div",{className:"text-muted-foreground text-xs",children:"Cursor completed this edit, but ACP did not include the file diff details."}):!y&&!p&&f.jsx(s_,{label:g?f.jsxs("span",{className:"flex items-center gap-2 w-full",children:[f.jsx("span",{children:"Command"}),!!e.input.timeoutMs&&f.jsxs("span",{className:"text-muted-foreground",children:["timeout: ",String(e.input.timeoutMs),"ms"]}),!!e.input.runInBackground&&f.jsx("span",{className:"text-muted-foreground",children:"background"})]}):p?"Contents":"Input",copyText:C,children:C}),r&&y&&!e.isError&&(w?f.jsx(T_,{content:o}):f.jsx("div",{className:"text-muted-foreground text-xs",children:"Cursor completed this read, but ACP did not include the file contents."})),p&&!e.isError&&f.jsx(T_,{content:e.input.content}),r&&!y&&!(p&&!e.isError)&&!(v&&!e.isError)&&f.jsx(s_,{label:e.isError?"Error":"Result",copyText:o,children:o})]})}),children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:(()=>{if(e.isError)return f.jsx(ro,{className:"size-4 text-destructive"});if(h)return f.jsx(Ox,{className:"size-4 text-muted-icon"});const R=rj(e.toolName);return f.jsx(R,{className:"size-4 text-muted-icon"})})()}),f.jsx(ao,{className:"text-left transition-opacity duration-200 truncate",children:f.jsx(Op,{animate:s,shimmerWidth:Math.max(20,(((k=d||u)==null?void 0:k.length)??33)*3),children:d||u})})]})})}function Wne({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),s=Math.floor(r/3600),o=Math.floor(r%3600/60),l=r%60;return s>0?`${s}h${o>0?` ${o}m`:""}`:o>0?`${o}m${l>0?` ${l}s`:""}`:`${l}s`};return e.success?f.jsxs(po,{className:`px-0.5 text-xs tracking-wide ${e.durationMs>6e4?"":"hidden"}`,children:[f.jsx("div",{className:"w-full h-[1px] bg-border"}),f.jsxs(ao,{className:"whitespace-nowrap text-[11px] tracking-widest text-muted-foreground/60 uppercase flex-shrink-0",children:["Worked for ",t(e.durationMs)]}),f.jsx("div",{className:"w-full h-[1px] bg-border"})]}):f.jsx("div",{className:"px-4 py-3 mx-2 my-1 rounded-lg bg-destructive/10 border border-destructive/20 text-destructive text-sm",children:e.result||"An unknown error occurred."})}function Vne({message:e}){return f.jsx("div",{className:"flex items-center justify-end gap-2 text-sm text-muted-foreground my-3",children:f.jsxs("div",{className:"inline-flex gap-1.5 items-center justify-center whitespace-nowrap text-sm font-medium bg-background text-foreground/60 border border-border h-9 pl-1 pr-4 rounded-full",children:[f.jsx(qI,{className:"h-4 w-4 ml-1.5"}),f.jsx("em",{children:"Interrupted"})]})})}function lp({size:e=4}){return f.jsxs("svg",{className:"flex-1",viewBox:`0 0 100 ${e}`,preserveAspectRatio:"none",style:{height:`${e}px`},children:[f.jsx("pattern",{id:"zigzag",width:e,height:e,patternUnits:"userSpaceOnUse",children:f.jsx("path",{d:`M0 ${e} L${e/2} 0 L${e} ${e}`,fill:"none",stroke:"currentColor",strokeWidth:"0.5",className:"text-muted-foreground/30",style:{stroke:"currentColor"}})}),f.jsx("rect",{width:"100%",height:e,fill:"url(#zigzag)",className:"text-muted-foreground/30"})]})}function qne(){return f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(lp,{}),f.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),f.jsx(lp,{})]})}function Kne(){return f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(lp,{}),f.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),f.jsx(lp,{})]})}function Gne({message:e}){return f.jsx(po,{children:f.jsxs(rh,{expandedContent:f.jsx(ih,{className:"my-4 text-xs",children:f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(Ic,{remarkPlugins:[Fc],components:zc(),children:e.summary})})}),children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:f.jsx(DN,{className:"h-4.5 w-4.5 text-muted-foreground"})}),f.jsx(ao,{children:"Summarized"})]})})}const Yne={compacting:"Compacting..."};function Xne({message:e}){const t=Yne[e.status]||e.status;return f.jsxs(po,{className:"grid grid-cols-[auto_1fr] items-center gap-1.5 text-sm animate-pulse",children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:f.jsx(DN,{className:"h-4.5 w-4.5 text-muted-foreground"})}),f.jsx(ao,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const Zne={read_file:{key:"read",singular:"read",plural:"reads"},edit_file:{key:"edit",singular:"edit",plural:"edits"},write_file:{key:"write",singular:"write",plural:"writes"},bash:{key:"bash",singular:"command",plural:"commands"},grep:{key:"grep",singular:"search",plural:"searches"},glob:{key:"glob",singular:"glob",plural:"globs"},subagent_task:{key:"task",singular:"agent",plural:"agents"},web_search:{key:"websearch",singular:"web search",plural:"web searches"},skill:{key:"skill",singular:"skill",plural:"skills"},todo_write:{key:"todo",singular:"todo update",plural:"todo updates"}},Qne={key:"other",singular:"tool call",plural:"tool calls"};function Jne(e){return Zne[e]??Qne}function ere(e){const t=new Map,n=[];for(const r of e){const s=r.toolKind,o=Jne(s),l=t.get(o.key);l?l.count++:(t.set(o.key,{category:o,count:1}),n.push(o.key))}return n.map(r=>{const{category:s,count:o}=t.get(r);return`${o} ${o===1?s.singular:s.plural}`}).join(", ")}function tre({messages:e,isLoading:t,localPath:n}){const[r,s]=b.useState(!1),o=b.useMemo(()=>ere(e),[e]),u=e.some(h=>h.result===void 0)&&t;return f.jsx(po,{className:"w-full",children:f.jsxs("div",{className:"flex flex-col w-full",children:[f.jsx("button",{onClick:()=>s(!r),className:`group cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${!r&&!u?"hover:opacity-60 transition-opacity":""}`,children:f.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:f.jsx(Or,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),f.jsx(ao,{className:"text-left",children:f.jsx(Op,{animate:u,children:o})})]})}),r&&f.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(h=>f.jsx(_3,{message:h,isLoading:t,localPath:n},h.id)),e.length>5&&f.jsx("button",{onClick:()=>s(!1),className:"cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-xs hover:opacity-80 transition-opacity",children:f.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[f.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:f.jsx(Or,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),f.jsx(ao,{className:"text-left",children:"Collapse"})]})})]})]})})}const nre=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function ZR(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!nre.has(t)}function rre(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(ZR(r)){const s=[r],o=n;for(n+=1;n<e.length&&ZR(e[n]);)s.push(e[n]),n+=1;s.length>=2?t.push({type:"tool-group",messages:s,startIndex:o}):t.push({type:"single",message:r,index:o});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function ire({messages:e,isLoading:t,localPath:n,latestToolIds:r,onOpenLocalLink:s,onAskUserQuestionSubmit:o,onExitPlanModeConfirm:l,pendingTool:u}){const h=b.useMemo(()=>rre(e),[e]);function d(g,p){if(g.kind==="user_prompt")return f.jsx(yne,{content:g.content,attachments:g.attachments},g.id);switch(g.kind){case"unknown":return f.jsx(xne,{json:g.json},g.id);case"system_init":return e.findIndex(y=>y.kind==="system_init")===p?f.jsx(Ene,{message:g,rawJson:g.debugRaw},g.id):null;case"account_info":return e.findIndex(y=>y.kind==="account_info")===p?f.jsx(Rne,{message:g},g.id):null;case"assistant_text":return f.jsx(Tne,{message:g},g.id);case"assistant_thought":return f.jsx(Nne,{message:g},g.id);case"tool":return g.toolKind==="ask_user_question"?f.jsx(jne,{message:g,onSubmit:o,isLatest:g.id===r.AskUserQuestion},g.id):g.toolKind==="exit_plan_mode"?f.jsx(Lne,{message:g,onConfirm:l,isLatest:g.id===r.ExitPlanMode,isActionable:(u==null?void 0:u.toolKind)==="exit_plan_mode"&&u.toolUseId===g.toolId},g.id):g.toolKind==="todo_write"?g.id!==r.TodoWrite?null:f.jsx(Pne,{message:g},g.id):f.jsx(_3,{message:g,isLoading:t,localPath:n},g.id);case"result":{const v=e[p+1],y=e[p-1];return(v==null?void 0:v.kind)==="context_cleared"||(y==null?void 0:y.kind)==="context_cleared"?null:f.jsx(Wne,{message:g},g.id)}case"interrupted":return f.jsx(Vne,{message:g},g.id);case"compact_boundary":return f.jsx(qne,{},g.id);case"context_cleared":return f.jsx(Kne,{},g.id);case"compact_summary":return f.jsx(Gne,{message:g},g.id);case"status":return p===e.length-1?f.jsx(Xne,{message:g},g.id):null}}return f.jsx(XG,{onOpenLocalLink:s,children:h.map(g=>{if(g.type==="tool-group")return f.jsx("div",{className:"group relative",[Mm]:"",children:f.jsx(tre,{messages:g.messages,isLoading:t,localPath:n})},`group-${g.startIndex}`);const p=d(g.message,g.index);return p?f.jsx("div",{id:`msg-${g.message.id}`,className:"group relative",[Mm]:"",children:p},g.message.id):null})})}function sre({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){b.useEffect(()=>{if(!n)return;let s=0,o=null;const l=p=>{const v=p instanceof Element?p:null,y=e.current,w=t.current;if($k({trigger:"pointer",activeElement:document.activeElement,pointerStartTarget:o,pointerEndTarget:v,root:y,fallback:w,hasActiveOverlay:Uk(document),hasActiveSelection:y8(window.getSelection())})!=="restore"){o=null;return}w==null||w.focus({preventScroll:!0}),o=null},u=p=>{cancelAnimationFrame(s),o=p.target instanceof Element?p.target:null},h=p=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{l(p.target)})},d=()=>{o=null;const p=t.current;!p||p.disabled||p.focus({preventScroll:!0})},g=p=>{if(p.key!=="Escape")return;const v=t.current;$k({trigger:"escape",activeElement:document.activeElement,fallback:v,hasActiveOverlay:Uk(document),canCancel:r,defaultPrevented:p.defaultPrevented})==="escape-focus"&&(p.preventDefault(),v==null||v.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",u,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("keydown",g,!0),window.addEventListener(Nm,d),()=>{cancelAnimationFrame(s),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("keydown",g,!0),window.removeEventListener(Nm,d)}},[r,n,t,e])}const im="How can I help you?",ore=19,are=72,lre=120;function cre(){var Ae,Ke,yt,xt,fe,Ie,De,lt,st,nt,rn;const e=hp(),t=b.useRef(null),n=b.useRef(null),r=b.useRef(null),[s,o]=b.useState(""),[l,u]=b.useState(!1),[h,d]=b.useState(0),g=Qd("(min-width: 768px)"),p=typeof window>"u"?!0:sj(window.location.hostname),v=((Ae=e.runtime)==null?void 0:Ae.projectId)??null,w=Yo(Ce=>v?Ce.projects[v]:void 0)??cY,C=md(Ce=>v?Ce.projects[v]:void 0)??iY,k=Yo(Ce=>Ce.addTerminal),R=Yo(Ce=>Ce.removeTerminal),E=Yo(Ce=>Ce.toggleVisibility),N=Yo(Ce=>Ce.resetMainSizes),L=Yo(Ce=>Ce.setMainSizes),D=Yo(Ce=>Ce.setTerminalSizes),j=md(Ce=>Ce.toggleVisibility),H=md(Ce=>Ce.setSize),G=Ri(Ce=>Ce.scrollbackLines),B=Ri(Ce=>Ce.minColumnWidth),q=e.keybindings,I=b.useMemo(()=>S0(q),[q]),V=w.terminals.length>0,F=!!(v&&w.isVisible&&V),W=!!(v&&V),O=!!(v&&C.isVisible),$=!!(v&&!g&&O),U=!!(v&&g),{isAnimating:X,mainPanelGroupRef:M,terminalFocusRequestVersion:P,terminalPanelRef:Z,terminalVisualRef:A}=CY({showTerminalPane:F,shouldRenderTerminalLayout:W,projectId:v,terminalLayout:w,chatInputRef:r}),{isAnimating:ie,panelGroupRef:J,sidebarPanelRef:ee,sidebarVisualRef:re}=xY({projectId:v,shouldRenderRightSidebarLayout:U,showRightSidebar:O,rightSidebarSize:C.size});sre({rootRef:n,fallbackRef:r,enabled:e.hasSelectedProject&&((Ke=e.runtime)==null?void 0:Ke.status)!=="waiting_for_user",canCancel:e.canCancel});const ce=()=>{if(v){if(V){E(v);return}k(v)}},he=Ce=>{var Te;if(!v||!F||X.current)return;const Ze=Ce.chat,oe=Ce.terminal;if(!Number.isFinite(Ze)||!Number.isFinite(oe))return;const ve=((Te=t.current)==null?void 0:Te.getBoundingClientRect().height)??0;if(fY(ve,oe)){N(v),E(v);return}L(v,[Ze,oe])};b.useEffect(()=>{if(e.messages.length!==0)return;o(""),u(!1);let Ce=0;const Ze=window.setInterval(()=>{Ce+=1,o(im.slice(0,Ce)),Ce>=im.length&&(window.clearInterval(Ze),u(!0))},ore);return()=>window.clearInterval(Ze)},[e.activeChatId,e.messages.length]),b.useEffect(()=>{function Ce(Ze){if(v){if(Ia(I,"toggleEmbeddedTerminal",Ze)){Ze.preventDefault(),ce();return}if(Ia(I,"toggleRightSidebar",Ze)){Ze.preventDefault(),j(v);return}if(Ia(I,"openInFinder",Ze)){if(!p)return;Ze.preventDefault(),e.handleOpenExternal("open_finder");return}if(Ia(I,"openInEditor",Ze)){if(!p)return;Ze.preventDefault(),e.handleOpenExternal("open_editor");return}Ia(I,"addSplitTerminal",Ze)&&(Ze.preventDefault(),k(v))}}return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[k,p,ce,v,I,j]),b.useEffect(()=>{const Ce=window.requestAnimationFrame(()=>{e.updateScrollState()}),Ze=window.setTimeout(()=>{e.updateScrollState()},ac);return()=>{window.cancelAnimationFrame(Ce),window.clearTimeout(Ze)}},[W,F,e.updateScrollState]),b.useEffect(()=>{function Ce(){e.updateScrollState()}return window.addEventListener("resize",Ce),()=>window.removeEventListener("resize",Ce)},[e.updateScrollState]),b.useEffect(()=>{if(g)return;const Ce=window.visualViewport;if(!Ce)return;const Ze=()=>{const oe=e.scrollRef.current;if(!oe)return;const ve=oe.scrollHeight-oe.scrollTop-oe.clientHeight;if(uj(ve)){requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.scrollToBottom(),e.updateScrollState()})});return}const Te=document.activeElement;Te&&oe.contains(Te)&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{var Ct;const Me=(Ct=e.inputRef.current)==null?void 0:Ct.getBoundingClientRect(),Ge=Te.getBoundingClientRect();if(Me&&Ge.bottom>Me.top){const Je=Ge.bottom-Me.top;oe.scrollBy({top:Je+16,behavior:"auto"})}e.updateScrollState()})})};return Ce.addEventListener("resize",Ze),Ce.addEventListener("scroll",Ze),()=>{Ce.removeEventListener("resize",Ze),Ce.removeEventListener("scroll",Ze)}},[g,e.scrollRef,e.scrollToBottom,e.updateScrollState]),b.useEffect(()=>{const Ce=t.current;if(!Ce||!W)return;const Ze=()=>{const ve=Ce.getBoundingClientRect().height;if(ve<=0)return;const Te=ve*(w.mainSizes[1]/100);Te<=0||d(Me=>Math.abs(Me-Te)<1?Me:Te)},oe=new ResizeObserver(Ze);return oe.observe(Ce),Ze(),()=>oe.disconnect()},[v,W,w.mainSizes]);const pe=Ce=>Number.isFinite(Ce)?Math.min(tx,Math.max(Xp,Ce)):C.size,Se=()=>{v&&j(v)},Re=f.jsxs(C0,{ref:n,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",children:[f.jsxs(k0,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[f.jsx(FW,{sidebarCollapsed:e.sidebarCollapsed,hasCompletedChats:e.completedChatIds.size>0,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,usage:e.usage,localPath:e.navbarLocalPath,embeddedTerminalVisible:F,onToggleEmbeddedTerminal:v?ce:void 0,rightSidebarVisible:O,onToggleRightSidebar:v?()=>j(v):void 0,onOpenExternal:p?Ce=>{e.handleOpenExternal(Ce)}:void 0,editorLabel:e.editorLabel,projectId:v??void 0,socket:e.socket,finderShortcut:p?I.bindings.openInFinder:void 0,editorShortcut:p?I.bindings.openInEditor:void 0,terminalShortcut:I.bindings.toggleEmbeddedTerminal,rightSidebarShortcut:I.bindings.toggleRightSidebar}),f.jsxs(Yp,{ref:e.scrollRef,onScroll:e.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[(yt=e.runtime)!=null&&yt.inactiveProviderMessage?f.jsxs("div",{className:"mx-auto mt-[72px] max-w-[800px] rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-900 dark:text-amber-200",children:["This thread uses ",e.runtime.provider,", which is currently inactive. ",e.runtime.inactiveProviderMessage]}):null,e.messages.length===0?f.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"}):null,e.messages.length>0?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"animate-fade-in space-y-5 pt-[72px] max-w-[800px] mx-auto",children:[f.jsx(ire,{messages:e.messages,isLoading:e.isProcessing,localPath:(xt=e.runtime)==null?void 0:xt.localPath,latestToolIds:e.latestToolIds,pendingTool:((fe=e.runtime)==null?void 0:fe.pendingTool)??null,onOpenLocalLink:e.handleOpenLocalLink,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?f.jsx(tY,{status:(Ie=e.runtime)==null?void 0:Ie.status}):null,e.commandError?f.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3",children:e.commandError}):null]}),f.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"})]}):null]}),e.messages.length===0?f.jsx("div",{className:"pointer-events-none absolute inset-x-4 animate-fade-in",style:{top:are,bottom:e.transcriptPaddingBottom},children:f.jsx("div",{className:"mx-auto flex h-full max-w-[800px] items-center justify-center",children:f.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground gap-4 opacity-70",children:[f.jsx(od,{className:"size-8 text-muted-foreground kaizen-empty-state-flower"}),f.jsx("div",{className:"text-base font-normal text-muted-foreground text-center max-w-xs flex items-center kaizen-empty-state-text","aria-label":im,children:f.jsxs("span",{className:"relative inline-grid place-items-start",children:[f.jsxs("span",{className:"invisible col-start-1 row-start-1 whitespace-pre flex items-center",children:[f.jsx("span",{children:im}),f.jsx("span",{className:"kaizen-typewriter-cursor-slot","aria-hidden":"true"})]}),f.jsxs("span",{className:"col-start-1 row-start-1 whitespace-pre flex items-center",children:[f.jsx("span",{children:s}),f.jsx("span",{className:"kaizen-typewriter-cursor-slot","aria-hidden":"true",children:f.jsx("span",{className:"kaizen-typewriter-cursor","data-typing-complete":l?"true":"false"})})]})]})})]})})},e.activeChatId??"new-chat"):null,f.jsx("div",{style:{bottom:lre},className:me("absolute left-1/2 -translate-x-1/2 z-10 transition-all",e.showScrollButton?"scale-100 duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]":"scale-60 duration-300 ease-out pointer-events-none blur-sm opacity-0"),children:f.jsx("button",{onClick:e.scrollToBottom,className:"flex items-center transition-colors gap-1.5 px-2 bg-background/80 dark:bg-card/40 backdrop-blur-lg hover:bg-muted/80 border border-border rounded-full aspect-square cursor-pointer text-sm text-foreground/80 hover:text-foreground",children:f.jsx(SI,{className:"h-5 w-5"})})})]}),f.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-20 pointer-events-none",children:f.jsx("div",{className:"bg-gradient-to-t from-background via-background pointer-events-auto",ref:e.inputRef,children:f.jsx(LW,{ref:r,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((De=e.runtime)==null?void 0:De.status)==="waiting_for_user"||!!((lt=e.runtime)!=null&<.inactiveProviderMessage),canCancel:e.canCancel,chatId:e.activeChatId,activeProvider:((st=e.runtime)==null?void 0:st.provider)??null,activeModel:((nt=e.runtime)==null?void 0:nt.model)??null,activePlanMode:((rn=e.runtime)==null?void 0:rn.planMode)??!1,availableProviders:e.availableProviders,keybindings:I},e.activeChatId??"new-chat")})})]});return f.jsxs("div",{ref:t,className:"flex-1 flex flex-col min-w-0 relative",children:[U&&v?f.jsxs(dd,{groupRef:J,orientation:"horizontal",className:"flex-1 min-h-0",onLayoutChange:Ce=>{var oe;if(!O||ie.current)return;const Ze=pe(Ce.rightSidebar);Math.abs(Ze-Ce.rightSidebar)<.1||(oe=J.current)==null||oe.setLayout({workspace:100-Ze,rightSidebar:Ze})},onLayoutChanged:Ce=>{!O||ie.current||H(v,pe(Ce.rightSidebar))},children:[f.jsx(Js,{id:"workspace",defaultSize:`${100-C.size}%`,minSize:"50%",className:"min-h-0 min-w-0",children:W?f.jsxs(dd,{groupRef:M,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:he,children:[f.jsx(Js,{id:"chat",defaultSize:`${w.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:Re}),f.jsx(hd,{withHandle:!0,orientation:"vertical",disabled:!F,className:me(!F&&"pointer-events-none opacity-0")}),f.jsx(Js,{id:"terminal",defaultSize:`${w.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:Z,children:f.jsx("div",{ref:A,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":F?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${ac}ms`},children:f.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:f.jsx(XE,{projectId:v,layout:w,onAddTerminal:k,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:G,minColumnWidth:B,splitTerminalShortcut:I.bindings.addSplitTerminal,focusRequestVersion:P,onRemoveTerminal:(Ce,Ze)=>{e.socket.command({type:"terminal.close",terminalId:Ze}).catch(()=>{}),R(Ce,Ze)},onTerminalLayout:D})})})})]},v):Re}),f.jsx(hd,{withHandle:!0,orientation:"horizontal",disabled:!O,className:me(!O&&"pointer-events-none opacity-0")}),f.jsx(Js,{id:"rightSidebar",defaultSize:`${C.size}%`,maxSize:`${tx}%`,className:"min-h-0 min-w-0",elementRef:ee,children:f.jsx("div",{ref:re,className:"h-full min-h-0 overflow-hidden","data-right-sidebar-open":O?"true":"false","data-right-sidebar-animated":"false","data-right-sidebar-visual":!0,style:{"--terminal-toggle-duration":`${ac}ms`},children:f.jsx(L2,{onClose:()=>j(v)})})})]},`${v}-right-sidebar`):W&&v?f.jsxs(dd,{groupRef:M,orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:he,children:[f.jsx(Js,{id:"chat",defaultSize:`${w.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:Re}),f.jsx(hd,{withHandle:!0,orientation:"vertical",disabled:!F,className:me(!F&&"pointer-events-none opacity-0")}),f.jsx(Js,{id:"terminal",defaultSize:`${w.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",elementRef:Z,children:f.jsx("div",{ref:A,className:"h-full min-h-0 overflow-hidden relative","data-terminal-open":F?"true":"false","data-terminal-animated":"false","data-terminal-visual":!0,style:{"--terminal-toggle-duration":`${ac}ms`},children:f.jsx("div",{style:h>0?{height:`${h}px`}:void 0,children:f.jsx(XE,{projectId:v,layout:w,onAddTerminal:k,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:G,minColumnWidth:B,splitTerminalShortcut:I.bindings.addSplitTerminal,focusRequestVersion:P,onRemoveTerminal:(Ce,Ze)=>{e.socket.command({type:"terminal.close",terminalId:Ze}).catch(()=>{}),R(Ce,Ze)},onTerminalLayout:D})})})})]},v):Re,$?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 z-40 bg-black/40 md:hidden",onClick:Se}),f.jsx("div",{className:"fixed inset-0 z-50 flex flex-col bg-background/95 backdrop-blur-2xl md:hidden",children:f.jsx(L2,{onClose:Se,className:"h-[var(--app-shell-height)]"})})]}):null]})}const ure=700,dre=1500;function hre(){const e=rl(),t=hp(),n=t.featureOverviewSnapshot,r=Qd("(min-width: 768px)"),s=typeof window>"u"?!0:sj(window.location.hostname),[o,l]=b.useState("view"),[u,h]=b.useState(""),[d,g]=b.useState(!1),[p,v]=b.useState("idle"),[y,w]=b.useState(null),S=b.useRef(""),C=b.useRef(0);if(b.useEffect(()=>{n&&(S.current=n.content,h(n.content),g(!1),v("idle"),w(null))},[n==null?void 0:n.featureId]),b.useEffect(()=>{n&&(S.current=n.content,h(D=>d?D:n.content),d||(v("idle"),w(null)))},[d,n]),b.useEffect(()=>{if(!n||!d)return;const D=C.current+1;C.current=D,v("saving"),w(null);const j=window.setTimeout(()=>{t.socket.command({type:"feature.updateOverview",featureId:n.featureId,content:u}).then(H=>{C.current!==D||!H||(S.current=H.content,g(!1),v("saved"))}).catch(H=>{C.current===D&&(v("error"),w(H instanceof Error?H.message:String(H)))})},ure);return()=>window.clearTimeout(j)},[u,d,n==null?void 0:n.featureId,t.socket]),b.useEffect(()=>{if(p!=="saved")return;const D=window.setTimeout(()=>{v("idle")},dre);return()=>window.clearTimeout(D)},[p]),b.useEffect(()=>{r||o!=="split"||l("view")},[r,o]),!n)return f.jsx("div",{className:"flex flex-1 items-center justify-center",children:f.jsx("div",{className:"text-sm text-muted-foreground",children:t.sidebarReady?"Overview not found.":"Loading overview…"})});const k=o==="view"||o==="split",R=p==="saving"?"Saving…":p==="saved"?"Saved":p==="error"?"Save failed":"Ready",E=me("shrink-0 text-[11px] md:text-xs",p==="error"?"text-destructive":"text-muted-foreground"),N=f.jsx(Yp,{className:"h-full min-h-0",children:f.jsx("div",{className:"mx-auto max-w-4xl px-4 py-5",children:f.jsx("div",{className:"prose prose-slate max-w-none dark:prose-invert",children:f.jsx(Ic,{remarkPlugins:[Fc],components:zc({onOpenLocalLink:t.handleOpenLocalLink}),children:u})})})}),L=f.jsx("div",{className:"flex h-full min-h-0 flex-col",children:f.jsx("div",{className:"mx-auto flex h-full min-h-0 w-full max-w-4xl px-4 py-5",children:f.jsx(Hd,{value:u,onChange:D=>{const j=D.target.value;h(j),g(j!==S.current),p!=="saving"&&v("idle"),w(null)},spellCheck:!1,className:"h-full min-h-0 resize-none rounded-none border-0 bg-transparent px-0 py-0 font-mono text-base leading-7 focus-visible:ring-0 md:text-[13px] md:leading-6"})})});return f.jsx("div",{className:"flex flex-1 min-w-0 flex-col",children:f.jsx(C0,{className:"h-full rounded-none border-0 bg-background",children:f.jsxs(k0,{className:"flex h-full min-h-0 flex-col p-0",children:[f.jsxs("div",{className:"flex flex-col gap-3 border-b border-border px-4 py-3 md:flex-row md:items-center md:justify-between",children:[f.jsxs("div",{className:"flex min-w-0 items-start gap-2 md:flex-1",children:[f.jsx(Xe,{variant:"ghost",size:"icon",className:"mt-0.5 h-8 w-8 shrink-0 rounded-full",title:"Back",onClick:()=>{if(window.history.length>1){e(-1);return}e("/")},children:f.jsx(RI,{className:"size-4"})}),f.jsxs("div",{className:"min-w-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n.title}),r?null:f.jsx("div",{className:me(E,"text-right"),children:R})]}),f.jsx("div",{className:"truncate text-xs text-muted-foreground",children:n.overviewRelativePath})]})]}),f.jsxs("div",{className:"flex items-center gap-2 md:shrink-0 md:gap-3",children:[r?f.jsx("div",{className:E,children:R}):null,f.jsx("div",{className:"flex min-w-0 flex-1 items-center rounded-lg border border-border p-1 md:flex-none",children:(r?[{mode:"view",label:"View",icon:Pk},{mode:"edit",label:"Edit",icon:pc},{mode:"split",label:"Split",icon:R6}]:[{mode:"view",label:"View",icon:Pk},{mode:"edit",label:"Edit",icon:pc}]).map(({mode:D,label:j,icon:H})=>{const G=o===D;return f.jsxs("button",{type:"button",onClick:()=>l(D),className:me("inline-flex flex-1 items-center justify-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors md:flex-none",G?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),children:[f.jsx(H,{className:"size-4"}),f.jsx("span",{children:j})]},D)})}),s?f.jsxs(Xe,{variant:"outline",size:"sm",className:"shrink-0 px-2.5 md:px-3",title:`Open in ${t.editorLabel}`,onClick:()=>{t.handleOpenExternalPath("open_editor",n.localPath)},children:[f.jsx(a6,{className:"size-4"}),f.jsxs("span",{className:"hidden md:inline",children:["Open in ",t.editorLabel]})]}):null]})]}),y?f.jsx("div",{className:"border-b border-destructive/20 bg-destructive/5 px-4 py-2 text-sm text-destructive",children:y}):null,f.jsx("div",{className:"flex-1 min-h-0",children:r&&o==="split"?f.jsxs(dd,{orientation:"horizontal",className:"h-full",children:[f.jsx(Js,{defaultSize:"50%",minSize:"25%",className:"min-w-0",children:N}),f.jsx(hd,{orientation:"horizontal",withHandle:!0}),f.jsx(Js,{defaultSize:"50%",minSize:"25%",className:"min-w-0 border-l border-border/60",children:L})]}):k?N:L})]})})})}function QR({narrow:e=!1,title:t,subtitle:n,icon:r=jN}){return f.jsxs("div",{className:me("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[f.jsxs("div",{className:me("flex items-center gap-1 mb-2",e&&"justify-center"),children:[f.jsx("div",{className:"p-2 pl-0 rounded-lg",children:f.jsx(r,{className:"h-6 w-6 text-muted-foreground"})}),f.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t})]}),n&&f.jsx("p",{className:me("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const fre={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function mre({value:e,onValueChange:t,options:n,size:r="md",className:s,optionClassName:o}){return f.jsx("div",{className:me("inline-flex items-center rounded-lg border border-border p-[3px] ",s),children:n.map(l=>{const u=l.value===e,h=l.icon,d=h?b.isValidElement(h)?h:(()=>{const p=h;return f.jsx(p,{className:r==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,g=f.jsxs("button",{type:"button",onClick:()=>t(l.value),disabled:l.disabled,"aria-pressed":u,className:me("rounded-[4px] border transition-colors",h?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",fre[r],u?"bg-white dark:bg-muted text-slate-900 dark:text-slate-200 border-slate-300 dark:border-white/10 bg-slate-200 ":"border-transparent text-slate-800 hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",l.disabled&&"opacity-50 pointer-events-none",o),children:[d,f.jsx("span",{children:l.label})]},l.value);return l.tooltip?f.jsxs(bs,{children:[f.jsx(_s,{asChild:!0,children:g}),f.jsx(Ki,{children:l.tooltip})]},l.value):g})})}function pre(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function gre(e){const t=e.split("/").filter(Boolean);return t[t.length-1]||e}function vre({open:e,onOpenChange:t,initialDirectory:n,onListDirectories:r,onConfirm:s}){var O;const[o,l]=b.useState("new"),[u,h]=b.useState(""),[d,g]=b.useState([]),[p,v]=b.useState({}),[y,w]=b.useState([]),[S,C]=b.useState(null),[k,R]=b.useState(""),[E,N]=b.useState(null),[L,D]=b.useState(null),j=b.useRef(null);b.useEffect(()=>{e&&(l("new"),h(""),g(n?n.roots:[]),v(n?{[n.currentPath]:n.entries}:{}),w(n?[n.currentPath]:[]),C((n==null?void 0:n.currentPath)??null),R(""),N(null),D(null),setTimeout(()=>{var $;return($=j.current)==null?void 0:$.focus()},0))},[n,e]),b.useEffect(()=>{e&&setTimeout(()=>{var $;o==="new"&&(($=j.current)==null||$.focus())},0)},[o,e]);const H=pre(u),G=H?`${b7}/${H}`:"",B=k.trim(),q=o==="new"?!!H:!!B,I=async $=>{N(null),D($??"__root__");try{const U=await r($);if(!$){g(U.roots),C(U.currentPath),v({[U.currentPath]:U.entries}),w([U.currentPath]);return}d.length===0&&(g([{name:gre(U.currentPath),localPath:U.currentPath}]),C(U.currentPath)),v(X=>({...X,[U.currentPath]:U.entries})),w(X=>X.includes(U.currentPath)?X:[...X,U.currentPath])}catch(U){N(U instanceof Error?U.message:String(U))}finally{D(null)}},V=async $=>{if(y.includes($)){w(U=>U.filter(X=>X!==$));return}if(p[$]){w(U=>[...U,$]);return}await I($)},F=($,U,X)=>{const M=y.includes($),P=k===$,Z=p[$]??[],A=L===$;return f.jsxs("div",{children:[f.jsxs("div",{className:me("grid grid-cols-[auto_1fr] items-center gap-2 px-3 py-2",P?"bg-muted":"hover:bg-muted/50"),style:{paddingLeft:`${12+X*16}px`},children:[f.jsx("button",{type:"button",className:"flex h-6 w-6 items-center justify-center rounded hover:bg-background disabled:opacity-50",onClick:()=>void V($),disabled:A,children:A?f.jsx(kr,{className:"h-4 w-4 animate-spin text-muted-foreground"}):f.jsx(Or,{className:me("h-4 w-4 text-muted-foreground transition-transform",M&&"rotate-90")})}),f.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",onClick:()=>R($),children:[M?f.jsx(TN,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):f.jsx(MN,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"truncate",children:U})]})]}),M&&Z.length>0?Z.map(ie=>F(ie.localPath,ie.name,X+1)):null]},$)},W=()=>{if(q){if(o==="new")s({mode:"new",localPath:G,title:u.trim()});else{const $=B.split("/").pop()||B;s({mode:"existing",localPath:B,title:$})}t(!1)}};return f.jsx(_p,{open:e,onOpenChange:t,children:f.jsxs(Fd,{size:"sm",children:[f.jsxs(xp,{className:"space-y-4",children:[f.jsx(yp,{children:"Add Project"}),f.jsx(mre,{value:o,onValueChange:l,options:[{value:"new",label:"New Folder"},{value:"existing",label:"Existing Folder"}],className:"w-full mb-2",optionClassName:"flex-1 justify-center"}),o==="new"?f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ti,{ref:j,type:"text",value:u,onChange:$=>h($.target.value),onKeyDown:$=>{$.key==="Enter"&&W(),$.key==="Escape"&&t(!1)},placeholder:"Project name"}),G&&f.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:G})]}):f.jsxs("div",{className:"space-y-2",children:[f.jsx(Ti,{type:"text",value:k,onChange:$=>R($.target.value),onKeyDown:$=>{$.key==="Enter"&&I(k||void 0)},placeholder:"Enter a server path, for example /home/bettie/Projects/my-app"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Import an existing folder from the connected server machine. You can type a path manually or choose from the root folder list below."}),f.jsx("div",{className:"flex justify-end",children:f.jsx(Xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>void I("~"),disabled:L!==null,children:"Load Root"})}),d.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Server Folders"}),f.jsxs(Yp,{className:"max-h-64 rounded-xl border border-border",children:[d.map($=>F($.localPath,$.name,0)),S&&((O=p[S])==null?void 0:O.length)===0?f.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:"No subfolders"}):null]})]}):L?f.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-border px-3 py-2 text-sm text-muted-foreground",children:[f.jsx(kr,{className:"h-4 w-4 animate-spin"}),"Loading folders from server machine..."]}):null,E?f.jsx("p",{className:"text-xs text-destructive",children:E}):null]})]}),f.jsxs(wp,{children:[f.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),f.jsx(Xe,{variant:"secondary",size:"sm",onClick:W,disabled:!q,children:o==="new"?"Create":"Import"})]})]})})}function bre({text:e}){const[t,n]=b.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return f.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void r(),children:t?f.jsx(Xi,{className:"h-4 w-4 text-green-400"}):f.jsx(Id,{className:"h-4 w-4"})})}function JR({children:e}){return f.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center group bg-background border border-border text-foreground rounded-xl p-1.5 pl-3 font-mono text-sm",children:[f.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[f.jsx(Or,{className:"inline h-4 w-4 opacity-40"}),f.jsx("code",{children:e})]}),f.jsx(bre,{text:e})]})}function sm({children:e}){return f.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function N_({children:e}){return f.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function M_({icon:e,title:t,subtitle:n,iconClassName:r}){return f.jsxs("div",{className:"flex flex-col items-center gap-0",children:[f.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:f.jsx(e,{className:r||"h-8 w-8 text-muted-foreground"})}),f.jsx("span",{className:"text-sm font-medium",children:t}),f.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function eT(){return f.jsx(kI,{className:"h-4 w-4 text-muted-foreground"})}function tT({number:e,title:t,children:n}){return f.jsx("div",{className:"flex gap-4",children:f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[f.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[e,"."]}),f.jsx("h3",{className:"font-medium text-foreground mb-2",children:t})]}),f.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:n})]})})}function _re({localPath:e,iconDataUrl:t,loading:n,onClick:r,onHide:s}){const o=un(l=>l.showProjectIconsInSidebar);return f.jsxs("div",{className:"relative group",children:[f.jsxs(bs,{children:[f.jsx(_s,{asChild:!0,children:f.jsxs("button",{className:me("border border-border hover:border-primary/30 rounded-lg bg-card px-4 py-3 flex items-center gap-3 w-full text-left hover:bg-muted/50 transition-colors",n&&"opacity-50 cursor-not-allowed"),disabled:n,onClick:r,children:[o?f.jsx(jA,{iconDataUrl:t,alt:`${Im(e)} icon`,className:"h-5.5 w-5.5",fallback:f.jsx(MN,{className:"h-5.5 w-5.5 text-muted-foreground flex-shrink-0"})}):null,f.jsx("span",{className:"font-medium text-foreground truncate flex-1 pr-10",children:Im(e)}),n?f.jsx(kr,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):null]})}),f.jsx(Ki,{children:f.jsx("p",{children:e})})]}),f.jsx(Xe,{variant:"ghost",size:"icon",className:"absolute right-2 top-1/2 h-7 w-7 -translate-y-1/2 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",disabled:n,onClick:l=>{l.stopPropagation(),s()},children:f.jsx(_d,{className:"h-4 w-4"})})]})}function yre({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:s,onOpenProject:o,onHideProject:l,onListDirectories:u,onCreateProject:h}){const[d,g]=hz(),[p,v]=b.useState(!1),y=b.useMemo(()=>(n==null?void 0:n.projects)??[],[n==null?void 0:n.projects]),w=e==="connecting"||!t,S=e==="connected"&&t,C=d.get("newProject")==="1";b.useEffect(()=>{S&&C&&v(!0)},[S,C]);const k=R=>{if(v(R),!R&&C){const E=new URLSearchParams(d);E.delete("newProject"),g(E,{replace:!0})}};return f.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[S?f.jsxs(f.Fragment,{children:[f.jsx(QR,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${Un} is connected, choose a project below to get started.`}),f.jsxs("div",{className:"w-full px-6 mb-10",children:[f.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[f.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:"Projects"}),f.jsxs(Xe,{variant:"default",size:"sm",onClick:()=>v(!0),children:[f.jsx(Dx,{className:"h-4 w-4 mr-1.5"}),"Add Project"]})]}),y.length>0?f.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-4 3xl:grid-cols-5 gap-2",children:y.map(R=>f.jsx(_re,{localPath:R.localPath,iconDataUrl:R.iconDataUrl,loading:r===R.localPath,onClick:()=>{o(R.localPath)},onHide:()=>{l(R.localPath)}},R.localPath))}):f.jsx(sm,{children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"No local projects discovered yet. Open one with Claude or Codex, or create a new project here."})}),s?f.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3 mt-4",children:s}):null]})]}):f.jsxs(f.Fragment,{children:[f.jsx(QR,{narrow:!0,icon:zk,title:w?`Connecting ${Un}`:`Connect ${Un}`,subtitle:w?`${Un} is starting up and loading your local projects.`:`Run ${Un} directly on your machine with full access to your local files and agent project history.`}),f.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[f.jsx(N_,{children:"Status"}),f.jsx("div",{className:"mb-8",children:f.jsx(sm,{children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(kr,{className:"h-4 w-4 text-muted-foreground animate-spin"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:w?`Connecting to your local ${Un} server...`:f.jsxs(f.Fragment,{children:["Not connected. Run ",f.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:zf()})," from any terminal on this machine."]})})]})})}),w?null:f.jsxs("div",{className:"mb-10",children:[f.jsx(N_,{children:"How it works"}),f.jsx(sm,{children:f.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[f.jsx(M_,{icon:jx,title:`${Un} CLI`,subtitle:"On Your Machine"}),f.jsx(eT,{}),f.jsx(M_,{icon:jN,title:`${Un} Server`,subtitle:"Local WebSocket"}),f.jsx(eT,{}),f.jsx(M_,{icon:zk,title:`${Un} UI`,subtitle:"Project Chat"})]})})]}),w?null:f.jsxs("div",{className:"mb-10",children:[f.jsx(N_,{children:"Setup"}),f.jsx(sm,{children:f.jsxs("div",{className:"space-y-4",children:[f.jsxs(tT,{number:1,title:`Start ${Un}`,children:[f.jsx("p",{children:"Run this command in your terminal:"}),f.jsx(JR,{children:zf()})]}),f.jsxs(tT,{number:2,title:"Open the local UI",children:[f.jsxs("p",{children:[Un," serves the app locally and opens the Local Projects page in an app-style browser window."]}),f.jsx(JR,{children:"http://localhost:3210/local"})]}),f.jsxs("div",{className:"mt-8",children:[f.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Notes"}),f.jsxs("div",{className:"space-y-3 text-sm",children:[f.jsxs("div",{className:"flex gap-4",children:[f.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:zf("").trim()}),f.jsx("span",{className:"text-muted-foreground",children:"Start in the current directory"})]}),f.jsxs("div",{className:"flex gap-4",children:[f.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:zf("--no-open")}),f.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),f.jsx(vre,{open:p,onOpenChange:k,initialDirectory:(n==null?void 0:n.rootDirectory)??null,onListDirectories:u,onConfirm:R=>{h(R)}}),f.jsx("div",{className:"py-4 text-center",children:f.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",Gx.split("/")[1]]})})]})}function xre(){const e=hp();return f.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:f.jsx(yre,{connectionStatus:e.connectionStatus,ready:e.localProjectsReady,snapshot:e.localProjects,startingLocalPath:e.startingLocalPath,commandError:e.commandError,onOpenProject:e.handleOpenLocalProject,onHideProject:e.handleHideLocalProject,onListDirectories:e.handleListDirectories,onCreateProject:e.handleCreateProject})})}function ec({children:e,className:t,icon:n,type:r="button",variant:s="outline",...o}){return f.jsxs("button",{type:r,className:me(YT({variant:s,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",t),...o,children:[n,e?f.jsx("span",{children:e}):null]})}const id=[{id:"general",label:"General",icon:t8,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"providers",label:"Providers",icon:P6,subtitle:"Manage the default chat provider and saved model defaults for Claude, Codex, Gemini, and Cursor."},{id:"keybindings",label:"Keybindings",icon:e6,subtitle:"Edit global app shortcuts stored in the active keybindings file."}];function nT(e){return e&&id.some(t=>t.id===e)?e:null}const wre=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],rT=Object.keys(BA);function Sre(e){return`Edit global app shortcuts stored in ${e}.`}function Cre(e){const t=(e==null?void 0:e.status)==="checking",n=(e==null?void 0:e.status)==="updating"||(e==null?void 0:e.status)==="restart_pending";return e!=null&&e.updateAvailable?{disabled:n,kind:"update",label:"Update",variant:"default"}:{disabled:t||n,kind:"check",label:"Check for updates",spinning:t,variant:"outline"}}function om(e,t){const n=tn(t),r=(e==null?void 0:e.settings[t])??Yn[t];return n.systemActive?r.active?"Active.":"Inactive.":"Inactive by server policy."}function kre(e){return e&&typeof e=="object"&&"idx"in e&&typeof e.idx=="number"&&e.idx>0?"back":"home"}function iT({themePreference:e,nextBackgroundImage:t,backgroundOpacity:n}){const r=typeof t=="string"&&t.trim()!=="";return e!=="custom"||!r||n!==1?{}:{backgroundOpacity:.85,backgroundBlur:6}}function xn({title:e,description:t,children:n,bordered:r=!0,alignStart:s=!1}){return f.jsx("div",{className:r?"border-t border-border":void 0,children:f.jsxs("div",{className:`flex flex-col sm:flex-row sm:justify-between gap-3 sm:gap-8 py-5 ${s?"sm:items-start":"sm:items-center"}`,children:[f.jsxs("div",{className:"min-w-0 max-w-xl",children:[f.jsx("div",{className:"text-sm font-medium text-foreground",children:e}),f.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:t})]}),f.jsx("div",{className:"flex w-full items-center sm:w-auto sm:shrink-0",children:n})]})})}function Ere(){var ts,dl;const e=rl(),{sectionId:t}=ST(),n=hp(),{theme:r,setTheme:s}=ZD(),o=nT(t)??"general",l=n.connectionStatus==="connecting"||!n.localProjectsReady,u=((ts=n.localProjects)==null?void 0:ts.machine.displayName)??"Unavailable",h=((dl=n.localProjects)==null?void 0:dl.projects.length)??0,d=Gx.split("/")[1]??"unknown",g=Ri(K=>K.scrollbackLines),p=Ri(K=>K.minColumnWidth),v=Ri(K=>K.editorPreset),y=Ri(K=>K.editorCommandTemplate),w=Ri(K=>K.setScrollbackLines),S=Ri(K=>K.setMinColumnWidth),C=Ri(K=>K.setEditorPreset),k=Ri(K=>K.setEditorCommandTemplate),R=n.keybindings,E=n.providerSettings,N=Ei(K=>K.defaultProvider),L=Ei(K=>K.providerDefaults),D=Ei(K=>K.showProviderIconsInSideTray),j=Ei(K=>K.setDefaultProvider),H=Ei(K=>K.setProviderDefaultModel),G=Ei(K=>K.setProviderDefaultModelOptions),B=Ei(K=>K.setProviderDefaultPlanMode),q=Ei(K=>K.setShowProviderIconsInSideTray),I=ci(K=>K.folderGroupsEnabled),V=ci(K=>K.showFeatureOverviewInSidebar),F=ci(K=>K.kanbanStatusesEnabled),W=ci(K=>K.commitProjectMetadataDirectory),O=ci(K=>K.setFolderGroupsEnabled),$=ci(K=>K.setShowFeatureOverviewInSidebar),U=ci(K=>K.setKanbanStatusesEnabled),X=ci(K=>K.setCommitProjectMetadataDirectory),M=un(K=>K.themeId),P=un(K=>K.customAppearance),Z=un(K=>K.backgroundImage),A=un(K=>K.backgroundOpacity),ie=un(K=>K.backgroundBlur),J=un(K=>K.showProjectIconsInSidebar),ee=un(K=>K.availableThemes),re=un(K=>K.setThemeId),ce=un(K=>K.setCustomAppearance),he=un(K=>K.setBackgroundImage),pe=un(K=>K.setBackgroundOpacity),Se=un(K=>K.setBackgroundBlur),Re=un(K=>K.setShowProjectIconsInSidebar),Ae=b.useMemo(()=>S0(R),[R]),Ke=Ae.filePathDisplay||x7(),[yt,xt]=b.useState(String(g)),[fe,Ie]=b.useState(String(p)),[De,lt]=b.useState(y),[st,nt]=b.useState(Z??""),[rn,Ce]=b.useState(String(A)),[Ze,oe]=b.useState(String(ie)),[ve,Te]=b.useState({}),[Me,Ge]=b.useState(null),[Ct,Je]=b.useState(null),[je,We]=b.useState(null),ut=b.useMemo(()=>Xx((E==null?void 0:E.settings)??Yn),[E==null?void 0:E.settings]),Ue=N==="last_used"||ut.some(K=>K.id===N)?N:"last_used",[sn,Yt]=b.useState([]),Ye=n.updateSnapshot,qt=n.themeSettings,jn=Cre(Ye),Wt=(Ye==null?void 0:Ye.status)==="checking"?"Checking for updates…":(Ye==null?void 0:Ye.status)==="updating"?"Installing update…":(Ye==null?void 0:Ye.status)==="restart_pending"?`Restarting ${Un}…`:(Ye==null?void 0:Ye.status)==="available"?`Update available${Ye.latestVersion?`: ${Ye.latestVersion}`:""}`:(Ye==null?void 0:Ye.status)==="up_to_date"?"Up to date":(Ye==null?void 0:Ye.status)==="error"?"Update check failed":"Not checked yet";b.useEffect(()=>{fetch("/api/backgrounds").then(K=>K.json()).then(K=>Yt(K)).catch(K=>console.error("Failed to load system backgrounds",K))},[]),b.useEffect(()=>{xt(String(g))},[g]),b.useEffect(()=>{Ie(String(p))},[p]),b.useEffect(()=>{lt(y)},[y]),b.useEffect(()=>{nt(Z??"")},[Z]),b.useEffect(()=>{Ce(String(A))},[A]),b.useEffect(()=>{oe(String(ie))},[ie]),b.useEffect(()=>{Te(Object.fromEntries(rT.map(K=>[K,Ub(Ae.bindings[K])])))},[Ae]),b.useEffect(()=>{t&&(nT(t)||e("/settings/general",{replace:!0}))},[e,t]);function Bt(){const K=Number(yt);if(!Number.isFinite(K)){xt(String(g));return}w(K)}function Pe(){const K=Number(fe);if(!Number.isFinite(K)){Ie(String(p));return}S(K)}function dt(){const K=st.trim()===""?null:st.trim(),rt=iT({themePreference:r,nextBackgroundImage:K,backgroundOpacity:A});he(K),rt.backgroundOpacity!==void 0&&pe(rt.backgroundOpacity),rt.backgroundBlur!==void 0&&Se(rt.backgroundBlur),ke({backgroundImage:K,...rt})}function gt(){const K=Number(rn);if(!Number.isFinite(K)||K<0||K>1){Ce(String(A));return}pe(K),ke({backgroundOpacity:K})}function wt(){const K=Number(Ze);if(!Number.isFinite(K)||K<0){oe(String(ie));return}Se(K),ke({backgroundBlur:K})}function Vt(K,rt){K.key==="Enter"&&(rt(),K.currentTarget.blur())}function ht(K,rt){K.key==="Enter"&&(rt(),K.currentTarget.blur())}function ft(){k(De)}async function pn(K=ve){try{Ge(null),await n.socket.command({type:"settings.writeKeybindings",bindings:sT(K)})}catch(rt){Ge(rt instanceof Error?rt.message:"Unable to save keybindings.")}}async function ke(K){try{await n.socket.command({type:"settings.writeThemeSettings",settings:{themePreference:(K==null?void 0:K.themePreference)??r,themeId:(K==null?void 0:K.themeId)??M,customAppearance:(K==null?void 0:K.customAppearance)??P,backgroundImage:(K==null?void 0:K.backgroundImage)!==void 0?K.backgroundImage:Z,backgroundOpacity:(K==null?void 0:K.backgroundOpacity)??A,backgroundBlur:(K==null?void 0:K.backgroundBlur)??ie,showProjectIconsInSidebar:(K==null?void 0:K.showProjectIconsInSidebar)??J}})}catch(rt){console.error("Failed to save theme settings:",rt)}}async function Oe(K,rt){We(K);try{await rt()}finally{We(On=>On===K?null:On)}}async function St(K){try{Je(null),await n.socket.command({type:"settings.writeProviderSettings",settings:K})}catch(rt){Je(rt instanceof Error?rt.message:"Unable to save provider settings.")}}async function ot(K){const rt={...ve,[K]:Ub(fs[K])};Te(rt);try{Ge(null),await n.socket.command({type:"settings.writeKeybindings",bindings:sT(rt)})}catch(On){Ge(On instanceof Error?On.message:"Unable to save keybindings.")}}const on=De.replaceAll("{path}","/Users/jake/Projects/kaizen/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),dn=id.find(K=>K.id===o)??id[0],Xt=o==="keybindings"?Sre(Ke):dn.subtitle,It=!l,Ft=o==="keybindings"?f.jsxs(ec,{onClick:()=>{n.handleOpenExternalPath("open_editor",Ke)},icon:f.jsx(B_,{className:"h-4 w-4"}),children:["Open in ",n.editorLabel]}):o==="general"?f.jsx(ec,{variant:jn.variant,onClick:()=>{if(jn.kind==="update"){n.handleInstallUpdate();return}n.handleCheckForUpdates({force:!0})},disabled:jn.disabled,icon:jn.kind==="check"?f.jsx(Tm,{className:me("size-3.5",jn.spinning&&"animate-spin")}):jn.kind==="update"?f.jsx(XI,{className:me("size-3.5")}):void 0,children:jn.label}):null;function yr(){if(kre(window.history.state)==="back"){e(-1);return}e("/",{replace:!0})}return f.jsxs("div",{className:"relative flex h-full flex-1 min-w-0 bg-background",children:[f.jsxs("div",{className:"flex min-w-0 flex-1",children:[f.jsx("aside",{className:`hidden w-[200px] shrink-0 md:block ${It?"pb-[89px]":""}`,children:f.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[f.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:"Settings"}),id.map(K=>f.jsx("button",{type:"button",onClick:()=>e(`/settings/${K.id}`),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${K.id===o?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:f.jsxs("div",{className:"flex items-center gap-2.5",children:[f.jsx(K.icon,{className:"h-4 w-4 shrink-0"}),f.jsx("span",{children:K.label})]})},K.label))]})}),f.jsxs("div",{className:"min-w-0 flex-1 overflow-y-auto",children:[f.jsx("div",{className:"md:hidden sticky top-0 z-10 bg-background border-b border-border px-4 py-2 backdrop-blur-md",children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto scrollbar-hide",children:id.map(K=>f.jsxs("button",{type:"button",onClick:()=>e(`/settings/${K.id}`),className:`flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm transition-colors ${K.id===o?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:[f.jsx(K.icon,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{children:K.label})]},K.id))}),f.jsx("button",{type:"button","aria-label":"Close settings",onClick:yr,className:"ml-1 flex shrink-0 items-center justify-center rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:f.jsx(ro,{className:"h-4 w-4"})})]})}),f.jsxs("div",{className:"w-full px-6 pt-8 md:pt-16 pb-32",children:[l?f.jsx("div",{className:"flex min-h-[240px] items-center justify-center rounded-2xl border border-border bg-card/40 px-4 py-6 text-sm text-muted-foreground",children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(kr,{className:"h-4 w-4 animate-spin"}),f.jsx("span",{children:"Loading machine settings…"})]})}):f.jsxs("div",{className:"mx-auto max-w-4xl",children:[f.jsxs("div",{className:"pb-6",children:[f.jsxs("div",{className:"flex items-center justify-between gap-4 min-h-[34px]",children:[f.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:dn.label}),f.jsxs("div",{className:"flex items-center gap-2",children:[Ft,f.jsx(ec,{"aria-label":"Close settings",title:"Close settings",onClick:yr,icon:f.jsx(ro,{className:"h-4 w-4"}),className:"hidden md:flex"})]})]}),f.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:Xt})]}),o==="general"?f.jsx(f.Fragment,{children:f.jsxs("div",{className:"border-b border-border",children:[f.jsx(xn,{title:"Application Update",description:f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[Wt,"."]}),Ye!=null&&Ye.lastCheckedAt?f.jsxs("span",{children:[" ","Last checked"," ",new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(Ye.lastCheckedAt),"."]}):null,Ye!=null&&Ye.error?f.jsxs("span",{children:[" ",Ye.error]}):null]}),bordered:!1,children:f.jsxs("div",{className:"text-right text-sm text-foreground",children:[f.jsxs("div",{children:["Current:"," ",(Ye==null?void 0:Ye.currentVersion)??d]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latest: ",(Ye==null?void 0:Ye.latestVersion)??"Unknown"]})]})}),f.jsx(xn,{title:"Release Notes",description:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"The old GitHub changelog page is hidden after the rebrand because releases are no longer sourced from a public GitHub repo."}),f.jsxs("span",{children:[" ","We need to come back to this and wire release notes to the deployment/NPX update flow."]})]}),children:f.jsx("div",{className:"rounded-full border border-border bg-muted/40 px-3 py-1 text-xs font-medium text-muted-foreground",children:"Temporary placeholder"})}),f.jsx(xn,{title:"Theme",description:"Choose between light, dark, system, or custom appearance",children:f.jsxs(gr,{value:r,onValueChange:K=>{s(K),ke({themePreference:K})},children:[f.jsx(Jn,{className:"w-[150px]",children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"light",children:"Light"}),f.jsx(Lt,{value:"dark",children:"Dark"}),f.jsx(Lt,{value:"system",children:"System"}),f.jsx(Lt,{value:"custom",children:"Custom"})]})]})}),r==="custom"?f.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[f.jsx(xn,{title:"Appearance",description:"Choose light, dark, or system mode for your custom theme",bordered:!1,children:f.jsxs(gr,{value:P,onValueChange:K=>{ce(K),ke({customAppearance:K})},children:[f.jsx(Jn,{className:"w-[150px]",children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"light",children:"Light"}),f.jsx(Lt,{value:"dark",children:"Dark"}),f.jsx(Lt,{value:"system",children:"System"})]})]})}),f.jsx(xn,{title:"Color Theme",description:`Choose a color palette for the interface. Custom JSON themes live in ${(qt==null?void 0:qt.themesDirectoryDisplay)??"~/.kaizen/themes"}. Read ${(qt==null?void 0:qt.themesReadmeFileDisplay)??"~/.kaizen/themes/THEME_README.md"} for authoring guidance.`,alignStart:!0,bordered:!1,children:f.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(gr,{value:M,onValueChange:K=>{re(K),ke({themeId:K})},children:[f.jsx(Jn,{className:"min-w-[180px]",children:f.jsx(wr,{})}),f.jsx(er,{children:f.jsx(Bb,{children:ee.map(K=>f.jsx(Lt,{value:K.id,children:K.label},K.id))})})]}),f.jsx(ec,{variant:"outline","aria-label":"Refresh themes",title:"Refresh themes",className:"px-2.5",disabled:je!==null,onClick:()=>{Oe("refresh",()=>n.handleRefreshThemeSettings())},icon:je==="refresh"?f.jsx(kr,{className:"size-3.5 animate-spin"}):f.jsx(Tm,{className:"size-3.5"})})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs(ec,{disabled:je!==null,onClick:()=>{Oe("open_editor",()=>n.handleOpenCustomThemes())},icon:je==="open_editor"?f.jsx(kr,{className:"size-3.5 animate-spin"}):f.jsx(H6,{className:"size-3.5"}),children:["Open in ",n.editorLabel]}),f.jsx(ec,{variant:"outline",disabled:je!==null,onClick:()=>{Oe("open_folder",()=>n.handleOpenExternalPath("open_finder",(qt==null?void 0:qt.themesDirectoryDisplay)??"~/.kaizen/themes"))},icon:je==="open_folder"?f.jsx(kr,{className:"size-3.5 animate-spin"}):f.jsx(B_,{className:"size-3.5"}),children:"Open folder"})]}),qt!=null&&qt.customThemeWarnings.length?f.jsx("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:qt.customThemeWarnings.join(" ")}):null]})}),f.jsx(xn,{title:"Background Image",description:"Choose a background or enter a custom URL",alignStart:!0,bordered:!1,children:(()=>{const K=sn.find(Ot=>Ot.url===st),rt=!st,On=!!st&&!K,ns=rt?"__none__":On?"__custom__":st,mi=rt?"None":On?"Custom URL":(K==null?void 0:K.name)??"Unknown";return f.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[f.jsxs(gr,{value:ns,onValueChange:Ot=>{if(Ot==="__none__")nt(""),he(null),ke({backgroundImage:null});else{const Tn=iT({themePreference:r,nextBackgroundImage:Ot,backgroundOpacity:A});nt(Ot),he(Ot),Tn.backgroundOpacity!==void 0&&pe(Tn.backgroundOpacity),Tn.backgroundBlur!==void 0&&Se(Tn.backgroundBlur),ke({backgroundImage:Ot,...Tn})}},children:[f.jsx(Jn,{className:"w-full",children:f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[rt?null:f.jsx("img",{src:st,alt:"",className:"h-5 w-9 shrink-0 rounded object-cover"}),f.jsx("span",{className:"truncate",children:mi})]})}),f.jsxs(er,{children:[f.jsx(fm,{value:"__none__",children:"None"}),sn.map(Ot=>f.jsx(fm,{value:Ot.url,thumbnail:Ot.url,thumbnailAlt:Ot.name,children:Ot.name},Ot.id)),On?f.jsx(fm,{value:"__custom__",thumbnail:st,thumbnailAlt:"Custom",children:"Custom URL"}):null]})]}),f.jsx(Ti,{type:"text",placeholder:"Or enter a custom URL...",value:st,onChange:Ot=>nt(Ot.target.value),onBlur:dt,onKeyDown:Ot=>ht(Ot,dt),className:"w-full"})]})})()}),f.jsx(xn,{title:"Background Opacity",description:"Opacity of the interface layered over the background (0 to 1)",bordered:!1,children:f.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:f.jsx(Ti,{type:"number",min:0,max:1,step:.05,value:rn,onChange:K=>Ce(K.target.value),onBlur:gt,onKeyDown:K=>Vt(K,gt),className:"hide-number-steppers w-28 text-right font-mono"})})}),f.jsx(xn,{title:"Background Blur",description:"Blur applied to the background image (in pixels)",bordered:!1,children:f.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:f.jsx(Ti,{type:"number",min:0,max:50,step:1,value:Ze,onChange:K=>oe(K.target.value),onBlur:wt,onKeyDown:K=>Vt(K,wt),className:"hide-number-steppers w-28 text-right font-mono"})})})]}):null,f.jsx(xn,{title:"Project Icons",description:"Show detected project icons in the sidebar and open-project list.",children:f.jsxs(gr,{value:J?"enabled":"disabled",onValueChange:K=>{const rt=K==="enabled";Re(rt),ke({showProjectIconsInSidebar:rt})},children:[f.jsx(Jn,{className:"w-[100px]",children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"disabled",children:"Off"}),f.jsx(Lt,{value:"enabled",children:"On"})]})]})}),f.jsx(xn,{title:"Folder Groups",description:"Show or hide feature folder grouping in the sidebar. Turning this off keeps the existing feature state, but flattens chats into a direct list and hides the new-folder button.",children:f.jsxs(gr,{value:I?"enabled":"disabled",onValueChange:K=>O(K==="enabled"),children:[f.jsx(Jn,{className:"w-[100px]",children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"disabled",children:"Off"}),f.jsx(Lt,{value:"enabled",children:"On"})]})]})}),I?f.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[f.jsx(xn,{title:"Feature Overview",description:"Generate and show an `overview.md` file for feature folders. Turning this off stops creating new overview files and hides existing overview rows from the sidebar.",bordered:!1,children:f.jsxs(gr,{value:V?"enabled":"disabled",onValueChange:K=>$(K==="enabled"),children:[f.jsx(Jn,{className:"w-[100px]",children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"disabled",children:"Off"}),f.jsx(Lt,{value:"enabled",children:"On"})]})]})}),f.jsx(xn,{title:"Kanban Status",description:"Show or hide feature status controls like Idea, Todo, Progress, Testing, and Done.",bordered:!1,children:f.jsxs(gr,{value:F?"enabled":"disabled",onValueChange:K=>U(K==="enabled"),children:[f.jsx(Jn,{className:"w-[100px]",children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"disabled",children:"Off"}),f.jsx(Lt,{value:"enabled",children:"On"})]})]})}),f.jsx(xn,{title:`${Ab} In Git`,description:`Control whether ${Un} keeps the project ${Ab} directory tracked in git or adds it to .gitignore for currently loaded projects and future opens. This is best suited to solo developers working across multiple machines. For team repos, we recommend ignoring \`${Ab}\`.`,bordered:!1,children:f.jsxs(gr,{value:W?"commit":"ignore",onValueChange:K=>{const rt=K==="commit";X(rt),n.handleSetCommitProjectMetadataDirectory(rt)},children:[f.jsx(Jn,{className:"w-[120px]",children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"commit",children:"Commit"}),f.jsx(Lt,{value:"ignore",children:"Ignore"})]})]})})]}):null,f.jsx(xn,{title:"Provider Icons In Side Tray",description:"Show provider badges next to chats in the left sidebar side tray.",children:f.jsxs(gr,{value:D?"enabled":"disabled",onValueChange:K=>q(K==="enabled"),children:[f.jsx(Jn,{className:"w-[100px]",children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"disabled",children:"Off"}),f.jsx(Lt,{value:"enabled",children:"On"})]})]})}),f.jsx(xn,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:f.jsxs(gr,{value:v,onValueChange:K=>C(K),children:[f.jsx(Jn,{className:"min-w-[180px]",children:f.jsx(wr,{})}),f.jsx(er,{children:f.jsx(Bb,{children:wre.map(K=>f.jsx(Lt,{value:K.value,children:K.label},K.value))})})]})}),v==="custom"?f.jsx("div",{className:"border-t border-border",children:f.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[f.jsxs("div",{className:"min-w-0 max-w-xl",children:[f.jsx("div",{className:"text-sm font-medium text-foreground",children:"Command Template"}),f.jsxs("div",{className:"mt-1 text-[13px] text-muted-foreground",children:["Include ","{path}"," and optionally ","{line}"," and"," ","{column}"," in your command."]})]}),f.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[f.jsx(Ti,{type:"text",value:De,onChange:K=>lt(K.target.value),onBlur:ft,onKeyDown:K=>ht(K,ft),className:"font-mono"}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview:"," ",f.jsx("span",{className:"font-mono",children:on})]})]})]})}):null,f.jsx(xn,{title:"Terminal Scrollback",description:"Lines retained for embedded terminal history",children:f.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[f.jsx(Ti,{type:"number",min:nx,max:rx,step:100,value:yt,onChange:K=>xt(K.target.value),onBlur:Bt,onKeyDown:K=>Vt(K,Bt),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),f.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[nx,"-",rx," ","lines",g===np?" (default)":""]})]})}),f.jsx(xn,{title:"Terminal Min Column Width",description:"Minimum width for each terminal pane",children:f.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[f.jsx(Ti,{type:"number",min:ix,max:sx,step:10,value:fe,onChange:K=>Ie(K.target.value),onBlur:Pe,onKeyDown:K=>Vt(K,Pe),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),f.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[ix,"-",sx," px",p===rp?" (default)":""]})]})})]})}):o==="providers"?f.jsxs("div",{className:"border-b border-border",children:[f.jsx(xn,{title:"Default Provider",description:"The default harness used for new chats before a provider is locked by an existing session.",bordered:!1,children:f.jsxs(gr,{value:Ue,onValueChange:K=>j(K),children:[f.jsx(Jn,{className:"min-w-[180px]",children:f.jsx(wr,{})}),f.jsx(er,{children:f.jsxs(Bb,{children:[f.jsx(Lt,{value:"last_used",children:"Last Used"}),ut.map(K=>f.jsx(Lt,{value:K.id,children:K.label},K.id))]})})]})}),Ct?f.jsx("div",{className:"border-t border-border px-0 py-3 text-sm text-destructive",children:Ct}):null,f.jsx(xn,{title:"Claude Code Defaults",description:`Saved defaults when using Claude Code. ${om(E,"claude")}`,alignStart:!0,children:f.jsxs("div",{className:me("max-w-[420px]",!tn("claude").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(gr,{value:((E==null?void 0:E.settings.claude)??Yn.claude).active?"active":"inactive",onValueChange:K=>{St({...(E==null?void 0:E.settings)??Yn,claude:{...(E==null?void 0:E.settings.claude)??Yn.claude,active:K==="active"}})},children:[f.jsx(Jn,{className:"min-w-[140px]",disabled:!tn("claude").systemActive,children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"active",children:"Active"}),f.jsx(Lt,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Gu,{availableProviders:Jo,selectedProvider:"claude",disabled:!tn("claude").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.claude.model,modelOptions:L.claude.modelOptions,onModelChange:(K,rt)=>{H("claude",rt)},onClaudeReasoningEffortChange:K=>{G("claude",{reasoningEffort:K})},onClaudeContextWindowChange:K=>{G("claude",{contextWindow:K})},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:L.claude.planMode,onPlanModeChange:K=>B("claude",K),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),f.jsx(xn,{title:"Codex Defaults",description:`Saved defaults when using Codex. ${om(E,"codex")}`,alignStart:!0,children:f.jsxs("div",{className:me("max-w-[420px]",!tn("codex").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(gr,{value:((E==null?void 0:E.settings.codex)??Yn.codex).active?"active":"inactive",onValueChange:K=>{St({...(E==null?void 0:E.settings)??Yn,codex:{...(E==null?void 0:E.settings.codex)??Yn.codex,active:K==="active"}})},children:[f.jsx(Jn,{className:"min-w-[140px]",disabled:!tn("codex").systemActive,children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"active",children:"Active"}),f.jsx(Lt,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Gu,{availableProviders:Jo,selectedProvider:"codex",disabled:!tn("codex").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.codex.model,modelOptions:L.codex.modelOptions,onModelChange:(K,rt)=>{H("codex",rt)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:K=>{G("codex",{reasoningEffort:K})},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:K=>{G("codex",{fastMode:K})},planMode:L.codex.planMode,onPlanModeChange:K=>B("codex",K),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),f.jsx(xn,{title:"Gemini Defaults",description:`Saved defaults when using Gemini. ${om(E,"gemini")}`,alignStart:!0,children:f.jsxs("div",{className:me("max-w-[420px]",!tn("gemini").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(gr,{value:((E==null?void 0:E.settings.gemini)??Yn.gemini).active?"active":"inactive",onValueChange:K=>{St({...(E==null?void 0:E.settings)??Yn,gemini:{...(E==null?void 0:E.settings.gemini)??Yn.gemini,active:K==="active"}})},children:[f.jsx(Jn,{className:"min-w-[140px]",disabled:!tn("gemini").systemActive,children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"active",children:"Active"}),f.jsx(Lt,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Gu,{availableProviders:Jo,selectedProvider:"gemini",disabled:!tn("gemini").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.gemini.model,modelOptions:L.gemini.modelOptions,onModelChange:(K,rt)=>{H("gemini",rt)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:K=>{G("gemini",{thinkingMode:K})},onCodexFastModeChange:()=>{},planMode:L.gemini.planMode,onPlanModeChange:K=>B("gemini",K),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),f.jsx(xn,{title:"Cursor Defaults",description:`Saved defaults when using Cursor. ${om(E,"cursor")}`,alignStart:!0,children:f.jsxs("div",{className:me("max-w-[420px]",!tn("cursor").systemActive&&"opacity-50"),children:[f.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:f.jsxs(gr,{value:((E==null?void 0:E.settings.cursor)??Yn.cursor).active?"active":"inactive",onValueChange:K=>{St({...(E==null?void 0:E.settings)??Yn,cursor:{...(E==null?void 0:E.settings.cursor)??Yn.cursor,active:K==="active"}})},children:[f.jsx(Jn,{className:"min-w-[140px]",disabled:!tn("cursor").systemActive,children:f.jsx(wr,{})}),f.jsxs(er,{children:[f.jsx(Lt,{value:"active",children:"Active"}),f.jsx(Lt,{value:"inactive",children:"Inactive"})]})]})}),f.jsx(Gu,{availableProviders:Jo,selectedProvider:"cursor",disabled:!tn("cursor").systemActive,showProviderPicker:!1,providerLocked:!0,model:L.cursor.model,modelOptions:L.cursor.modelOptions,onModelChange:(K,rt)=>{H("cursor",rt)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:L.cursor.planMode,onPlanModeChange:K=>B("cursor",K),includePlanMode:!0,className:"justify-start flex-wrap"})]})})]}):o==="keybindings"?f.jsxs("div",{className:"border-b border-border",children:[Me?f.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:Me}):null,Ae.warning?f.jsx("div",{className:"mb-4 rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:Ae.warning}):null,rT.map((K,rt)=>{const On=Ub(fs[K]),ns=ve[K]??"",mi=ns!==On;return f.jsx(xn,{title:BA[K],description:f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"Comma-separated shortcuts."}),mi?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:" "}),f.jsxs("button",{type:"button",onClick:()=>{ot(K)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",On]})]}):null]}),bordered:rt!==0,children:f.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:f.jsx(Ti,{type:"text",value:ns,onChange:Ot=>{const Tn=Ot.target.value;Te(rs=>({...rs,[K]:Tn}))},onBlur:Ot=>{const Tn={...ve,[K]:Ot.currentTarget.value};Te(Tn),pn(Tn)},onKeyDown:Ot=>ht(Ot,()=>{const Tn={...ve,[K]:Ot.currentTarget.value};Te(Tn),pn(Tn)}),className:"font-mono"})})},K)})]}):null]}),n.commandError?f.jsxs("div",{className:"mx-auto mt-4 flex max-w-4xl items-start gap-3 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[f.jsx(k6,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),f.jsx("span",{children:n.commandError})]}):null]})]})]}),It?f.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:f.jsx("div",{className:"px-6 py-[14.25px]",children:f.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-xs text-muted-foreground lg:grid-cols-4 lg:gap-3",children:[f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[f.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Machine"}),f.jsx("div",{className:"truncate text-foreground/80",children:u})]})}),f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[f.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Connection"}),f.jsx("div",{className:"truncate text-foreground/80",children:n.connectionStatus})]})}),f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[f.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Projects"}),f.jsx("div",{className:"truncate text-foreground/80",children:h})]})}),f.jsx("div",{className:"min-w-0",children:f.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[f.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Version"}),f.jsx("div",{className:"truncate text-foreground/80",children:d})]})})]})})}):null]})}function sT(e){return{submitChatMessage:Ma(e.submitChatMessage??""),toggleProjectsSidebar:Ma(e.toggleProjectsSidebar??""),toggleEmbeddedTerminal:Ma(e.toggleEmbeddedTerminal??""),toggleRightSidebar:Ma(e.toggleRightSidebar??""),openInFinder:Ma(e.openInFinder??""),openInEditor:Ma(e.openInEditor??""),addSplitTerminal:Ma(e.addSplitTerminal??"")}}function Rre(){const e=typeof navigator<"u"&&navigator.standalone===!0,t=typeof window<"u"&&window.matchMedia("(display-mode: standalone)").matches;return e||t}function Tre(){const e=window.visualViewport,t=Math.round((e==null?void 0:e.height)??window.innerHeight),n=Math.max(0,Math.round((e==null?void 0:e.offsetTop)??0));return{height:t,offsetTop:n}}function Nre(){b.useLayoutEffect(()=>{let e=0,t=null,n=0;const r=Rre(),s=()=>{e=0;const{height:u,offsetTop:h}=Tre();t===null&&(t=h),u>n&&(n=u);const d=Math.max(0,h-t),g=n-u>120||d>12,p=document.documentElement;p.style.setProperty("--app-shell-height",`${u}px`),p.style.setProperty("--app-shell-offset-top",r?g?`max(0px, calc(${d}px - env(safe-area-inset-top)))`:"0px":`${d}px`),p.style.setProperty("--app-composer-bottom-padding",r?g?"0px":"max(12px, env(safe-area-inset-bottom))":g?"12px":"20px")},o=()=>{e!==0&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(s)};o();const l=window.visualViewport;return window.addEventListener("resize",o),window.addEventListener("orientationchange",o),l==null||l.addEventListener("resize",o),l==null||l.addEventListener("scroll",o),()=>{e!==0&&window.cancelAnimationFrame(e),window.removeEventListener("resize",o),window.removeEventListener("orientationchange",o),l==null||l.removeEventListener("resize",o),l==null||l.removeEventListener("scroll",o)}},[])}const Mre=`${Dp}last-seen-version`;function Are(e,t){return!(!t||e.defaultPrevented||e.isComposing||TW(e.target))}function Dre(){const e=Pi(),t=ST(),n=XY({activeChatId:t.chatId??null,activeOverviewFeatureId:t.featureId??null}),r=Qd("(min-width: 768px)"),s=A2(d=>d.widthPx),o=A2(d=>d.setWidth),l=e.pathname==="/",u=Gx.split("/")[1]??"unknown",h=b.useMemo(()=>S0(n.keybindings),[n.keybindings]);return Nre(),b.useEffect(()=>{window.localStorage.setItem(Mre,u)},[u]),b.useEffect(()=>{function d(g){const p=Ia(h,"toggleProjectsSidebar",g);Are(g,p)&&(g.preventDefault(),n.toggleProjectsSidebar(r))}return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[r,h,n.toggleProjectsSidebar]),f.jsxs("div",{className:"relative flex h-[var(--app-shell-height)] min-h-[var(--app-shell-height)] overflow-hidden",style:{top:"var(--app-shell-offset-top)"},children:[f.jsx(CW,{data:n.sidebarData,completedChatIds:n.completedChatIds,activeChatId:n.activeChatId,activeOverviewFeatureId:n.activeOverviewFeatureId,connectionStatus:n.connectionStatus,ready:n.sidebarReady,open:n.sidebarOpen,collapsed:n.sidebarCollapsed,isDesktopViewport:r,showMobileOpenButton:l,onOpen:n.openSidebar,onClose:n.closeSidebar,onToggle:n.toggleProjectsSidebar,onExpand:n.expandSidebar,desktopWidth:s,toggleShortcut:h.bindings.toggleProjectsSidebar,onResizeDesktopWidth:o,onCreateChat:(d,g)=>{n.handleCreateChat(d,g)},onCreateFeature:d=>{n.handleCreateFeature(d)},onRenameFeature:d=>{n.handleRenameFeature(d)},onDeleteFeature:d=>{n.handleDeleteFeature(d)},onSetProjectBrowserState:(d,g)=>{n.handleSetProjectBrowserState(d,g)},onSetProjectGeneralChatsBrowserState:(d,g)=>{n.handleSetProjectGeneralChatsBrowserState(d,g)},onSetFeatureBrowserState:(d,g)=>{n.handleSetFeatureBrowserState(d,g)},onSetFeatureStage:(d,g)=>{n.handleSetFeatureStage(d,g)},onSetChatFeature:(d,g)=>{n.handleSetChatFeature(d,g)},onReorderFeatures:(d,g)=>{n.handleReorderFeatures(d,g)},folderGroupsEnabled:n.folderGroupsEnabled,showFeatureOverviewInSidebar:n.showFeatureOverviewInSidebar,kanbanStatusesEnabled:n.kanbanStatusesEnabled,onOpenFeatureOverview:d=>{n.handleOpenFeatureOverview(d)},onDeleteChat:d=>{n.handleDeleteChat(d)},onRemoveProject:d=>{n.handleRemoveProject(d)},onRefreshProviderUsage:n.handleRefreshProviderUsage,onOpenProviderLogin:d=>{n.handleOpenProviderLogin(d)},providerSettings:n.providerSettings,startingLocalPath:n.startingLocalPath,updateSnapshot:n.updateSnapshot,onInstallUpdate:()=>{n.handleInstallUpdate()}}),f.jsx(R8,{open:n.createFeatureModalProjectId!==null,onOpenChange:d=>{d||n.handleCloseCreateFeatureModal()},onConfirm:d=>n.handleConfirmCreateFeature(d)}),f.jsx(T8,{open:n.cursorCurlImportOpen,onOpenChange:d=>{d||n.handleCloseCursorCurlImport()},onSubmit:d=>n.handleSubmitCursorCurlImport(d)}),f.jsx(OL,{context:n})]})}function jre(){return f.jsx(u7,{children:f.jsxs(C8,{children:[f.jsx(zL,{children:f.jsxs(La,{element:f.jsx(Dre,{}),children:[f.jsx(La,{path:"/",element:f.jsx(xre,{})}),f.jsx(La,{path:"/settings",element:f.jsx(jL,{to:"/settings/general",replace:!0})}),f.jsx(La,{path:"/settings/:sectionId",element:f.jsx(Ere,{})}),f.jsx(La,{path:"/chat/:chatId",element:f.jsx(cre,{})}),f.jsx(La,{path:"/overview/:featureId",element:f.jsx(hre,{})})]})}),f.jsx(Wz,{})]})})}const y3=document.getElementById("root");if(!y3)throw new Error("Missing #root");z4.createRoot(y3).render(f.jsx(b.StrictMode,{children:f.jsx(az,{children:f.jsx($G,{children:f.jsx(jre,{})})})}));
|